Introduction
Large Language Models (LLMs) are typically static after their initial training phase. As the world evolves, their internal knowledge becomes outdated. Updating these models presents significant challenges: retraining is prohibitively expensive, fine-tuning often leads to "catastrophic forgetting" of prior knowledge, and standard Retrieval-Augmented Generation (RAG) can be slow and sensitive to noise in massive document stores.
Compression Memory Training (CMT) is a novel framework designed to address these issues. It enables LLMs to learn from a continuous stream of information by compressing documents into a compact memory bank and dynamically injecting this knowledge into the model's attention layers.
Methods: The CMT Architecture
CMT implements a three-stage pipeline inspired by human cognitive processes: encoding, storage, and retrieval.
- Encoding (Compression): A dedicated compressor (e.g., a Llama-2 decoder) transforms long documents into a small set of condensed vectors or "soft tokens." This process significantly reduces redundancy compared to raw text storage.
- Storage (Memory Bank): These vectors are stored in a latent memory bank. Because the base LLM's parameters remain frozen, the model's core capabilities are preserved, eliminating catastrophic forgetting.
- Retrieval & Aggregation: During inference, a cross-attention mechanism identifies and pulls the most relevant condensed vectors. These are mapped into cached Key-Value (KV) pairs and injected directly into the LLM’s transformer layers.
Novel Training Objectives
CMT utilizes a Memory-Aware Objective that focuses on the delta between the base model's knowledge and the external memory. By using a contrastive ensemble of logits, the training process maximizes the utility of the provided memory. Additionally, a Self-Matching strategy aligns query and memory embeddings for more precise retrieval.
Evaluation and Results
The framework was evaluated on three major benchmarks: StreamingQA (news articles 2007–2020), SQuAD, and ArchivalQA.
Performance and Efficiency
On the StreamingQA dataset with Llama-2-7b, CMT achieved a +4.07 improvement in Exact Match (EM) and +4.19 in F1 score over the strongest baseline, MAC. Furthermore, CMT is highly efficient, requiring 5.4x fewer trainable parameters than MAC and offering lower inference latency through its top-$k$ filtering mechanism.
Robustness to Noise
A critical advantage of CMT is its stability. In scenarios where irrelevant "noise" documents were added to the memory bank, CMT's performance remained remarkably consistent.
As shown in the figure above, while traditional methods experience sharp declines as noise increases, CMT maintains superior accuracy, demonstrating its ability to filter out irrelevant information effectively.
Conclusion and Future Work
CMT represents a significant step toward real-time, continual knowledge adaptation for LLMs. By combining memory compression with dynamic injection, it bypasses the costs of retraining and the risks of forgetting. Future research will explore cross-model generalization—making condensed vectors universal across different architectures—and scaling the framework to models exceeding 70B parameters.
Summary updated