# CAMR: Compatibility-Aware Memory Replay for Continual Learning in Large Language Models

Jingpu Yang, Tianhao Li, Fengxian Ji, Yufeng Wang, Shuxin Zheng, Xiaoqing Zhang · arXiv · 2026-10-27

- **Problem** Parameter-space methods, knowledge-editing methods and history-selection replay leave open which incoming examples should supervise an update and how much replay each arrival receives. CAMR is introduced to decide both together.
- **Method** CAMR uses compatibility checks and a sigmoid memory gate to feed an actor-critic writer that picks ADD, MERGE or IGNORE for each arrival under a fixed cap on historical replay.

![Figure 2: Overview of CAMR. The writer retrieves and filters compatible history, then selects ADD, MERGE, or IGNOREto form the training batch; feedback from th…](https://refivu.com/papers/24445413-cb2e-4d23-a34a-5020794de1e7/figures/figure-3000446cfe44471e031a32c60264ceb3.png?thumb=512)

**Figure 2** : Overview of CAMR. The writer retrieves and filters compatible history, then selects ADD, MERGE, or IGNOREto form the training batch; feedback from the updated language model trains the writer.

[Original paper](https://arxiv.org/abs/2610.36734v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Jingpu Yang, Tianhao Li, Fengxian Ji, Yufeng Wang, Shuxin Zheng, Xiaoqing Zhang · CAMR: Compatibility-Aware Memory Replay for Continual Learning in Large Language Models · Original paper figure · Extracted the figure area from page 4 of the original PDF.

## Why supervision and replay need a joint decision

Continual factual updating asks a model to take in new and replacement facts over a long sequence while keeping earlier facts that still hold. Parameter-space methods and knowledge-editing methods control how weights move, but their update rules do not decide which incoming and stored examples should drive training. Experience replay addresses retention by revisiting stored examples, yet full-history replay grows more expensive as the stream lengthens, and random replay ignores what each example still needs.

Adaptive replay methods go further and choose history by interference risk or transfer value, as MIR and TSR do. That choice covers only the historical side. The incoming example may still need more learning, may gain from being trained alongside related history, or may already be mastered and need no direct update. The study therefore asks whether one policy can set the supervision of the current example and the composition of historical replay together, under a fixed cap on replayed examples per arrival.

## Three supervision actions under a replay cap

The cap K counts only historical replay examples, not the current one, so each arrival has a fixed number of historical slots. Under ADD, the incoming example is trained together with general replay. MERGE keeps that structure but gives compatible related history priority inside the same budget. IGNORE drops direct supervision of the incoming example when it duplicates a record verified as mastered, and it still replays history.

Figure 1 places the three actions beside a comparison with Random Replay and the scaling experiments. The language model is trained by full-parameter supervised fine-tuning, while retrieval and the action policy operate only inside training. Feedback from acquisition, retention and cost updates the policy online. Evaluation is closed-book, and retrieval and writer decisions stay confined to training.

## How compatible history is found and filtered

Each stored record is classified against the incoming example as equivalent, conflicting or retired. With structured metadata, a slot is a (subject, relation, scope) triple and a fact identity also includes object and target. Without metadata, input-output pairs match after conservative Unicode and whitespace normalization. Eligible history H\_t is what remains after removing retired, current-equivalent and conflicting records, while equivalent records stay available so that IGNORE can still be checked.

Before action selection, a probe set P\_t is drawn uniformly without replacement from H\_t, with size min(P, floor(\|H\_t\|/2)). The probes measure loss changes and are excluded from the training batch. The remaining records form the replay pool U\_t = H\_t \\ P\_t. Retrieval combines semantic search with exact lookups. A frozen MPNet encoder produces mean-pooled, L2-normalized embeddings, random-hyperplane locality-sensitive hashing finds similar records, and exact indices find records by fact identity and slot.

The results are reranked by cosine similarity and filtered by the compatibility rules. Records with similarity above the threshold τ\_s form the candidate set C\_t ⊆ U\_t, which feeds the gate, while U\_t supplies general replay.

## Gating history and choosing an action

The writer projects the current embedding and each candidate embedding into a shared d\_h-dimensional space and normalizes both with RMSNorm, giving \\( u\_t = \\mathrm{RMSNorm}(W\_Q e\_t) \\) and \\( k\_i = \\mathrm{RMSNorm}(W\_K e\_i) \\). Each candidate receives a weight from a sigmoid of its scaled dot product with the current query: \\\[ g\_{ti} = \\sigma\\left(\\frac{u\_t^\\top k\_i}{\\sqrt{d\_h}}\\right) \\\] Because each weight passes through its own sigmoid, candidates are scored independently rather than normalized against one another.

The gated candidates are averaged into \\( v\_t = \\frac{1}{\|C\_t\|}\\sum\_{i\\in C\_t} g\_{ti} k\_i \\), and their mean gate value is \\( \\bar g\_t \\). Both are set to zero when C\_t is empty.

Two actor heads give masked sigmoid probabilities for IGNORE and MERGE, and the three actions receive probabilities as follows: \\\[ \\pi(\\mathrm{IGNORE}\\mid z\_t)=\\rho^I\_t,\\quad \\pi(\\mathrm{MERGE}\\mid z\_t)=(1-\\rho^I\_t)\\rho^M\_t,\\quad \\pi(\\mathrm{ADD}\\mid z\_t)=(1-\\rho^I\_t)(1-\\rho^M\_t) \\\]

## Training on the sampled batch and updating the writer

Sampling depends on the chosen action. ADD and IGNORE draw uniformly from U\_t, while MERGE reserves part of the budget for uniform draws and gives the rest to compatible candidates from C\_t. Unused candidate slots are filled from the remaining pool. Every draw is without replacement, and at most K records are selected. The training batch holds the current example and the replay set under ADD or MERGE, and only the replay set under IGNORE.

The language-model loss is answer-only. It averages the answer-token NLL over the original question and an optional same-answer view, keeps end-of-sequence tokens and leaves out prompt tokens. When the current fact is active and replay is nonempty, the objective is \\\[ L^{LM}\_t = \\alpha\\,\\ell\_\\theta(x\_t) + (1-\\alpha)\\,\\frac{1}{\|R\_t\|}\\sum\_{x\\in R\_t}\\ell\_\\theta(x) \\\] with α balancing the current example and the replayed examples.

Current-only steps give the current loss unit weight, history-only steps average the replay losses, and an empty IGNORE batch triggers no update. AdamW updates the model and keeps its optimizer state across events.

The writer's reward after each event is \\\[ r\_t = \\Delta^{cur}\_t + \\lambda\_h \\Delta^{hist}\_t - \\lambda\_c \\frac{C\_t}{C\_{ref}} \\\] where Δcur is the reduction in the current question's loss, Δhist is the mean reduction over the historical probes, and C\_t counts logical nonpadding training tokens. Probe and mastery-check forward passes are excluded from C\_t, and an empty probe set gives zero historical gain.

The writer's parameters stay fixed within a rollout and are updated at its end, using discounted returns G\_t = r\_t + γG\_{t+1} and advantages computed against the critic value V\_t. The actor loss is \\\[ L\_\\pi = -\\frac{1}{\|D\|}\\sum\_{t\\in D}\\left\[\\bar A\_t \\log \\pi\_\\phi(a\_t\\mid z\_t) + \\beta H\_t\\right\] \\\] over choice events, the critic regresses to the returns, and forced actions train only the critic.

The relevance gate receives gradient only through the actor loss.

## Long-stream factual updating on WikiBigEdit

On WikiBigEdit the study processes 100,000 facts in their original eight-interval order and reads Original Match at 3K, 10K, 50K and 100K. Among the evaluated methods, CAMR (Full FT) has the highest Original Match at each of those checkpoints.

The unmodified Qwen3-8B-Base scores 14.67 at 3K and 12.88 at 100K, which places the gains in the table against a low starting point.

Table 1 also lists a separate CAMR (LoRA) run with K=8 and a learning rate of 2×10 −4 through 50K updates and 10−4 afterward, so it is a different configuration from the Full FT row.

## Replacement updates on WikiFactDiff

WikiFactDiff is processed in twelve stages, each with 2,700 new facts and 300 replacements. The current stage is evaluated for success rates, reported as ES and GS. The figure also plots ED and GD, which are new-minus-obsolete answer-probability gaps. CAMR keeps ES near 100% across the stream.

At 36K, both CAMR and Random Replay (Full FT) reach 99.33% ES, while CAMR reaches 98.08% GS, a 1.25-point improvement over Random Replay (Full FT). The 1.25-point gap is reported at this one checkpoint in the text. ED and GD are positive at every reported replacement checkpoint, which the authors read as a higher average probability for updated answers than for obsolete ones.

## Cross-task and cross-domain sequences

The TRACE sequence runs C-STANCE, MeetingBank, Py150 and text-only ScienceQA. CAMR (Full FT) reaches 56.75%, 69.84%, 67.92% and 95.40% on these four tasks, the highest final scores among the evaluated methods.

Random Replay (Full FT) reaches 95.35 on ScienceQA, against 95.40 for CAMR (Full FT), and CAMR (LoRA) reaches 92.80.

The cross-domain sequence runs FinQA, GSM8K, APPS introductory and SAMSum. CAMR (Full FT) reaches 76.11%, 81.58%, 30.50% and 45.10% on these tasks, and the three earlier tasks retain or improve on their post-acquisition scores. Those final scores exceed Random Replay (Full FT) by 2.70, 5.46, 9.10 and 3.43 points respectively. The authors say CAMR leads on FinQA and SAMSum, while O-LoRA and Adam-NSCL reach the highest GSM8K and APPS scores.

## Replay cap and component ablations

Table 4 compares CAMR with Random Replay and Semantic Replay at per-arrival caps of 4, 8 and 16, all with full-parameter fine-tuning. At K=4, CAMR reaches 93.98% Original and 86.56% Rephrase, against 93.62% and 86.08% for Random Replay. At K=16, CAMR reaches 98.10% Original and 90.42% Rephrase. Semantic Replay reaches 80.40% Original at K=4, 82.62% at K=8 and 87.96% at K=16, below CAMR on Original and Rephrase at every cap.

At K=4, Random Replay scores higher than CAMR on Persona (70.74% against 69.98%) and on Locality (19.58% against 18.34%), so CAMR's lead at that cap covers Original and Rephrase only. At K=8, CAMR reports 72.62% Persona and 19.86% Locality, the highest values in the table, and it leads all four metrics at that cap.

The writer ablations in Table 5 remove one component at a time: Action Selection (leaving ADD-only routing), Online Feedback (freezing the initialized writer), Memory Gate (weighting all candidates equally), IGNORE (masking that action) and Replay on IGNORE (skipping historical replay for that action). On NumGLUE-ds the complete writer scores 77.54, against 74.57 without Action Selection, 72.85 without Memory Gate, 76.63 without IGNORE and 73.54 without Replay on IGNORE.

The text singles out NumGLUE-ds as the task most sensitive to memory gating and to replay under IGNORE, and it says Online Feedback improves three of the four tasks, with the largest gain on NumGLUE-ds. These drops support keeping each component for this task mix. They do not show that every component helps on every task, because the table covers FOMC, NumGLUE-cm, NumGLUE-ds and Py150 only.

At 100K, CAMR gives the fixed core-3K set 2.42 times the replay share that Random Replay gives it. CAMR's replay covers 90.4% of arrived facts, against 83.9% for Semantic Replay, and the authors link this to MERGE reserving uniform slots while ADD samples uniformly.

## Limits of the evidence

The experiments focus on Qwen3-8B-Base, and the authors plan to extend CAMR to larger models and other model families.

The replay-cap study in Table 4 compares CAMR only with Random Replay and Semantic Replay. The 1.25-point GS margin on WikiFactDiff is reported at one checkpoint, 36K. The 150K comparison with Full-history Replay (LoRA) is described in the text only as a surpass on all four Match metrics.

## Paper info

- **Authors**: Jingpu Yang, Tianhao Li, Fengxian Ji, Yufeng Wang, Shuxin Zheng, Xiaoqing Zhang
- **Venue**: arXiv · Preprint
- **First published**: 2026-10-27
- **Added**: 2026-10-28
- **Updated**: 2026-10-27
- **Version**: v1
- **arXiv**: 2610.36734
- **Category**: cs.CL
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2610.36734v1) · [PDF ↗](https://arxiv.org/pdf/2610.36734v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Continual learning requires large language models to acquire new knowledge and capabilities while retaining what they have learned. Fine-tuning and replay support acquisition and retention, but deciding whether incoming examples need supervision and which historical examples to revisit remains a challenge. We propose Compatibility-Aware Memory Replay (CAMR), an adaptive framework that jointly controls current-example supervision and historical replay. CAMR combines compatibility checks with a learned memory gate to guide an online policy over three actions: learning incoming examples with general replay, jointly reinforcing compatible related examples, and skipping direct supervision of verified mastered duplicates. The policy learns from acquisition, retention, and training-cost feedback under a bounded per-arrival replay budget. We evaluate CAMR with Qwen3-8B-Base on continual factual updating and cross-task and cross-domain learning. On WikiBigEdit, CAMR consistently leads evaluated methods in Original Match from 3K to 100K facts, reaching 93.66% after just 3K facts and surpassing Full-history Replay (LoRA) after 100K facts. It also achieves the highest final scores on all four selected TRACE tasks and maintains or improves earlier-task performance relative to post-acquisition levels in a sequence spanning financial question answering, mathematical reasoning, code generation, and summarization.

## Quote from the paper

Jingpu Yang, Tianhao Li, Fengxian Ji, Yufeng Wang, Shuxin Zheng, Xiaoqing Zhang (2026). CAMR: Compatibility-Aware Memory Replay for Continual Learning in Large Language Models. arXiv:2610.36734v1. https://arxiv.org/abs/2610.36734v1

**BibTeX**

```
@misc{yang2026camr,
  title = {{CAMR: Compatibility-Aware Memory Replay for Continual Learning in Large Language Models}},
  author = {Jingpu Yang and Tianhao Li and Fengxian Ji and Yufeng Wang and Shuxin Zheng and Xiaoqing Zhang},
  year = {2026},
  eprint = {2610.36734},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.36734v1}
}
```

## Other paper commentary

- [PaLM-E: An Embodied Multimodal Language Model](https://refivu.com/en/papers/c14507e3-43e7-434d-adc8-94f0d2c42b5f-palm-e-an-embodied-multimodal-language-model.md)
- [Large Language Models are Zero-Shot Reasoners](https://refivu.com/en/papers/6b8a675c-a686-4e78-8256-301472d5cac2-large-language-models-are-zero-shot-reasoners.md)
- [Generative Agents: Interactive Simulacra of Human Behavior](https://refivu.com/en/papers/3638efc4-db4a-48d9-bc16-5a758d9198fd-generative-agents-interactive-simulacra-of-human-behavior.md)
- [SWE-bench: Can Language Models Resolve Real-World GitHub Issues?](https://refivu.com/en/papers/1cf41e87-39dc-4e23-9d0c-22ab7bc2a24b-swe-bench-can-language-models-resolve-real-world.md)
- [Voyager: An Open-Ended Embodied Agent with Large Language Models](https://refivu.com/en/papers/39fe0a31-1bf8-4ca2-bc7b-151ae7a6faa4-voyager-an-open-ended-embodied-agent-with-large.md)
- [Finetuned Language Models Are Zero-Shot Learners](https://refivu.com/en/papers/3dedf278-64d7-4653-93ff-bf4504ae70ac-finetuned-language-models-are-zero-shot-learners.md)
- [CogACT: A Foundational Vision-Language-Action Model for Synergizing Cognition and Action in Robotic Manipulation](https://refivu.com/en/papers/52aadf90-b60a-4301-8fb3-f8cf89016dc5-cogact-a-foundational-vision-language-action-model-for.md)
- [SmolVLA: A Vision-Language-Action Model for Affordable and Efficient Robotics](https://refivu.com/en/papers/39053767-ba8f-472c-b05c-af9ccbcac6d4-smolvla-a-vision-language-action-model-for-affordable.md)
- [Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow](https://refivu.com/en/papers/a0c4439d-88d7-4d0f-be30-5509d158003e-flow-straight-and-fast-learning-to-generate-and.md)
- [Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding](https://refivu.com/en/papers/eaa0c3ba-e0e4-4517-8ef7-d6ec6ba261b6-photorealistic-text-to-image-diffusion-models-with-deep.md)
- [Let's Verify Step by Step](https://refivu.com/en/papers/389050a4-3045-4cce-994c-b4c5da04031a-let-s-verify-step-by-step.md)
- [Consistency Models](https://refivu.com/en/papers/f97e5129-1522-4b93-9b60-0a1f3af22d42-consistency-models.md)

## Terms in this paper

- [LoRA](https://refivu.com/en/terms/bee764895c36-lora)
- [GSM8K](https://refivu.com/en/terms/e48f0e01064d-gsm8k)
- [RMSNorm](https://refivu.com/en/terms/9b1cafd281f0-rmsnorm)
- [experience replay](https://refivu.com/en/terms/5ee9a599e6c6-experience-replay)
- [ScienceQA](https://refivu.com/en/terms/4deed9de0244-scienceqa)
- [continual learning](https://refivu.com/en/terms/19ff9fd4f621-continual-learning)
- [ADD](https://refivu.com/en/terms/6f7300fea4d4-add)
- [locality-sensitive hashing](https://refivu.com/en/terms/a7e3d2290a38-locality-sensitive-hashing)
- [memory gate](https://refivu.com/en/terms/7111e8918df6-memory-gate)
- [SAMSum](https://refivu.com/en/terms/3445bdf3342b-samsum)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/24445413-cb2e-4d23-a34a-5020794de1e7-camr-compatibility-aware-memory-replay-for-continual)
