Manuscript Offprint
arXiv:2610.12599STAPLE: Static Sparse Upcycling of Pretrained Checkpoints via Embedding Modules
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Ranajoy Sadhukhan†, Euijin Hong†, Sheng Cao¶, Zechun Liu§, Shuowei Jin‡, Sha Li‡, Changlong Yu‡, Xin Liu‡, Qin Lu‡, Zhenyu Shi‡, Priyanka Nigam‡, Beidi Chen†
rsadhukh@andrew.cmu.edu, ejhong@andrew.cmu.edu, rick.caos@gmail.com, zechunliu@meta.com, {shuowei,slliz,changlyu,xliucr,luqn,zshi,nigamp}@amazon.com, beidic@andrew.cmu.edu
†Carnegie Mellon University, ¶D. E. Shaw Research, §Meta AI, ‡Amazon Research
Sparse computation can scale the parametric capacity of large language models without proportionally increasing active computation, but pretraining sparse architectures remains expensive and data-hungry. Existing sparse upcycling methods mainly target Mixture-of-Experts (MoE) models, where expert homogeneity, sample inefficiency, and system overheads can limit practical scalability. Static sparse memory offers predictable access and token-specific updates that can help address these challenges, but naively integrating it into pretrained computation yields poor returns. In this work, we introduce STAPLE, a recipe built upon STEM for integrating static sparse memory into pretrained models. Whereas STEM replaces FFN up-projections with token-indexed embeddings, STAPLE retains these projections and adds the embeddings as a residual pathway, preserving pretrained computation while learning complementary token-specific information in a scalable manner. On OLMo-2 1B, STAPLE improves over continued dense training by 4.27 points on HumanEval, 2.80 on MBPP, 2.27 on GSM8K, and 1.65 on DROP, with gains spanning programming, mathematical reasoning, and reading comprehension. Average performance increases with static capacity, and improvements persist on the larger OLMo-2 7B backbone. STAPLE also outperforms static sparse baselines such as STEM and an Engram-style model, and achieves a higher average score than an MoE upcycling baseline while decoding faster with less than half its GPU model memory and measured GPU energy per token in our throughput-oriented decoding evaluation. Importantly, despite introducing billions of parameters late in training, our host-offloaded implementation keeps generation throughput within 1.5% and training throughput within 3% of the dense baseline, while caching only the embeddings of the most frequent tokens on the GPU. These results show that static sparse memory can provide a sample-efficient, scalable, and sustainable path for expanding pretrained models without sparse pretraining from scratch.

Github: https://github.com/Infini-AI-Lab/STAPLE
Website: https://infini-ai-lab.github.io/STAPLE
1 Introduction
Scaling model capacity remains one of the most reliable ways to improve language-model capabilities (Kaplan et al., 2020; Hoffmann et al., 2022). Sparse computation makes this scaling attractive by increasing total parametric capacity without proportionally increasing active computation. Yet repeatedly pretraining larger sparse models from scratch is prohibitively expensive. This motivates sparse upcycling (Komatsuzaki et al., 2023; He et al., 2025; Vavre et al., 2024): expanding an already pretrained checkpoint through limited continued training such that the full potential of large parametric capacity is realized without training from scratch.
Most existing sparse upcycling methods rely on Mixture-of-Experts (MoE). A standard strategy clones pretrained FFNs into multiple experts, preserving the seed model at initialization (Komatsuzaki et al., 2023; He et al., 2025). However, cloned experts can remain functionally similar, limiting the benefit of further expert scaling. Breaking this expert homogeneity through domain-specialized branches, partial reinitialization, or additional optimization stages can improve specialization but at the cost of larger training budget (Nakamura et al., 2025) or additional training stages (Sukhbaatar et al., 2024; Mirvakhabova et al., 2025). Furthermore, MoE scaling also incurs routing, load-balancing, expert-fragmentation, memory, and communication overheads that can hurt practical training and serving efficiency (Doubov et al., 2024). The value of added expert capacity therefore depends on its performance gains relative to these costs. Hence, an effective upcycling method should be

(a) MMLU score vs train tokens

(b) Scalability

(c) Comparative Analysis
Figure 1 Overview of STAPLE. (a) STAPLE improves over the dense baseline early in mid-training, while replacement-style STEM upcycling remains below it. The horizontal axis counts mid-training tokens, excluding the preceding warmup or dense continuation stage. (b) Downstream performance improves as static sparse capacity is increased through embedding rank or the number of augmented layers. (c) Domain averages normalized to continued dense training; the largest gain is in code, with smaller gains in mathematics, knowledge, and reading comprehension.
sample-efficient, preserve the training and serving efficiency of the seed model, and remain scalable as sparse capacity grows.
Recent emergence in static sparse architectures (Google DeepMind, 2025; Sadhukhan et al., 2026; Cheng et al., 2026; Liu et al., 2026; Tseng and Sa, 2026) has brought a breakthrough in scaling parametric capacity in a system-efficient manner. These architectures insert large token- or phrase-indexed embedding tables that are particularly amenable to CPU offloading and asynchronous prefetching, allowing substantial parametric expansion with little additional GPU-memory footprint or latency overhead. Unlike cloned MoE experts, token-indexed rows receive updates from distinct token-conditioned subsets of the training data, providing a structural bias toward differentiation. However, static sparse upcycling introduces its own challenges. First, replacing pretrained computation with newly initialized sparse memory discards useful features that must then be relearned. Second, existing static sparse architectures can suffer from poor sample efficiency: each embedding row is updated only when its corresponding token or phrase appears, producing highly non-uniform training signals under a limited token budget. Finally, even if these optimization challenges are addressed, it remains unclear whether static sparsity can continue to deliver performance gains as additional sparse capacity is introduced. Our key findings below directly address these concerns.
Sparsity should complement existing architecture: Retaining pretrained computation is important for effective static sparse upcycling, which is often not maintained by existing static sparse approaches. For instance, STEM (Sadhukhan et al., 2026) replaces the FFN up-projection with a token-indexed embedding table. As Fig. 1a illustrates, STEM upcycling continues to struggle with downstream performance even after 100B tokens, whereas retaining the pretrained FFN up-projection and adding static memory as a residual pathway performs substantially better. This allows the new parameters to focus on complementary token-specific information rather than relearning computation already present in the seed model.
Initialize for sample-efficient adaptation: Preserving the pretrained model's initial functionality through correct initialization is important for better sample efficiency. Additionally, a short warmup with selective freezing of pretrained components then encourages the newly introduced embeddings to learn useful complementary knowledge, particularly improving knowledge-intensive and commonsense tasks (Figs. 2c and 2a).
Scalability: When allowed to learn complementary token-specific knowledge, static memory continues to improve performance as capacity grows without proportionally increasing systems cost (Fig. 4). As illustrated in Fig. 1b, STAPLE improves in average downstream performance as we increase either the number of augmented layers or the embedding dimension, while the added memory can remain largely offloaded to CPU memory.
Based on these observations, we introduce STAtic uPycLing via Embedding layers (STAPLE). Building

(a) Common sense reasoning ablation

