Many Steps into One: Reasoning Contraction and the Limits of Safe Memory Reuse for LLM Agents
Organizations: ByteDance · Scale AI
Abstract
Thought templates, skill libraries, agent memories and caches turn many reasoning steps into one. We call this reasoning contraction. A contracted memory saves reasoning steps and errors until its facts change, then quietly answers wrong. Most systems trust memories by counting successes and failures. We prove that such counters are badly tuned change detectors: a symmetric counter notices a partial change only after a power of its false-alarm horizon, and an unclipped one may never notice it. On five LLMs answering multi-hop questions over edited facts, ExpeL- and ACE-style counters serve 7.0-13.5x more stale answers than certified memories given the same information, and on code tasks with an exact verifier 35-73x more. Safety also has a price. When facts change and each memory is judged only by its own verified outcomes, one number, the certification load, sets how much reasoning any safe memory can skip, and under Zipf demand it yields a scaling law. Our recipe weighs each memory's failures by its own likelihood ratio, certifies its utility against live reasoning, and restarts the certificate when facts change, with the likelihood-ratio detector as the safety net for unannounced changes; for large edits it also invalidates the memory.
Figures & tables
| Certificate | Needs | Guarantee |
|---|---|---|
| Restart only : ledger , restarts | notices † | -safe per epoch ( Proposition 23 ); as run , growth – on the laws checked, plus nats ( Section C.2 ) |
| Ours (recommended): + invalidate on notice | notices † , some missed | as above; a missed notice adds the carried-over term of Proposition 23 (iii) |
| No notice : discard at own alarm | none | -safe for folds on post-change evidence ( Proposition 25 ); not per epoch if ( Proposition 24 ) |
| Per candidate : level each | none | per candidate only ( Figure 1 a, code) |
| stale per queries | unretired at stream end | bad folds | ||||||
| Model | ExpeL | ACE | ours ∘ | ExpeL | ACE | LR | counters | ours |
| Qwen3-8B | 967 | 946 | 72 | 53% | 53% | 3% | 284–400 | 0.0 |
| Qwen3-4B | 795 | 783 | 85 | 57% | 51% | 0% | 111–148 | 0.1 |
| Granite-8B | 657 | 650 | 82 | 22% | 22% | 0% | 282–369 | 0.4 |
| Mistral-7B | 298 | 294 | 42 | 25% | 25% | 0% | 486–595 | 0.6 |
| OLMo-3-7B | 480 | 445 | 51 | 64% | 55% | 9% | 172–211 | 0.3 |
| Policy | Acc | Calls | Stale | Bad | ||
| no memory | live always | .379 | 3.26 | 0 | 0 | 43.8 |
| no retire | fold once | .534 | 1.45 | 1290 | 34 | 31.8 |
| compiled plan, fold once | .639 | 1.45 | 95 | 34 | 24.8 | |
| vCache-style, | .377 | 2.86 | 30 | – | 43.5 | |
| counters | ExpeL-style counter | .613 | 1.75 | 967 | 284 | 27.0 |
| ACE-style counter | .618 | 1.86 | 946 | 400 | 26.7 |
Appendix figures & tables30 assets
Supplementary material from the paper’s appendix.
Appendix
| 10 | 20 | 50 | 100 | 200 | 500 | 1000 | |
|---|---|---|---|---|---|---|---|
| .28 | .34 | .30 | .25 | .19 | .11 | .081 | |
| .27 | .33 | .26 | .20 | .13 | .058 | .030 | |
| bound (i) | .26 | .32 | .23 | .20 | .10 | .025 | .003 |
| Policy (Qwen3-8B) | Acc | Calls | Stale | SpF | |
|---|---|---|---|---|---|
| direct (path generation) | .186 | 1.00 | 0 | 0 | 54.1 |
| Hebbian + decay | .444 | 3.80 | 0.4 | 0.3 | 40.1 |
| compiled plan + SPRT | .650 | 2.51 | 10 | 0.3 | 25.3 |
| loss-tuned | .631 | 1.62 | 659 | 118 | 25.7 |
| SPRT + symmetric | .604 | 2.84 | 20 | 0.7 | 28.7 |
| betting, no restarts | .643 | 2.55 | 72 | 0.1 | 25.9 |
| live | ours (recommended) | macros + betting restart only / no restarts / per-cand. | compiled plan + betting restarts / no restarts / per-cand. | |||||||||||
| Model | Acc | Calls | Acc | Calls | Acc | Calls | Stale | Acc | Calls | Stale | ||||
| Qwen3-8B | .379 | 3.26 | 43.8 | .648 | 2.56 | 25.5 | .642/.643/.646 | 2.57 | 66/72/76 | 26.0 | .668/.673/.677 | 2.46 | 16/14/12 | 24.1 |
| Qwen3-4B | .226 | 4.48 | 74.0 | .556 | 3.10 | 43.0 | .551/.554/.553 | 3.08 | 82/85/91 | 43.5 | .591/.596/.596 | 2.90 | 10/12/12 | 39.7 |
| Granite-3.3-8B | .152 | 4.47 | 80.3 | .439 | 3.57 | 53.8 | .438/.441/.447 | 3.52 | 79/82/84 | 53.8 | .469/.472/.477 | 3.39 | 13/15/16 | 50.9 |
| Mistral-7B | .097 | 4.96 | 94.6 | .241 | 5.00 | 80.5 | .245/.247/.250 | 4.94 | 38/42/43 | 80.0 | .257/.259/.258 | 4.88 | 9/9/10 | 78.7 |
| OLMo-3-7B | .076 | 2.39 | 46.4 | .280 | 2.68 | 36.7 | .276/.280/.283 | 2.68 | 51/51/51 | 36.9 | .294/.297/.299 | 2.64 | 11/12/12 | 36.0 |
| empirical optimum | delay at matched FR (uses) | stale per | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | episodes | predicted [95% CI] | best | ours | best | ours | |||||||
| Qwen3-8B | 81 | .068 | .746 | .86 | 1.84 [1.36, 2.47] | 25 | .24 | 853 | 482 | 468 | 81 | 185 | 76 |
| Qwen3-4B | 65 | .044 | .746 | .88 | 2.14 [1.52, 3.32] | 0.75 | .34 | 330 | 398 | 317 | 54 | 231 | 91 |
| Granite-3.3-8B | 32 | .161 | .863 | .97 | 0.93 [0.57, 1.50] | 0.25 | .40 | 169 | 317 | 126 | 63 | 173 | 84 |
| Mistral-7B | 17 | .237 | .896 | .94 | 0.67 [0.39, 1.11] | 0.1 | .33 | 141 | 252 | 106 | 84 | 78 | 43 |
| OLMo-3-7B | 17 | .135 | .821 | .94 | 1.14 [0.59, 2.83] | 0.25 | .23 | 131 | 227 | 115 | 57 | 88 | 51 |
| ExpeL-style counter | ACE-style counter | |||
|---|---|---|---|---|
| Model | Acc | Acc | ||
| Qwen3-8B | [ , ] | [ , ] | [ , ] | [ , ] |
| Qwen3-4B | [ , ] | [ , ] | [ , ] | [ , ] |
| Granite-3.3-8B | [ , ] | [ , ] | [ , ] | [ , ] |
| Mistral-7B | [ , ] | [ , ] | [ , ] | [ , ] |
| OLMo-3-7B | [ , ] | [ , ] | [ , ] | [ , ] |
| certificate | Acc | Stale | SpF | slowdown | ||
|---|---|---|---|---|---|---|
| 0 | uncorrected | .436 | 69 | 0.71 | 1.00 | 1.00 |
| .05 | uncorrected | .370 | 63 | 0.21 | 1.88 | 1.23 |
| known | .370 | 61 | 0.21 | 2.00 | ||
| estimated | .369 | 61 | 0.21 | 1.99 | ||
| .1 | uncorrected | .326 | 61 | 0.17 | 2.56 | 1.56 |
| known | .328 | 59 | 0.12 | 2.82 |
| vCache, | plug-in, | ||||||
|---|---|---|---|---|---|---|---|
| Model | live Acc | hits | Acc | hits | Acc | Stale | |
| Qwen3-8B | .379 | .124 | .377 | .847 | .309 | 536 | |
| Qwen3-4B | .226 | .119 | .225 | .848 | .187 | 241 | |
| Granite-3.3-8B | .152 | .110 | .151 | .841 | .126 | 203 | |
| Mistral-7B | .097 | .111 | .097 | .847 | .082 | 115 | |
| OLMo-3-7B | .076 | .119 | .076 | .835 | .063 | 100 | |
| Rule (pooled) | episodes | cens. | unretired at end | RM delay, | median |
|---|---|---|---|---|---|
| LR (per-cand. betting) | 212 | 13 | 6.1 [2.5, 10.8]% | 76 [55, 107] | 45 [40, 55] |
| LR (SPRT) | 222 | 14 | 6.3 [2.4, 10.6]% | 103 [64, 176] | 50 [44, 64] |
| ExpeL-style | 1,954 | 1,241 | 63.5 [57.5, 69.8]% | 3,014 [2,204, 3,895] | 375 [216, 682] |
| ACE-style | 1,865 | 999 | 53.6 [47.6, 59.9]% | 2,569 [1,882, 3,332] | 211 [122, 373] |
| unretired at stream end | RM delay within uses | ||||||
| Model | eps. | ExpeL | ACE | LR | ExpeL | ACE | LR |
| Qwen3-8B | 66 | 53% | 53% | 3% | 4,501 | 4,507 | 92 |
| Qwen3-4B | 53 | 57% | 51% | 0% | 4,391 | 4,139 | 46 |
| Granite-3.3-8B | 18 | 22% | 22% | 0% | 3,278 | 3,251 | 44 |
| Mistral-7B | 8 | 25% | 25% | 0% | 2,110 | 2,095 | 61 |
| OLMo-3-7B | 11 | 64% | 55% | 9% | 5,071 | 4,507 | 942 |
| Model | Acc | stale | SpF | folds | restarts | |
|---|---|---|---|---|---|---|
| Qwen3-8B | [ , ] | [ , ] | 72 66 | 0.10 0.00 | 60.0 53.8 | 149 |
| Qwen3-4B | [ , ] | [ , ] | 85 82 | 0.20 0.07 | 72.9 66.5 | 110 |
| Granite-3.3-8B | [ , ] | [ , ] | 82 79 | 0.67 0.47 | 69.4 62.3 | 100 |
| Mistral-7B | [ , ] | [ , ] | 42 38 | 0.97 0.60 | 36.1 28.1 | 138 |
| OLMo-3-7B | [ , ] | [ , ] | 51 51 | 0.40 0.30 | 41.1 35.5 | 79 |
| Model | Acc | bad-fold epochs | alarms | stale | |
|---|---|---|---|---|---|
| Qwen3-8B | [ , ] | [ , ] | / | 68.3 | 70 66 |
| Qwen3-4B | [ , ] | [ , ] | / | 61.0 | 83 82 |
| Granite-3.3-8B | [ , ] | [ , ] | / | 91.8 | 81 79 |
| Mistral-7B | [ , ] | [ , ] | / | 224.2 | 42 38 |
| OLMo-3-7B | [ , ] | [ , ] | / | 99.7 | 49 51 |
| (i) own null | on null ev. | (ii) task | (iii) wrong | stale | ||
|---|---|---|---|---|---|---|
| restart only | .01 | 0/6704 | 0 | 0/6693 | 11.2% | 69 |
| .05 | 0/6657 | 0 | 0/6645 | 11.6% | 75 | |
| .1 | 0/6620 | 0 | 0/6611 | 11.7% | 78 | |
| .2 | 2/6554 | 2 | 2/6546 | 11.8% | 82 | |
| .5 | 12/6401 | 12 | 10/6396 | 12.8% | 103 | |
| no notice | .01 | 6/6471 | 0 | 5/6458 | 10.7% | 70 |
| Policy ( ) | Acc | Calls | Stale | Acc vs restart only (points) |
|---|---|---|---|---|
| restart only (restart-only certificate) | .430 | 3.36 | 63.3 | – |
| invalidate | .430 | 3.20 | 0.0 | [ , ] |
| ours: invalidate + LR | .433 | 3.38 | 0.0 | [ , ] |
| drop only | .332 | 3.84 | 0.0 | [ , ] |
| verified-answer cache | .188 | 3.43 | 0.0 | [ , ] |
| vCache-style | .186 | 3.50 | 0.0 | [ , ] |
| Policy (pooled) | Acc | Calls | Stale | Bad/stream | |
|---|---|---|---|---|---|
| live always | .175 | 4.47 | 0 | 0 | 79.3 |
| fold once | .340 | 2.60 | 231 | 8.5 | 62.6 |
| ExpeL-style counter | .391 | 3.39 | 241 | 149 | 59.0 |
| ACE-style counter | .391 | 3.52 | 238 | 207 | 59.2 |
| restart only (restart-only certificate) | .356 | 4.03 | 80.5 | 0.10 | 62.8 |
| ours (recommended) | .337 | 4.22 | 0 | 0.11 | 64.8 |
| Model | template-versions | notice | silent live-trace change | silent live-accuracy change |
|---|---|---|---|---|
| Qwen3-8B | 21,528 | 884 | 1,392 | 286 |
| Qwen3-4B | 21,600 | 867 | 3,124 | 363 |
| Granite-3.3-8B | 21,456 | 966 | 4,719 | 448 |
| Mistral-7B | 21,384 | 1,333 | 5,328 | 385 |
| OLMo-3-7B | 21,528 | 1,129 | 2,264 | 233 |
| Variant | Use when | Evidence |
|---|---|---|
| Recommended: invalidate on notice + certify with restarts + LR-CUSUM | false deployments must be bounded and notices may be incomplete | 0 stale with notices; 13–66 per when 20–100% are missed ( Table 16 ); no false certification at ; code: stale per with only requirement notices, bad folds in of epochs under test at ( Section D.6 ) |
| Restart only | changes are mild and partial, notices reliable | points over invalidation on natural edits ( Section D.5.3 ) |
| Compiled plans + certificate | the derivation can be re-executed cheaply on current facts | points over restart-only macros, stale per ( Table 16 ) |
| Verified answer cache | exact repeats, reliable notices | live accuracy; of queries in one step |
| Counters (ExpeL/ACE) | staleness is mild and folding everything pays; never when stale answers are costly | natural edits: points, – bad folds per stream |
| Id | Edit (re-enacted) | Precedent | Programs broken |
|---|---|---|---|
| A1 | typing.List etc. removed | PEP 585 deprecation | 55 / 68, total |
| A2 | re.sub/split : count, flags keyword-only | deprecated in 3.13 | 0 / 0 |
| A3 | str patterns ASCII-only by default | Python 2/3 default | 0 / 0 |
| A4 | int–str conversion capped at 640 digits | 3.11 (CVE-2020-10735) | 1 / 1, partial |
| A5 | round half away from zero | Python 2 | 2 / 2, partial |
| A6 | math.floor/ceil return float | Python 2 | 1 / 1, total |
| step accounting | call accounting | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Policy | Acc | acc (points) | steps/q | one-step | calls/q | one-step | Stale | Unretired | ||
| live always | .762 | 2.68 | 16.0 | 0 | 1.68 | 10.21 | 0 | 0 | – | |
| fold once | .765 | [ , ] | 1.24 | 14.1 | .94 | 1.17 | 9.35 | .94 | 1,043 | 100% |
| ExpeL-style counter | .822 | [ , ] | 1.37 | 11.1 | .90 | 1.27 | 7.44 | .90 | 518 | 59% |
| ACE-style counter | .823 | [ , ] | 1.40 | 11.0 | .89 | 1.29 | 7.40 | .89 | 510 | 57% |
| per candidate (no notices) | .850 | [ , ] | 2.01 | 10.2 | .63 | 1.95 | 7.19 | .33 | 10.1 | 10% |
| LR-CUSUM ( ) | best fixed weight ( – ) | ||||
|---|---|---|---|---|---|
| Model | FR | stale uses | episodes | weight ( ) | LR [95% CI] |
| Qwen3-8B | 38.8 | 968 | 196 | (84) | [ , ] |
| Qwen3-4B | 29.8 | 656 | 234 | (84) | [ , ] |
| Granite-3.3-8B | 47.5 | 526 | 281 | (42) | [ , ] |
| Mistral-7B | 29.7 | 813 | 468 | (84) | [ , ] |
| OLMo-3-7B | 21.8 | 550 | 277 | (46) | [ , ] |
| Stage | Real evidence (Qwen3-8B, template T118, edit sequence 303, stream seed 6) | Statistic | |
|---|---|---|---|
| 44 | form | Audited live trace of “What individuals have their residence in the state where Louisiana Tech University is situated?” (3 calls, 1,300/59 tokens): hop located in the administrative territorial entity (fwd) Louisiana; hop residence (bwd) Elmore Leonard; answer type human . Correct. | , |
| 44–10,769 | certify | 33 audited shadow labels: 26 both correct ( ), 7 live wrong and macro correct ( ), 0 macro failures | |
| 10,769 | fold | routing call {"type": 1} + lookup in a 272-anchor table frozen at | LR-CUSUM , , |
| 93,194 | reuse | 2,982 one-call answers before the edit, all correct (live: .798 on the same queries); 5,566 LLM calls (64.8%) saved over the macro’s 3,026 folded uses | |
| 93,194 | edit | located in the administrative territorial entity , (451 facts); e.g. Cardiff University: Cardiff Hong Kong, gold John Williams Bruce Lee, Ip Man, Stephen Chow; the macro still answers John Williams | : |
| 93,227–94,247 | retire | audited folded labels 0,1,0,0 (Univ. of Basel, Univ. of Windsor, East Tennessee State Univ., Cardiff Univ.); 1,053 queries, 43 folded uses and 29 stale answers after the edit | : 2.99, 2.66, 5.66, 8.65 |
| at in-control rate | ||||||
| Rule | at edit | retires at label | uses / stale | |||
| ExpeL-style importance ( ) | 92 | not by end (239) | 3,283 / 894 | |||
| ACE-style helpful/harmful | 90/0 | not by end (330/93) | 3,283 / 894 | |||
| symmetric, (SPRT + symmetric) † | 0 | 19 | 169 / 47 | 17.8 | 420 | |
| symmetric, | 0 | 152 | 1,460 / 374 | 180.6 | ||
| LR , | 0 | 44 | 389 / 103 | 37.1 | ||
| # | instance (T010) | plug-in LLR | ||||||
| 1 | 3179 | Q2656 | (1,1) | .011 | .096 | |||
| 11 | 27863 | Q30002 Chengdu | (0,0) | .121 | .910 | |||
| 17 | 34168 | Q25416 | (1,1) | .190 | 1.342 | |||
| 18 | 35098 | Q48320 Kōbe (stale) | (0,1) | .096 | 1.295 | |||
| 19 | 35271 | Q1467 Cebu City (stale) | (0,1) | .402 | 1.248 | |||
| 35 | 59956 | Q1467 | (0,1) | 3.226 discard | 1.781 |
| Template (rank) | audits | epoch | one-step | labels to fold | ||||
|---|---|---|---|---|---|---|---|---|
| in stream | (queries) | (queries) | predicted | observed | SPRT / betting | |||
| T132 (1) | .258 | 5,042 | 642 | 24.9k | 200k | .883 | .994 | 19 / 9 |
| T048 (8) | .0214 | 430 | 210 | 98.2k | 100k a | .375 | .738 | 38 / 106 |
| T027 (10) | .0165 | 323 | 213 | 129k | 200k | .524 | .906 | 38 / 106 |
| T110 (73) | .00154 | 31 | 213 | 1.38M | 100k b | 0 | not in stream (8 of 39 b ) / not in stream | |
| T115 (204) | .00043 | 6 | 208 | 4.87M | 200k | 0 | not in stream (5 of 38) / not in stream |