Tokenizer-Agnostic Engram Module
Abstract
Deepseek's Engram, a conditional memory module, was introduced to trade-off storage versus reasoning in large language models. However, the module relies on token-level -gram hashing for Engram embedding lookup, introducing a tight coupling to the tokenizer used: a model with a different tokenizer would have to train its own Engram embeddings from scratch. To improve the reusability of Engram embeddings, we propose a change to the hashing routine, enabling compatibility between Engram models using different tokenizers. Instead of modelling disjoint -gram spaces, we treat -gram as a method to sample potentially useful byte sequences, from all possible byte sequences across tokens. We replace the XOR-based hashing with the general polynomial hashing with a joint embedding space across . This work investigates the possible trade-offs and shows that this simple substitution produces comparable performance and achieves tokenizer-agnosticism: hash equivalence for byte-equivalent token sequences.
Create a lesson
Metadata
- Comments
- Preprint, 7 pages
Related papers
Bigger Model or Bigger Table? How Much Backbone a Chorus N-gram Module Replaces
Shared title terminologycs.CLSzymon Kocur
FlyingStart: Learned Cross-Token Warm Starts for Fixed-Point Decoding in Recurrent-Depth Language Models
Shared title terminologycs.CLRunguo Li, Dezhen Lu, Zixiang Ni
From Grammar Deltas to Token Masks: Incremental Constrained Decoding under Runtime Grammar Evolution
Shared title terminologycs.CLHantao Hua, Jiming Su, Yonggang Che et al.
What If Chinese Were Latinized? A Counterfactual Study of Input Representation, Tokenization, and Language Modeling
Shared title terminologycs.CLZijie Zheng, Ej Zhou
ModernELECTRA: Replaced-Token Detection with Boundary-Window Reconstruction for Compact Encoders that Classify and Embed
Shared title terminologycs.CLMykhailo Shtopko, Ihor Stepanov, Dmytro Vodianytskyi et al.
Deneb-Vritra: Descriptions, Edges and Names Examined by Blocking Via Restoring Token Representations and Attention
Shared title terminologycs.CLMohammed Nayeem Khan, Akhil P, Shahina Shaik