From encoding to erasure, how AI manages what it knows.
Every piece of knowledge has to enter a system somehow. In modern AI, that act is continuous, layered, and often invisible.
During training, information is written into a neural network's weights through a process only recently mapped with precision. Researchers at Tel Aviv University and the Allen Institute for AI demonstrated that the feed-forward layers inside a transformer function as key-value memory stores: the first matrix learns to recognize input patterns, the second learns what to produce in response. A fact does not live in a single neuron. It is distributed as an address-and-content pair across these layers, retrieved whenever the right pattern appears. That insight opened the door to model editors like ROME and MEMIT, developed by MIT-affiliated groups, which treat weights as a writable database. To change a stored fact, you solve a targeted least-squares equation and insert the new association directly, no retraining required.
Writing also happens at inference time. When a language model generates text, it appends new entries to a key-value cache with every token produced. In agent frameworks it takes a third form, encoding experiences as dense vectors deposited into an external store that persists between sessions. These three timescales are not metaphors for the same operation. They carry different costs, different durability, and different failure modes, and understanding which kind of writing a system relies on is the first step toward understanding why it behaves the way it does.
Storing information in an AI system is not the same as storing a file. A hard drive holds bits and retrieves them exactly. An AI memory store holds meaning and retrieves approximations of it, which is either a feature or a defect depending on the task.
The dominant architecture in production is the vector database. Systems like Pinecone and Weaviate convert data into high-dimensional numerical vectors indexed by approximate nearest-neighbor algorithms. The tradeoff is precision: approximate retrieval is fast, but a raw vector database has no understanding of what it holds. It cannot distinguish a permanent user preference from a throwaway remark, cannot detect contradictions between records, and degrades silently as stale entries accumulate. The deeper response to that failure mode has been tiered memory modeled explicitly on operating system design. UC Berkeley's MemGPT introduced virtual context management: a bounded working context analogous to RAM, backed by external archival stores analogous to disk, with the model issuing its own paging instructions when its working context fills. Google Research's Titans pushed further, embedding a dedicated neural memory module trained to memorize at test time alongside standard attention, scaling to context windows exceeding two million tokens without the linear cost that makes large contexts prohibitively expensive.
A memory that cannot be found is no memory at all. Retrieval is where the theoretical elegance of AI storage meets the practical messiness of real queries, and where most production systems either succeed or quietly fail.
The dominant paradigm is retrieval-augmented generation. The system queries an external store at inference time, pulls the most relevant passages, and feeds them into the model's context before generating a response. Dense retrieval encodes semantic meaning but misses exact keyword matches; sparse retrieval catches keywords but misses meaning. Most production deployments now use hybrid retrieval, a linear combination of both scores, because neither alone is robust enough. The theoretical lineage runs back to DeepMind's Neural Turing Machines, which defined differentiable read and write heads over an external memory matrix, allowing a network to address memory by content rather than fixed location. That architecture proved difficult to scale, but its core insight now lives inside every transformer. Attention is, mathematically, a retrieval operation: a query vector addresses a set of keys, computes similarity scores, and reads a weighted sum of the corresponding values. Every forward pass is a memory lookup. The difference between attention and a vector database is that attention operates over learned representations packed into the model's weights, while a vector database holds explicit, inspectable records outside it. Both answer the same question: given what I am looking for, what do I already know that is relevant?
Retrieving information is not the same as using it. Execution is where memory becomes behavior, and the mechanism that governs it is more constrained than it first appears.
The primary execution mechanism is in-context learning. When relevant information appears inside a model's context window, the model conditions its output on it without changing any weights. A model that knows nothing about a company's internal documentation can answer questions about it accurately simply by reading a few relevant paragraphs placed in its context. A meta-analysis published at ICLR 2025, covering over one hundred papers across twenty datasets and fourteen models, found that chain-of-thought prompting produced the strongest gains on mathematics and formal logic, with average improvements of roughly fourteen points on symbolic tasks. On other task types the gains were modest. More tellingly, the same research found that for the most capable contemporary models, step-by-step examples do not reliably improve reasoning quality. What they improve is output format. The examples function less as demonstrations of how to think and more as templates for how to respond. Neurosymbolic architectures address this directly by splitting execution into two components: a neural module that generates candidate solutions and a symbolic verifier that checks them against formal constraints. Neither alone does what the combination achieves.
A hand-drawn diagram of the memory lifecycle on a laboratory glass board captures the six-phase loop that governs how modern AI systems encode, hold, recall, apply, share, and discard information. Daice Labs.
The last two phases are typically treated as afterthoughts. Sharing is assumed to happen naturally, and forgetting is assumed to be a failure. Both assumptions are wrong.
Sharing learned information across AI systems has turned out to be algebraically tractable. Research from the University of Washington, Microsoft Research, and the Allen Institute for AI showed that fine-tuning a pretrained model produces a task vector, the arithmetic difference between the fine-tuned weights and the original. Those vectors can be added to build multi-task models, subtracted to remove capabilities, or combined by analogy, all at zero additional computational cost. A model trained on French and one trained on English, combined by weight arithmetic, can produce a model capable of translation without a single additional training step.
Forgetting is the phase that makes the others sustainable. Neural networks catastrophically overwrite prior knowledge when trained on new tasks, a failure documented since the 1980s. The leading mitigations divide into regularization, which penalizes changes to parameters important to prior tasks; replay, which interleaves old examples with new training data; and parameter isolation, which carves out fresh weight space per task so that nothing interferes. Intentional forgetting has become a separate compliance problem: under European and California data protection law, users have the legal right to have their data removed from a model's behavior, a requirement now called machine unlearning. At inference time the problem reduces to cache management, tokens evicted by recency or accumulated attention score, the same logic as least-recently-used eviction in Redis or Memcached. The memory lifecycle is, at every stage, a set of problems computing has been solving for decades. The novelty is that the substrate is now learned, distributed, and probabilistic. The principles remain exactly the same.
Key references: Geva, M. et al., "Transformer Feed-Forward Layers Are Key-Value Memories," EMNLP 2021. Meng, K. et al., "Locating and Editing Factual Associations in GPT," NeurIPS 2022 (ROME). Meng, K. et al., "Mass-Editing Memory in a Transformer," ICLR 2023 (MEMIT). Packer, C. et al., "MemGPT: Towards LLMs as Operating Systems," arXiv 2023 (UC Berkeley). Behrouz, A. et al., "Titans: Learning to Memorize at Test Time," NeurIPS 2025 (Google Research). Sprague, Z. et al., "To CoT or not to CoT?", ICLR 2025 (UT Austin / Johns Hopkins / Princeton). Ilharco, G. et al., "Editing Models with Task Arithmetic," ICLR 2023 (University of Washington / Microsoft Research / Allen Institute for AI). Kirkpatrick, J. et al., "Overcoming catastrophic forgetting in neural networks," PNAS 2017 (DeepMind). Graves, A. et al., "Neural Turing Machines," arXiv 2014 (DeepMind).
Daice Labs Inc.
Brookline, MA, USA
Roll the "daice"–exploration & programmable adaptation.