> ## Content Index
> Fetch the complete content index at: https://www.stirup.si/llms.txt
> Use this file to discover other available public pages before exploring further.

# Conditional Memory Module Enhances Transformer Contextual Recall
- URL: https://www.stirup.si/conditional-memory-module-enhances-transformer-contextual-recall-4ac46d4e/
- Published: 2026-11-10T12:45:27.000Z
- Updated: 2026-11-10T12:45:27.000Z
- Description: An experiment by DeepSeek in early 2026 integrated a Conditional Memory Module called Engram into a transformer model, using Vowpal Wabbit to train an embedding table that improved contextual recall and model performance.
- Author: Satish Das
- Tags: Community, News, Stirup Research

## Implementation of the Conditional Memory Module

The implementation of the Conditional Memory Module involves training an embedding table using Vowpal Wabbit (VW), an online learning library, and then integrating this table into a transformer model as an in-memory lookup mechanism. This approach, explored in an experiment from early 2026 by DeepSeek, introduces a "conditional memory" module called Engram. The prototype trains the memory table with VW and subsequently uses it within a transformer to enhance its capacity for contextual recall. In one test, a pretrained model (Qwen2.5-0.5B) was run over training data, and the hidden state at layer #4 was recorded for every token. This hidden state was then used to populate the embedding table, effectively transforming the linear model into a memory module that can be accessed by the transformer during inference. This method leverages the efficiency of VW for training and the contextual understanding of transformers, creating a hybrid system that combines the strengths of both paradigms.

## Training and Evaluation of the Student Model

In the Training and Evaluation of the Student Model section, researchers trained two identical student models for 4,600 steps on 8 × 512 tokens from cleaned WikiText-103, totaling about 20 million tokens. One model was trained without memory, while the other incorporated a frozen VW lookup as transformer memory. Evaluation metrics showed that the student with memory achieved a cross-entropy of 4.82 nats, compared to 5.16 nats for the model without memory, resulting in a 0.34 nat improvement. These results were measured over the same training steps and are attributed to the inclusion of the VW lookup, which appears to enhance model performance. The data is sourced from the held-out cross-entropy evaluation, with lower values indicating better performance.

## Performance and Benefits of the Memory Table

The performance benefits of using a memory table, as demonstrated in this experiment, are significant. By precomputing fundamental language features and providing them as a lookup table instead of training them as network weights, the model achieves a 29% lower perplexity with less than 0.1% more compute per training step, according to [Hacker News Show](https://www.liminalplanes.com/blog/vw?ref=stirup.si). This approach leverages a one-off VW fit on a CPU, which is negligible compared to the compute required for transformer training, as noted in [Hacker News Show](https://www.liminalplanes.com/blog/vw?ref=stirup.si). The flexibility of the table is also highlighted, as it does not need to remain fixed once exported, as stated in [Hacker News Show](https://www.liminalplanes.com/blog/vw?ref=stirup.si). This method offers a practical way to enhance model accuracy with minimal additional computational overhead.

## Potential Applications of the Memory Table

Potential applications of the memory table include enabling transformers to access a knowledge base that can be updated independently and continuously, without altering the model's weights. This approach could allow for pluggable domain-specific knowledge or per-customer memory, as noted in research ([Hacker News Show](https://www.liminalplanes.com/blog/vw?ref=stirup.si)). The memory table could act as a supplementary resource, where the model learns to read from it and determine how much to trust the information, as described by the student model's training process ([Hacker News Show](https://www.liminalplanes.com/blog/vw?ref=stirup.si)). This setup may also align with how fundamental features are formed in early layers of transformers, supporting the integration of external knowledge ([Hacker News Show](https://www.liminalplanes.com/blog/vw?ref=stirup.si)). However, the effectiveness of this method depends on the quality and relevance of the memory table's content, which remains an area for further exploration.

## Sources and reporting notes

- [Hacker News Show](https://www.liminalplanes.com/blog/vw?ref=stirup.si)

Based on published source material. No independent hands-on testing is claimed.