Learning to Communicate: Toward End-to-End Optimization of Multi-Agent Language Systems

Ye Yu, Heming Liu, Haibo Jin, Xiaopeng Yuan, Peng Kuang, Haohan WangarXiv 2026

This academic paper introduces DiffMAS, a framework designed to move multi-agent language systems (MAS) beyond the limitations of natural language communication by using learnable, continuous internal representations.

TL;DR

DiffMAS replaces discrete, text-based messaging between LLM agents with a learnable "latent communication" protocol using shared Key-Value (KV) caches. By optimizing these interactions end-to-end via supervised fine-tuning, the framework achieves massive performance gains—up to +26.7% on AIME24—while significantly improving decoding stability.

What Problem Does This Paper Address?

Multi-agent systems typically collaborate by passing natural language messages. While intuitive, this creates two major bottlenecks:

  1. Information Loss: Complex reasoning must be compressed into discrete tokens, often losing subtle contextual signals.
  2. Optimization Boundaries: You cannot easily backpropagate gradients through discrete text. This means we usually optimize agent roles or prompts, but we can't optimize the communication protocol itself.

Existing "latent" alternatives (sharing internal hidden states) often skip training, leading to "distribution mismatch." A model trained on its own thoughts becomes "confused" when another agent's raw internal states are injected into its context, leading to unstable and chaotic reasoning.

Methods

DiffMAS treats inter-agent communication as a differentiable operator within the computation graph. The process unfolds in two stages:

  • Stage I (Trace Building): Upstream agents (e.g., a Planner and a Critic) sequentially generate reasoning steps. Instead of outputting text, their internal Key-Value (KV) caches are captured and concatenated into a "shared KV trace."
  • Stage II (End-to-End Optimization): The final agent (the Solver) performs autoregressive decoding conditioned on this accumulated latent trace.
Figure 1: In Stage I, agents 1 to K–1 sequentially construct a shared KV trace by prefilling the existing cache and appending newly generated KV segments without gradient updates. The accumulated KV trace serves as a latent communication medium across agents. In Stage II, the final agent performs autoregressive decoding on the prefilled KV cache. Cross-attention over the KV trace produces hidden states, which are projected through the LM head to generate tokens. Supervised fine-tuning is applied using cross-entropy loss, and gradients are backpropagated to update only the LoRA parameters of the final agent while keeping the backbone model frozen.

The authors use Parameter-Efficient Fine-Tuning (LoRA) to update the model. Crucially, because the communication channel is continuous (KV states), gradients can flow back through the entire multi-agent trajectory. This allows the system to learn a task-specific "latent language" where upstream agents learn how to encode useful info, and downstream agents learn how to interpret it.

Datasets

The authors evaluated DiffMAS across a diverse suite of reasoning benchmarks:

  • Mathematics & Science: AIME 2024, AIME 2025, and GPQA-Diamond.
  • Code Generation: HumanEval+ and MBPP+.
  • Commonsense Reasoning: OpenBookQA.

For training, they used surprisingly small, curated datasets (e.g., only 210 samples for math and 50 for code), demonstrating that DiffMAS is highly sample-efficient at learning effective communication protocols.

Key Insights and Ideas

  • The Concatenation Advantage: The paper provides a mathematical proof (Proposition 3.1) showing that concatenating latent traces avoids the "vanishing gradient" problem inherent in systems that overwrite a fixed-size hidden state. In DiffMAS, every agent's contribution remains equally accessible to the gradient, regardless of how early they appear in the chain.
  • Stability through Alignment: Raw latent injection is often "brittle." By training the interface, DiffMAS aligns the injected KV states with the model's expected distribution. This results in much smoother entropy curves and lower perplexity during decoding compared to training-free methods.
  • Compactness vs. Noise: Interestingly, more communication isn't always better. The authors found that a small number of latent steps (around 10) is optimal; beyond that, longer traces introduce redundancy and noise that can degrade performance.

Key Results

DiffMAS consistently outperformed single-agent baselines, text-based MAS, and training-free latent methods:

  • Reasoning Jumps: On the difficult AIME24 math benchmark, DiffMAS (using Qwen3-8B) achieved 76.7%, a massive +26.7% improvement over the single-agent baseline.
  • Hard Science: On GPQA-Diamond, it reached 60.1% (+20.2% gain).
  • Decoding Stability: As shown in the perplexity analysis, DiffMAS produces a much tighter distribution of results with fewer "chaotic" outliers than prior latent methods.
Figure 3: Perplexity distribution showing DiffMAS's superior decoding stability.

The framework also showed significantly higher self-consistency. While text-based systems often fail consistently or succeed sporadically, DiffMAS shifts the outcome toward high-consistency success (3-4 correct samples out of 4).

Figure 2: Self-consistency heatmap across different problem indices.

Limitations and Future Work

  • Context Window Pressure: Because KV traces are concatenated, the total context length grows with the number of agents and steps. This could hit hardware memory limits for very long reasoning chains.
  • Fixed Sequential Topology: This study focused on a linear pipeline (Planner → Critic → Refiner → Solver). The authors suggest that future work should explore more complex, non-linear communication graphs.
  • Interpretability: Since the communication happens in latent space, humans cannot "read" what the agents are saying to each other, which may be a drawback for applications requiring high transparency.

Summary updated

BibTeX
@misc{yu2026learning,
  author = {Ye Yu and Heming Liu and Haibo Jin and Xiaopeng Yuan and Peng Kuang and Haohan Wang},
  title = {{Learning to Communicate: Toward End-to-End Optimization of Multi-Agent Language Systems}},
  year = {2026},
  eprint = {2604.21794},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.21794},
}
Figure