Contrast the hard token budget with the soft quality budget of a context window
The hard budget is the API token limit and is binary. The soft budget is the size beyond which quality degrades even though the API still accepts the call, and it is usually far smaller.
Imagine a backpack with a zipper. The zipper closes at a fixed maximum: that is the hard limit, and if you try to stuff more in, the zipper will not close. But long before you reach that physical maximum, the bag becomes too heavy to carry comfortably. Your shoulders start to ache, you walk slower, you trip on stairs. That comfort limit is the soft budget. The model has both. The zipper is enforced by the API. The shoulder pain is the model's accuracy quietly dropping as you cram more context in. Smart packing means staying inside the comfortable limit, not just inside the zipper limit.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
The hard vs soft budget distinction is the most consequential conceptual move in 2026 context engineering. Teams that internalize it ship faster, cheaper, more accurate systems. Teams that conflate the two ship slow, expensive, less accurate systems and cannot tell why their evals plateau.
This deep dive defines both budgets precisely, explains the mechanisms that produce the soft budget, shows how to measure it for a given model and task, and walks through the practical engineering disciplines that follow from taking the soft budget seriously.
Defining the two budgets precisely
The hard budget is an interface property of the model API. The tokenizer counts tokens, the API documents a maximum, and beyond that maximum the call is rejected with a clear error. Hard budgets are public facts: Claude Opus 4.7 is 200K input plus 8K output, GPT-5.5 is 256K to 1M input depending on the tier, Gemini 3.1 Pro is 2M+ depending on tier, DeepSeek V3.2 is 128K, Llama 4 Maverick is 1M and Llama 4 Scout claims 10M. The exact numbers shift across releases, but the structural property is the same: there is a published number, and exceeding it produces a deterministic, observable failure.
The soft budget is a behavioral property of the model. It is the token count beyond which adding more context erodes the quality of the answer, even though the call still succeeds. The soft budget is task-dependent (a single-needle retrieval task tolerates more context than a multi-step reasoning task), model-dependent (Claude Opus 4.7 has different curves than Gemini 3.1 Pro), and prompt-dependent (well-positioned context survives further than poorly-positioned context).
The soft budget is not a number you find in the docs. It is a curve you measure with an eval. RULER and Needle-in-a-Haystack are the standard 2026 instruments, and BABILong is the standard for multi-step reasoning under long context. The output of each is an accuracy vs length curve, and the knee of that curve is the soft budget for that task on that model.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Claude Opus 4.7 advertises 200K input but Anthropic's own long-context guide recommends 32K-64K for best quality on retrieval tasks
- Gemini 3.1 Pro offers a 2M+ window but Google's RULER results show quality erosion past 128K
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you empirically measure the soft budget for a given model and task?
Run a long-context eval (RULER, NIAH, or a task-specific synthetic) where you sweep context length and plot accuracy. The knee in the curve is the soft budget for that task. RULER is the most comprehensive 2026 option because it covers multiple subtask categories. For a real production task, build a small synthetic that mirrors your retrieval shape and measure on the actual model you plan to deploy.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Treating the hard token limit as the only budget that matters and stuffing context up to that ceiling, accepting silent quality loss.
60 second bullets to scan on the way to the call.
Define the hard budget and give a 2026 example by model SKU
Define the soft budget and explain why it differs by task and model
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.