(b) Math & code ablation

(c) MMLU ablation
Figure 2 Domain-specific performance comparison among STEM upcycling, STAPLE and STAPLE with no warmup. Each model uses four embedding layers. The horizontal axes count mid-training tokens, excluding the separate warmup stage where used. Panels (a–c) illustrate the importance of retaining the FFN up-projections in STAPLE as it consistently outperforms STEM in every aspect. Panels (a,c) show the importance of warmup in improving general knowledge and commonsense task performances. Conversely, panel (b) suggests that math and code reasoning performances are relatively less affected.
on STEM (Sadhukhan et al., 2026), STAPLE retains the pretrained FFN up-projection and augments it with a zero-initialized token-indexed embedding. The dense pathway preserves shared pretrained computation, while the static pathway learns complementary token-specific information. We scale this capacity through both the number of augmented layers and the embedding dimension. For systems efficiency, the large embedding tables remain in CPU memory and are accessed through asynchronous prefetching, LFU caching, token deduplication, and row-sparse optimization during training and serving.
On OLMo-2 1B, STAPLE improves over continued dense training by 4.27 points on HumanEval, 2.80 on MBPP, 2.27 on GSM8K, and 1.65 on DROP, raising the ten-task average by 1.20 points (Fig. 1c). Average performance improves with static capacity (Fig. 1b), and gains persist on the larger OLMo-2 7B backbone. Under the same budget, STAPLE also outperforms the parameter-matched static sparse baselines, STEM and an Engram-style model. Compared with a serving-efficient MoE upcycling baseline, STAPLE achieves a higher average score while decoding faster with a much smaller GPU memory footprint, and it stays within 1.5% and 3% of dense generation and training throughput. Furthermore, predictable memory access could further benefit speculative decoding (Leviathan et al., 2023) by enabling prefetching of the rows needed for target verification (Liu et al., 2026). The reduced HBM footprint leaves more room for KV caching and larger batches, while differences in weight reuse and execution overhead motivate examining energy alongside parameter count: in our throughput-oriented decoding evaluation, STAPLE keeps measured GPU energy per token within 1–2% of dense and reduces it by over 50% relative to the MoE baseline. Beyond these performance and efficiency gains, STAPLE exposes an interpretable and editable memory: targeted embedding interventions modify model behavior while preserving its ability to follow contextual evidence (Sec. 4.2). Together, these results suggest that existing pretrained models can gain new capabilities from scalable static sparse memory without expensive training or a prohibitive increase in serving cost.
2.1 Architecture study: impact of retaining the up-projection
STEM Layers. Consider a gated FFN with gate, up, and down projections , , and , respectively, and hidden state at layer . STEM (Sadhukhan et al., 2026) replaces the pretrained up-projection output

Figure 3 Pair-wise cosine similarity analysis between mean token-wise up-projection output and STEM embeddings in different layers of STAPLE with 12 STEM tables. Overall, the STEM embeddings are quite orthogonal to the respective mean up-projection output vectors.
with a token-indexed embedding , where is the input token id and is a layer-local table with vocabulary size and FFN width :
A key architectural choice is whether sparse memory should replace or augment pretrained computation. In our four-layer ablation, replacement-based STEM upcycling fails to match continued dense training even with additional warmup (Fig. 1a), whereas retaining the pretrained FFN up-projection and adding STEM embeddings as a residual pathway yields substantially better downstream performance under the same training budget (Fig. 2).
Token-indexed embeddings receive updates only when their corresponding tokens appear, producing highly non-uniform training signals under a limited token budget. Replacement-based STEM compounds this general challenge of sparse memory by discarding useful pretrained up-projection features, which the new embeddings must then relearn. Moreover, it lacks a straightforward functionality-preserving initialization: random, token-wise mean, principal-component, and transformed input-embedding initializations did not improve long-term performance in our experiments.
These observations motivate the additive design of STAPLE:
The pretrained up-projection preserves shared dense computation, while the added embeddings learn complementary token-specific residual information, as further examined in Sec. 4.1 and Fig. 3.
2.2 Initialization
We initialize the embeddings with zero weights. This restores the seed model's computation graph and avoids discarding the knowledge embedded into the pretrained model weights.
Warmup. Furthermore, we find that a short warmup phase can better prepare the newly introduced STEM embeddings for subsequent mid-training. Before training on the high-quality mid-training mixture, we train STAPLE on a small subset of the pretraining corpus ( ). Since the seed model has already been optimized on this corpus, we freeze the FFN up-projections during warmup. This preserves the pretrained dense computation while forcing the new embedding tables to learn useful complementary signals.
As shown in Fig. 2c and Fig. 2a, warmup consistently improves MMLU and average commonsense reasoning over direct upcycling throughout mid-training. This suggests that brief exposure to the pretraining distribution helps token-indexed embeddings acquire useful general-purpose memory before adapting to the mid-training mixture. In contrast, warmup provides no consistent gains on advanced math and programming tasks (Fig. 2b). To control this comparison, we exclude math and code sources from warmup, although they constitute a small

Dense / MoE With host-offloaded STEM tables Host DRAM: bf16 tables + fp32 AdamW moments
(a) Training throughput and GPU memory

