cs.CLJul 31, 2026

Tokenizer-Agnostic Engram Module

Authors: Jia Peng LimHai Leong Chieu

Organizations: Singapore Management University · DSO National Laboratories

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 NN-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 NN-gram spaces, we treat NN-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 NN. 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.

Explore similar work

CardsList
  1. MultiHashFormer: Hash-based Generative Language Models

    Jun 26, 2026Huiyin Xue, Atsuki Yamaguchi, Nikolaos AletrasEncodersAutoregressive Model