cd /news/large-language-models/beyond-scaling-laws-why-memory-is-th… Β· home β€Ί topics β€Ί large-language-models β€Ί article
[ARTICLE Β· art-139177] src=dev.to β†— pub= topic=large-language-models verified=true sentiment=Β· neutral

Beyond Scaling Laws: Why Memory Is the LLM's Next Step (with a 3M-Token Recall Experiment)

A developer argues that the next leap in LLM capability will come from human-like memory mechanisms rather than scaling laws alone, contending that finite attention windows cannot control ever-rising model output. To test the idea, the developer built a harness called agent-shell and ran a 3-million-token recall experiment on an agent.

by read10 min views1 publishedSep 24, 2026

In my view, scaling laws are not the only key factor behind model capability gains β€” even the most cutting-edge RL does not count as part of scaling laws.

Every leap in model capability is built on paradigm breakthroughs β€” on thinking about intelligence at a fundamental level. The Transformer brought the AI era; the LLM capability leap is largely built on CoT. If every model ran in non-thinking mode, could today's models outperform last year's models at the same point in time? Even for the same model with identical post-training, whether it thinks β€” and how hard it thinks β€” largely determines performance. And all of these gains rest on our own thinking about intelligence.

Both Transformer and CoT are imitations of higher human functions. The Transformer simulates human semantic understanding rather than being a probabilistic character-guessing machine: it is mathematical semantic understanding, not a mathematical probability game. Traced to its lowest level, the human brain also requires neural signals; the Transformer is nothing more than a silicon-based semantic understanding system. That is remarkable β€” but it absolutely does not prove that LLMs are greater than humans. The breakthroughs and achievements of LLMs exist essentially because they resemble humans and are striving to approach humans, this higher form of intelligence. CoT is better analogized to a higher human function: explicit logical reasoning. Note the qualifier β€” explicit logical reasoning only, not logical reasoning as a whole, nor the entirety of the brain's higher thinking. Humans also possess a great deal of implicit thinking and inspiration that emerges from internal parallel mechanisms.

So what I believe truly drives breakthroughs is not the increase of parameters, or not purely the increase of parameters. It is that once we ourselves understand intelligence better and thereby arrive at a better intelligence paradigm, scaling laws begin to take effect β€” rather than worshipping scaling laws in black-box fashion. If a non-thinking GPT-6 could beat DeepSeek V4.1 High, only then could you believe that AI is an alien mind and that scaling laws are the golden rule. Otherwise, AI is merely a low-level intelligence with powerful compute.

The relationship between every kind of AI and humans should be understood as this: God created Eve from Adam's rib, only because Adam was lonely.

In my view, the LLM's next step should be memory β€” giving LLMs a human-like memory mechanism instead of only an attention mechanism. Attention alone is incomplete, because the world's information is infinite while your attention window is always finite. This becomes especially acute as LLM output throughput keeps rising: if the LLM's attention can no longer control its own output, the project is bound to spiral out of control.

Humans face the same problem. Why can humans manage code β€” or exercise engineering control β€” through architectural awareness and other forms of global awareness? Because humans possess the higher function of state memory, or, put plainly, something in the back of your mind keeps you alert.

That higher function, plainly stated, is memory and recollection. Human memory is fundamentally built on forgetting: details are dropped, but the state at the time is retained. The state is fuzzy, yet the state can serve as meta-information for reasoning β€” it can become a reasoning head β€” helping a person advance to the next step. Producing a correct next step does not require the full history. It requires that a massive history be compressed into states, one state after another, each state becoming a reasoning head β€” like islands in a vast sea, letting your brain use island-hopping tactics, combining the currently traversed information with the key information recalled, to produce the correct next step.

That is how I understand it.

To validate this, I wrote a harness β€” agent-shell β€” and the following is my experimental data.

Subject under evaluation: the agent-shell context-engineering system as a whole (tiered compression + envelopes + tombstones + recall fallback), not a single recall component.

