Different model classes reward different context knobs: small windows want aggressive trimming, cached prefixes want stability, reasoning models want output reservation, weak long-context models want head and tail
Imagine packing for five different trips. A weekend carry-on (small window) means ruthless trimming, only essentials. A road trip with a passenger who has a magic suitcase that remembers your packing list (cached prefix) means stable layout to keep the magic working. A hike where you will write a long journal at the top (reasoning model) means leaving lots of paper blank for later. A drive where you tend to only remember the first and last hour (weak long-context) means putting the important stops at the start and end. A photo trip (vision model) means keeping camera notes right next to the photos. The packing rules are not universal. They depend on the trip.
Detailed answer & concept explanation~4 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 minutes: name the five classes and the dominant knob for each; explain why prompt caching rewards stability and reasoning rewards restraint; describe head and tail layout.
Real products, models, and research that use this idea.
- Anthropic's published Claude Opus 4.7 prompt-caching guide shows up to 90% input-cost reduction and 85% TTFT reduction for stable cached prefixes; the load-bearing optimization for that model class.
- OpenAI's GPT-5.5 reasoning configuration recommends reserving output token budgets of 4k+ for non-trivial tasks; documented in the responses API guide.
- Llama 4 Maverick 2026 long-context benchmarks (RULER, BABILong) confirm a steeper midcontext dip than frontier closed models, validating head and tail layout for that fleet.
- Gemini 3.1 Pro vision token accounting: images are charged at provider-defined token rates that must be budgeted alongside text.
- Cursor and Continue route different file-edit tasks to different models in 2026 with per-class context budgets, illustrating the mixed-fleet adapter pattern.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow do you design a router that picks the model class first, then the context layout?
QWhat goes wrong if you mix a cached prefix with retrieval results above the cache boundary?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Applying the same context layout across every model in your fleet. A layout tuned for Claude Opus 4.7 with caching is a poor layout for a small 8k local model and vice versa.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.