Agent Compute Cost Optimization
Where the tokens actually go
Teams running multi-agent systems consistently hit the same wall: costs grow faster than throughput. Adding the 5th or 10th agent doesn't 5x or 10x the bill — it multiplies it. Here's why, and how to fix it without giving up agent count.
The O(N²) trap
In a typical multi-agent setup, agents coordinate by passing natural-language messages — a planner, critics, executors all reading each other's prose. Each new agent has to read what every other agent produced. Context blows up quadratically.
At 4 agents it's annoying. At 16 it's expensive. At 128 it's broken — the model spends most of its compute re-parsing the same paragraphs to extract a handful of facts.
Why cheaper models only delay the problem
Switching to a smaller model lowers $/token but doesn't change the curve. You're still moving the same volume of redundant context through every call. The bill flattens for a quarter, then resumes climbing the moment you add more agents or more steps per task.
The structural fix: state, not transcripts
Replace the chat-log wire format with a shared, structured state. Agents commit typed packets — concrete findings, not prose. A deterministic reducer merges them and records provenance. On each turn an agent reads a compact, bounded view of state instead of the full conversation.
Coordination cost flattens from ~O(N²) to ~O(N). The model still does the thinking — it just stops paying to re-read the room.
What you measure
- Tokens per task, not per call — coordination hides at the task level.
- Tokens per added agent — should be roughly linear, not quadratic.
- Wall-clock per task — bounded context usually cuts latency in the same proportion as cost.
Frequently asked
- Why does agent compute cost grow faster than agent count?
- When agents coordinate by passing natural-language messages, every agent's output becomes input for the others. With N agents that's an O(N²) growth in shared context — and most tokens are restating things other agents already said.
- Can a smaller model fix it?
- Partially. Swapping to a cheaper model cuts per-token cost but doesn't change the token volume curve. At enough agents, even the cheapest model is expensive because you're paying to re-parse the same context over and over.
- What changes with state-based coordination?
- Agents commit typed packets to a shared state instead of broadcasting prose. A deterministic reducer merges them. Each agent reads a compact, bounded view of state — coordination cost flattens from ~O(N²) to ~O(N).
- When is it worth the architecture change?
- Roughly when you have 4+ agents coordinating, token bills are scaling faster than throughput, or silent disagreements between agents are causing bugs you can't audit.
SACL flattens the curve
Typed packets, deterministic reducer, bounded state. ~97% fewer tokens at 128 agents on public benchmarks.
See the benchmark →