Core proposition: recall is the fallback for moments when summarized information is incomplete, not a mandatory step in every task β€” the evaluation measures two separate tracks: "what the compression main path carries" and "when the fallback fires."

Item Value
Corpus seed=101, 64 blocks Γ— ~118.5K characters β‰ˆ 3,007,411 token-eq ; 384 same-distribution distractor blocks; 128 golden needles (exact svcβ†’KEY mapping, G001–G128)
Strict A/B blocks.json for out-r1 / out-r7 / out-r8 arebyte-identical by SHA256 (same corpus compared across three runs)
Model deepseek-v4-flash (tao-deepseek relay); system-side compression / archival / recall executed by a system agent on the same model
Scoring pure-rule score.mjs : hit = KEY string appears in the reply; pairHit = same-line svc:KEY pairing (stricter); golden keys isolated throughout (contamination guard)
Tool allowlist r1–r7: databus_query ,state_query ,ask_recall ;r8 addsmailbox_read ,mailbox_status ,mailbox_markread (nosend )
Permissions NO permission.full throughout (fail-closed gate stays armed);violations.jsonl monitors privilege escalation
Unit-test baseline 3059 tests passing (the single failure is a stale chroma-bridge junction in this environment;stash confirms it is unrelated to the code)
Run Configuration delta Total hits 10% 30% 50% 70% 90% Lost needles
r1 Baseline (fence bug present) 116/128 = 90.6% 18/26 22/26 26/26 26/26 24/24 G019-G026, G043/44, G049/50
r2 Same as above 118/128 = 92.2% 24/26 18/26 26/26 26/26 24/24 G019/20, G031-36, G047/48
r3 Same as above 114/128 = 89.1% 16/26 22/26 26/26 26/26 24/24 G009-G010, G019-G028, G045/46
r7 Fence hard boundary + in-dispatch feedback retry + tombstones + 512K reminder 126/128 = 98.4% 26/26 24/26 26/26 26/26 24/24 G051/52
r7-clean r7 revival + history debridement + new prompt/tools 126/128 = 98.4% 26/26 24/26 26/26 26/26 24/24 G051/52
r8 Full set + real prompt mailbox section + mailbox allowlist 128/128 = 100% 26/26 26/26 26/26 26/26 24/24 none

Key readings:

The "depth decay" was an illusion. The 10%/30% bucket losses in r1–r3 correspond one-to-one (100%) with "envelope sections swallowed by the block chunker" (fence bug: mem- envelopes did not count as block boundaries + failed re-selection grew block spans β†’ secondary compression destroyed neighboring envelopes). After the fix, the early buckets scored perfectly, and the 90% bucket never lost a point across three runs β€” the decay curve was actually a map of where the bug was.

The final 2 needles from r7β†’r8 (G051/52, historically the semantic-loss needles that existed only in raw-archive): in r8 the compressor preserved the keys this round (evidenced by curated=1/conv=2) β€” the perfect score is attributable to fidelity of the compression main path, not to recall rescuing them at ASK time (0 tool calls in the ASK round).

Contamination finding (methodology). Reviving r7 and asking directly produced a reply byte-identical to the original run, with 0 tool calls β€” when the history contains a prior answer to the same question, the model simply replays it. Only after debridement (stripping the two questions and two answers, leaving history at block 64) did a rerun yield a valid comparison. Revival tests must be debrided first.

