arXiv(opens in a new tab)cs.AISep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.02264

Codebook Agent: Amortized Topology Design for LLM Multi-Agent Systems

Jinxi Yu, Yubei Li, Eric Hanchen Jiang, Zhi Zhang, Dong Liu, Wenxiao Zhao, Levina Li, Kai-Wei Chang, Ying Nian Wu

Abstract

Adapting the communication topology of an LLM multi-agent system to each query improves both accuracy and efficiency, yet current designers treat this as conditional graph generation: a variational, autoregressive, or diffusion decoder searches the N×NN\times N adjacency space, and a graph-network proxy trained on utility and a structural cost such as edge count ranks the sampled candidates. We argue that this formulation is misaligned with the problem. Empirically, topologies that survive a reward filter collapse to about six distinct graphs even when the codebook capacity grows from 8 to 64; edge count is negatively correlated with measured token consumption (Pearson r≈−0.4r \approx -0.4), so sparsifying the graph makes inference more expensive; and a message-passing scorer over agent-profile nodes is adjacency-invariant whenever agents share a profile—the default configuration of published benchmarks—so it cannot rank candidates at all in that regime. These three facts motivate Codebook Agent: a vector-quantized autoencoder compresses successful topologies into a query-independent 16-entry codebook; a reward-weighted MLP maps the query embedding to a distribution over codes; and an MLP proxy that reads the flattened adjacency, regressed on measured utility and per-task normalized token cost, reranks the top decoded candidates in a single batched forward pass. With no iterative search and no message passing at test time, Codebook Agent is the most accurate method on all six benchmarks we compare (84.6 average against 83.0 for the strongest prior designer), emits a topology in 2.4 ms, and uses 21.9–33.2% fewer LLM tokens. Our code is available here: https://github.com/jinxiy1104/CodebookAgent.

1 Introduction

Multi-agent systems built from LLM agents solve reasoning, question answering, and coding tasks by exchanging intermediate outputs over a communication topology (Wu et al. 2024; Hong et al. 2024; Qian et al. 2024; Du et al. 2024). That topology is not bookkeeping: it decides which agents see which messages, and both accuracy and token consumption move with it (Qian et al. 2025; Zhuge et al. 2024; Zhang et al. 2025b). The field has therefore progressed from hand-designed structures to learned ones, and most recently to query-conditioned generators that emit a fresh topology for every input (Zhang et al. 2025c; Jiang et al. 2026).

The latest designers share a natural but costly recipe. A variational (Zhang et al. 2025c), autoregressive (Li et al.

Figure

Figure 1: Three regimes of topology design. (Top) A fixed topology is reused for every query: zero design cost, but no single graph fits every task. (Middle) Query-conditioned generators adapt the graph via an iterative loop that samples and scores KK candidates at each of TT steps, typically with a proxy trained on utility and edge count. (Bottom) Codebook Agent keeps per-query adaptation and removes the loop: the design space is discretized once offline into a codebook, a query embedding selects codes, and one batched proxy call under a token-based cost objective returns the winner.

2026), or diffusion decoder (Jiang et al. 2026) searches the N×NN\times N adjacency space; a graph network over agent-profile nodes then ranks candidates with a utility head and a structural cost head, typically the edge count ∣E∣|E| (Zhuge et al. 2024; Zhang et al. 2025b,c; Jiang et al. 2026). The recipe looks principled—generate, then score—yet it quietly assumes that the useful design space is large enough to need a generative decoder, that ∣E∣|E| tracks inference cost, and that message passing can tell two topologies apart. Our measure-

*These authors contributed equally.

ments reject all three assumptions.

Figure 1 sketches the consequence. First, the useful design space is a short list, not a manifold: topologies that solve their task fall into about six distinct codes even as codebook capacity grows from 8 to 64, and the best fixed topology stays within 1.4 accuracy points of every generated one we measure—so capacity spent modeling adjacency is spent where the problem does not live. Second, the structural cost surrogate is inverted: edge count correlates with measured tokens at r≈−0.4r \approx -0.4, because sparse communication yields longer completions, so minimizing ∣E∣|E| maximizes the bill it was introduced to reduce. Third, on the homogeneous teams that dominate published benchmarks, a message-passing scorer over profile nodes is adjacency-invariant: every candidate receives the same score, the ranking does not exist, and hundreds of guided diffusion steps reproduce a constant.

