In Continual learning, we described how an agent might learn your writing preferences from the edits you make to its drafts. If you regularly shorten emails, remove formal language, and leave the recipient with a clear next step, our consolidation system can capture that preference in a few lines of text. Those lines can already help with the next draft, but the model has to read them again each time. Part of what we want from continual learning is for the agent to learn to write that way without the reminder.
At MidBrain, we’re interested in Continual learning as a way to internalize preferences and procedures while the agent works with you. But given that we already produce consolidated memories, it seemed worth asking whether we could use those directly. Doc-to-LoRA takes a document and generates a small set of changes to a model’s weights, called an adapter, in a single pass. We could compile a user’s consolidated memory when it changes, then use the adapter in subsequent conversations without putting the memory back in the prompt.
Our Doc-to-LoRA analysis found that this worked surprisingly well in one respect: on a personal-memory benchmark, we could replace consolidated text with an adapter and get much the same accuracy. What made us reluctant to use it was how sensitive that result was to the way we combined memories, and how little of the recurring work it saved in our setting.
From consolidation to internalization
MidBrain supplies two kinds of memory. Consolidated memory carries forward what we’ve learned about a user and how they work. Retrieved episodes bring back particular exchanges relevant to the question at hand. On PersonaMem-v2, we used a fixed snapshot of MidBrain memory to answer multiple-choice questions about each persona’s preferences. Qwen3-4B scored 39.0% with all the memories as text and 39.1% when we compiled the consolidated memories together and kept the retrieved episodes as text. The absolute scores also depend on how the model answers: Claude Haiku 4.5 scored 54.0% on the same questions with the same memories supplied as text, using its usual answer-generation protocol.
Compiling memories separately would be convenient: if one preference changed, we could replace its adapter without recompiling the others. But when we added the individual adapters together, as Doc-to-LoRA does by default, accuracy fell to 27.4%. Scaling down their combined contribution brought it back to 38.7%. That recovered most of the lost accuracy. Whether it was worth replacing text still depended on how reliably the model could use a particular memory and how much work we saved on later requests.
We saw a related difficulty on factual questions, where it was easier to tell what had gone wrong. In a single-passage test, Gemma answered 65 questions correctly with the text but missed them with the adapter. In that group, 46% of the incorrect responses matched the answer to another question about that passage. Asked when Warsaw became the capital of the Kingdom of Poland, Gemma answered 1313 instead of 1596. The passage gives 1313 as the year of the first historical reference to Warsaw. Adding adapters for unrelated passages made answering the original question harder still. For a companion that accumulates memories over time, we need a new memory to be useful where it applies without making an earlier one harder to use.
How much work does D2L save?
The attraction of compiling a memory is that we pay for it once and can use it many times. In the PersonaMem-v2 experiment, however, most of the text the model read came from retrieved episodes. Replacing the consolidated memory reduced the median memory input from 10,159 to 8,736 tokens per request, about 14%.
We also measured serving throughput separately on one A100 GPU, with four documents per user. In the text comparison, the model processed the full prompt on every request; in the adapter comparison, the documents had already been compiled. With one request at a time, both Gemma and Qwen were slower with adapters. With one request each from 16 different users in a batch, Qwen produced 66% more output tokens per second than it did with text, while Gemma gained 9%. We didn’t time the text baseline with KV-prefix caching, which would let it reuse the computation for an unchanged memory prefix across a user’s requests. We still have to account for producing the adapter whenever the memory changes.
Learning from the interaction
These results leave us with little reason to replace consolidated text with Doc-to-LoRA in the setting we tested. They also bring us back to why we’re interested in online learning. Consider a draft where you cut two paragraphs of background but keep a fairly long explanation of what the recipient needs to do next. “Keep emails short” is a reasonable summary of your preference. The request, the draft, and your edits tell us something more specific about which details you considered worth keeping in that situation.
Our hypothesis is that learning from the request and your correction together will help the agent recognize when a preference applies. The question for a later draft is whether the agent can recognize what to shorten without cutting the explanation the recipient needs. Over a longer sequence, we’d also want to know whether it can adapt when your preferences change, what happens to the procedures it learned earlier, and how often it needs to use a lesson before the saved work repays the cost of learning it.
The full paper, “Doc-to-LoRA Analysis: Query Conditioning, Wrong Facts, and Distractor Interference”, examines where the adapters interfere with one another, what we tried to recover, and the serving measurements behind that conclusion. The experiment code and results are in the companion repository on GitHub.