# Problem Fix Verification
1 Fence swallowing envelopes (span 2β†’4β†’6; envelopes treated as raw material and compressed twice) mem- envelopes become a hard block lower bound ( isBlockEndFence ) Across r8's 51 compressions, turnCount=2, envelopes 51/51 intact, 0 lost stamps
2 A compression that "didn't hand in its homework" burned the whole round and re-cut wider In-dispatch retry with feedback (error fed back for immediate rework, 2 attempts) r7 live-fire rescued 2 times; dispatchCompression failed=0 (vs 8 in r1)
3 Missing mailbox tombstones (swap-outs left no trace) Swap-out tombstones at four sites: G1 / G2 / M3 / cross-compression (stamp + covers + three-channel recall method) r8 final state: 61 tombstones (51 compressions + 11 M3 batches; ledger reconciles)
4 Prompt edited in the wrong file (working-agent.md was not wired in; the real promptstatic-prompt.ts had zero mailbox content) Added ## 3. Mailbox to the real prompt + regression tests pinning it static-prompt.test 27/27 (including new assertions); in r8 the model calledmailbox_read as early as block 10
5 A single mailbox read could blow up the context mailbox_readerrors out when returning >50 messages (dual escape hatches: pagination / delegation) + offset pagination + recall-onlymailbox_read_any (toolRefs + ctx dual safety) 13 unit tests + targeted live-fire (Β§6)
6 Compounding loss across generations of G2 transcription Generation hard gate: only G1β†’G2 allowed, G2β†’G3 forbidden; lineage fully flattened ( #LINEAGE per-stamp covers + gen) New assertions in distill / edge-goal-distill all green
7 M3 tombstones could be rejected by the 10K cap (silent loss) Goal truncated to 60 + fitMailBody 9000 budget degradation r8 live: M3 ran 11 batches for the first time , all tombstones delivered
8 Model assumed "not in the window = does not exist" and reported MISSING outright 512K memory reminder (appended to each user entry) + hard prompt rule "verify before reporting unknown" During r8 ingestion the model made 4 proactive tool calls; 0 calls in the ASK round because envelopes were complete (correct behavior)

state_query / ask_recall / mailbox appeared 0 times in reasoning β€” not "considered and decided against checking," but rather that "check first" did not exist in the decision tree at all.mailbox_read β†’ databus_query β†’ DEEPSEEK_TOKEN_COUNTER overshoots 512K by roughly estimateContextTokens comment explicitly states that "the local count overestimates on highly repetitive corpora, and this is the usage.prompt_tokens on a prompt-cache hit (scanidx2 measured a real 1.2M while usage was stuck at 200K); after discarding the upstream count, local overestimation became a deliberate anti-overflow choice.markBeforeAsk = historyBeforeAsk.length, then after ASK ends, history.slice(markBeforeAsk) retrieves new messages β€” replaceRange (2 messages β†’ 1) shrinks the array in place within the history region at any time, invalidating the index.historyBeforeAsk was captured at 04:26:26.8; memory.compressed events completed inside the ASK windowS-1790137731964-lqq7ex landing at 04:28:51.964); history was read at 04:28:51.97 β†’ the slice came up empty β†’ log shows 0 assistant msgs after ask. The fallback (scanning the full history for the last assistant string reply) happened to retrieve the correct answer, so markBeforeAsk to sessions-probe50); mailbox has tool_histogram={"mailbox_read":2,"mailbox_markread":1} β€” mailbox_markread advances the unread queue (matching the prompt guidance word for word);limit, so the error message became an untriggered safety gate (its logic covered by 13 unit tests).mailbox_read_any was already live-fire verified in r7-clean (11 internal calls inside recall, including cross-mailbox paging).benchmark-mrcr-3m/out-r1...r3, r7, r7-clean, r8, probe50 (blocks/ask/reply/score/run.log/trace/violations)sessions-r7, sessions-r7-clean, sessions-r8, Temp\mrcr3m-gold-s42\{r7,r8} (r8 gold uses the same 128-needle set as r7; re-scored and verified equivalent)

If you have better experimental ideas or an interest in the project, I'd love to hear from you. The GitHub repo is here: https://github.com/uos1231234/agent-shell β€” feel free to read the code, though my experimental data and the project-upgrade PR are not yet uploaded or merged. I am looking for people who share this technical direction to maintain and update the project together. You can reach me at 2424105750@qq.com, or send me a DM.

── more in #large-language-models 4 stories Β· sorted by recency
── more on @agent-shell 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/beyond-scaling-laws-…] indexed:0 read:10min 2026-09-24 Β· β€”