Encoding Context into LLM Weights: What Makes It Context?

Yue Wang, Qizhou Wang, Feng Liu, Gang Niu, Masashi Sugiyama +1 more
10/13/2026
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

Longer contexts allow large language models (LLMs) to condition their predictions on more information, but inference costs grow prohibitively with context length. An emerging alternative uses test-time updates to encode context as temporary changes to model weights.

Show full abstract

However, encoding this information into weights that already represent general knowledge obscures its role as context, so the LLM may fail to use it properly to condition subsequent inference. To restore this contextual role, we first associate each context with an identifier during encoding, thereby distinguishing the newly encoded information from pre-existing knowledge. Invoking the identifier at inference then enables the LLM to recite the encoded context. Nevertheless, successful recitation does not ensure that the LLM will use the recalled information as context. We therefore further introduce a prompting framework that explicitly guides the LLM to use this information as context. Across diverse controlled tasks and practical benchmarks, our method outperformed the baseline using only off-the-shelf LLMs, showing its advances in context encoding.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2026encoding,
  title  = {Encoding Context into LLM Weights: What Makes It Context?},
  author = {Yue Wang and Qizhou Wang and Feng Liu and Gang Niu and Masashi Sugiyama and Bo Han},
  year   = {2026},
  eprint = {2610.17686},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.17686v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.17686.svg)](https://codeofpaper.com/paper/2610.17686)

Discussion