Neuro-Symbolic Language Modeling with Automaton-augmented Retrieval
Uri Alon, Frank F. Xu, Junxian He, Sudipta Sengupta, Dan Roth, Graham Neubig
Abstract
Retrieval-based language models (R-LM) model the probability of natural language text by combining a standard language model (LM) with examples retrieved from an external datastore at test time. While effective, a major bottleneck of using these models in practice is the computationally costly datastore search, which can be performed as frequently as every time step. In this paper, we present RetoMaton - retrieval automaton - which approximates the datastore search, based on (1) saving pointers between consecutive datastore entries, and (2) clustering of entries into"states". This effectively results in a weighted finite automaton built on top of the datastore, instead of representing the datastore as a flat list. The creation of the automaton is unsupervised, and a RetoMaton can be constructed from any text collection: either the original training corpus or from another domain. Traversing this automaton at inference time, in parallel to the LM inference, reduces its perplexity by up to 1.85, or alternatively saves up to 83% of the nearest neighbor searches over NN-LM (Khandelwal et al., 2020) without hurting perplexity. Our code and trained models are available at https://github.com/neulab/retomaton .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
24 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learning cites Improving Language Models by Retrieving from Trillions of Tokens
- Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learning cites Generalization through Memorization: Nearest Neighbor Language Models
- Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learning cites Nearest Neighbor Machine Translation
- Improving Language Models by Retrieving from Trillions of Tokens cites Generalization through Memorization: Nearest Neighbor Language Models
- Improving Language Models by Retrieving from Trillions of Tokens cites Accelerating Large-Scale Inference with Anisotropic Vector Quantization
- Improving Language Models by Retrieving from Trillions of Tokens cites Retrieval Augmented Language Model Pre-Training
- Chameleon: a Heterogeneous and Disaggregated Accelerator System for Retrieval-Augmented Language Models cites Improving Language Models by Retrieving from Trillions of Tokens
- Chameleon: a Heterogeneous and Disaggregated Accelerator System for Retrieval-Augmented Language Models cites Generalization through Memorization: Nearest Neighbor Language Models
- Chameleon: a Heterogeneous and Disaggregated Accelerator System for Retrieval-Augmented Language Models cites Nearest Neighbor Machine Translation
- Chameleon: a Heterogeneous and Disaggregated Accelerator System for Retrieval-Augmented Language Models cites Retrieval Augmented Language Model Pre-Training
- Test-Time Training on Nearest Neighbors for Large Language Models cites Improving Language Models by Retrieving from Trillions of Tokens
- Test-Time Training on Nearest Neighbors for Large Language Models cites Generalization through Memorization: Nearest Neighbor Language Models
- Test-Time Training on Nearest Neighbors for Large Language Models cites Retrieval Augmented Language Model Pre-Training
- Unlimiformer: Long-Range Transformers with Unlimited Length Input cites Improving Language Models by Retrieving from Trillions of Tokens
- Unlimiformer: Long-Range Transformers with Unlimited Length Input cites Generalization through Memorization: Nearest Neighbor Language Models
- Nearest Neighbor Machine Translation cites Generalization through Memorization: Nearest Neighbor Language Models
- Nearest Neighbor Machine Translation cites Accelerating Large-Scale Inference with Anisotropic Vector Quantization
- Retrieval Augmented Language Model Pre-Training cites Generalization through Memorization: Nearest Neighbor Language Models
Cited by top-tier papers24
- Unlimiformer: Long-Range Transformers with Unlimited Length InputAmanda Bertsch, Uri Alon, Graham Neubig, Matthew GormleyNeurIPS 2023 · 176 citations
- Decoupling Knowledge from Memorization: Retrieval-augmented Prompt LearningXiang Chen, Lei Li, Ningyu Zhang, Xiaozhuan Liang et al.NeurIPS 2022 · 68 citations
- Test-Time Training on Nearest Neighbors for Large Language ModelsMoritz Hardt, Yu SunICLR 2024 · 66 citations
- Algorithmic progress in language modelsAnson Ho, Tamay Besiroglu, Ege Erdil, Zifan Carl Guo et al.NeurIPS 2024 · 51 citations
- Chameleon: a Heterogeneous and Disaggregated Accelerator System for Retrieval-Augmented Language ModelsWenqi Jiang, Marco Zeller, Roger Waleffe, Torsten Hoefler et al.VLDB 2025 · 50 citations
Builds on11
- Retrieval Augmented Language Model Pre-TrainingKelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat et al.ICML 2020 · 2,937 citations
- Improving Language Models by Retrieving from Trillions of TokensSebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai et al.ICML 2022 · 1,629 citations
- Generalization through Memorization: Nearest Neighbor Language ModelsUrvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer et al.ICLR 2020 · 1,038 citations
- Accelerating Large-Scale Inference with Anisotropic Vector QuantizationRuiqi Guo, Philip Sun, Erik Lindgren, Quan Geng et al.ICML 2020 · 539 citations
- Nearest Neighbor Machine TranslationUrvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer et al.ICLR 2021 · 323 citations
Related papers
- You can't pick your neighbors, or can you? When and How to Rely on Retrieval in the kNN-LMAndrew Drozdov, Shufan Wang, Razieh Rahimi, Andrew McCallum et al.EMNLP Findings 2022 · 10 citations
- Why do Nearest Neighbor Language Models Work?Frank F. Xu, Uri Alon, Graham NeubigICML 2023 · 33 citations
- RegaVAE: A Retrieval-Augmented Gaussian Mixture Variational Auto-Encoder for Language ModelingJingcheng Deng, Liang Pang, Huawei Shen, Xueqi ChengEMNLP Findings 2023 · 3 citations
- Efficient Nearest Neighbor Language ModelsJunxian He, Graham Neubig, Taylor Berg-KirkpatrickEMNLP 2021
- Scaling Retrieval-Based Language Models with a Trillion-Token DatastoreRulin Shao, Jacqueline He, Akari Asai, Weijia Shi et al.NeurIPS 2024 · 76 citations
