Papers
Topics
Authors
Recent
Search
2000 character limit reached

TF-Engram: A Train-Free Engram with SSD-Backed Memory for Large Language Models

Published 8 Jul 2026 in cs.CL and cs.LG | (2607.07388v1)

Abstract: LLMs store factual knowledge and domain-specific patterns implicitly in dense Transformer parameters, making knowledge expansion costly through pretraining, fine-tuning, retrieval augmentation, or longer contexts. Engram-style memory offers a compact hidden-state injection pathway, but existing GPU-resident designs often rely on hash-based compression, causing unrelated phrases to collide in shared slots and weakening phrase-level semantic fidelity. We present TF-Engram, a train-free Engram system that constructs phrase-specific semantic memory offline from external corpora, stores large memory tables across a GPU--DRAM--SSD hierarchy, and uses Early-Exit Guided Predictive Prefetching to hide external-memory latency during autoregressive decoding. On Qwen3-0.6B, TF-Engram improves the average downstream score from 57.6 to 59.4, outperforming both the frozen backbone and a parameter-matched LoRA baseline. System evaluation shows that large TF-Engram tables can be built with moderate offline cost, SSD-backed storage substantially reduces GPU memory demand, and predictive prefetching recovers much of the throughput loss caused by external memory access. These results demonstrate that static phrase memory can be integrated into LLM inference as a scalable, train-free, and low-overhead system component.

Summary

  • The paper presents a train-free, SSD-backed hierarchical memory system that enhances scalability and semantic fidelity in large language models.
  • It employs offline phrase mining, semantic encoding, and early-exit prefetching to reduce GPU memory footprint while preserving inference speed.
  • Empirical evaluations demonstrate improved factual recall and minimal latency overhead, outperforming traditional hash-compressed memory approaches.

TF-Engram: Train-Free SSD-Backed Phrase Memory for LLMs

Motivation and Contributions

TF-Engram introduces a robust, train-free Engram memory system that addresses the core scalability and semantic fidelity challenges inherent in prior GPU-resident, hash-compressed memory augmentation designs for LLMs (2607.07388). Traditional Engram implementations utilize hash-based compression to fit vast phrase spaces into limited GPU slots, resulting in unavoidable semantic collisions and ambiguous memory signals. Moreover, most existing approaches rely heavily on model-specific training for memory entry construction, hindering transferability and rapid domain extension.

TF-Engram resolves these limitations by (1) constructing phrase-specific semantic memory offline from large-scale corpora, (2) organizing memory hierarchically across GPU, DRAM, and SSD, and (3) deploying early-exit guided predictive prefetching to mask external-storage latency during autoregressive decoding. This architecture facilitates scalable, high-fidelity injection of static phrase knowledge into LLMs, while preserving throughput and minimizing inference overhead.

Figure 1

Figure 1: Technique overview of TF-Engram, illustrating offline phrase mining and encoding, hierarchical storage (GPU--DRAM--SSD), and early-exit guided prefetching for latency hiding.

Train-Free Memory Construction

TF-Engram's phrase memory is assembled offline via corpus mining, phrase tokenization, and semantic encoding—eschewing any model-specific parameter training. Candidate phrases, extracted from diverse corpora (FineWeb-Edu, Wikipedia, C4, arXiv, PubMed), are tokenized according to the target LLM and encoded leveraging a frozen external model (e.g., Qwen3-Embedding). The resulting memory table encapsulates precise phrase-specific vectors indexed for efficient runtime lookup.

This separation of memory construction from backbone optimization enables portability and seamless domain adaptation: memory tables are extensible without re-training the underlying LLM. The phrase-to-memory mapping remains explicit and collision-free, sharply contrasting with hash-compressed approaches where semantic fidelity rapidly degrades as phrase coverage increases.

SSD-Backed Hierarchical Memory Organization

TF-Engram decouples memory capacity from GPU limitations through a tiered storage hierarchy:

  • GPU Cache: Hot, frequently accessed phrase entries for low-latency injection.
  • Host DRAM: Staging for warm entries and rapid metadata access.
  • NVMe SSD: Cold storage for bulk phrase memories, absorbing long-tail demand.

