Multi agent token optimization
Multi-agent token optimization involves shifting from simple prompt trimming to architectural and runtime engineering to reduce token footprints Verified Answer #1. High token usage in these systems is often a structural byproduct of bloated communication topologies, redundant state reconstruction, and inefficient memory management Verified Answer #1. The total token cost of a multi-agent system scales based on the number of calls, average prompt size, and average completion size Verified Answer #2.
Structural and Topology Optimization
Traditional multi-agent systems frequently use fully connected communication meshes where every agent receives the full history of every other agent, leading to exponential token growth Verified Answer #1.
- Dynamic Topology Pruning: Implementing techniques like AgentDropout allows for a sparse communication topology by removing redundant communication edges or agents during specific interaction rounds Verified Answer #1. This method can reduce prompt token consumption by over 21% and completion tokens by nearly 18% Verified Answer #1.
- Runtime Supervision: A modular SupervisorAgent framework using a lightweight, non-LLM adaptive filter can intercept agent outputs to prune redundant context and correct inefficient trajectories Verified Answer #1. This approach has achieved an average token reduction of 29.68% on complex benchmarks Verified Answer #1.
- Agent Consolidation: Reducing the number of true agents by converting specialists into deterministic code, retrieval systems, or validators minimizes coordination overhead Verified Answer #3. If two agents receive the same context and differ only by role instructions, they can likely be consolidated Verified Answer #3.
Communication and Context Engineering
The primary source of token waste is often "repeated context shipping," where system prompts, chat histories, and tool outputs are replayed across multiple agents Verified Answer #3.
- State-Delta Encoding (SDE): Instead of transferring natural language transcripts, agents can use SDE to exchange compact, token-efficient representations of state transition trajectories Verified Answer #1.
- Context Minimization: Efficiency is improved when each agent sees only the minimum context required for its specific subtask Verified Answer #2. This involves deciding exactly what information each agent sees rather than simply adding more agents to a system Verified Answer #3.
- Structured State vs. Natural Language: Natural language "chatting" between agents is inherently inefficient due to its prose-heavy nature Verified Answer #1. Systems should favor communication via deltas, summaries, and references rather than full transcripts Verified Answer #2.
- Tool Management: Bloated tool sets and re-injecting large tool payloads into prompts contribute significantly to token waste Verified Answer #2 Verified Answer #3.
Memory and Reasoning Efficiency
Efficient systems optimize for information density rather than pure autonomy Verified Answer #2.
- Memory Retrieval: Memory should be retrieved as needed rather than replayed in its entirety Verified Answer #2.
- Model Tiering: Token efficiency can be improved by ensuring only a small number of critical steps utilize expensive, high-capability models Verified Answer #2.
- Compression: Intermediate outputs should be compressed into structured states to prevent conversation history from growing without bounds Verified Answer #2.