High Throughput Is Not Low Latency: A Breakdown of AI Agent Task Duration

    When an LLM decodes at hundreds of tokens per second, why can a single agent task still take hours to complete? This article explains why token throughput and end-to-end task latency measure entirely different things, presents a practical decomposition model of total task time (queueing, prefill, planning, tool execution, verification, and context compression), and shows why optimizing decoding speed yields only linear, low-coefficient gains while reducing serial tool dependencies and retries delivers multiplicative improvements. It also covers emerging compute-scaling trends that increase per-token computation without growing parameters, explains why coding agent tasks push latency costs beyond the software team, and provides an observability checklist, tracing instrumentation guidance, and a concrete playbook for engineering leaders translating demo capabilities into real delivery schedules.

    1. Hundreds of Tokens per Second, Yet a Task Runs for Hours

    A recent public benchmark surfaced a telling set of numbers: a large model’s decoding throughput was measured at over a hundred tokens per second during off-peak hours, dropping to tens of tokens per second at peak; meanwhile, an agent task involving physics simulation and 3D animation generation took nearly five hours end to end.

    These two numbers don’t contradict each other—they measure completely different layers. The former is the instantaneous rate of the decoding stage, covering only the “token-by-token generation” segment. The latter is the total duration of a complete delivery pipeline, including queueing, prefill, multi-round planning, tool calls, engineering file reads, context compression, and final artifact acceptance. Treating token rate as task rate is one of the most common—and most expensive—misjudgments in enterprise LLM adoption today.

    This distinction is very real in project planning. After watching a demo, a product manager may readily translate “it can write scripts, generate 3D models, and build mini-games” into headcount reduction starting tomorrow. The engineering lead, however, faces a different list: how many tool calls the agent will make, how many engineering files it will read, how many rounds of context compression it will trigger, who accepts the final artifact, and how failures roll back. While the model writes code on stage, the timers, permission systems, and token meters keep running backstage.

    2. Decomposing the Five Hours: A Composition Model for Task Latency

    To optimize end-to-end latency, you first need to decompose it. A workable approximation:

    1. T_total ≈ T_queue + T_prefill
    2. + Σ (T_plan_decode + T_tool + T_verify) × N_round
    3. + T_compress × N_compress

    The engineering meaning of each term:

    • T_queue (queueing): waiting caused by resource contention at peak hours; the most volatile component and the easiest to hide behind averages.
    • T_prefill (prefill): roughly proportional to input context length; long repositories and long documents significantly increase time-to-first-token.
    • T_plan_decode (planning decode): the only part actually governed by token rate, but often a small fraction of long tasks.
    • T_tool (tool execution): compilation, testing, rendering, retrieval—typically the single largest term by an order of magnitude, and mostly serial in dependency.
    • T_verify (verification): whether the artifact compiles, tests pass, rendering succeeds; failures trigger retries, creating a multiplier effect.
    • T_compress (context compression): unavoidable in long tasks, and each compression round is itself a model call.

    The conclusion is direct: optimizing decoding rate improves total duration linearly with a small coefficient; optimizing tool serialization and retry count yields multiplicative gains.

    3. Longer Compute Paths: Same Parameters, Greater Effective Depth

    Another notable industry trend: capability gains no longer come solely from stacking parameters. One repeatedly validated approach shares weights across some layers of the base model and executes them for multiple rounds—total parameter count stays the same, but the compute path gets longer.

    It’s like having the same musicians play a complex passage one more time instead of immediately expanding the orchestra—the performance may be more refined, and the rehearsal time genuinely increases. Engineering teams must understand the costs:

    1. Per-token compute rises, pressuring both throughput and latency; capacity planning can no longer look at parameter count alone.
    2. Memory footprint decouples from parameter scale, but compute consumption tracks “effective depth.”
    3. Cache-reuse strategies need re-evaluation, since repeated execution erodes the benefits of some inter-layer caches.

    Therefore, “how many B parameters” is no longer a sufficient selection criterion—you must add “per-token effective compute” as a dimension.

    4. Why Coding Tasks Push Latency Costs Beyond the Software Team

    Coding tasks are the scenario most likely to trigger every cost item above, and the impact spills over into product, testing, operations, and security teams:

    • Tool call count: reading files, running tests, checking logs, committing changes—each step is an independent round trip.
    • Context size: prefill costs from large-repository retrieval often exceed the cost of generation itself.
    • Compression rounds: the longer the task, the more likely history gets compressed, and information loss causes rework.
    • Acceptance responsibility: who signs off on the artifact and how failures roll back determines whether automation truly closes the loop.
    • Permissions and audit: write access, execution privileges, and data boundaries are prerequisites for production deployment.

    5. Observability First, Optimization Second

    Without per-stage instrumentation, every performance discussion is guesswork. Instrument your agent framework to uniformly record the following fields:

    Metric Meaning Purpose
    TTFT Time to first token Diagnose prefill and queueing
    TPS Decode rate Check whether compute tier matches demand
    tool_latency_p50/p95 Tool latency distribution Locate serial bottlenecks
    rounds / retries Rounds and retries Assess multiplier effects
    compress_count Compression count Evaluate context strategy
    tokens_in / tokens_out Metering and cost Cost accounting and quotas

    Illustrative implementation (using a generic inference interface abstraction):

    1. import time
    2. def run_task(prompt, tools, cfg):
    3. trace, ctx = [], prompt
    4. for step in range(cfg["max_steps"]):
    5. t0 = time.perf_counter()
    6. resp = call_model(ctx) # generic inference interface
    7. trace.append({
    8. "step": step,
    9. "ttft_ms": resp.first_token_ms,
    10. "decode_s": time.perf_counter() - t0,
    11. "in": resp.usage["prompt_tokens"],
    12. "out": resp.usage["completion_tokens"],
    13. })
    14. if resp.finish_reason != "tool_call":
    15. return resp.text, summarize(trace)
    16. t1 = time.perf_counter()
    17. obs = tools[resp.tool_name](**resp.args) # tool execution
    18. trace.append({"step": step, "tool_s": time.perf_counter() - t1})
    19. if should_compress(ctx, obs, cfg["window"]):
    20. ctx = compress(ctx, obs) # context compression
    21. trace[-1]["compressed"] = True
    22. else:
    23. ctx = ctx + obs
    24. return None, summarize(trace)

    With a trace in hand, you can answer the key question: of those five hours, how much time was the model actually generating?

    6. Converting Demo Capability into Delivery Schedules: A Checklist for Engineering Leads

    1. Separate metric definitions: external communication must present both “decoding throughput” and “end-to-end task duration” curves, annotated with peak and off-peak figures.
    2. De-serialize first: parallelize parallelizable tool calls and cache repeated retrieval results—this usually outperforms swapping models.
    3. Front-load compression strategy: define the retention window, summarization granularity, and non-droppable key constraints (interface definitions, acceptance criteria) up front.
    4. Automate acceptance: script compilation, unit tests, static analysis, and rendering checks so retries become measurable costs rather than hidden overtime.
    5. Least privilege: default to read-only; write and execute operations go through approval and sandboxes, with a complete audit trail.
    6. Quotas and budgets: set budget caps per task rather than per token; stop on overrun and output intermediate artifacts to avoid “five hours of runtime with zero deliverables.”
    7. Canary and comparison: run A/B tests on the same task batch, using end-to-end duration and first-pass rate as core metrics—not demo effects.

    7. Conclusion

    High throughput is a necessary capability, but it is not a delivery capability. What truly determines whether an agent can enter the production schedule is the decomposability, observability, and acceptability of its end-to-end latency. Put token rate, tool latency, compression rounds, and acceptance cost on the same measurement table—only then can you translate “impressive demo” into “shippable next week.”