toolcall() ← all concepts

// concept · context

More context makes it worse.

Everything you send — system prompt, history, retrieved docs, tool output — competes inside one finite window. Filling it is not free storage; it is spending an attention budget with diminishing returns.

// the mechanism

There is one budget and everything shares it. The system prompt, the conversation so far, every retrieved chunk, every tool result, and the answer itself all come out of the same window. They are not stored separately — they compete.

Anthropic frames it as an attention budget: context is a finite resource with diminishing marginal returns. Past a point, adding relevant material stops helping and starts costing you.

# all of this is one budget system prompt + history + retrieved docs + tool output + answer

Length alone degrades accuracy

This is measured, not folklore. Chroma's context-rot study ran 18 models and found performance degrades as input length grows — a single distractor lowers accuracy, and four compound the effect. RULER shows effective context is far below the advertised number; NoLiMa found 11 of 13 models dropped below half their short-context baseline at 32K.

The nuance that matters: it is not true that any irrelevant token hurts. Genuinely random noise can even help slightly. What buries an answer is lookalike-but-wrong material — plausible, on-topic, and stale. That is exactly what a broad retrieval sweep pulls in.

The middle gets under-weighted

Attention is not uniform across the window. The classic "lost in the middle" result found a U-shaped curve: material at the start and end is used well, material in the middle is used worst. In one setup, moving the key document from best position to the middle cost about 22 points — and the middle placement scored below the same model given no documents at all.

start used well middle under-weighted — can be worse than nothing end used well

Newer models handle this better. None are immune. If one passage decides the answer, do not bury it at position 40 of 80.

Wrong context actively misleads

Irrelevant context dilutes; contradictory context overrides. Related-but-wrong passages have been measured dropping accuracy by 5.9–11.1 points, and a plausible contradiction can cost around 15.8. Models will adopt a counterfactual passage over their own prior knowledge roughly 65% of the time.

Concretely: a stale line saying an order is "still processing" when it shipped last week doesn't confuse the model — it convinces it.

The rule

aim for the smallest set of high-signal tokens not everything that might be relevant

That phrasing is close to Anthropic's own: the smallest possible set of high-signal tokens that maximise the likelihood of your desired outcome. Practically — retrieve fewer, better chunks; put what decides the answer at the start or the end; and prune stale material aggressively, because it outranks being merely useless.

This is what context engineering names: the layer that includes prompt design, retrieval, memory and tool output as components. Related: context rot and context window limits.

Sources: Anthropic — effective context engineering · Chroma — context rot · Liu et al. — lost in the middle · NoLiMa · context-faithful prompting

One concept a week. Free.

The deeper, copy-paste version of each ToolCall short — in your inbox.

// total: 0.00 · spam: void · unsubscribe: one click