Zhejiang University and ByteDance Seed turn a prompt's lessons into model weights
In short
- Cortex is a method, described in an arXiv preprint dated 14 October 2026 (not yet peer reviewed), for making a language model keep what a prompt taught it after the prompt is gone. The authors are from Zhejiang University and ByteDance Seed; the paper says the first author and several others did the work at ByteDance Seed.
- After 50 factual edits in a row on a 14-billion-parameter model (Qwen2.5-14B-Instruct), the authors report that its stronger variant, Cortex-Structural, recovered 88.9% of the gain the facts gave when supplied in the prompt, while keeping 99.8% of the model's original performance on queries outside the edits.
- The code is open under the MIT licence. The models in the project's Hugging Face collection, however, are baseline comparison adapters from another method, not Cortex itself.
- All numbers come from the authors' own testbed and have not been independently reproduced.
88.9% of the prompt's gain recovered after 50 edits (Structural); 99.8% of original non-target performance kept; 28.5% recovered by ROME, the strongest baseline in that test; 4B–120B model sizes tested
The problem: a prompt is a short-term memory
Give a language model a page of documentation for a tool it has never seen and it can use the tool. Take the page away and the skill goes with it. That is because a prompt does not change the model: the model's weights, the numbers learned in training, stay the same, and what it "remembers" lasts only while the text sits in its context window.
One answer is to store notes outside the model and paste the relevant ones back in each time. The paper points out that this depends on finding the right note at the right moment, and indirectly relevant experience can be missed. The other answer is to write the lesson into the weights. The risk there is damage: teach a model one new fact the wrong way and it may get worse at things it used to do.
The authors call the goal memory consolidation, borrowing the term from the way the brain moves new memories from temporary to long-term storage. Their definition has three demands: recover the gain the context gave, work without the context, and leave everything else the model could do untouched. They measure two things for each method. The Consolidation Rate (CR) is the fraction of the context's gain recovered once the context is removed. The Retention Rate (RR) is how much of the original performance is kept on queries outside the intended change.
How Cortex works
Cortex has three steps, as the paper describes them.
- Guess the questions. It generates likely future queries about the context, then records how the model answers them with the context in view. Those answers are the targets. It does not use the held-out evaluation data.
- Confine the change. Updates go only into the model's feed-forward layers. One variant, Synaptic, adds small low-rank updates (the LoRA technique) to existing weights. The other, Structural, adds new feature channels beside the existing weights and leaves those untouched. Both can be merged into a standard model.
- Teach the version without context. A student copy that does not see the context is trained to match the teacher that does, on output probabilities and on internal hidden states. For a series of updates, the earlier model is frozen and only new parameters are trained; old generated questions are replayed with fresh answers, so past contexts need not be stored.
The 50-edit result
The headline test applies 50 factual edits one after another to Qwen2.5-14B-Instruct and compares Cortex with five editing methods: FT-M, ROME, MEMIT, AlphaEdit and WISE. Results are averaged over three runs.
The paper adds that the first ten facts were still at 97.2% (Structural) and 92.6% (Synaptic) mean CR after 40 later edits, and that at the final checkpoint 0.0% of Structural's responses ended through repetition or a length limit, against 86.2–91.3% for FT-M, ROME, MEMIT and AlphaEdit.
A fact is not the same as knowing how to use it. Both variants reach about 95% on direct questions about an edited fact (95.3% and 95.6%). On compositional questions that require applying the new fact, called portability, Structural reaches 49.4% and Synaptic 30.7%. The authors note that producing the new answer is easier than using it in these questions.
Beyond facts: the wider testbed
The authors built a testbed with five task families: agent experience, learning a new API, steering a persona, suppressing knowledge, and editing facts. They tested 4B to 120B dense and mixture-of-experts models, including text-only and multimodal ones, though the inputs were text throughout. Their claim is that at least one Cortex variant sits on the CR-versus-RR Pareto frontier (no tested method beats it on both at once) in each of the 15 panels of their main figure, and in most settings overall.
Some findings are less flattering, and the paper reports them:
- Batches are harder. On GPT-OSS-20B, learning new APIs fell from 91–93% CR when each context was handled separately to 45–59% when several were combined.
- Suppression has a cost. Making GPT-OSS-20B forget a topic reached 97–100% CR but only 76–83% RR; related knowledge suffered most.
- It does not always work. In one agent benchmark (tau2-Bench on GPT-OSS-20B), Synaptic's success rate of 56.3% fell below the untouched model's 60.3%.
- It can beat the prompt. On Qwen2.5 in ALFWorld, consolidated models reached 128–133% CR, more than simply supplying the context.
How open it is
The code, a Python package called mc, is on GitHub under the MIT licence, which allows use, modification and redistribution with the licence notice kept. The README shows a quick start that consolidates one fact into Qwen3-4B-Thinking-2507 using LoRA, and covers the evaluation tasks and continual runs.
The Hugging Face collection lists four models, named Cortex-Baseline-SHINE-..., for Qwen2.5-14B and Qwen3-4B-Thinking-2507. By their names these are baseline adapters from a hypernetwork method called SHINE, which the paper compares against, so they are not Cortex weights. We did not open their model cards, and the lead we started from did not state their licence. The paper says the testbed will be released publicly; we did not check whether it is yet.
What to keep in mind
- Preprint, own testbed. The authors built the test, wrote the contexts and chose the baselines. The 50-edit test uses one 14B model and one kind of edit.
- Consolidation is not everything. The authors themselves show two baselines (LoCAS and δ-Mem) that keep about 98–101% of old skills on two batch code tasks but recover only −9% to 11% of the gain, which is why they report both rates.
- Cost. Each edit trains a new adapter, and the authors list pruning and merging of the added structure as future work.
Terms in plain English
- Weights / parameters: the numbers inside a model that training sets. (Our wording.)
- Context window: the text the model can see right now. Anything in it is forgotten when the conversation ends. (Our wording.)
- LoRA: a way to change a model by adding a small pair of low-rank matrices instead of retraining everything.
- Feed-forward network (FFN): the part of each layer of a transformer that processes each token after attention; the paper treats it as where knowledge is stored.
- Pareto frontier: the set of results where improving one measure means losing on the other.
Where things stand
The authors list future work as consolidating across tasks, handling large batches, pruning and merging the added structures, and hypernetworks that predict the new parameters straight from a context. The repository was still being updated in late November 2026.
Sources
- Cortex: Consolidating Context into Parametric Memory, arXiv, 14 October 2026
- zjunlp/cortex, GitHub (MIT)
- Cortex collection, Hugging Face
Sources
More from AI in China
- Baidu releases Unlimited SVG, an open model that redraws images as editable code
- DeepSeek's open models grew to 1.6 trillion parameters in a year, free to download
- Alibaba's Qwen team released five downloadable models this year, most under Apache 2.0
- The Chinese Academy of Sciences sets out 20 foundational science questions for AI
- Qwen releases FlashQLA, open code that runs its linear attention up to 3x faster