Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Tensorizing Engram: Sharing Latents Across N-Gram Embeddings is Beneficial in LLMs

About

Modern language models represent text using discrete token-level embeddings, which forces recurring multi-token patterns to be learned implicitly across Transformer layers. Both Over-tokenized Transformers and Engram attempt to address this limitation by explicitly incorporating multi-token (n-gram) memories. However, they rely on separate hash tables for each n-gram order, which introduces hash collisions and prevents nested n-grams from sharing the underlying latent structures. To address these issues, we propose Tensorized Engram (TN-gram), a compact memory module that represents tensorized n-gram embeddings through shared factors in the Canonical Polyadic (CP) form. TN-gram learns shared token-position factors together with order-absorption vectors to encode the embeddings of different n-gram order. Comprehensive experiments demonstrate that TN-gram matches or even outperforms Engram-style n-gram modules while requiring much fewer parameters.

Wuyang Zhou, Yuxuan Gu, Giorgos Iacovides, Yuning Qiu, Qibin Zhao, Danilo Mandic• 2026

Related benchmarks

TaskDatasetResultRank
Commonsense ReasoningWinoGrande
Accuracy53.04
1581
Conversational Question AnsweringCoQA
Accuracy8.92
35
Coreference ResolutionWinogender
Accuracy56.41
15
Multiple-choice Question AnsweringMultiple-choice tasks (HS-ZS, ARC, COPA, CSQA, PIQA, OBQA, HS, LSAT-AR, BoolQ, LangID)
Average Accuracy37.82
6
Diverse ReasoningBIG-Bench Hard
BBH QA Score12.32
6
Showing 5 of 5 rows

Other info

Follow for update