TokenMem Injects Knowledge Faithfully into Frozen LLMs

Chengzhang Yu, Chenyang Zheng, Zening Lu, Yingru He, Yutong Huang, Yiming Zhang, Yue Xu, Zhanpeng Jin· July 28, 2026 View original

Summary

TokenMem is a lightweight memory system that injects external knowledge into frozen Large Language Models through a dedicated cross-attention channel, bypassing conflicts with parametric memory. It uses a thin gating adapter and a two-phase curriculum to achieve high knowledge compliance, even with counterfactual information.

Retrieval-Augmented Generation (RAG) systems often struggle with "knowledge conflicts," where retrieved information clashes with a Large Language Model's (LLM) pre-existing parametric memory, leading to unpredictable outputs. This issue arises because RAG typically uses a shared self-attention pathway, forcing the model to reconcile conflicting information. TokenMem offers a novel solution by introducing a lightweight memory system that injects external knowledge into frozen LLMs via a dedicated cross-attention channel. This design ensures that retrieved knowledge bypasses direct competition with the model's internal parametric memory. The system trains only a small gating adapter using a two-phase curriculum: first, learning general knowledge utilization, and then specifically strengthening faithful compliance when presented with counterfactual information. Experiments across various LLMs show TokenMem achieving significantly higher Knowledge Compliance (69-70%) on counterfactual benchmarks compared to vanilla RAG (20-52%), demonstrating its ability to faithfully integrate new information.

Why it matters

Improving the faithfulness of knowledge injection in LLMs is crucial for applications requiring high accuracy, especially when dealing with dynamic or potentially conflicting external information, enhancing reliability and reducing hallucinations.

How to implement this in your domain

  1. 1Evaluate current RAG implementations for "knowledge conflict" issues and unpredictable outputs.
  2. 2Explore alternative knowledge injection methods like TokenMem that use dedicated channels for external information.
  3. 3Investigate training lightweight gating adapters to control knowledge flow into frozen LLMs.
  4. 4Implement a two-phase curriculum for fine-tuning knowledge injection systems, focusing on both utilization and faithful compliance.
  5. 5Benchmark the knowledge compliance of LLM applications, especially with counterfactual data, to identify areas for improvement.

Who benefits

AI DevelopmentContent CreationHealthcareLegalFinancial Services

Key takeaways

  • RAG systems often suffer from knowledge conflicts when retrieved information contradicts LLM parametric memory.
  • TokenMem injects knowledge faithfully via a dedicated cross-attention channel, avoiding conflicts.
  • A two-phase training curriculum for a thin gating adapter is critical for high knowledge compliance.
  • The method significantly improves LLM adherence to external knowledge, even with counterfactuals.

Original post by Chengzhang Yu, Chenyang Zheng, Zening Lu, Yingru He, Yutong Huang, Yiming Zhang, Yue Xu, Zhanpeng Jin

"arXiv:2607.22625v1 Announce Type: new Abstract: Retrieval-augmented generation (RAG) enhances large language models (LLMs) with external knowledge, but suffers from knowledge conflicts: when retrieved information contradicts parametric memory, the shared self-attention pathway pr…"

View on X

Originally posted by Chengzhang Yu, Chenyang Zheng, Zening Lu, Yingru He, Yutong Huang, Yiming Zhang, Yue Xu, Zhanpeng Jin on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses