Manuscript Offprint

arXiv:2610.36948

Self-Keyed In-Parameter Memorization for External Memory-Free Dialogue Recall in Frozen Language Models

XinYu Piao, Myunghoon Ryu, Joongheon Kim, Jong-Kook Kim

Abstract

A large language model maintains conversational content in an external storage that is outside the model and grows as the dialogue continues. This work assumes an environment where a language model has no external memory and no prior knowledge of the future question or its answer. The motivation is to research whether a dialogue can be stored in the model parameters and later answer a question about it. This work proposes self-keyed in-parameter memorization (SkIM), a closed-form method in which the model generates its own questions about each dialogue turn and writes those questions into its parameters as the keys that later retrieve the turn's content. Generating many varied questions for each turn allows a later user question to match one even when phrased differently, and its answer is recalled from the parameters alone. Evaluated on five language models, SkIM recalls most stored dialogue turns from later user questions, and it answers from the model parameters without any external storage.

Introduction

Recent large language models (LLMs) serve as conversational assistants and their conversations often run for many exchanges (Petroni et al. 2019; Roberts, Raffel, and Shazeer 2020; De Cao, Aziz, and Titov 2021; Kwon et al. 2023). As a conversation lengthens, answering well often depends on recalling something the user mentioned much earlier (Xu, Szlam, and Weston 2022; Packer et al. 2023; Wu et al. 2025). However, language models keep the dialogue not in their parameters but in a key-value (KV) cache or an external retrieval store that grows as the history accumulates. The KV cache stores the attention keys and values of every past token, sparing the model from recomputing them at each step (Vaswani et al. 2017; Shazeer 2019; Kwon et al. 2023). Its size grows proportionately to the length of the history and the generated tokens accumulate in the KV cache. Both memory use and inference cost rise as more turns arrive (Pope et al. 2022; Dao et al. 2022). Instead, retrieval-augmented generation (RAG) stores the dialogue in an external index and searches it for relevant passages at each question, placing them in the context (Lewis et al. 2020, 2021). The answer then depends on whether the index holds the right passage and whether the question was turned into an effective search query (Guu et al. 2020; Maharana et al. 2024). Based on these observations, this work asks whether a frozen model can internalize a dialogue as it unfolds and later answer a question about it from its parameters alone. The aim is to establish whether such internalization is feasible at all, rather than to improve on retrieval or long-context systems that already answer from external memory.

Prior studies aim to store a model's memory in its parameters rather than in an external buffer (Meng et al. 2022a,b; Wang et al. 2024; Fang et al. 2025). Weight editing is one such approach that writes a fact directly into the parameters (Mitchell et al. 2022; Meng et al. 2022a,b). Given a subject and a relation, such as a person and their birthplace, these methods compute a closed-form update to one or a few feed-forward projections that causes the model to output the intended object (Meng et al. 2022a,b). A null-space projection allows many such edits to accumulate without overwriting one another (Fang et al. 2025). However, this approach rests on two assumptions that conversational memory does not satisfy. First, the object to store must be provided as a label because the update is solved to reproduce that object at the edited site (Meng et al. 2022a,b). Because no such label exists in a dialogue, the model must itself determine which part of a raw user turn should be stored. Second, a fixed cue that is typically the subject and relation must be known in advance when constructing the edit (Meng et al. 2022a,b). In a dialogue, there is no fixed cue to install because the later question is unknown when the turn is stored and may be phrased in unforeseen ways. Long-context models and retrieval systems avoid both assumptions, but they retain the dialogue outside the parameters (Lewis et al. 2021), in a cache or an index that grows as turns accumulate (Maharana et al. 2024; Kwon et al. 2023). Thus, editing requires supervision that a dialogue cannot provide, whereas external buffers avoid that supervision only by incurring an ever-growing storage cost (Kwon et al. 2023; Maharana et al. 2024).

Prior work established that the feed-forward layers of a transformer store factual associations and recall them at inference, and that a band of middle layers is where such facts are most readily located and edited (Geva et al. 2021; Dai et al. 2022; Meng et al. 2022a; Geva et al. 2023). Building on that finding, this work writes each user turn into the down-projection of one mid-to-late feed-forward layer by a closed-form rule. The target layer is chosen per model and a later question is answered from the edited parameters alone.

∗^{*}Corresponding author.

This work assumes an environment where a frozen model has no external memory and no access to the future question or its answer when it stores a turn, which makes a direct comparison to other editing methods difficult. The setting imposes four constraints, namely no gradient fine-tuning, no external memory at recall, a per-turn cost independent of the number of stored turns, and preserved general behavior. This work forgoes the KV cache despite its usefulness and keeps the dialogue in the parameters (Vaswani et al. 2017; Shazeer 2019). Because the model has no future question or answer, it must produce from the turn alone the object and cue that weight editing receives but a dialogue cannot provide.

This work proposes a Self-Keyed In-parameter Memorization approach, called SKIM, that allows a frozen model to store a turn and later recall it without the ground-truth answer or the future question. The proposed SKIM operates on spans, each a short contiguous piece of a turn's text. SKIM proceeds in three stages, namely (i) extracting candidate spans from the raw turn, (ii) generating for each span several questions that the span answers and keeping the ones that best separate that span from its rivals in the same turn, and (iii) installing every question–span pair into one projection by a joint closed-form edit. The generated questions take the place of the fixed subject–relation input that prior editing must be given in advance. Because many diverse questions serve as keys for each span, a later user question resembles one of them even when phrased differently, and the question itself selects the right span at recall. The main contributions of this work are summarized as follows.

• This work aims to retain a dialogue and answer a later question about it in an environment without external memory, neither a KV cache nor a retrieval store.

• This work proposes SKIM, a closed-form method that internalizes each turn into the model parameters without the ground-truth answer or the future question, using self-generated questions as keys for its stored spans.

• This work shows that SKIM stores a dialogue as its turns arrive one at a time and reaches the recall of a single batch edit without the forgetting that sequential edits cause.

• Evaluated on five language models, SKIM recalls stored dialogue turns at a five-model mean of 63.1% and 75.0% on the strongest model, well above the no-cache floor that removes all memory.

References (26)