In-Context Aggregation Error
A wrong total or count from a model doing arithmetic in its own context.
Hand a bank teller twenty bills and she'll count them by hand in a few seconds, correctly. Hand her two hundred and she reaches for the counting machine. She knows a long count gives her many more chances to lose her place, and that a miscount feels exactly like a correct one.
Agents don't reach for the machine unless you give them one. A tool hands back pages of records, the agent reads every one, and then it adds them up in its own context, the way a person adds a column of figures in their head. Every number it fetched can be right and the total still wrong. Nothing flags the error, either. "276 commits" reads just as confidently as "278."
In practice
In The Model Can't Add, an agent paged through mock Stripe charges and totaled the failed ones per currency. Here are three of its answers in tool mode, where it did the sums itself:
| Items | Currency | Reported | Correct |
|---|---|---|---|
| 100 | AUD | 435,300 | 563,500 |
| 200 | AUD | 693,300 | 778,700 |
| 200 | JPY | 375,550 | 571,450 |
Notice what the authors did next. They summed the pages the agent had actually received, and those pages added up to the correct totals exactly. The data was right. The arithmetic, done across 20 to 57 amounts held in context, was not. Given a sandboxed script for the sums, the same agent was exact at every size.
The error also grows with the data. In the larger run, tool mode was right in 8 of 8 attempts at 20 items and 4 of 8 at 200. With one run per cell, read that as a direction, not a rate.
Counting is no safer than adding. In Count Trips, Not Tokens, an agent fetched 75 repositories in one response, said 36 were private, and the list held 33. That task was later found confounded by its mock data, but the private count itself was checkable, and it was wrong.
Why it matters
Totals, counts and rankings are answers people act on: revenue by region, refunds per customer. A wrong one looks like a right one, and it slips past graders too. In an earlier probe from The Model Can't Add, an LLM judge ruled a EUR total of 1,171,050 equivalent to the true 1,211,050, on both votes.
What to do about it
H-08 Compositional Accelerators is the main fix: let the computer do the arithmetic, through server-side counts and totals, filters that report how many items matched, or a sandboxed script. H-03 Token Hygiene & High Observation Yield helps from the other side. When a tool must return many records, it should also return the count and totals it already knows, so the agent copies a number instead of computing one.
Related
An agent reads every token a tool returns, with no skimming, so every record lands in context waiting to be added. The Guide calls this literal exhaustive readingLexicon · 10Literal Exhaustive ReadingIngesting every returned token without human visual skimming.. As those pages pile up, the agent's reasoning blurs, a slide named attention entropyLexicon · 15Attention EntropyProgressive reasoning degradation as session debris and noise accumulate., and a long sum is its worst case. The root cause is usually semantic impedanceLexicon · 34Semantic ImpedanceMismatch between the granularity of agent reasoning and available actions.: the agent thinks "total the failed charges," while the tools offer one page of charges at a time.