September 1, 2026
How to Reduce Tokens in Multi-Turn Conversations (2026)
Learn how to reduce tokens in multi-turn conversations with sliding windows, summarization, and query-aware compression. Cut costs and boost accuracy.

TL;DR
Every turn in a multi-turn LLM conversation resends the entire chat history, causing token costs to grow quadratically, not linearly. A 10-turn conversation costs roughly 55x a single turn, not 10x. Beyond cost, the ICLR 2026 Best Paper found a 39% average accuracy drop across all tested LLMs in multi-turn settings. Techniques like sliding windows, rolling summarization, prompt compression, and query-aware compression can cut token usage by 60-72% while maintaining or even improving answer quality.
Key Takeaways: How to Reduce Tokens in Multi-Turn Conversations
Reducing token usage in multi-turn LLM conversations requires managing dynamic context growth using five primary strategies:
-
Query-Aware Compression: Extracts only the history spans relevant to the active user prompt, yielding up to 72% token reduction without dropping critical facts.
-
Sliding Window Capping: Retains only the last 3 to 5 turns of conversation to put a hard ceiling on quadratic token accumulation.
-
Rolling Summarization: Condenses older back-and-forth messages into a concise 200-token summary once conversations exceed 6 to 8 turns.
-
Prompt and Prefix Caching: Reuses precomputed attention states for static system instructions, slashing static input processing costs by up to 90%.
-
Tool Output Truncation: Filters or compresses raw JSON and Markdown outputs from API calls before appending them to the session history.
What “Reduce Tokens in Multi-Turn Conversations” Actually Means
Most LLM APIs are stateless. The model remembers nothing between calls. To maintain a coherent conversation, your application must resend the full conversation history, every user message, every assistant reply, every tool output, with each new request.
This means that every token from turns 1 through N-1 gets reprocessed as input when you send turn N. The model does the same work over and over, and you pay for it every time.
Reducing tokens in multi-turn conversations is the practice of shrinking that repeated context so you send fewer tokens per turn without losing the information the model needs to give a good answer.
The Math: Why Costs Grow Quadratically
The total input tokens across an entire conversation follow a triangular number pattern: N(N+1)/2. Here’s what that looks like in practice:
Turn | New Tokens | Cumulative Input Tokens Sent This Turn | Running Total (All Turns) |
1 | 200 | 200 | 200 |
2 | 300 | 500 | 700 |
3 | 400 | 900 | 1,600 |
5 | 400 | 1,900 | 5,600 |
10 | 400 | 3,100 | 23,100 |
20 | 400 | 7,100 | 86,100 |
A 10-turn conversation doesn’t cost 10x a single turn. It costs closer to 55x, because each turn includes all previous turns. An Augment Code analysis showed that a 20-step agent loop where each step generates 1,000 tokens produces 210,000 cumulative input tokens, not the 20,000 a per-step estimate would suggest.
This is the token snowball. And it hits production systems hard.
Try Compresr’s compression demo to see how much of your multi-turn history can be safely compressed.
Why Reducing Tokens in Multi-Turn Conversations Matters
Cost Spirals That Sneak Up on You
By turn 10, the cost per API call is roughly 7x to 10x the cost of turn 1 for identical output length. As the Redis engineering blog documents, a 20-turn conversation can consume 5,000 to 10,000 tokens when only 500 to 1,000 tokens of recent context would actually be needed.
The real-world consequences are brutal. One B2B SaaS startup discovered costs of approximately $4.20 per session with 15-turn averages, accumulating $67,000 in unexpected LLM costs by week three. Token prices have fallen 280x over two years, but total enterprise AI spend has risen 320% in the same period, according to NeuralTrust’s token optimization research. Cheaper per-token pricing doesn’t help when your architecture multiplies token volume exponentially.
For a deeper breakdown of how these costs compound, see our guide on conversation history token costs.
Latency Gets Worse Every Turn
Time to first token (TTFT) scales linearly with prompt length. A 10,000-token prompt takes meaningfully longer to process than a 1,000-token prompt. In agentic workflows where the model makes decisions in a loop, each additional turn adds latency to every subsequent call. Users notice.
Accuracy Degrades, Not Just Cost
This is the part most teams miss. The ICLR 2026 Best Paper (awarded outstanding paper at ICLR) tested 15 LLMs across more than 200,000 conversations and found a 39% average accuracy drop in multi-turn versus single-turn settings. Every model tested performed significantly worse.
The mechanism is straightforward: as conversation history grows, the system prompt and early instructions get buried under thousands of tokens of chat history. Compliance teams have found that a constraint stated at turn one (“do not quote internal pricing”) gets silently violated by turn fifteen. The model’s attention drifts toward recent tokens and away from the instructions that matter most.
This phenomenon, sometimes called context rot, means that reducing tokens isn’t just about saving money. Sending less can produce better answers.
Research from the CachedAttention paper, analyzing real ShareGPT conversations, found that historical tokens exceed 99% of context by later turns, and repetitive computation occupies 99% of prefilling time. The model spends nearly all its compute re-reading old text.
Six Proven Techniques to Reduce Tokens in Multi-Turn Conversations
Each technique below works differently, with distinct trade-offs on complexity, savings, and information loss. Most production systems combine two or more.
For background on the broader compression category, our context compression glossary entry covers the fundamentals.
1. Sliding Window (Truncation)
How it works: Keep only the most recent N turns of conversation in the context. As new turns arrive, the oldest ones drop off.
Typical savings: Caps context growth entirely. A 5-turn window means you never send more than ~5 turns of history regardless of conversation length.
Trade-off: Simple but lossy. Important facts mentioned in early turns vanish permanently. If the user said “my budget is $50,000” in turn 2 and you’re on turn 12 with a 5-turn window, that constraint is gone.
Practitioners on Reddit and in GitHub discussions report that a window of 3 to 5 turns works for most use cases. Too small and you miss important context. Too large and you pay for tokens that don’t improve accuracy. The window size becomes a tunable parameter specific to your application.
2. Rolling Summarization
How it works: Use the LLM (or a smaller model) to summarize older conversation turns into a condensed recap. You replay a 200-token summary plus the last few turns verbatim instead of 5,000 tokens of raw history.
Typical savings: Studies show summarization can yield up to 60% reduction in context window costs, with roughly 80% of key information retained.
Trade-off: Summarization itself costs tokens. You’re calling the LLM to summarize so you can save on future LLM calls. Few articles quantify the break-even point, but it generally pays off around turn 6 to 8, when the accumulated history is large enough that the compression savings exceed the summarization cost.
There’s also a fidelity risk. Abstractive summarization can introduce subtle distortions. A 2024 study on multi-document QA found that abstractive compression at moderate ratios decreased performance by 4.69 F1 points, while extractive approaches actually improved accuracy. The summarizer can quietly drop or alter details that matter later.
3. Algorithmic Prompt Compression
How it works: Instead of rewriting or selecting, algorithmically remove tokens contributing least to meaning. Tools like LLMLingua use small language models to score each token by predictability, then drop low-information tokens.
Typical savings: The same study found extractive reranker-based compression achieved +7.89 F1 points at 4.5x compression. Compression actually improved accuracy by removing noise.
Trade-off: The compressed output often looks ungrammatical to a human but remains readable to the target LLM. This can make debugging harder since the compressed prompts are difficult for humans to inspect.
For a detailed comparison of compression tools, see our prompt compression tools comparison.
4. Query-Aware Compression
How it works: Rather than compressing generically, this approach keeps only the spans relevant to the current query. If the user asks about pricing in turn 15, the compressor retains pricing-related context from the full history and drops everything else.
Typical savings: The MT-OSC research demonstrated up to 72% token reduction for 10-turn conversations using optimized multi-turn compression.
Why this matters: Most existing compression techniques are query-independent, meaning they optimize memory for general retention rather than the specific question at hand. Query-aware compression bridges the gap between “throw away everything old” (sliding window) and “keep everything” (full history). It’s the approach most likely to both reduce tokens and improve accuracy simultaneously, because the model receives focused, relevant context instead of a firehose.
Compresr’s API is built around this approach, using query-aware compression models that keep only the spans relevant to a given query. At $0.10 per 1M tokens compressed, the economics work even for high-volume agent loops.
5. KV Cache Optimization
How it works: At the infrastructure level, the key-value (KV) cache stores computed attention states so that previously seen tokens don’t need to be recomputed from scratch. During inference, only new tokens need full computation while historical tokens reuse cached states, avoiding repeated embedding, feed-forward, normalization, and projection operations.
Typical savings: Varies by implementation. KVzip research showed 3 to 4x memory compression for chatbot contexts.
Trade-off: Standard cache-eviction methods like H₂O aren’t suitable for multi-turn conversations because they permanently discard tokens that may be needed in later turns. Newer methods like RocketKV-MT address this by retaining all KV tokens in memory for future turns while constraining token selection in the current turn. This requires infrastructure control that most teams using hosted APIs don’t have.
6. Prefix and Prompt Caching
How it works: Hosted providers (Anthropic, OpenAI, Google) cache the static prefix of your prompt so repeated calls with the same system prompt don’t reprocess those tokens. On Claude Sonnet, cache reads cost $0.30/1M versus $3.00/1M for uncached input, a 90% reduction on the cached portion.
Trade-off: Prompt caching only addresses the fixed system prompt. The growing conversation history, which is the dominant cost driver in multi-turn loops, changes every turn and cannot be cached. Each new tool output is unique too. Caching is helpful but doesn’t solve the core snowball problem.
For a thorough comparison of when caching helps versus when compression is needed, see our prompt caching comparison guide.
Context Optimization Techniques Compared
Technique | Average Token Savings | Implementation Effort | Primary Risk / Trade-Off | Best Suited For |
Sliding Window | 50% – 80% (Capped) | Very Low | Permanently drops early facts & system constraints | Short chats (<10 turns) |
Rolling Summarization | 40% – 60% | Medium | Minor information drift; incurs summary API cost | Mid-length conversations (10–30 turns) |
Prompt Compression (LLMLingua) | 30% – 60% | Medium | Output unreadable to humans; debugging difficulty | Non-critical background context |
Query-Aware Compression | 60% – 72% | High | Requires real-time relevance scoring | Long agentic workflows & tool outputs |
KV Cache Optimization | 3x – 4x Memory | High (Infra level) | Requires direct hosting/infrastructure control | Self-hosted LLM deployments |
Prefix / Prompt Caching | Up to 90% (Static) | Low | Doesn't compress dynamic conversation growth | Fixed system instructions & system prompts |
How to Choose the Right Technique
The right approach depends on conversation length, tolerance for information loss, and how much infrastructure control you have.
Short conversations (under 10 turns): A sliding window of 3 to 5 turns usually handles things fine. The token accumulation hasn’t reached painful levels, and the information loss from truncation is minimal.
Medium conversations (10 to 30 turns): This is where rolling summarization or prompt compression becomes necessary. The quadratic cost growth is real at this range, and accuracy degradation from bloated context starts to show. Combining a summary of older turns with verbatim recent turns is a common pattern.
Long or agentic conversations (30+ turns): Query-aware compression plus a deliberate memory architecture is the right call. Generic summarization at this scale either loses too much information or costs too much in summarization calls. Agent loops with tool outputs are particularly aggressive token consumers because each tool response can be thousands of tokens of JSON or markdown.
Recommended Multi-Turn Compression Architecture
For production LLM applications, a hybrid pipeline yields the best balance of cost savings, latency reduction, and accuracy retention:
-
Step 1: Cache Fixed Assets Set explicit cache control headers on your static system prompt and standard instructions so provider APIs process these tokens at discounted cache-read rates.
-
Step 2: Evaluate Turn Depth
-
If total history is 5 turns or fewer, append all messages directly to the prompt without compression.
-
If total history exceeds 5 turns, split the payload into active turns and deep history.
-
Step 3: Process Deep History (Turns 1 through N-5) Run the older conversation history through a query-aware compression layer using the current user prompt as the reference target. Pass only the high-relevance text spans forward as a compressed background summary.
-
Step 4: Append Recent History (Turns N-4 to Present) Keep the most recent 3 to 5 turns intact in verbatim format to preserve immediate conversational context and recent tool outputs.
-
Step 5: Assemble Final Request Combine the cached system prompt, the compressed background summary, and the recent verbatim turns into a single optimized payload before calling the model API.
Most production teams don’t pick one technique in isolation. A typical stack looks like: prefix caching for the system prompt, query-aware compression for conversation history, and sliding window as a fallback safety net.
To automate compression in your stack, the Compresr quick-start guide walks through integration in under five minutes with Python or TypeScript SDKs.
Recommended Multi-Turn Compression Architecture
For production LLM applications, a hybrid pipeline yields the best balance of cost savings, latency reduction, and accuracy retention:
-
Step 1: Cache Fixed Assets Set explicit cache control headers on your static system prompt and standard instructions so provider APIs process these tokens at discounted cache-read rates.
-
Step 2: Evaluate Turn Depth
-
If total history is 5 turns or fewer, append all messages directly to the prompt without compression.
-
If total history exceeds 5 turns, split the payload into active turns and deep history.
-
Step 3: Process Deep History (Turns 1 through N-5) Run the older conversation history through a query-aware compression layer using the current user prompt as the reference target. Pass only the high-relevance text spans forward as a compressed background summary.
-
Step 4: Append Recent History (Turns N-4 to Present) Keep the most recent 3 to 5 turns intact in verbatim format to preserve immediate conversational context and recent tool outputs.
-
Step 5: Assemble Final Request Combine the cached system prompt, the compressed background summary, and the recent verbatim turns into a single optimized payload before calling the model API.
Practical Tips from Practitioners
Real users have developed habits that complement the technical approaches above.
Start new conversations frequently. The ICLR paper itself notes anecdotal evidence that Cursor users frequently create new conversations “whenever they can” as a strategy to ensure high-quality responses. One Claude Code user’s single biggest piece of advice: “Don’t let a conversation run past 15 to 20 turns.” A GitHub issue on the Claude Code repository documented one user consuming 68% of their 5-hour Pro usage in a single multi-turn conversation.
Set per-session token budgets. Rather than discovering cost overruns after the fact, cap each conversation session at a maximum input token count. When the budget is exhausted, either summarize and continue or start fresh.
Route long conversations to smaller models. Short conversations work fine on larger, more expensive models. But very long conversations where you’ve already summarized or compressed context can often be handled by a smaller, faster, cheaper model without quality loss. Our guide on context compression and model routing covers this strategy in detail.
Compress tool outputs separately. In agent loops, tool outputs (API responses, file contents, search results) are often the biggest per-turn payload. They’re typically verbose JSON or markdown with significant redundancy. Compressing these before they enter the conversation history has an outsized impact on total token usage. Teams building with LangChain can wire this in through framework-level integration.
Strip images from history after the first relevant turn. If a user uploads an image in turn 3 and you’ve already processed it, continuing to resend the image tokens for turns 4 through 20 is pure waste.
Watch for the 99% problem. As the General Compute engineering blog notes, most LLM tutorials show single-turn requests, but production agents maintain conversation state across many turns, and that state management is where most production bugs live. The gap between tutorial simplicity and production reality is where token costs explode.
The Counterintuitive Insight: Less Context, Better Answers
Most teams frame token reduction as a cost optimization. That framing is incomplete. The ICLR 2026 research and multiple compression studies demonstrate that sending less context can produce more accurate outputs.
The extractive compression study that showed +7.89 F1 points at 4.5x compression is a striking example. By removing low-information tokens, the compressor effectively reduces noise, helping the model focus on what matters. Similarly, query-aware compression filters conversation history to only the relevant portions, which means the model’s attention is concentrated rather than diluted across thousands of irrelevant tokens.
This reframes the entire conversation. Reducing tokens in multi-turn conversations isn’t about accepting a quality trade-off. Done well, it’s a quality improvement that happens to also save money and reduce latency.
See compression in action on your own prompts.
FAQ
Why do multi-turn conversations cost so much more than single-turn requests?
LLM APIs are stateless. Every turn resends the entire conversation history as input tokens. This creates a quadratic growth pattern where a 10-turn conversation costs roughly 55x a single turn, not 10x. Each new message includes all previous messages, so token counts accumulate as a triangular sum: N(N+1)/2.
How many tokens does a typical multi-turn conversation waste?
According to Redis’s engineering analysis, a 20-turn conversation can consume 5,000 to 10,000 tokens when only 500 to 1,000 tokens of recent context would typically be needed. By later turns, the CachedAttention research found that historical tokens exceed 99% of the total context.
Does reducing tokens hurt answer quality?
Not necessarily. The ICLR 2026 Best Paper showed that bloated multi-turn context actually reduces accuracy by 39% on average. Compression studies show that extractive compression at 4.5x ratios can improve F1 scores by nearly 8 points. The key is removing noise rather than removing relevant information, which is why query-aware compression tends to outperform generic approaches.
What’s the difference between prompt caching and token compression?
Prompt caching saves money on the static parts of your prompt (system prompt, few-shot examples) by avoiding reprocessing them. It doesn’t address the growing conversation history, which is the main cost driver in multi-turn settings. Compression actively reduces the dynamic portion of your context. Most teams benefit from using both.
When should I start compressing conversation history?
The break-even point depends on your technique. Sliding windows are essentially free to implement and worth using from the start. Summarization-based approaches typically pay off around turn 6 to 8, when the token savings from compressed history exceed the cost of the summarization call itself. For agentic loops with tool outputs, compression is worth applying from turn 1 because tool responses are often thousands of tokens each.
Can I combine multiple token reduction techniques?
Yes, and most production systems do. A common pattern is prefix caching for the system prompt, query-aware compression for conversation history, and a sliding window as a hard ceiling. The techniques operate at different levels and complement each other rather than conflicting.
How do I reduce tokens in multi-turn conversations if I’m using LangChain or LangGraph?
Framework integrations exist that let you add compression as middleware. For LangChain, compression can be applied to tool outputs and conversation history through dedicated middleware components. For LangGraph, compression can be wired in as a node. The important thing is compressing before tokens enter the conversation state, not after.
What’s the fastest way to test token compression on my existing conversations?
Export a sample conversation from your application, measure the token count, then run it through a compression API to see the reduced token count and compare output quality. This gives you a concrete savings number and quality assessment before committing to an architecture change.