TL;DR
Multi-agent LLM systems normally chat with each other in text—a painfully slow process that eats up thousands of tokens and breaks the gradient flow needed to train the agents together. CacheMAS throws out both intermediate text and iterative "latent thinking" loops, letting agents pass notes strictly via their initial prefill KV caches in a single forward pass. The result is a system that uses ~3× fewer tokens, runs ~2× faster, and can be trained end-to-end with standard reinforcement learning to beat existing multi-agent setups across math, coding, and QA.
What Problem Does This Paper Address?
Dividing hard problems among specialized LLM personas—say, an Analyzer, a Solver, and a Validator—boosts reasoning. Historically, these agents collaborate like humans over Slack: Agent 1 generates a wall of text, Agent 2 reads (prefills) all of it plus its own prompt to generate more text, and so on. On a tough math problem, a three-agent chain easily burns through 39,000 tokens. Worse, because sampling discrete words is non-differentiable, gradients can't flow backward from the Validator to the Analyzer. Training the team requires clunky workarounds like designing custom rewards for every single agent.
Recent "latent communication" frameworks tried fixing the speed issue by having agents loop through hidden continuous states (latent thoughts) instead of emitting words, passing their Key-Value (KV) memory caches to the next agent. While faster, this left an open question: inside that passed KV cache, is the useful signal coming from the multi-step latent thinking loop, or just the initial "prefill" pass where the agent reads the prompt?
Methods
After discovering that the prefill cache does almost all the heavy lifting (more on that below), the authors designed CacheMAS—an architecture that collapses a multi-agent relay race into one prefill and one decode per problem.
Here is how it works:
- Segment-Routed Single Prefill: Instead of running agents sequentially, CacheMAS concatenates the prompts and problem input for all three roles—
(Prompt_1 + x) + (Prompt_2 + x) + (Prompt_3 + x)—into one sequence. Three separate copies of the base LLM's weights ($\theta_1, \theta_2, \theta_3$) handle their respective token segments during linear projections and feed-forward layers. - Cache Communication: Inside the attention layers, standard causal masking allows later segments to read the Key and Value projections of earlier segments. The Solver attends to the Analyzer's prefill cache; the Validator attends to both. Only the final Validator enters a decoding loop to write out the actual answer.
- Joint End-to-End GRPO: Because there are no intermediate text-sampling steps or deep latent loops detaching the computation graph, the entire three-agent pipeline behaves like one standard autoregressive policy. The authors apply off-the-shelf Group Relative Policy Optimization (GRPO) using only a single final-answer reward. Gradients flow backward from the final answer straight through the attention caches to specialize $\theta_2$ and $\theta_1$ simultaneously.
Datasets
The authors do not introduce new benchmarks, opting to test across established reasoning suites:
- Controlled Study: GSM8K (a 488-sample test split).
- Evaluation: Competition math (AIME 2024, 2025, 2026), multi-hop question answering (HotPotQA, Bamboogle, MusiQue), and code generation (MBPP+, HumanEval+).
- RL Training: DAPO-Math for math, APPS and CodeContests for code, and the HotPotQA training split for QA.
Key Insights and Ideas
- Latent thinking loops saturate almost immediately: In untrained latent-MAS setups, the cosine similarity between consecutive latent steps hits $\ge 0.99$ by step 5. Passing only the initial prefill KV cache retains 79.9% accuracy on GSM8K (within 1 point of the full baseline), whereas passing only the latent-loop KV cache collapses accuracy to ~53–60%.
- Why latent states fail—distribution shift: Projecting untrained latent transition states into 2D space shows they drift completely outside the distribution of natural text tokens. When pushed through the model's language head, almost every top-1 token is just
\n\n—meaning downstream agents essentially read latent thoughts as blank paragraph breaks!
- RL turns passive caches into specialized teammates: Before RL, shuffling the order of the Analyzer and Solver or swapping in another problem's cache barely hurts accuracy. After joint RL, any perturbation drops accuracy by 2 to 9+ percentage points, proving the agents genuinely learn to encode sample-specific, order-sensitive signals for the Validator.
- Architecture and extra parameters both pull their weight: Testing a shared-weight variant (one model copy instead of three) showed that joint cache optimization alone beats text-MAS by ~1.3–1.7 points, while giving each role dedicated weights adds another ~1.5–1.9 points.
Key Results
Evaluated on Qwen3-8B and Hunyuan-1.8B:
- Speed & Efficiency: On Qwen3-8B, CacheMAS uses 21%–61% of the tokens (roughly 3× fewer overall), runs 1.5×–5.3× faster end-to-end, and speeds up prefill wall-time by up to 33× on AIME compared to TextMAS.
- Accuracy: Even training-free, CacheMAS beats TextMAS by +4.3 average points on multi-hop QA and matches it on code. Adding joint RL (CacheMAS+RL) sweeps the board, beating TextMAS and LatentMAS on every single benchmark (e.g., lifting Qwen3-8B AIME scores by an average of +5.3 points over untrained CacheMAS).
- Faster, Better RL: Compared to per-agent MAS-GRPO on Hunyuan-1.8B, CacheMAS+RL scores +4.0 to +5.1 points higher on QA while running ~6.6× faster in wall-clock time.
Limitations and Future Work
Because each role gets its own copy of the projection and feed-forward weights, parameter memory scales linearly with team size (taking 2.85× the memory of a single Qwen3-8B backbone for three agents). The authors note that swapping full weight copies for lightweight per-role adapters (like LoRA) on a shared backbone could preserve single-pass training at a fraction of the memory. Future work also includes adapting CacheMAS to dynamic routing topologies and mixing different model families using learned KV-cache translators.
Summary updated