This SSD-backed organization allows scaling to tables orders of magnitude larger than feasible in GPU memory, without incurring massive hash collisions. Cache policies prioritize entries based on access frequency, phrase length, and predicted utility, maintaining efficiency despite sparse, data-dependent access patterns typical of LLM inference.

Early-Exit Guided Predictive Prefetching

The primary challenge with externalized phrase memory is the latency penalty of SSD and CPU--GPU transfers in the autoregressive token-generation pipeline. TF-Engram mitigates this by predicting future memory accesses before the final layer's token output. An auxiliary prefetch head, attached to an intermediate Transformer layer (L−r)(L-r), yields top-KK next-token candidates; these are mapped to possible phrase memory entries which are asynchronously prefetched during the remaining forward computation, thus maximizing latency overlap.

Figure 2

Figure 2: Early-exit guided predictive prefetching leverages intermediate hidden states to anticipate future phrase accesses, issuing SSD/DRAM fetches during remaining layer computation for efficient latency hiding.

Prefetch prioritization is computed as a function of prediction likelihood, phrase utility, and cache benefit, balancing accurate access against wasted I/O. The early-exit layer depth and prefetch budget are critical system parameters, optimized for maximal overlap window and prediction fidelity.

Empirical Evaluation

TF-Engram was evaluated using Qwen3-0.6B as the backbone, contrasting with both the frozen model and a parameter-matched LoRA baseline. The inclusion of SSD-backed semantic memory, with early-exit prefetching, yields consistent performance gains on knowledge-intensive benchmarks (MMLU, ARC-Challenge, TruthfulQA-MC2, etc.). The average downstream score improves from 57.6 (backbone) and 58.7 (LoRA) to 59.4 with TF-Engram—demonstrating enhanced factual recall and semantic injection without parameter updates.

TF-Engram's scalability further manifests in resource overhead analyses:

  • Offline Construction: A 100M-entry memory table incurs ∼\sim2 hours corpus processing, dominated by n-gram extraction; storage scales linearly with table size.
  • Runtime Overhead: SSD-backed design reduces GPU memory footprint from ∼\sim24GB (GPU-resident) to ∼\sim3GB, enabling high-capacity augmentation. Prefetching recovers much of the throughput lost to SSD access; latency per token with Top-128 prefetch is only ∼\sim4\% greater than GPU-resident configuration.

Figure 3

Figure 3: Offline construction cost as a function of phrase table size, showing dominant n-gram extraction time.

Figure 4

Figure 4: Runtime resource overhead for memory scaling, highlighting reduced GPU memory with SSD-backed storage.

Figure 5

Figure 5: Decode latency overhead for GPU-resident vs. SSD-backed memory; latency gap minimized by predictive prefetching.

Sensitivity analysis shows accuracy consistently increases with memory scale (up to 100M entries), and a moderate early-exit layer (e.g., layer 8) offers optimal prefetch/accuracy trade-off.

Figure 6

Figure 6: Sensitivity of model performance and latency to memory scale and early-exit layer position.

Implications and Future Directions

TF-Engram demonstrates that train-free, high-capacity phrase memory can be systematically integrated into LLM inference for improved factual and domain recall, scalability, and deployment robustness. Hierarchical storage obviates the necessity for hash-based collision-prone compression, and early-exit prefetching recovers efficiency otherwise lost to external memory latency.

Practically, TF-Engram enables rapid augmentation and specialization of LLMs for new domains by simply expanding the phrase memory, without retraining or parameter-efficient fine-tuning. Theoretically, it opens a new axis of LLM architecture, decoupling static knowledge from dense parametric computation, and supports scalable, dynamic semantic injection with minimal inference penalty.

Future extensions may involve:

  • Adaptive memory construction pipelines for continual, streaming corpus updates.
  • Integration of more sophisticated semantic encoders for improved phrase representation.
  • Optimized vector indexing and batch prefetch strategies for even higher throughput.
  • Exploration of phrase-level memory in multi-modal or non-autoregressive architectures.

Conclusion

TF-Engram establishes a scalable, train-free external memory system for LLMs, leveraging SSD-backed hierarchical storage and early-exit prefetching for efficient phrase-level knowledge injection. Empirical results confirm strong accuracy gains and low overhead, positioning TF-Engram as a practical and flexible augmentation for next-generation LLM inference (2607.07388).

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Tweets

Sign up for free to view the 1 tweet with 1 like about this paper.