FactorEngram paper: factorized n-gram memory with basis-level gating beats Engram on 340M/1B models

pmttyji · reddit · 2026-10-06

A new arXiv paper, FactorEngram, improves lookup-based memory scaling for LLMs. Unlike Engram, which stores each retrieved n-gram embedding in its own hashed slot with a scalar gate, FactorEngram retrieves sparsity-regularized coefficients over a shared dictionary of basis vectors, letting related patterns reuse components and letting context gate each memory component individually. It covers both single tokens and multi-token n-grams and systematically studies branch insertion points. On 340M- and 1B-parameter Transformer backbones it improves language modeling and downstream tasks; ablations show inserting the memory branch before the attention sublayer in middle layers works best.

Original post →

More from Research

Research channel →