The History Tax: Why Turn Ten Costs 5.6x More Than Turn One, and How to Cap It
Johnny Mai, Director of Gen AI Product Strategy at Qwen, argues that context windows should be treated as cost centers with explicit per-part budgets. His worked example shows turn ten of a support conversation costing 5.6 times turn one — not because the model changed, but because history and tool results ride along on every request. He proposes four techniques (summarization, reranking, structured outputs, just-in-time loading) that cut session cost by roughly 78% under stated assumptions, and warns that the savings count only if quality holds on your own evaluation set.
Every turn of an agent conversation resends the entire past. In the worked example Johnny Mai uses — a ten-turn support agent on qwen3.8-max — the first turn costs about $0.024 and the tenth costs $0.132. The user asked nothing harder at turn ten. The model did not get more expensive. The past did. Mai calls this the history tax: the tokens you pay to re-send earlier messages, tool results and retrieved documents on every subsequent request. In his illustrative scenario, history and tool results account for roughly 72% of total session input.
Mai's central proposal is to treat the context window as a budget rather than a ceiling. Open any production request log, he writes, and the input breaks into six parts: system prompt, tool definitions, retrieved documents, conversation history, tool results and the current user message. Each part has its own growth curve. The system prompt is fixed but creeps as teams add rules. Tool definitions grow with every tool registered. Retrieved documents grow with chunk count and size. History and tool results compound because they ride along on every later request in the session. The user message is usually the smallest part.
The budgeting discipline has three rules. First, one owner per column: the platform team owns the fixed prefix, the retrieval owner owns retrieved tokens, the agent owner owns history and tool results. Second, alert on the ceiling, not the average — log input tokens per part on every request and trigger when the 95th percentile crosses the budget. Third, price the ceiling. At qwen3.8-max's Singapore list price of $2.00 per million input tokens, a support-agent ceiling of 7,200 tokens costs $0.0144 of input per turn. That number goes into the cost model, not just the architecture diagram. On tiered models the ceiling also protects the rate: qwen3.7-plus jumps from $0.40 to $1.20 per million tokens at 256K, so crossing the tier makes every input token in that request more expensive, not just the extra ones.