Fold, Don't Stream: Recurrent Depth as a Storage-Residency Optimization for Consumer-Device LLM Inference

When a language model exceeds a consumer device's RAM, decoding falls off a storage cliff: every token forces the active parameters to be re-read from disk. We measure this cliff directly on an Apple M1 Max (32 GB): a dense 70B model at 4-bit reads ∼44 GB from SSD per generated token and decodes at ∼0.02 tokens/s. This paper does not propose a new recurrence mechanism — recurrent depth (executing a small stack of layers R times) is established from Universal Transformers onward. Our contribution is a re-measurement and re-framing: we treat looping as a storage-residency lever rather than a parameter- or reasoning-efficiency one, examine a previously unmeasured design axis inside looped MoE, and directly instrument the beyond-RAM decode cliff the mechanism removes. Controlled 30M-parameter studies show that at equal resident bytes and equal training tokens a looped transformer recovers 41% (dense) and up to 54% (Mixture-of-Experts) of the quality gained by doubling memory, cross-reproduced on two hardware/precision stacks; a compute-matched control shows this advantage is specific to the equal-token regime at our scale. For looped MoE, across seeds, sticky routing (re-using the first pass's expert selection) is statistically indistinguishable from free re-routing (Δ = +0.003 ± 0.004 nats, n=3) while freezing expert touches at top-k: cross-loop routing freedom buys nothing measurable, so access locality is free. An R-sweep shows saturating returns (asymptote ∼53–55%; practical optimum R=3–4). On the systems side, a ∼300-line graph-folding patch to llama.cpp removes the cliff on the same laptop: the 70B dense model accelerates from 0.02 to 2.40 ± 0.10 tokens/s (∼125×) and a 118B-A8B MoE from 1.4 to 2.37 ± 0.42 (∼1.7×), with zero swap. As a controlled endpoint we build a flattened twin of a production looped model (Nanbeige4.2-3B): a layer-duplicated checkpoint computing the identical function (greedy outputs match token-for-token). Under a memory budget admitting the folded (4.4 GB) but not the flattened (7.8 GB) form, the twin collapses to 0.1 tokens/s (231 GB of SSD reads) while the folded form sustains 15.1 tokens/s — a 151× gap with quality identical by construction, isolating residency as the sole cause. The same production model runs coherently at 49 tokens/s on this machine (a different stack and scale; §4.3), consistent with loop-native models already occupying this regime. This is a working preprint (v2.2, revised after adversarial review); it has not been peer reviewed. A Korean translation is included as a secondary file for accessibility; the English version is authoritative.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-07-24
DOI
https://doi.org/10.5281/zenodo.21534340
Primary Topic
Advanced Data Storage Technologies
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Fold, Don't Stream: Recurrent Depth as a Storage-Residency Optimization for Consumer-Device LLM Inference

Gigyeom Ahn
Zenodo (CERN European Organization for Nuclear Research)
Advanced Data Storage Technologies
preprint

Fold, Don't Stream: Recurrent Depth as a Storage-Residency Optimization for Consumer-Device LLM Inference

Gigyeom Ahn
preprint en

Abstract

When a language model exceeds a consumer device's RAM, decoding falls off a storage cliff: every token forces the active parameters to be re-read from disk. We measure this cliff directly on an Apple M1 Max (32 GB): a dense 70B model at 4-bit reads ∼44 GB from SSD per generated token and decodes at ∼0.02 tokens/s. This paper does not propose a new recurrence mechanism — recurrent depth (executing a small stack of layers R times) is established from Universal Transformers onward. Our contribution is a re-measurement and re-framing: we treat looping as a storage-residency lever rather than a parameter- or reasoning-efficiency one, examine a previously unmeasured design axis inside looped MoE, and directly instrument the beyond-RAM decode cliff the mechanism removes. Controlled 30M-parameter studies show that at equal resident bytes and equal training tokens a looped transformer recovers 41% (dense) and up to 54% (Mixture-of-Experts) of the quality gained by doubling memory, cross-reproduced on two hardware/precision stacks; a compute-matched control shows this advantage is specific to the equal-token regime at our scale. For looped MoE, across seeds, sticky routing (re-using the first pass's expert selection) is statistically indistinguishable from free re-routing (Δ = +0.003 ± 0.004 nats, n=3) while freezing expert touches at top-k: cross-loop routing freedom buys nothing measurable, so access locality is free. An R-sweep shows saturating returns (asymptote ∼53–55%; practical optimum R=3–4). On the systems side, a ∼300-line graph-folding patch to llama.cpp removes the cliff on the same laptop: the 70B dense model accelerates from 0.02 to 2.40 ± 0.10 tokens/s (∼125×) and a 118B-A8B MoE from 1.4 to 2.37 ± 0.42 (∼1.7×), with zero swap. As a controlled endpoint we build a flattened twin of a production looped model (Nanbeige4.2-3B): a layer-duplicated checkpoint computing the identical function (greedy outputs match token-for-token). Under a memory budget admitting the folded (4.4 GB) but not the flattened (7.8 GB) form, the twin collapses to 0.1 tokens/s (231 GB of SSD reads) while the folded form sustains 15.1 tokens/s — a 151× gap with quality identical by construction, isolating residency as the sole cause. The same production model runs coherently at 49 tokens/s on this machine (a different stack and scale; §4.3), consistent with loop-native models already occupying this regime. This is a working preprint (v2.2, revised after adversarial review); it has not been peer reviewed. A Korean translation is included as a secondary file for accessibility; the English version is authoritative.

Zenodo (CERN European Organization for Nuclear Research)
Advanced Data Storage Technologies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.