Faster LLM Inference, Slower Delivery: Why Long-Running Tasks Stay Slow
Faster token generation does not automatically make long-running AI tasks deliver results faster. Drawing on a real example of a 3D animation task that took about five hours, this article breaks end-to-end latency into queueing, prefill, decode, tool execution, retries, and post-processing. It explains why token throughput alone cannot fix long task latency and outlines six practical engineering practices: DAG-based orchestration with checkpoints, context management, parallel and speculative execution, externalizing deterministic work to tools, stage-level observability, and cost and quota strategies. It also recommends replacing token-per-second metrics with delivery metrics such as success rate, P95 end-to-end latency, cost per task, and manual rework rate.
1. The Opening Gap: Generation Is Fast, Delivery Is Slow
When a model service platform launched its new-generation model in late November, the published inference figures were roughly 200 tokens per second during off-peak hours and about 70 to 80 tokens per second at peak. Around the same time, a public hands-on report showed a 3D animation generation task involving physics calculations that took about five hours in total.
Put those two sets of numbers side by side and an easily overlooked fact emerges: single-token throughput only determines how fast the model can “talk,” while task delivery time is determined by the entire pipeline. A several-fold increase in generation speed does not automatically translate into a several-fold increase in delivery speed.
For developers and enterprise users, the real questions have never been how many tokens a model emits per second. They are: how long does it take from task submission to a usable result; how costly is a single failure; and can turnaround remain predictable during peak hours?
2. Breaking Task Latency into Measurable Stages
To optimize delivery time, you first need to decompose it. The end-to-end duration of a typical generative task can be approximated as:
T_total = T_queue + T_prefill + T_decode + T_tool + T_retry + T_post
- T_queue: queueing and rate-limit waiting, which grows significantly at peak;
- T_prefill: prefilling the input context, roughly linear in input length;
- T_decode: token-by-token decoding, dependent on output length and contention under concurrency;
- T_tool: time spent in external tools, rendering, compilation, computation, and similar steps;
- T_retry: duplicated cost caused by retries after failures;
- T_post: result parsing, validation, persistence, and post-processing.
In the hands-on example above, the five hours were overwhelmingly not spent in T_decode. For a 3D task with physics simulation and rendering, the real bottlenecks are usually T_tool and T_retry: physics solving, frame-by-frame rendering, and asset loading are deterministic computations that take minutes or longer, while the model only generates scripts and parameters.
The conclusion is straightforward: optimizing token speed can only compress T_decode; compressing T_total requires governing the other five stages.
3. Why “200 tokens/s” Cannot Rescue Long Tasks
First, Amdahl’s law applies. If decoding accounts for only 5% of total time, doubling decode speed yields less than 3% overall improvement. Betting all engineering effort on generation speed is a classic local-optimization trap.
Second, queueing and peak-hour volatility. The gap between 200 off-peak and 70 to 80 at peak means a single task’s decode time may become two to three times longer during peak periods. For tasks that run for hours continuously, any congestion is amplified into an overall delay.
Third, the prefill cost of long contexts. Long documents, large codebases, and multi-turn history push up T_prefill, and that cost is paid again every turn. The longer the context, the more times you pay it repeatedly.
Fourth, the multiplicative effect of retries. Once a long task fails at the final step, all preceding work is discarded, and a rerun multiplies the cost by two or more.
Fifth, serial dependencies. If every sub-step must wait for confirmation of the previous result, total time is the sum of all stages rather than the maximum.
4. Six Practical Engineering Practices
4.1 Task Orchestration: Split Long Tasks into a Resumable DAG
Do not make the model “do everything in one shot.” Model the task as a directed acyclic graph, make each node’s inputs and outputs explicit, persist state to external storage, and rerun only the failed node.
# Example: node-based orchestration with resume from checkpointtask = DAG([Node("parse_spec", retry=2),Node("gen_scene", retry=2, depends=["parse_spec"]),Node("physics", retry=1, depends=["gen_scene"], tool="solver"),Node("render", retry=1, depends=["physics"], tool="renderer"),Node("verify", retry=3, depends=["render"]),], checkpoint="object_storage://task-ckpt/")
4.2 Context Management: Carry Only What Is Necessary
Retrieve on demand, summarize in layers, and compress history on a rolling basis to keep each turn’s input within the necessary scope. For code tasks, retrieve relevant file snippets first instead of stuffing in an entire repository.
4.3 Parallelism and Speculation: Turn Serial into Parallel
Run nodes without dependencies concurrently. Where dependencies exist, use a speculative “draft first, validate later” flow so validation overlaps with the next generation step.
4.4 Externalize Tools: Leave Deterministic Computation to Deterministic Engines
Physics solving, compilation, and rendering should not be “mentally computed” by the model; they should be performed by the tools it calls. The model’s value lies in generating correct call parameters and workflow.
4.5 Observability: Stage-Level Timing and Automated Alerts
Instrument every stage from T_queue to T_post and output P50/P95 latency distributions with automatic alerts on timeouts. Without stage-level data, optimization is guesswork.
stage p50 p95queue 2s 40sprefill 1.1s 6.8sdecode 38s 120stool 210s 1800sretry 0s 600s
4.6 Cost and Quota Strategy: Off-Peak Scheduling, Batching, and Caching
Schedule non-real-time tasks to off-peak periods; cache results for repeated prefixes; treat a “quota increase” as throughput headroom to raise concurrency and reduce queueing, rather than simply producing longer outputs.
5. Acceptance Criteria: Replace Speed Metrics with Delivery Metrics
Shift the evaluation criteria from “tokens/s” to four business metrics: task success rate, P95 end-to-end latency, cost per task, and manual rework rate. Only when all four improve at the same time does faster inference create real business value.
6. Conclusion
The new-generation model has pushed single-token generation to new heights, but the five-hour long task is a reminder: delivery is a chain, not a point. Whoever first makes orchestration, context, parallelism, tools, and observability solid can turn “the model is fast” into “the business is fast.”
