Lngram v2: Latent N-Gram Memory with Interpretable Discrete Representations
Not on the map. Why?
Abstract (arXiv)
Transformers lack a native lookup mechanism, requiring repeated dense computation to recognize and reuse local static patterns. Lngram v1 introduces tokenizer-independent conditional memory through discrete latent n-gram addressing, but its memory capacity is coupled with the backbone width, limiting scalability due to high parameter and activation costs. We propose Lngram v2, which decouples the number of routes, memory dimension, and backbone width, and introduces a context-aware grouped-query attention readout to scale memory capacity independently. A zero-value Sink and counterfactual surrogate gradients further improve readout selectivity and routing trainability while preserving hard discrete addressing. Experiments across vision--language models (VLMs) of different scales show consistent improvements, including successful scaling to a 30B-parameter model. Compared with Lngram v1, Lngram v2 substantially reduces both total and activated memory parameters while maintaining or improving language modeling performance. Further analysis shows that its discrete IDs preserve substantial semantic structure of continuous hidden states, enabling semantic recovery from IDs alone and stable ID--semantic associations across datasets. These results establish Lngram v2 as an efficient and scalable latent conditional memory mechanism whose discrete addresses also provide a structured interface for analyzing internal model representations.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 31 of its 39 references that are in the map. First posted on arXiv 3 Sep 2026.
Builds on
31 of 39 references.
References · 31
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2014Microsoft COCO: Common Objects in Contextcited by 17,498
- 2022Flamingo: a Visual Language Model for Few-Shot Learningcited by 4,337
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
- 2023MMBench: Is Your Multi-modal Model an All-around Player?cited by 2,105
- 2023MMMU: A Massive Multi-discipline Multimodal Understanding and Reasoning Benchmark for Expert AGIcited by 2,044
- 2013Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computationcited by 2,031
- 2020GLU Variants Improve Transformercited by 1,724
19 more
- 2023MathVista: Evaluating Mathematical Reasoning of Foundation Models in Visual Contextscited by 1,582
- 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,359
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,311
- 2016Understanding intermediate layers using linear classifier probescited by 1,279
- 2023MM-Vet: Evaluating Large Multimodal Models for Integrated Capabilitiescited by 1,221
- 2024The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scalecited by 1,104
- 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,093
- 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,046
- 2024Are We on the Right Way for Evaluating Large Vision-Language Models?cited by 893
- 2024DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Modelscited by 834
- 2016A Diagram Is Worth A Dozen Imagescited by 793
- 2017Network Dissection: Quantifying Interpretability of Deep Visual Representationscited by 703
- 2024PaliGemma: A versatile 3B VLM for transfercited by 679
- 2023HallusionBench: An Advanced Diagnostic Suite for Entangled Language Hallucination and Visual Illusion in Large Vision-Language Modelscited by 572
- 2023OCRBench: On the Hidden Mystery of OCR in Large Multimodal Modelscited by 466
- 2023Teaching CLIP to Count to Tencited by 194
- 2019Large Memory Layers with Product Keyscited by 120
- 2026Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Modelscited by 78
- 2026Kwai Keye-VL-2.0 Technical Reportcited by 3
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Lngram: N-gram Conditional Memory in Latent Space
- 2026Learning When to Attend: Conditional Memory Access for Long-Context LLMs
- 2026Memory Grafting: Scaling Language Model Pre-training via Offline Conditional Memory
- 2026NGM: A Plug-and-Play Training-Free Memory Module for LLMs
- 2026TF-Engram: A Train-Free Engram with SSD-Backed Memory for Large Language Models
- 2026Memory Decoder at Scale: A Pretrained, Parametric Long-Term Memory
- 2026IndexMem: Learned KV-Cache Eviction with Latent Memory for Long-Context LLM Inference
- 2025Breaking Quadratic Barriers: A Non-Attention LLM for Ultra-Long Context Horizons