If the problem is to choose among a few graphs under a measured cost, the matching designer is not another decoder. Codebook Agent therefore amortizes topology design into three feed-forward pieces: a vector-quantized autoencoder (van den Oord, Vinyals, and Kavukcuoglu 2017) that indexes successful topologies into 16 codes, a reward-weighted MLP that maps the query embedding to a distribution over those codes, and an MLP proxy that reads the flattened adjacency and is regressed on measured utility and per-task normalized token cost. At test time we decode the top codes, score them in one batched proxy call, and execute the winner—2.4 ms, with no sampling loop and no message passing.

References (47)

  • Program Synthesis with Large Language Models
  • Why Do Multi-Agent LLM Systems Fail? In Advances in Neural Information Processing Systems 38, Datasets and Benchmarks Track
  • Are More LLM Calls All You Need? Towards the Scaling Properties of Compound AI Systems
  • FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performance
  • Evaluating Large Language Models Trained on Code
  • AgentVerse: Facilitating Multi-Agent Collaboration and Exploring Emergent Behaviors
  • Optima: Optimizing Effectiveness and Efficiency for LLM-Based Multi-Agent System
  • Training Verifiers to Solve Math Word Problems
  • Improving Factuality and Reasoning in Language Models through Multiagent Debate
  • Measuring Massive Multitask Language Understanding
  • Measuring Mathematical Problem Solving with the MATH Dataset
  • Distilling the Knowledge in a Neural Network
  • Denoising Diffusion Probabilistic Models
  • MetaGPT: Meta Programming for a Multi-Agent Collaborative Framework
  • Automated Design of Agentic Systems
  • LLM-Blender: Ensembling Large Language Models with Pairwise Ranking and Generative Fusion
  • H.; Li, M.; Wan, G.; Yin, S.; Wu, Y.; Liang, X.; Li, X.; Sun, Y.; Wang, W.; Chang, K.-W.; and Wu, Y. N. 2026
  • Score-Based Generative Modeling of Graphs via the System of Stochastic Differential Equations
  • More Agents Is All You Need
  • Assemble Your Crew: Automatic Multi-agent Communication Topology Design via Autoregressive Graph Generation
  • Dynamic LLM-Agent Network: An LLM-Agent Collaboration Framework with Agent Team Optimization
  • Are NLP Models Really Able to Solve Simple Math Word Problems? In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies
  • ChatDev: Communicative Agents for Software Development
  • Scaling Large Language Model-Based Multi-Agent Collaboration
  • Generating Diverse High-Fidelity Images with VQ-VAE-2
  • Solving General Arithmetic Word Problems
  • GraphVAE: Towards Generation of Small Graphs Using Variational Autoencoders
  • Should We Be Going MAD? A Look at Multi-Agent Debate Strategies for LLMs
  • Denoising Diffusion Implicit Models
  • TopoDIM: One-shot Topology Generation of Diverse Interaction Modes for Multi-Agent Systems
  • Learning MLPs on Graphs: A Unified View of Effectiveness, Robustness, and Efficiency
  • Neural Discrete Representation Learning
  • Graph Attention Networks
  • DiGress: Discrete Denoising Diffusion for Graph Generation
  • Self-Consistency Improves Chain of Thought Reasoning in Language Models
  • AgentDropout: Dynamic Agent Elimination for Token-Efficient and High-Performance LLM-Based Multi-Agent Collaboration
  • Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Extracting Low-/High-Frequency Knowledge from Graph Neural Networks and Injecting It into MLPs: An Effective GNN-to-MLP Distillation Framework
  • AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
  • GraphRNN: Generating Realistic Graphs with Deep Auto-Regressive Models
  • Multi-agent Architecture Search via Agentic Supernet
  • Cut the Crap: An Economical Communication Pipeline for LLM-Based Multi-Agent Systems
  • G-Designer: Architecting Multi-Agent Communication Topologies via Graph Neural Networks
  • AFlow: Automating Agentic Workflow Generation
  • Graph-Less Neural Networks: Teaching Old MLPs New Tricks via Distillation
  • Unifying Generation and Prediction on Graphs with Latent Graph Diffusion
  • GPTSwarm: Language Agents as Optimizable Graphs