(b) Decode throughput
Figure 4 Training and serving efficiency of host-offloaded STAPLE. (a) Training throughput and GPU-resident weights plus optimizer state; parameter counts include the STEM tables. STAPLE keeps its bf16 tables and fp32 AdamW moments in host DRAM (hatched), matching the dense GPU footprint, whereas the MoE baseline (Sec. 3) keeps all experts and their optimizer states on the GPU. (b) Decode throughput on one NVIDIA B200 at batch size 64 and context length 256, labeled with GPU memory for weights plus, for STAPLE, a 1 GB cache of frequently accessed rows. Latency and prefill results are in Table 4.
fraction of the original pretraining corpus. These results suggest that sparse memory remains responsive to the subsequent mid-training distribution and can learn capabilities not emphasized during warmup.
2.3 Scalability
We scale STAPLE along two axes: the number of embedding-augmented layers L and the embedding dimension r. Under the same continued-training budget, increasing L from 4 to 12 raises the average downstream score from 45.10 to 45.59 (Table 2; Fig. 1b). The gains include reasoning-heavy tasks: from L = 4 to L = 12, MBPP improves by 1.80 points, HumanEval by 1.83 points, and DROP by 0.73 points, while MMLU is essentially unchanged (51.27 vs. 51.21). We place the embedding tables in early decoder layers (1–12), allowing token-specific residuals to be integrated into representations processed by subsequent layers.
To vary the memory capacity within each layer, we replace the full-rank table with and learn a projection :
The resulting module has parameters per layer and adds projection FLOPs per token. For OLMo-2 1B, reduces the token-indexed table by . At , this low-rank variant reaches 44.97 average performance versus 45.59 for full-rank STAPLE and 44.39 for dense continuation (Table 2). Together, these results show that STAPLE benefits from scaling both the number of augmented layers and the capacity of each embedding table.
2.4 System Efficiency
Although STAPLE substantially increases the parametric memory footprint, the predictable token-indexed access pattern allows the large tables to remain in CPU DRAM, with only needed rows transferred to the GPU for training and inference. The challenge is to hide the host to device memory transfer cost behind model computation.
Inference-time offloading. We reduce retrieval overhead through three complementary optimizations. Asynchronous prefetching overlaps transfers for upcoming requests or prefill chunks with current computation; during decode, later-layer lookups overlap with earlier-layer execution. Frequency-aware caching exploits the Zipfian token distribution. Caching 5–6% of the vocabulary achieves roughly 80% hit rate, reducing the GPU-resident STAPLE-12L embedding footprint from 19.73 GB to a 1 GB cache. Token deduplication transfers each distinct row only once per prefill batch, reducing prefetch workload by roughly 50%. We omit it during decode, where the deduplication overhead exceeds the savings. As Fig. 4b shows, with 19.73 GB of learned tables offloaded, STAPLE-12L stays within 1.5% of dense decode throughput at batch size 64 (within 1.0% at batch size 1; Table 4). Prefill throughput is within 1.5% of dense at batch size 64, but is 6.9% lower at batch size 1. Relative to the MoE baseline, STAPLE uses about 54% less HBM model memory and improves decode throughput by 2.04× at batch size 64 and 58% at batch size 1. Beyond latency, energy per generated token captures the benefits of weight reuse across the batch, efficient dense kernels, and reduced background energy from shorter execution. In our throughput-oriented decoding evaluation, STAPLE's measured GPU energy per token stays within 1–2% of dense and over 50% below the evaluated MoE implementation (Appendix B). The same predictable access pattern could also benefit speculative decoding, as draft token IDs expose the rows needed for target verification, allowing embedding prefetching to overlap with ongoing computation.
Training-time offloading. Training also requires gradients and optimizer states, making full-table GPU residency costly. Yet each step accesses only the distinct token ids in its batch, , rather than the full vocabulary V. With non-uniform token frequencies, typically , and U grows sublinearly with batch size (Takahashi and Tanaka-Ishii, 2019). We keep the full STEM tables and fp32 AdamW states in CPU DRAM and materialize only the active rows on GPU. This compact buffer acts as the autograd leaf, avoiding dense gradients; row-restricted AdamW updates only the accessed rows. We observe no degradation in end-to-end downstream task performance when training with these sparse optimizer updates. To improve throughput, we overlap host gathering, host-to-device/device-to-host transfers, and optimizer work with backbone computation. As host work scales with U but transformer compute scales with the total token count, overlap becomes more favorable at larger batches. STAPLE-12L trains within 3% of dense throughput (113.9K vs. 117.0K tokens/s) with 91.9 GiB of tables and optimizer moments in host DRAM; its GPU-resident weights and optimizer state match the dense model, and the compact row buffers add only about 3% peak HBM, whereas the MoE baseline trains 13% slower (101.7K tokens/s) and needs the GPU memory for weights and optimizer state (Fig. 4a). Appendix C details both pipelines.
3 Experimental Setup
Models. We use OLMo-2 1B (OLMo et al., 2024) as the primary dense seed model because its training recipe, datasets, and optimizer-state checkpoints are publicly available. The released checkpoint is pretrained on 4T tokens and contains 16 decoder layers. We construct STAPLE variants by augmenting the early decoder layers with 4 or 12 STEM embedding tables, all zero-initialized so that the upcycled model initially preserves the computation and performance of the dense checkpoint. Additionally, we upcycle the same OLMo-2 1B backbone with a single-stream Engram-style model using memory modules at layers 2 and 7, hashed 2-gram and 3-gram memories with eight 64-dimensional heads per order, and approximately 9.87B additional embedding-memory parameters matched to STAPLE-12L; this implementation uses context-conditioned key/value projections with sigmoid gating and a depthwise causal convolution, but omits Engram's multi-branch hyper-connections. Following the upcycling approach of He et al. (2025), we also include a relatively serving-efficient MoE baseline, which replaces the FFNs in eight interleaved decoder layers with MoE layers of eight full-width experts and top-1 routing; we refer to it as the MoE baseline.
Datasets. For mid-training, we use the DOLMA 3 DOLMINO MIX (Olmo et al., 2025) high-quality data mixture, which contains training sequences from web, non-web, and synthetic sources. This mixture is designed to improve academic question answering, mathematical reasoning, and programming abilities, and to prepare models for subsequent post-training (Ouyang et al., 2022; Wei et al., 2022). For the additional warmup phase, we train on approximately 100B tokens sampled from DCLM BASELINE 1.0 (Li et al., 2025), the main component of the seed model's pretraining mixture. This budget is approximately 2.5% of the seed checkpoint's 4T pretraining tokens. The original mixture also includes dedicated code and math sources (OLMo et al., 2024), which we exclude from warmup. This choice allows us to isolate the effect of warmup on STEM initialization without introducing additional math or code-specific supervision before mid-training.
Training. For all dense backbone parameters, we follow the OLMo-2 1B training hyperparameters (OLMo et al., 2024) and initialize the optimizer from the released pretrained optimizer states. During mid-training, newly introduced STEM embeddings use a peak learning rate approximately that of the dense parameters, and all parameter groups follow a linear decay to zero. Warmup instead uses cosine schedules, with the backbone
Table 1 Upcycling comparison and design ablations. All models in the first block use the OLMo-2 1B seed; the Engram-style baseline's added embedding memory is parameter-matched to STAPLE-12L. The replacement-style STEM and additive STAPLE models both use 12 embedding layers. The second block reports the OLMo-2 7B backbone with for STAPLE. Best values are bolded within each backbone block.
| Method | Commonsense | Knowledge MMLU | RC DROP | Math | Code | Avg. | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ARC-E | ARC-C | HSwag | WinoG | GSM8K | MATH | MBPP | HEval | ||||
| OLMo-2 1B: baselines and architecture/initialization comparisons | |||||||||||
| Baseline | 75.42 | 47.44 | 65.18 | 66.22 | 50.30 | 41.91 | 37.76 | 7.68 | 28.80 | 23.17 | 44.39 |
| MoE upcycling (8 experts, top-1) | 75.04 | 45.73 | 66.82 | 64.72 | 49.96 | 40.74 | 39.80 | 7.64 | 28.00 | 28.05 | 44.65 |
| Engram-style | 77.40 | 47.35 | 66.05 | 64.01 | 50.98 | 41.68 | 38.21 | 8.44 | 29.20 | 24.39 | 44.77 |
| STEM (L=12) | 74.37 | 42.06 | 60.79 | 61.56 | 44.30 | 37.00 | 26.00 | 6.94 | 22.60 | 23.78 | 39.94 |
| STAPLE (L=12) | 76.60 | 45.99 | 68.27 | 63.77 | 51.21 | 43.56 | 40.03 | 7.44 | 31.60 | 27.44 | 45.59 |
| OLMo-2 7B: larger-backbone evaluation | |||||||||||
| Baseline | 82.07 | 55.97 | 77.52 | 74.82 | 62.53 | 62.79 | 67.79 | 11.08 | 41.80 | 34.76 | 57.11 |
| STAPLE (L=16) | 82.58 | 57.76 | 77.62 | 74.35 | 62.67 | 63.55 | 70.13 | 12.02 | 43.40 | 35.98 | 58.01 |
resuming its original pretraining schedule. Full training hyperparameters are listed in Table 3 (Appendix A). During the STAPLE warmup phase, we freeze the up-projections in the augmented layers so that the newly added static memory can adapt without perturbing this pretrained pathway. When the separate STEM warmup stage is omitted, we instead apply a warmup ratio to the embedding-specific learning-rate schedule during mid-training. The main 1B comparisons use approximately 100B warmup tokens followed by 100B mid-training tokens. The dense baseline receives the same token budget, using its original pretraining learning-rate schedule during the warmup-equivalent stage. The 7B experiments use a reduced budget of approximately 30B warmup tokens followed by 70B mid-training tokens due to their higher computational cost.
Evaluations. We evaluate our models on a broad benchmark suite spanning commonsense reasoning, general knowledge, reading comprehension, mathematics, and coding. For commonsense reasoning, we report ARC-Easy (Clark et al., 2018) (0-shot, accuracy), ARC-Challenge (Clark et al., 2018) (0-shot, normalized accuracy), HellaSwag (Zellers et al., 2019) (0-shot, normalized accuracy), and WinoGrande (Sakaguchi et al., 2020) (0-shot, accuracy). We evaluate general knowledge on MMLU (Hendrycks et al., 2021a) (0-shot, accuracy) and reading comprehension on DROP (Dua et al., 2019) (3-shot, F1). For mathematics, we use GSM8K (Cobbe et al., 2021) (5-shot, strict exact match) and Hendrycks MATH (Hendrycks et al., 2021b) (0-shot, exact match). For coding, we evaluate MBPP (Austin et al., 2021) (5-shot, pass@1) and HumanEval (Chen et al., 2021) (0-shot, pass@1).
4 Results & Analysis
Table 1 shows that STAPLE-12L raises the ten-task average from 44.39 to 45.59 over continued dense training. Although large parametric memory is usually associated with memorization, the gains extend to reasoning-heavy tasks: HumanEval improves by 4.27 points, MBPP by 2.80, GSM8K by 2.27, and DROP by 1.65.
Under the same upcycling budget, STEM struggles to even match continued dense training performance, with notable performance degradations in knowledge-based tasks as well as GSM8K. This establishes the benefits of retaining the pretrained model's computation graph while upcycling with static memory. Furthermore, STAPLE achieves higher domain-average math and code scores and higher DROP performance than the parameter-matched Engram-style baseline, supporting the effectiveness of its architecture and adaptation recipe. Compared with the MoE baseline, STAPLE gains 0.94 points on average while delivering higher decode throughput and using less GPU-resident model memory (Fig. 4). These comparisons establish a favorable performance-efficiency tradeoff for the evaluated configurations.
Table 2 separates the effects of augmenting more layers and increasing the embedding dimension. STAPLE improves average performance along both scaling axes, and the added capacity has negligible impact on model throughput. We additionally evaluate STAPLE on an OLMo-2 7B backbone to test whether the gains persist beyond the 1B setting. We augment the first 16 decoder layers with STEM tables and, due to the substantially higher training cost, restrict training to approximately 30B warmup tokens followed by 70B mid-training tokens. As shown in Table 1, STAPLE improves the average score from 57.11 to 58.01 and improves 9 of the 10 evaluated tasks. The gains are particularly encouraging on reasoning and code: average mathematics
Table 2 STAPLE scalability on OLMo-2 1B. Increasing the number of augmented layers and the embedding dimension are separate capacity axes; denotes the low-rank variant, while the other STAPLE rows use full-width embeddings. All rows use the same continued-training budget. Best values are bolded within this table.
| Method | Commonsense | Knowledge MMLU | RC DROP | Math | Code | Avg. | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ARC-E | ARC-C | HSwag | WinoG | GSM8K | MATH | MBPP | HEval | ||||
| Baseline | 75.42 | 47.44 | 65.18 | 66.22 | 50.30 | 41.91 | 37.76 | 7.68 | 28.80 | 23.17 | 44.39 |
| STAPLE (L=4) | 76.98 | 46.25 | 66.00 | 65.82 | 51.27 | 42.83 | 39.35 | 7.08 | 29.80 | 25.61 | 45.10 |
| STAPLE (L=12) | 76.60 | 45.99 | 68.27 | 63.77 | 51.21 | 43.56 | 40.03 | 7.44 | 31.60 | 27.44 | 45.59 |
| STAPLE (L=12, r=512) | 76.18 | 46.67 | 66.99 | 65.59 | 50.49 | 41.91 | 39.80 | 6.28 | 30.20 | 25.61 | 44.97 |
performance improves by 4.16% relative to the 7B baseline, while average code performance improves by 3.68%. The modest MMLU gain may reflect the shorter warmup, consistent with the 1B warmup ablation, although this explanation is not isolated in the 7B experiments. These results suggest that the benefits of static sparse memory extend to larger backbones even under a substantially reduced training budget.
4.1 Ablation studies
Figure 3 compares learned token embeddings with their corresponding mean up-projection outputs. Their low cosine similarity suggests that the two feature streams occupy different directions, but geometry alone does not establish the memory's usefulness. We therefore test the model's dependence on these embeddings through removal ablations.
Specifically, we progressively remove the last 4, last 8, or all 12 embedding tables from a STAPLE-12L checkpoint at evaluation time, without retraining. As shown in Fig. 5a, the average score across ten benchmarks falls from 45.59 to 41.28, 36.94, and 32.17, respectively. The sharp decline shows that the model relies on the learned static memory after mid-training. The fully ablated model is not equivalent to the original dense seed, since the remaining weights have co-adapted with static memory.
Dependence on embedding depth. The dependence is especially pronounced on math and code tasks: removing all tables lowers GSM8K, MBPP, and HumanEval by 31.08, 27.40, and 23.17 points, compared with 7.34 on ARC-Challenge and 7.08 on MMLU. Even removing only the last four tables reduces GSM8K by 17.59 points, MBPP by 8.40 points, and HumanEval by 8.54 points. Thus, the learned memory contributes beyond the earliest augmented layers, particularly to generation-heavy mathematical and programming tasks, whereas the knowledge-intensive tasks benefit more from the bottom-most embedding layers.
4.2 Interpretability: Interplay between static memory and contextual reasoning
The removal ablations show that STAPLE relies on its static memory, but not how that memory affects individual predictions. Following STEM (Sadhukhan et al., 2026), we probe this with causal interventions on the embeddings. Because each row of is selected only by the input token id, substituting one token's row for another at a selected position alters the memory contribution without changing the input text, so any change in the output is attributable to the embeddings. At the same time, Eq. (2) scales by the context-dependent gate , so context may counteract a conflicting memory signal. We test this on two tasks, finding the maximum of five numbers and writing Python code that finds the maximum of an array. In both, we replace the STEM embedding for 'maximum' with that for 'minimum' and vary the number of correct demonstrations in the prompt.
Order statistics. Without few-shot demonstrations, the swap overrides the instruction: the model assigns 0.93 probability to the minimum (Fig. 5b). Each demonstration shifts probability toward larger answers, and with four the model assigns 0.97 probability to the maximum.
Code generation. The swap also alters the generated algorithm, since comparing with < rather than > turns the loop into a minimum finder. The probability of < is 0.40 without demonstrations and falls to 0.11 with four (Fig. 5c). For reference, the unmodified model almost never uses <, while rewriting the instruction to 'minimum' makes < the most likely choice at every demonstration count.

