Get Started

Async and Hogwild! Inference

Speculative decoding (Phase 10 · 15) parallelizes tokens within one sequence. Multi-agent frameworks parallelize across whole sequences but force explicit coordination (voting, sub-task splitting). Hogwild! Inference (Rodionov et al., arXiv:2504.06261) does something else: run N instances of the same LLM in parallel against a SHARED key-value cache. Each worker sees every other worker's generated tokens instantly. Modern reasoning models, QwQ, DeepSeek-R1, can self-coordinate through that shared cache without any fine-tuning. The approach is experimental but it opens an entirely new axis of inference parallelism that sits orthogonal to spec decode. This lesson implements a two-worker Hogwild! simulator in stdlib Python and explains why the shared-cache collaboration emerges from the existing model's reasoning abilities.

60 minutesBuildPython (stdlib)Members

Learning Objectives

  • Describe the three common parallel-LLM topologies (voting, sub-task, Hogwild!) and name which problems each one targets.
  • State the core Hogwild! setup: multiple workers, one shared KV cache, emergent coordination via self-prompting.
  • Compute the wall-time speedup of Hogwild! as a function of worker count Ntask-level parallelism pand coordination overhead c.
  • Implement a two-worker Hogwild! simulator on a toy problem and observe the emergent task division.