High-Throughput Sub-Agents: Optimizing Latency and Cost in Multi-Agent Orchestration
In multi-agent systems, overall latency is often dictated by the slowest sub-agent rather than the main model. This article explains why generation throughput matters most for sub-agents, how to break "speed" into measurable metrics like TTFT and TPS, how to split work between strong main agents and fast sub-agents, and how to control cost with budget-aware routing and observability practices—along with a list of anti-patterns to avoid.
The Underrated Variable: Sub-Agent “Return Speed”
In a multi-agent architecture, the main agent handles planning and decision-making, while sub-agents execute the decomposed subtasks. Most discussions focus on “how strong the main model is,” but overlook a structural fact: the main agent’s waiting time is often determined by the slowest link in the chain.
It’s worth distinguishing how throughput matters in these two roles:
- Main agent scenario: After the main model produces one step, it typically waits for tool calls, retrieval, or code execution to return. This wait is dictated by the external environment, so improving generation speed from tens to hundreds of tokens per second yields limited end-to-end latency gains—a “masked benefit.”
- Sub-agent scenario: A sub-agent’s output feeds back into the main agent, which sits idle in the meantime. Here, generation speed directly determines the length of that idle gap. Shorter gaps keep the main agent’s contextual attention more coherent and reduce accumulated errors across multiple rounds of decomposition.
High throughput is therefore not a vague “better performance”—it is a lever that gets amplified in asynchronous orchestration.
Breaking “Fast” into Measurable Metrics
“Fast” involves at least three non-equivalent quantities that should not be conflated in evaluation:
- Time to first token (TTFT): determines interactive feel and streaming experience;
- Token generation speed (TPS): determines completion time for medium-to-long outputs;
- End-to-end latency: includes queuing, network, tool execution, and feedback overhead.
Sub-agent optimization should focus on items 2 and 3. A practical approximation:
T_sub ≈ TTFT + L_out / TPS + T_tool + T_overheadMain agent idle time ≈ max(T_sub_i) (slowest branch when dispatched in parallel)
This shows that with parallel dispatch, the bucket effect is pronounced: overall latency is bounded by the slowest sub-branch. Raising average throughput matters less than eliminating long-tail outliers.
The Master-Slave Division: A Triangle of Capability, Latency, and Cost
A more robust engineering approach is not “one model for everything,” but layering by task characteristics:
| Dimension | Main Agent | Sub-Agent |
|---|---|---|
| Task nature | Planning, trade-offs, cross-domain reasoning | Local, well-bounded execution |
| Context | Long, must maintain global consistency | Short, only the task slice |
| Key metric | Reasoning quality and stability | Throughput and latency |
| Output form | Decisions and plans | Structured results (patches, checklists, JSON) |
An often-ignored lesson: the main model is not necessarily better at fine-grained work. Planning-oriented models usually excel at abstraction and trade-offs, but for concrete code details or local rewrites, a high-throughput, task-optimized smaller model can easily outperform—while returning results faster and reducing async-branch interference with the main context. In such cases, a “strong main + fast sub” combination can actually outperform “strong main + strong-but-slow sub.”
Interface Design: Streaming Returns and Session State Management
Orchestration efficiency depends not only on models but also on interface design. Two capabilities are especially critical for sub-agents:
- Streaming/incremental returns: let the main agent receive usable fragments early and reason while receiving, compressing the idle window;
- Session state management: when the server maintains context, clients don’t need to build their own session storage and replay logic, reducing orchestration code complexity and failure surface.
If the API only supports one-shot responses and requires self-managed session state, the orchestration layer must additionally handle state consistency, checkpoint-resume, and idempotent retries—significantly raising engineering cost.
Cost Alignment: Matching Consumption Rates Across Quotas
When the main model runs on a subscription quota and sub-models are billed by usage, a common pain point is mismatched consumption rates: frequent sub-calls drain the main model’s quota quickly, or the sub-model budget spirals out of control. A workable strategy is tiered budgets plus routing:
# Example: route by task characteristics and enforce budget constraintsdef route(task):if task.needs_global_reasoning or task.context_tokens > LIMIT_MAIN:return "main" # Planning / long contextreturn "sub" # Local execution, throughput firstdef dispatch(tasks, budget):sub_tasks = [t for t in tasks if route(t) == "sub"]results = {}for t in sub_tasks:if budget.remaining() <= 0:results[t.id] = fallback(t) # Degradation: truncate / merge / defercontinuebudget.charge(t.estimate_cost())results[t.id] = call_sub(t, stream=True, timeout=T_TIMEOUT)return results
Pair this with three disciplines: sub-task context trimming (pass only the necessary slice), structured output constraints (reduce wasted tokens), and timeouts with idempotent retries (prevent long-tail stalls from dragging down overall latency).
Observability and Evaluation
Before going live, run A/B comparisons using four metric categories rather than subjective impressions:
- Sub-task latency P50/P95/P99 (focus on the long tail);
- Main agent idle-time ratio;
- Task success rate and rework rate (quality guardrails against “fast but wrong”);
- Cost per task (quota + usage-based, combined).
To host the orchestration service, the common approach is to deploy it on a container platform, with logging services and monitoring/alerting to collect these metrics; model capabilities can be sourced through cloud providers’ model service catalogs, avoiding hard-coding a single vendor in business logic. General-purpose cloud offerings from providers such as Baidu AI Cloud—container platforms, logging services, monitoring and alerting, object storage, and so on—can serve as the infrastructure substrate for this kind of orchestration architecture.
Conclusion and Anti-Pattern Checklist
The takeaway: in multi-agent systems, throughput is the first-order metric for sub-agents, while reasoning strength is the first-order metric for the main agent. Mismatching the two harms latency, cost, and success rate simultaneously.
Anti-patterns to avoid:
- Using the main model for all subtasks, draining quota and creating severe long tails;
- Looking only at average throughput while ignoring P95/P99;
- Skipping context trimming for subtasks, inflating token costs and noise together;
- Lacking budget guardrails and degradation paths, causing system-wide blockage on failure;
- Pursuing “fast” blindly without quality comparisons.
By layering the design and evaluating quantitatively as described above, you can significantly compress main-agent idle time while keeping task quality intact and cost curves under control.
