Manuscript Offprint

arXiv:2608.23851

Does Episodic Memory Help Close the Lexical Frequency Gap in Sensitivity to Syntactic Contrasts? A Test Using Retrieval-Augmented Language Models

Jing Liu, Najoung Kim

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Grammatical knowledge and how it is empirically tested are typically considered robust to the frequency of the lexical items in the expressions. However, neural network-based models of grammaticality exhibit high sensitivity to lexical frequency. We draw upon Complementary Learning Systems theory to test the hypothesis that robustness to lexical frequency can arise via a hippocampal episodic memory mechanism, which enables rapid encoding and retrieval of specific experiences and allows learners to leverage them when processing rare patterns. We use retrieval-augmented language models as an instantiation of such an episodic memory mechanism (specifically, k-nearest-neighbor language models that augment parametric models with explicit instance storage), and test whether this augmentation helps close the lexical frequency gap that vanilla language models exhibit in syntactic contrast tests. Using syntactic contrasts with frequency-stratified test items, we find that retrieval augmentation narrows the performance gap between high- and low-frequency items, consistent with episodic memory compensating for weak parametric representations. This benefit is consistent across different syntactic phenomena and across models pretrained on child-realistic and large-scale data. Additionally, we show that structural information is critical for effective retrieval, whereas semantic similarity alone provides little benefit. While these are promising proof-of-concept results supporting our hypothesis, the frequency gap is narrowed rather than fully closed. Based on our analyses, we propose preferential reweighting of retrieved instances, better representations and retrieval strategies for structural information, and flexible configurations of storage and retrieval as promising future directions for improving the implementation of episodic memory in language models. 1^{1}

1 Introduction

Language models are known to exhibit systematic lexical frequency biases: their performance on linguistic evaluations correlates with how often the lexical items in the test examples appear in training data, leading to low-frequency items posing a persistent challenge (Wei et al., 2021; Kim et al., 2022; Diehl Martinez et al., 2024). While frequency does influence human performance in empirical tests of grammatical knowledge such as acceptability judgments (Kempen & Harbusch, 2005; Bader & Häussler, 2010; Lau et al., 2017, i.a.), recent work (Christensen & Kizach, 2024) has shown evidence for robustness to lexical frequency in delineating the critical contrasts. What accounts for this gap between human robustness and model fragility?

One possible answer comes from Complementary Learning Systems (CLS) theory (McClelland et al., 1995; Kumaran et al., 2016), which proposes that the brain employs two

1^{1}Code is available at https://github.com/Jing-L97/Generative_replay.

distinct memory systems: a hippocampal system that rapidly encodes and retrieves specific experiences, and a neocortical system that gradually extracts generalizable statistical patterns. When parametric knowledge is weak, as it is for rare items, episodic memory can compensate by directly retrieving relevant past encounters (Davis & Gaskell, 2009). This division of labor has also been proposed to be relevant to linguistic processing (Borensztajn & Zuidema, 2011; Duff & Brown-Schmidt, 2012), leading us to hypothesize that episodic retrieval may reflect the mechanism that underlies human robustness to lexical frequency in syntactic processing.

In this work, we computationally test this hypothesis by asking whether augmenting language models with an explicit retrieval mechanism helps close the lexical frequency gap in syntactic contrast evaluations. We adopt k-nearest-neighbor language models (kNN-LM; Khandelwal et al. 2020) as our proxy for episodic memory: the non-parametric datastore caches training instances for direct retrieval at inference time (analogous to hippocampal episodic traces), while the underlying parametric network consolidates statistical patterns through training (analogous to neocortical learning). The original kNN-LM has already been shown to be particularly helpful for rare patterns (Mallen et al., 2023; Kandpal et al., 2023), and recent work shows that the information available in the context can be used more flexibly than the same information stored parametrically (Lampinen et al., 2025; Chan et al., 2022), both consistent with the CLS prediction. At the same time, a recent finding that kNN-LMs do not improve prediction of low-frequency tokens in standard language modeling evaluation (Nishida et al., 2025) makes it a non-trivial and empirically open question whether retrieval benefits extend to the domain of syntactic knowledge.

We investigate this question through syntactic contrast tests across three different phenomena (subject-verb agreement, wh-questions, relative clauses) using frequency-stratified test items, under both child-realistic and large-scale pretraining. We further analyze what drives retrieval effectiveness by contrasting full versus semantics-only retrieval, by examining the role of structural similarity in retrieved instances, and by varying the configurations of retrieval (retrieval granularity, context window size, and number of retrieved neighbors). Our results show that retrieval augmentation consistently narrows the lexical frequency gap across all phenomena and both model scales, with greater gains for more syntactically complex phenomena. Nevertheless, the gap remains not fully closed. To this end, we analyze the limitations of the current modeling approach and posit preferential reweighting, improved representations and retrieval for structural information, and flexible configurations of storage and retrieval as promising future directions.

References (40)