(a) Embedding layer ablation

(b) Order-statistics intervention

(c) Code-generation intervention
Figure 5 Static memory ablation and controlled embedding interventions. (a) Benchmark-score retention after removing the last 4, 8, or all 12 embedding tables from trained STAPLE-12L. (b) Order statistics: with the STEM embedding for ‘maximum’ swapped for that of ‘minimum’, probability over the five sorted candidates (heatmap) and expected answer rank (line) as correct demonstrations are added. (c) Code generation: probability that the generated maximum-finding loop compares with < under the same swap, alongside the unmodified model and the instruction rewritten to ‘minimum’.
In both tasks, the static embeddings causally change the output, from the selected answer to the program's logic, yet consistent context progressively overrides them. This is consistent with the context-dependent gate controlling how much the token-indexed memory contributes.
We further trace an implicit numerical update through a GSM8K solution in Appendix D (Fig. 6). With the question unchanged, a vocabulary-id-based STEM row remapping from 60 to 120 shifts the intermediate quantities and final answer to match an explicitly rewritten question, illustrating how a targeted memory intervention can propagate through downstream reasoning.
5 Related Works
Static sparse memory. Token-indexed memory expands language-model capacity with little additional computation, as explored by Gemma 3n (Google DeepMind, 2025), STEM (Sadhukhan et al., 2026), and JTok (Yang et al., 2026). MeKi (Ding et al., 2026) adds memory parallel to the FFN, while (Tseng and Sa, 2026) contextually aggregates statically selected embeddings. Engram (Cheng et al., 2026) uses hashed n-gram memory with contextual gating; LongCat-Flash-Lite (Liu et al., 2026) also studies n-gram embedding scaling, and Qwen3.8-Flash-Next (Qwen Team, 2026a,b) demonstrates host-offloaded memory at scale. STAPLE studies how to make newly added static capacity useful in mature pretrained checkpoints under limited continued training. It retains the pretrained up-projection that STEM replaces and adds zero-initialized token residuals within the FFN. Our architecture and warmup studies examine this adaptation recipe, and our parameter-matched Engram-style baseline compares an alternative memory design under the same upcycling budget.
Memory-based adaptation. Learned key-value memory layers provide another form of sparse capacity (Lample et al., 2019; Berges et al., 2024). Sparse memory finetuning selectively updates memory slots to acquire knowledge while reducing forgetting (Lin et al., 2025), and subsequent work retrofits pretrained Transformers with sparse memory and recovery training (Goyal et al., 2026). These studies emphasize knowledge acquisition and retention. STAPLE instead examines how deterministically indexed memory scales broad downstream performance during continued training, combining preservation of pretrained FFN computation with predictable retrieval for training and serving offload.
Sparse upcycling. Sparse upcycling reuses pretrained dense weights to initialize MoEs (Komatsuzaki et al., 2023; He et al., 2025; Vavre et al., 2024). Domain-specialized branches (Sukhbaatar et al., 2024), informed router initialization (Jiang et al., 2025), and partial expert reinitialization (Nakamura et al., 2025) address expert specialization. Other studies characterize training-budget tradeoffs (Liew et al., 2025) and serving overheads (Doubov et al., 2024). STAPLE expands token-indexed memory while retaining dense FFN computation, avoiding cloned expert pools and learned routing. Its central challenge is making sparsely and unevenly updated parameters useful within a limited training budget; we study architecture, initialization, and warmup choices that enable this expansion while largely preserving the seed model's throughput.
6 Conclusion
We introduced STAPLE, a simple and sample-efficient method for expanding the parametric capacity of pretrained dense models during mid-training. STAPLE shows that the system-efficient scaling of static sparsity can translate into practical performance gains even in the upcycling setting. The key idea is to preserve the pretrained model's learned knowledge and to further complement it with scalable memory. Despite introducing a large number of new parameters, STAPLE remains highly token-efficient and provides consistent gains with increasing memory scale, notably on reasoning-heavy tasks. Our training recipe enables static sparse upcycling of pretrained models, and compared with a serving-efficient MoE upcycling baseline, STAPLE achieves a higher average score while training faster and decoding faster with a much smaller GPU memory footprint. An exciting direction for future work is whether jointly scaling static memory with MoE can continue to push the performance-efficiency frontier.
References
Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, et al. Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021.
Vincent-Pierre Berges, Barlas Oğuz, Daniel Haziza, Wen tau Yih, Luke Zettlemoyer, and Gargi Ghosh. Memory layers at scale, 2024. https://arxiv.org/abs/2412.09764.
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. Evaluating large language models trained on code, 2021.
Xin Cheng, Rui Tian, Wangding Zeng, Damai Dai, Qinyu Chen, Bingxuan Wang, Zhenda Xie, Kezhao Huang, Xingkai Yu, Chengqi Deng, Shangyan Zhou, Chenggang Zhao, Zhewen Hao, Yukun Li, Han Zhang, Zhengyan Zhang, Yixu Wei, M. Y. Xu, Huishuai Zhang, Dongyan Zhao, and Wenfeng Liang. Conditional memory via scalable lookup: A new axis of sparsity for large language models, 2026. https://arxiv.org/abs/2601.07372.
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? Try ARC, the AI2 reasoning challenge. arXiv:1803.05457v1, 2018.
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021.
Ning Ding, Fangcheng Liu, Kyungrae Kim, Linji Hao, Kyeng-Hun Lee, Hyeonmok Ko, and Yehui Tang. MeKi: Memory-based expert knowledge injection for efficient LLM scaling, 2026. https://arxiv.org/abs/2602.03359.
Sasha Doubov, Nikhil Sardana, and Vitaliy Chiley. Sparse upcycling: Inference inefficient finetuning. In Proceedings of the 4th NeurIPS Efficient Natural Language and Speech Processing Workshop, volume 262 of Proceedings of Machine Learning Research, pages 194–205. PMLR, 2024. https://proceedings.mlr.press/v262/doubov24a.html.
Dheeru Dua, Yizhong Wang, Pradeep Dasigi, Gabriel Stanovsky, Sameer Singh, and Matt Gardner. DROP: A reading comprehension benchmark requiring discrete reasoning over paragraphs. In Proc. of NAACL, 2019.
Google DeepMind. Gemma 3n model overview, 2025. https://ai.google.dev/gemma/docs/gemma-3n. Accessed: 2025-09-04.
Satyam Goyal, Anirudh Kanchi, Garv Shah, and Prakhar Gupta. Improving sparse memory finetuning, 2026. https://arxiv.org/abs/2604.05248.
Alan Gray. Getting started with CUDA graphs. NVIDIA Technical Blog, 2019. https://developer.nvidia.com/blog/cuda-graphs/.
Ethan He, Abhinav Khattar, Ryan Prenger, Vijay Korthikanti, Zijie Yan, Tong Liu, Shiqing Fan, Ashwath Aithal, Mohammad Shoeybi, and Bryan Catanzaro. Upcycling large language models into mixture of experts, 2025. https://arxiv.org/abs/2410.07524.
Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. Proceedings of the International Conference on Learning Representations (ICLR), 2021a.
Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. Measuring mathematical problem solving with the MATH dataset, 2021b. https://arxiv.org/abs/2103.03874.
Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, Tom Hennigan, Eric Noland, Katie Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karen Simonyan, Erich Elsen, Jack W. Rae, Oriol Vinyals, and Laurent Sifre. Training compute-optimal large language models, 2022. https://arxiv.org/abs/2203.15556.
Wangyi Jiang, Yaojie Lu, Hongyu Lin, Xianpei Han, and Le Sun. Improved sparse upcycling for instruction tuning. In Proceedings of the 31st International Conference on Computational Linguistics, pages 9485–9498, Abu Dhabi, UAE, 2025. Association for Computational Linguistics. https://aclanthology.org/2025.coling-main.636/.
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models, 2020. https://arxiv.org/abs/2001.08361.
Aran Komatsuzaki, Joan Puigcerver, James Lee-Thorp, Carlos Riquelme Ruiz, Basil Mustafa, Joshua Ainslie, Yi Tay, Mostafa Dehghani, and Neil Houlsby. Sparse upcycling: Training mixture-of-experts from dense checkpoints, 2023. https://arxiv.org/abs/2212.05055.
Guillaume Lample, Alexandre Sablayrolles, Marc'Aurelio Ranzato, Ludovic Denoyer, and Hervé Jégou. Large memory layers with product keys, 2019. https://arxiv.org/abs/1907.05242.
Yaniv Leviathan, Matan Kalman, and Yossi Matias. Fast inference from transformers via speculative decoding, 2023. https://arxiv.org/abs/2211.17192.
Jeffrey Li, Alex Fang, Georgios Smyrnis, Maor Ivgi, Matt Jordan, Samir Gadre, Hritik Bansal, Etash Guha, Sedrick Keh, Kushal Arora, Saurabh Garg, Rui Xin, Niklas Muennighoff, Reinhard Heckel, Jean Mercat, Mayee Chen, Suchin Gururangan, Mitchell Wortsman, Alon Albalak, Yonatan Bitton, Marianna Nezhurina, Amro Abbas, Cheng-Yu Hsieh, Dhruba Ghosh, Josh Gardner, Maciej Kilian, Hanlin Zhang, Rulin Shao, Sarah Pratt, Sunny Sanyal, Gabriel Ilharco, Giannis Daras, Kalyani Marathe, Aaron Gokaslan, Jieyu Zhang, Khyathi Chandu, Thao Nguyen, Igor Vasiljevic, Sham Kakade, Shuran Song, Sujay Sanghavi, Fartash Faghri, Sewoong Oh, Luke Zettlemoyer, Kyle Lo, Alaaeldin El-Nouby, Hadi Pouransari, Alexander Toshev, Stephanie Wang, Dirk Groeneveld, Luca Soldaini, Pang Wei Koh, Jenia Jitsev, Thomas Kollar, Alexandros G. Dimakis, Yair Carmon, Achal Dave, Ludwig Schmidt, and Vaishaal Shankar. Datacomp-lm: In search of the next generation of training sets for language models, 2025. https://arxiv.org/abs/2406.11794.
Seng Pei Liew, Takuya Kato, and Sho Takase. Scaling laws for upcycling mixture-of-experts language models. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 37682–37704. PMLR, 2025. https://proceedings.mlr.press/v267/liew25a.html.
Jessy Lin, Luke Zettlemoyer, Gargi Ghosh, Wen-Tau Yih, Aram Markosyan, Vincent-Pierre Berges, and Barlas Oğuz. Continual learning via sparse memory finetuning, 2025. https://arxiv.org/abs/2510.15103.
Hong Liu, Jiaqi Zhang, Chao Wang, Xing Hu, Linkun Lyu, Jiaqi Sun, Xurui Yang, Bo Wang, Fengcun Li, Yulei Qian, Lingtong Si, Yerui Sun, Rumei Li, Peng Pei, Yuchen Xie, and Xunliang Cai. Scaling embeddings outperforms scaling experts in language models, 2026. https://arxiv.org/abs/2601.21204.
Leyla Mirvakhabova, Babak Ehteshami Bejnordi, Gaurav Kumar, Hanxue Liang, Wanru Zhao, and Paul Whatmough. Dirichlet-prior shaping: Guiding expert specialization in upcycled MoEs, 2025. https://arxiv.org/abs/2510.01185.
Taishi Nakamura, Takuya Akiba, Kazuki Fujii, Yusuke Oda, Rio Yokota, and Jun Suzuki. Drop-Upcycling: Training sparse mixture of experts with partial re-initialization, 2025. https://arxiv.org/abs/2502.19261.
Team OLMo, Pete Walsh, Luca Soldaini, Dirk Groeneveld, Kyle Lo, Shane Arora, Akshita Bhagia, Yuling Gu, Shengyi Huang, Matt Jordan, Nathan Lambert, Dustin Schwenk, Oyvind Tafjord, Taira Anderson, David Atkinson, Faeze Brahman, Christopher Clark, Pradeep Dasigi, Nouha Dziri, Michal Guerquin, Hamish Ivison, Pang Wei Koh, Jiacheng Liu, Saumya Malik, William Merrill, Lester James V. Miranda, Jacob Morrison, Tyler Murray, Crystal Nam, Valentina Pyatkin, Aman Rangapur, Michael Schmitz, Sam Skjonsberg, David Wadden, Christopher Wilhelm, Michael Wilson, Luke Zettlemoyer, Ali Farhadi, Noah A. Smith, and Hannaneh Hajishirzi. 2 OLMo 2 Furious, 2024. https://arxiv.org/abs/2501.00656.
Team Olmo, Allyson Ettinger, Amanda Bertsch, Bailey Kuehl, David Graham, David Heineman, Dirk Groeneveld, Faeze Brahman, Finbarr Timbers, Hamish Ivison, Jacob Morrison, Jake Poznanski, Kyle Lo, Luca Soldaini, Matt Jordan, Mayee Chen, Michael Noukhovitch, Nathan Lambert, Pete Walsh, Pradeep Dasigi, Robert Berry, Saumya Malik, Saurabh Shah, Scott Geng, Shane Arora, Shashank Gupta, Taira Anderson, Teng Xiao, Tyler Murray, Tyler Romero, Victoria Graf, Akari Asai, Akshita Bhagia, Alexander Wettig, Alisa Liu, Aman Rangapur, Chloe Anastasiades, Costa Huang, Dustin Schwenk, Harsh Trivedi, Ian Magnusson, Jaron Lochner, Jiacheng Liu, Lester James V. Miranda, Maarten Sap, Malia Morgan, Michael Schmitz, Michal Guerquin, Michael Wilson, Regan Huff, Ronan Le Bras, Rui Xin, Rulin Shao, Sam Skjonsberg, Shannon Zejiang Shen, Shuyue Stella Li, Tucker Wilde, Valentina Pyatkin, Will Merrill, Yapei Chang, Yuling Gu, Zhiyuan Zeng, Ashish Sabharwal, Luke Zettlemoyer, Pang Wei Koh, Ali Farhadi, Noah A. Smith, and Hannaneh Hajishirzi. Olmo 3, 2025. https://arxiv.org/abs/2512.13961.
Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, and Ryan Lowe. Training language models to follow instructions with human feedback, 2022. https://arxiv.org/abs/2203.02155.
Qwen Team. On the design of Qwen3.8-Next architecture: Evaluation, efficiency, and training stability. Technical report, Alibaba Group, August 2026a.
Qwen Team. Qwen3.8-Flash-Next: A new architecture, towards ultimate cost-efficiency, August 2026b. https://qwen.ai/blog?id=qwen3.8-flash-next.
Ranajoy Sadhukhan, Sheng Cao, Harry Dong, Changsheng Zhao, Attiano Purpura-Pontoniere, Yuandong Tian, Zechun Liu, and Beidi Chen. STEM: Scaling transformers with embedding modules, 2026. https://arxiv.org/abs/2601.10639.
Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. WinoGrande: An adversarial Winograd schema challenge at scale. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 8732–8740, 2020.
Sainbayar Sukhbaatar, Olga Golovneva, Vasu Sharma, Hu Xu, Xi Victoria Lin, Baptiste Rozière, Jacob Kahn, Daniel Li, Wen tau Yih, Jason Weston, and Xian Li. Branch-Train-MiX: Mixing expert LLMs into a mixture-of-experts LLM, 2024. https://arxiv.org/abs/2403.07816.
Shuntaro Takahashi and Kumiko Tanaka-Ishii. Evaluating computational language models with scaling properties of natural language, 2019. https://arxiv.org/abs/1906.09379.
Albert Tseng and Christopher De Sa. L : Large lookup layers, 2026. https://arxiv.org/abs/2601.21461.
Aditya Vavre, Ethan He, Dennis Liu, Zijie Yan, June Yang, Nima Tajbakhsh, and Ashwath Aithal. Llama 3 meets MoE: Efficient upcycling, 2024. https://arxiv.org/abs/2412.09952.
Jason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M. Dai, and Quoc V. Le. Finetuned language models are zero-shot learners, 2022. https://arxiv.org/abs/2109.01652.
Yebin Yang, Huaijin Wu, Fu Guo, Lin Yao, Xiaohan Qin, Jingzhi Wang, Debing Zhang, and Junchi Yan. JTok: On token embedding as another axis of scaling law via joint token self-modulation, 2026. https://arxiv.org/abs/2602.00800.
Zihao Ye, Lequn Chen, Ruihang Lai, Wuwei Lin, Yineng Zhang, Stephanie Wang, Tianqi Chen, Baris Kasikci, Vinod Grover, Arvind Krishnamurthy, and Luis Ceze. FlashInfer: Efficient and customizable attention engine for LLM inference serving. In Proceedings of the Eighth Conference on Machine Learning and Systems, 2025. https://proceedings.mlsys.org/paper_files/paper/2025/file/dbf02b21d77409a2db30e56866a8ab3a-Paper-Conference.pdf.
Jie You, Jae-Won Chung, and Mosharaf Chowdhury. Zeus: Understanding and optimizing GPU energy consumption of DNN training. In USENIX NSDI, 2023.
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. HellaSwag: Can a machine really finish your sentence? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2019.
Appendix
A Training hyperparameters
Table 3 Training hyperparameters for warmup and mid-training. STEM/STAPLE tables are the token-indexed static sparse embeddings; Engram n-gram tables are the hashed n-gram embeddings of the Engram-style baseline. During STAPLE warmup, pretrained up-projections in augmented layers are frozen. The backbone warmup schedule resumes the base model's pretraining cosine schedule at its final checkpoint. MoE expert weights use a separate cosine schedule during warmup and linear decay during mid-training, with a peak learning rate of in both stages.
| Parameter group | Training setup | Optimization schedule | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Stage | Parameters | Seq. Len. | Batch Size | Train Steps | Warmup Steps | Resume Step | End Step | LR Scheduler | Peak LR | Min LR Ratio | Weight Decay |
| Warmup | STEM/STAPLE tables | 4096 | 512 | 50,000 | 500 | 0 | 50,000 | cosine | 0.6 | ||
| Engram n-gram tables | 4096 | 512 | 50,000 | 500 | 0 | 50,000 | cosine | 0.6 | |||
| Backbone | - | - | 50,000 | 0 | 1,907,359 | 2,384,186 | cosine | 0.1 | |||
| MoE expert weights | - | - | 50,000 | 500 | 0 | 50,000 | cosine | 0.91 | |||
| Mid-training | STEM/STAPLE tables | 4096 | 512 | 50,000 | 0 | 0 | 50,000 | linear | 0 | ||
| Engram n-gram tables | 4096 | 512 | 50,000 | 0 | 0 | 50,000 | linear | 0 | |||
| Backbone | - | - | 50,000 | 0 | 0 | 50,000 | linear | 0 | |||
| MoE expert weights | - | - | 50,000 | 0 | 0 | 50,000 | linear | 0 | |||
B Serving latency and throughput
Table 4 reports the full serving measurements summarized in Fig. 4b, including batch-size-1 decode and prefill latency and throughput.
Table 4 Serving efficiency on one NVIDIA B200. All measurements use context length 256; latency and throughput are reported in ms and tok/s. HBM memory includes resident weights and GPU caches. STAPLE-12L offloads 12 embedding tables (19.73 GB in BF16 precision) to CPU DRAM with a 1 GB GPU cache. MoE denotes the upcycled MoE baseline of Sec. 3 (eight interleaved MoE layers, each with eight full-width experts and top-1 routing), which keeps all experts in HBM and incurs routing and token-reordering overhead.
| Architecture | HBM model memory | Linear FLOPs / token | Decode B1 ms / tok/s | Decode B64 ms / tok/s | Prefill B1 ms / tok/s | Prefill B64 ms / tok/s |
|---|---|---|---|---|---|---|
| Dense | 2.97 GB GPU weights | ~2.56 G | 1.224 / 817 | 1.817 / 35.2K | 1.419 / 180.5K | 34.184 / 479.3K |
| STAPLE-12L | 2.97 GB GPU weights + 1 GB cache | ~2.56 G | 1.237 / 809 | 1.845 / 34.7K | 1.524 / 168.0K | 34.678 / 472.5K |
| STEM-12L | 2.57 GB GPU weights + 1 GB cache | ~2.16 G | 1.151 / 869 | 1.671 / 38.3K | 1.413 / 181.1K | 27.580 / 594.1K |
| MoE (8 experts, top-1) | 8.61 GB GPU weights, all 8 experts | ~2.56 G + routing | 1.951 / 513 | 3.761 / 17.0K | 2.975 / 86.1K | 36.179 / 452.9K |
Energy measurements and host-cost estimates. We use an NVIDIA DGX B200 system (board DGXB200, version A.5) with dual Intel Xeon Platinum 8570 processors and PCIe Gen5 ×16 CPU–GPU links. In a separate energy-profiling run on one otherwise idle B200 GPU, we measure decode at batch size 64 and context length 256 using Zeus (You et al., 2023), with three repeats per model agreeing within 1.5%. GPU energy per generated token is 18.69 mJ for dense, 18.92 mJ for STAPLE-12L, and 45.37 mJ for the MoE baseline: STAPLE adds approximately 1.2% over dense and uses 58.3% less than MoE. Activity-based estimates complement these GPU measurements: multiplying measured host-memory and PCIe traffic by conservative per-bit energy coefficients places STAPLE's additional host-memory and transfer energy below 0.2% of its GPU energy. The CPU launch-thread energy is estimated at approximately 1% of GPU energy for all three models, leaving the comparison essentially unchanged.
C Implementation Details
We keep the large STEM tables in CPU DRAM and move only the rows required by the current workload to the GPU. Inference uses a small GPU-resident LFU cache, whereas training materializes a compact buffer over the distinct token set described in Sec. 2.4.
C.1 Inference-time embedding offload
Prefill and decode require different host-to-device embedding retrieval paths because of the difference in their prefetching workloads. Table 5 summarizes the implementation; in both cases, retrieval is overlapped with backbone execution. Our serving stack additionally uses CUDA graphs (Gray, 2019), a fused in-place KV-cache append kernel, and FlashInfer (Ye et al., 2025) for paged decode attention.
Table 5 Inference-time retrieval paths for host-offloaded STEM tables. Prefill favors bulk deduplicated transfers, whereas decode uses GPU-driven fine-grained lookup to minimize exposed latency.
| Phase | Retrieval path | Overlap / execution |
|---|---|---|
| Prefill | • Deduplicate prompt tokens once.• Probe the GPU LFU cache and gather only cache-miss rows from CPU.• Pack misses into pinned host buffers and issue bulk asynchronous H2D copies. | • Reuse the same inverse token map across all STAPLE layers.• Prefetch later-layer rows while earlier transformer layers execute.• Pipeline successive requests/chunks and fuse compact-row reconstruction with the FFN using torch.compile. |
| Decode | • Store every four adjacent STAPLE tables in a token-major CPU layout.• Launch a GPU lookup kernel that probes the LFU cache.• On a miss, read the row directly from CUDA-registered host memory; no CPU gather or explicit H2D copy is required. | • Capture grouped lookups and model execution in a multi-stream CUDA graph.• Launch later lookup groups on a side stream while earlier layers compute.• Synchronize only when a group is first consumed (layers 1, 5, and 9 for STAPLE-12L). |
For very short prefills, where CPU-gather setup dominates, we use the same GPU-driven mapped-host path as decode. This avoids CPU gathers and explicit H2D copies on the latency-sensitive path.
C.2 Training-time embedding offload
Algorithm 1 shows the training pipeline. The token union and inverse map are computed once per step and reused by every STEM layer; full tables and fp32 AdamW moments remain in host memory.
Algorithm 1: Training step with host-offloaded STEM tables.
Input: batch token ids ; host tables/states
1 // once per step
2 for in forward order do
3 enqueue host gather into pinned memory
4 enqueue async H2D copy and record ready event
5 end for
6 run forward; at each STEM layer, wait for its ready event and use
7 run backward
8 foreach STEM layer when compact gradient becomes ready do
9 enqueue async D2H copy of into the alternate staging buffer
10 update with row-restricted AdamW on rows
11 end foreach
The compact row buffer is the autograd leaf, so backward never allocates a dense gradient. Gradient staging is double buffered, while H2D and D2H transfers use separate streams. We issue next-step gathers in forward consumption order rather than inheriting backward order, which bounds the exposed pipeline-fill latency for the first augmented layer.
Finally, host-memory placement is important for sustaining bandwidth: table allocations are interleaved across NUMA memory controllers and optionally backed by huge pages, while the OpenMP worker pool uses a passive idle policy to avoid competing with the GPU-launch thread. Latency-critical CUDA-event waits are instead polled by the dedicated host worker.
D Tracing an implicit numerical update through downstream reasoning
The ablations establish reliance on static memory, and Section 4.2 shows that individual embeddings can steer predictions. Here we trace how an intervention propagates through a multi-step GSM8K solution.
Setup. We use four-shot chain-of-thought context on items the unmodified model solves correctly, separately from the five-shot benchmark evaluation in Section 3. Unlike the position-specific probes, this intervention is keyed to a vocabulary id: the STEM row for 60 is remapped to the row for 120 in the intervened tables, leaving the input text and dense weights unchanged. The remapping applies wherever the source id occurs, including in the model's own continuation.
GSM8K test item 10: original question
A new program had 60 downloads in the first month. The number of downloads in the second month was three times as many as the downloads in the first month, but then reduced by 30% in the third month. How many downloads did the program have total over the three months?
(a) Original model and question – answer: 366
In the first month, the program had 60 downloads. In the second month, the program had 60 x 3 = 180 downloads. In the third month, the program had 180 - (180 x 0.3) = 180 - 54 = 126 downloads. So the program had a total of 60 + 180 + 126 = 366 downloads over the three months.
366
(b) STEM row update: 60 120; unchanged question – answer: 732
In the first month, the program had 120 downloads. In the second month, the program had 120 x 3 = 360 downloads. In the third month, the program had 360 - (360 x 0.3) = 360 - 108 = 252 downloads. So the program had a total of 120 + 360 + 252 = 732 downloads over the three months.
732
(c) Text input update: 60 replaced by 120; original memory – answer: 732
In the first month, the program had 120 downloads. In the second month, the program had 120 x 3 = 360 downloads. In the third month, the program had 360 - (360 x 0.3) = 252 downloads. So the program had a total of 120 + 360 + 252 = 732 downloads over the three months.
732
Figure 6 A token-indexed memory intervention propagates through a GSM8K solution. Full output text for the original model, the STEM row update, and the rewritten-question control, with line wrapping adjusted for readability. Highlights mark the critical numerical changes. With the question unchanged, the row update produces the same intermediate quantities and final answer as explicitly replacing 60 with 120 in the question.
Observation and interpretation. The row update changes the monthly quantities from 60, 180, and 126 to 120, 360, and 252, and the total from 366 to 732. Agreement with the rewritten-question control supports interpreting this as a change in the effective numerical premise used by subsequent computation. The example links a token-addressable memory intervention to coherent downstream reasoning, but does not establish general edit reliability or an isolated fact representation. Since remapping applies to all source-id occurrences, it does not separate prompt-processing effects from generated-token feedback.