Sharp Nearby, Fuzzy Far Away: How Neural Language Models Use Context
Open accessThe DOI matches its Crossref record; 30 of the 34 references it cites were found in a registry or an index.
Abstract
We know very little about how neural language models (LM) use prior linguistic context.In this paper, we investigate the role of context in an LSTM LM, through ablation studies.Specifically, we analyze the increase in perplexity when prior context words are shuffled, replaced, or dropped.On two standard datasets, Penn Treebank and WikiText-2, we find that the model is capable of using about 200 tokens of context on average, but sharply distinguishes nearby context (recent 50 tokens) from the distant history.The model is highly sensitive to the order of words within the most recent sentence, but ignores word order in the long-range context (beyond 50 tokens), suggesting the distant past is modeled only as a rough semantic field or topic.We further find that the neural caching model (Grave et al., 2017b) especially helps the LSTM to copy words from within this distant context.Overall, our analysis not only provides a better understanding of how neural LMs use their context, but also sheds light on recent success from cache-based models.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Figures







Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
The source backs part of the claim, not all of it — or backs it for a different population, condition or comparison.
In the citing paper
“These observations complement prior work, which found that non-instruction fine-tuned language models are biased towards recent tokens (i.e., the end of the input context; Khandelwal et al., 2018;Press et al., 2021).”
From Lost in the Middle: How Language Models Use Long Contexts (2024) · cites this paper as Khandelwal et al., 2018
Experimental — accuracy not yet measuredThe source backs part of the claim, not all of it — or backs it for a different population, condition or comparison.
In the citing paper
“Transformers process natural language as a sequence on finite context windows; however, global relationships among words beyond these windows cannot be completely modeled via sequence processing only.”
From Emotion Classification With Visibility Graphs (2025) · cites this paper as [13]
Experimental — accuracy not yet measured
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Hochreiter, S., & Schmidhuber, J. (1997) · Neural Computation · doi:10.1162/neco.1997.9.8.1735 · Cited by 102,318 · cited 1×
“LSTMs are designed to capture long-range dependencies in sequences (Hochreiter and Schmidhuber, 1997).”
BackgroundNeural Machine Translation by Jointly Learning to Align and Translate
Bahdanau, D., Cho, K., & Bengio, Y. (2014) · arXiv · doi:10.48550/arxiv.1409.0473 · Cited by 16,213 · cited 1×
“However, the success of copy mechanisms such as attention and caching (Bahdanau et al., 2015; Hill et al., 2016; Merity et al., 2017; Grave et al., 2017a,b) suggests that information in the distant context is very useful.”
BackgroundBuilding a Large Annotated Corpus of English: The Penn Treebank
Marcus, M. (1993) · doi:10.21236/ada273556 · Cited by 7,405
The Stanford CoreNLP Natural Language Processing Toolkit
Manning, C., Surdeanu, M., Bauer, J., Finkel, J., Bethard, S., & McClosky, D. (2014) · Proceedings of 52nd Annual Meeting of the Association for Computational Linguistics: System Demonstrations · doi:10.3115/v1/p14-5010 · Cited by 7,037 · cited 1×
“We obtain part-of-speech tags using Stanford CoreNLP (Manning et al., 2014).”
MethodRecurrent neural network based language model
Mikolov, T., Karafiát, M., Burget, L., Černocký, J., & Khudanpur, S. (2010) · Interspeech 2010 · doi:10.21437/interspeech.2010-343 · Cited by 5,390 · cited 1×
“We analyze two datasets commonly used for language modeling, Penn Treebank (PTB) (Marcus et al., 1993; Mikolov et al., 2010) and Wikitext-2 (Wiki) (Merity et al., 2017).”
MethodGenerating Sequences With Recurrent Neural Networks
Graves, A. (2013) · arXiv · doi:10.48550/arxiv.1308.0850 · Cited by 2,894 · cited 1×
“For several years now, neural language models (NLMs) (Graves, 2013; Jozefowicz et al., 2016; Grave et al., 2017a; Dauphin et al., 2017; Melis et al., 2018; Yang et al., 2018) have consistently outperformed classical n -gram models, an improvement often attributed to their ability to model…”
Background(2013) · Cited by 2,056
A theoretically grounded application of dropout in recurrent neural networks
Gal, Y., & Ghahramani, Z. (2016) · Cambridge University Engineering Department Publications Database · Cited by 1,600
Language Modeling with Gated Convolutional Networks
Dauphin, Y., Fan, A., Auli, M., & Grangier, D. (2016) · arXiv (Cornell University) · doi:10.48550/arxiv.1612.08083 · Cited by 1,080 · cited 2×
“For several years now, neural language models (NLMs) (Graves, 2013; Jozefowicz et al., 2016; Grave et al., 2017a; Dauphin et al., 2017; Melis et al., 2018; Yang et al., 2018) have consistently outperformed classical n-gram models, an improvement often attributed to their ability to model long-range dependencies in far…”
BackgroundExploring the Limits of Language Modeling
Józefowicz, R., Vinyals, O., Schuster, M., Shazeer, N., & Wu, Y. (2016) · arXiv (Cornell University) · doi:10.48550/arxiv.1602.02410 · Cited by 823 · cited 2×
“For several years now, neural language models (NLMs) (Graves, 2013; Jozefowicz et al., 2016; Grave et al., 2017a; Dauphin et al., 2017; Melis et al., 2018; Yang et al., 2018) have consistently outperformed classical n-gram models, an improvement often attributed to their ability to model long-range dependencies in far…”
Background
Cited by
Rives, A., Meier, J., Sercu, T., Goyal, S., Lin, Z., Liu, J., Guo, D., Ott, M., Zitnick, C. L., Ma, J., et al. (2021) · Proceedings of the National Academy of Sciences · doi:10.1073/pnas.2016239118 · Cited by 3,286
Transformer-XL: Attentive language models beyond a fixed-length context
Dai, Z., Yang, Z., Yang, Y., Carbonell, J., Le, Q., & Salakhutdinov, R. (2019) · Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/p19-1285 · Cited by 3,169
“…but not limited to devising novel architectures to better encode the context (Bengio et al., 2003; Mikolov et al., 2010; Zilly et al., 2016; Krause et al., 2016; Grave et al., 2016b; Dauphin et al., 2016; Chung et al., 2016; Merity et al., 2016; Kalchbrenner et al., 2016; Al-Rfou et al.,…”
BackgroundWhat Does BERT Look at? An Analysis of BERT’s Attention
Clark, K., Khandelwal, U., Levy, O., & Manning, C. D. (2019) · Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP · doi:10.18653/v1/w19-4828 · Cited by 1,373
“One line of research examines the outputs of language models on carefully chosen input sentences (Linzen et al., 2016; Khandelwal et al., 2018; Gulordava et al., 2018; Marvin and Linzen, 2018).”
BackgroundSelf-citationTransformer-XL: Attentive Language Models Beyond a Fixed-Length Context
Dai, Z., Yang, Z., Yang, Y., Carbonell, J., Le, Q. V., & Salakhutdinov, R. (2019) · arXiv · doi:10.48550/arxiv.1901.02860
“…but not limited to devising novel architectures to better encode the context (Bengio et al., 2003; Mikolov et al., 2010; Zilly et al., 2016; Krause et al., 2016; Grave et al., 2016b; Dauphin et al., 2016; Chung et al., 2016; Merity et al., 2016; Kalchbrenner et al., 2016; Al-Rfou et al.,…”
BackgroundLost in the Middle: How Language Models Use Long Contexts
Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024) · Transactions of the Association for Computational Linguistics · doi:10.1162/tacl_a_00638 · Cited by 1,612
“The pioneering work of Khandelwal et al. (2018) showed that small LSTM language models make increasingly coarse use of longer-term context; Sankar et al. (2019) found similar results in dialogue models.”
ResultLost in the Middle: How Language Models Use Long Contexts
Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2023) · arXiv · doi:10.48550/arxiv.2307.03172 · Cited by 1,599
“The pioneering work of Khandelwal et al. (2018) showed that small LSTM language models make increasingly coarse use of longer-term context; Sankar et al. (2019) found similar results in dialogue models.”
ResultA Survey of AI-Generated Content (AIGC)
Cao, Y., Li, S., Liu, Y., Yan, Z., Dai, Y., Yu, P., & Sun, L. (2025) · ACM Computing Surveys · doi:10.1145/3704262 · Cited by 182
Enhancing the Locality and Breaking the Memory Bottleneck of Transformer on Time Series Forecasting
Li, S., Jin, X., Xuan, Y., Zhou, X., Chen, W., Wang, Y.-X., & Yan, X. (2019) · arXiv (Cornell University) · doi:10.48550/arxiv.1907.00235 · Cited by 1,053
“As an example, [13] shows that language models using LSTM have an effective context size of about 200 tokens on average but are only able to sharply distinguish 50 tokens nearby, indicating that even LSTM struggles to”
MethodLinguistic Knowledge and Transferability of Contextual Representations
Liu, N. F., Gardner, M., Belinkov, Y., Peters, M. E., & Smith, N. A. (2019) · Proceedings of the 2019 Conference of the North · doi:10.18653/v1/n19-1112 · Cited by 621
“, 2016a, inter alia), ablating components of the model and dataset (Kuncoro et al., 2017; Gaddy et al., 2018; Khandelwal et al., 2018), or interpreting attention mechanisms (Bahdanau et al.”
BackgroundAnalysis Methods in Neural Language Processing: A Survey
Belinkov, Y., & Glass, J. (2019) · Transactions of the Association for Computational Linguistics · doi:10.1162/tacl_a_00254 · Cited by 477
“A number of studies evaluated the effect of erasing or masking certain neural network components, such as word embedding dimensions, hidden units, or even full words (Li et al., 2016b; Feng et al., 2018; Khandelwal et al., 2018; Bau et al., 2018).”
BackgroundCalibrate Before Use: Improving Few-Shot Performance of Language Models
Zhao, T. Z., Wallace, E., Feng, S., Klein, D., & Singh, S. (2021) · arXiv · doi:10.48550/arxiv.2102.09690 · Cited by 513
“, 2021), suffer from recency bias (Khandelwal et al., 2018; Ravfogel et al., 2019), and prefer generic responses instead of rare text (Li et al.”
BackgroundCao, Y., Li, S., Liu, Y., Yan, Z., Dai, Y., Yu, P. S., & Sun, L. (2023) · arXiv · doi:10.48550/arxiv.2303.04226 · Cited by 463
“These methods are capable of attending to around 200 tokens in a sample [26], which marks a significant improvement compared to N-gram language models.”
MethodDissecting Contextual Word Embeddings: Architecture and Representation
Peters, M., Neumann, M., Zettlemoyer, L., & Yih, W.-T. (2018) · Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/d18-1179 · Cited by 434
“Concurrent with our work, Khandelwal et al. (2018) studied the role of context in influencing language model predictions, Gaddy et al. (2018) analyzed neural constituency parsers, Blevins et al. (2018) explored whether RNNs trained with several different objectives can learn hierarchical syntax, and…”
BackgroundTraffic transformer: Capturing the continuity and periodicity of time series for traffic forecasting
Cai, L., Janowicz, K., Mai, G., Yan, B., & Zhu, R. (2020) · Transactions in GIS · doi:10.1111/tgis.12644 · Cited by 392
“First, they struggle to preserve very long-term sequential information, which leads to the loss of long-term temporal dependency in time series during the forward path (Khandelwal, He, Qi, & Jurafsky, 2018).”
BackgroundRives, A., Meier, J., Sercu, T., Goyal, S., Lin, Z., Liu, J., Guo, D., Ott, M., Zitnick, C. L., Ma, J., et al. (2019) · doi:10.1101/622803 · Cited by 3,280
Document-Level Relation Extraction with Adaptive Thresholding and Localized Context Pooling
Zhou, W., Huang, K., Ma, T., & Huang, J. (2021) · Proceedings of the AAAI Conference on Artificial Intelligence · doi:10.1609/aaai.v35i16.17717 · Cited by 316
The power of noise: Redefining retrieval for rag systems
Cuconasu, F., Trappolini, G., Siciliano, F., Filice, S., Campagnano, C., Maarek, Y., Tonellotto, N., & Silvestri, F. (2024) · Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval · doi:10.1145/3626772.3657834 · Cited by 236
“However, they often struggle with understanding semantic relationships between words [22].”
Do NLP Models Know Numbers? Probing Numeracy in Embeddings
Wallace, E., Wang, Y., Li, S., Singh, S., & Gardner, M. (2019) · Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP) · doi:10.18653/v1/d19-1534 · Cited by 227
Cirstea, R.-G., Guo, C., Yang, B., Kieu, T., Dong, X., & Pan, S. (2022) · International Joint Conference on Artificial Intelligence · doi:10.24963/ijcai.2022/277 · Cited by 255
Big code != big vocabulary: open-vocabulary models for source code
Karampatsis, R.-M., Babii, H., Robbes, R., Sutton, C., & Janes, A. (2020) · Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering · doi:10.1145/3377811.3380342 · Cited by 182
“Current NLMs are based on architectures such as recurrent neural networks (RNN) [63], long short-term memory (LSTM) [45], or Transformer [85] that model long range dependencies: a study of LSTM NLMs showed that they use context as large as 250 words [56], much longer than n-grams.”
MethodTowards Efficient Generative Large Language Model Serving: A Survey from Algorithms to Systems
Miao, X., Oliaro, G., Zhang, Z., Cheng, X., Jin, H., Chen, T., & Jia, Z. (2025) · ACM Computing Surveys · doi:10.1145/3754448 · Cited by 238
“• Recurrent unit : Although recurrent neural networks (RNN) (e.g., LSTM [252]) tend to struggle with capturing long-term dependencies in sequences [161], there are still several approaches using recurrent units to replace Transformer modules and achieve linear computational and memory complexity…”
A survey on deep learning based knowledge tracing
Song, X., Li, J., Cai, T., Yang, S., Yang, T., & Liu, C. (2022) · Knowledge-Based Systems · doi:10.1016/j.knosys.2022.110036 · Cited by 201
On the Explainability of Natural Language Processing Deep Models
Zini, J. E., & Awad, M. (2023) · ACM Computing Surveys · doi:10.1145/3529755 · Cited by 120
“[52] (2015) Post-hoc LSTM Identiication of high-level patterns Reasoning on �−gram models, Subject-verb agreement [57] (2016) Post-hoc LSTM Heatmap T-SNE visualization [60] (2016) Post-hoc LSTM Probing Subject-verb agreement and logical inference [11] (2018) Post-hoc RNN Correspondence between network depth and syntac…”
BackgroundMethodAdvancing Transformer Architecture in Long-Context Large Language Models: A Comprehensive SurveyPreprint
Huang, Y.-P., Xu, J., Lai, J., Jiang, Z., Chen, T., Li, Z., Yao, Y., Ma, X., Yang, L., Chen, H., et al. (2023) · arXiv (Cornell University) · doi:10.48550/arxiv.2311.12351 · Cited by 217
“The recent LongNet [46] further improves computational efficiency by introducing dilated attention , which expands the attentive field exponentially as the distance between tokens increases.”
BackgroundA Practical Survey on Faster and Lighter Transformers
Fournier, Q., Caron, G. M., & Aloise, D. (2023) · ACM Computing Surveys · doi:10.1145/3586074 · Cited by 145
“[11] empirically observed”
Meister, C., Pimentel, T., Wiher, G., & Cotterell, R. (2023) · Transactions of the Association for Computational Linguistics · doi:10.1162/tacl_a_00536 · Cited by 70
“For instance, Khandelwal et al. (2018) show that a recurrent neural language model’s memory is empirically bounded at roughly 200 words.”
Trellis Networks for Sequence Modeling
Bai, S., Kolter, J. Z., & Koltun, V. (2018) · arXiv (Cornell University) · doi:10.48550/arxiv.1810.06682 · Cited by 90
“While RNNs can in principle retain unlimited history, there is both empirical and theoretical evidence that the memory horizon of RNNs is bounded (Bai et al., 2018; Khandelwal et al., 2018; Miller & Hardt, 2018).”
BackgroundDo Neural Dialog Systems Use the Conversation History Effectively? An Empirical Study
Sankar, C., Subramanian, S., Pal, C., Chandar, S., & Bengio, Y. (2019) · Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/p19-1004 · Cited by 119
Neural Approaches to Conversational AI
Gao, J., Galley, M., & Li, L. (2019) · now publishers, Inc. eBooks · doi:10.1561/9781680835533 · Cited by 107
Recurrent Quantum Neural NetworksPreprint
Bausch, J. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2006.14619 · Cited by 262
Recursive long short-term memory network for predicting nonlinear structural seismic response
Xu, Z., Chen, J., Shen, J., & Xiang, M. (2021) · Engineering Structures · doi:10.1016/j.engstruct.2021.113406 · Cited by 125
MMM : Exploring Conditional Multi-Track Music Generation with the TransformerPreprint
Ens, J., & Pasquier, P. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2008.06048 · Cited by 140
“In contrast to Recurrent Neural Networks (RNN), which sharply distinguish nearby context (the most recent 50 tokens) from the distant history (Khandelwal, He, Qi, & Jurafsky, 2018) distant tokens to be directly attended to if they are relevant to the current prediction.”
BackgroundControllable Neural Story Plot Generation via Reward Shaping
Tambwekar, P., Dhuliawala, M., Martin, L. J., Mehta, A., Harrison, B., & Riedl, M. O. (2019) · Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence · doi:10.24963/ijcai.2019/829 · Cited by 81
Pham, T., Bui, T., Mai, L., & Nguyen, A. (2021) · Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021 · doi:10.18653/v1/2021.findings-acl.98 · Cited by 79
“In word prediction, LSTMs and pre-trained BERT were found to exhibit a certain degree of insensitivity when the context words are randomly shuffled (Khandelwal et al., 2018; Mitchell and Bowers, 2020; Ettinger, 2020).”
Giulianelli, M., Harding, J., Mohnert, F., Hupkes, D., & Zuidema, W. H. (2018) · BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP (BlackboxNLP) · doi:10.18653/v1/w18-5426 · Cited by 245
“approaches include visualising the state space of these networks, performing ablations to the network, or using the internal states of the networks for some auxiliary task (e.g., Adi et al., 2016; Kádár et al., 2017; Conneau et al., 2018; Khandelwal et al., 2018).”
Zhang, C., Xu, Q., Yu, Y., Zhou, G., Zeng, K., Chang, F., & Ding, K. (2024) · Robotics and Computer-Integrated Manufacturing · doi:10.1016/j.rcim.2024.102883 · Cited by 124
PRCBERT: Prompt Learning for Requirement Classification using BERT-based Pretrained Language Models
Luo, X., Xue, Y., Xing, Z., & Sun, J. (2022) · Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering · doi:10.1145/3551349.3560417 · Cited by 87
“Only based on the attention mechanism [5], the transformer can implement semantic interaction between all sequence text subwords (also called tokens) without any attenuation (due to the gradient vanishing and explosion caused by the long relative distance between subwords, previous LSTMbased language models can proces…”
MethodDissecting Contextual Word Embeddings: Architecture and RepresentationPreprint
Peters, M. E., Neumann, M., Zettlemoyer, L., & Yih, W.-T. (2018) · arXiv (Cornell University) · doi:10.48550/arxiv.1808.08949 · Cited by 115
“Concurrent with our work, Khandelwal et al. (2018) studied the role of context in influencing language model predictions, Gaddy et al. (2018) analyzed neural constituency parsers, Blevins et al. (2018) explored whether RNNs trained with several different objectives can learn hierarchical syntax, and…”
BackgroundJoshi, A., Fidalgo, E., Alegre, E., & Fernández-Robles, L. (2022) · Expert Systems with Applications · doi:10.1016/j.eswa.2022.118442 · Cited by 114
Automatic Story Generation: A Survey of Approaches
Alhussain, A. I., & Azmi, A. M. (2022) · ACM Computing Surveys · doi:10.1145/3453156 · Cited by 79
“[81] showed, RNN’s predictions in practice depend on a relatively small part of the previous tokens.”
BackgroundContextualized Emotion Recognition in Conversation as Sequence Tagging
Yan, W., Zhang, J., Ma, J., Wang, S., & Xiao, J. Z. (2020) · Annual Meeting of the Special Interest Group on Discourse and Dialogue · doi:10.18653/v1/2020.sigdial-1.23 · Cited by 113
“Nevertheless, including LSTM and GRU, RNNs are limited in their capability to process tasks involving very long sequences in practice (Brad-bury et al., 2016; Khandelwal et al., 2018).”
BackgroundA Self-Attentional Neural Architecture for Code Completion with Multi-Task Learning
Liu, F., Li, G., Wei, B., Xia, X., Fu, Z., & Jin, Z. (2020) · Proceedings of the 28th International Conference on Program Comprehension · doi:10.1145/3387904.3389261 · Cited by 84
“of gating in LSTMs might not be sufficient to address the gradient vanishing and explosion issue fully. Empirically, previous work has found that LSTM language models use 200 context words on average [19], indicating room for further improvement. To ease this issue, attention mechanisms [2, 37], which add direct conne…”
BackgroundMethodInfluentialAbnar, S., Beinborn, L., Choenni, R., & Zuidema, W. H. (2019) · BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP (BlackboxNLP) · doi:10.18653/v1/w19-4820 · Cited by 107
“…into the results, we see that while changing the conditions of the inputs to the models has a significant impact on the representations they compute and their performance on NLP tasks (Khandelwal et al., 2018), these changes do not get reflected in their alignment with the brain representations.”
TinyHAR: A Lightweight Deep Learning Model Designed for Human Activity Recognition
Zhou, Y., Zhao, H., Huang, Y., Riedel, T., Hefenbrock, M., & Beigl, M. (2022) · Proceedings of the 2022 ACM International Symposium on Wearable Computers · doi:10.1145/3544794.3558467 · Cited by 78
“However, RNNs still have difficulties capturing temporal dependencies over long ranges, as they suffer from the "forgetting" defect [11].”
BackgroundPhonotactic Complexity and Its Trade-offs
Pimentel, T., Roark, B., & Cotterell, R. (2020) · Transactions of the Association for Computational Linguistics · doi:10.1162/tacl_a_00296 · Cited by 89
SAMNet: Toward Latency-Free Non-Intrusive Load Monitoring via Multi-Task Deep Learning
Liu, Y., Qiu, J., & Ma, J. (2021) · IEEE Transactions on Smart Grid · doi:10.1109/tsg.2021.3139395 · Cited by 78
Meaning to Form: Measuring Systematicity as Information
Pimentel, T., McCarthy, A. D., Blasí, D. E., Roark, B., & Cotterell, R. (2019) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/p19-1171 · Cited by 92
“Recurrent neural networks are great representation extractors, being able to model long dependencies—up to a few hundred tokens (Khandelwal et al., 2018)—and complex distributions Pr(wi | w<i) (Mikolov et al.”
BackgroundTemporal Convolutional Attention-based Network For Sequence ModelingPreprint
Hao, H., Wang, Y., Xue, S., Xia, Y., Zhao, J., & Shen, F. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2002.12530 · Cited by 80
What Context Features Can Transformer Language Models Use?
O’Connor, J., & Andreas, J. (2021) · Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers) · doi:10.18653/v1/2021.acl-long.70 · Cited by 35
“Computational issues limit the effective context size such models can be practically trained on, but this size is still sig-nificantly greater the models mentioned above: as previously noted, Khandelwal et al. (2018) revealed influence from up to 200 tokens of context.”
BackgroundResultInfluentialUnderstanding and Detecting Hallucinations in Neural Machine Translation via Model Introspection
Xu, W., Agrawal, S., Briakou, E., Martindale, M. J., & Carpuat, M. (2023) · Transactions of the Association for Computational Linguistics · doi:10.1162/tacl_a_00563 · Cited by 53
“To lower the cost of computing source contributions, we clip the source length at 40, and only consider the influence back-propagated through the most recent 10 target tokens – prior work shows that nearby context is more influential than distant context (Khandelwal et al., 2018).”
BackgroundCombining computational controls with natural text reveals aspects of meaning composition
Toneva, M., Mitchell, T. M., & Wehbe, L. (2022) · Nature Computational Science · doi:10.1038/s43588-022-00354-6 · Cited by 98
Catelli, R., Casola, V., Pietro, G. D., Fujita, H., & Esposito, M. (2020) · Knowledge-Based Systems · doi:10.1016/j.knosys.2020.106649 · Cited by 69
Assessing the Benchmarking Capacity of Machine Reading Comprehension Datasets
Sugawara, S., Stenetorp, P., Inui, K., & Aizawa, A. (2020) · Proceedings of the AAAI Conference on Artificial Intelligence · doi:10.1609/aaai.v34i05.6422 · Cited by 63
Predicting Temporal Sets with Deep Neural Networks
Yu, L., Sun, L., Du, B., Liu, C., Xiong, H., & Lv, W. (2020) · ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD) · doi:10.1145/3394486.3403152 · Cited by 71
“The reason is that RNNs only propagate information sequentially, which limits the perception field of temporal dependency learning [13].”
Variational Self-attention Network for Sequential Recommendation
Zhao, J., Zhao, P., Zhao, L., Liu, Y., Sheng, V. S., & Zhou, X. (2021) · IEEE International Conference on Data Engineering (ICDE) · doi:10.1109/icde51399.2021.00138 · Cited by 70
“For example, Khandelwal et al. [10] demonstrated that language models using LSTM can apply about 200 context tokens on average.”
MethodCharacter-Level Language Modeling with Deeper Self-Attention
Al-Rfou, R., Choe, D., Constant, N., Guo, M., & Jones, L. (2019) · Proceedings of the AAAI Conference on Artificial Intelligence · doi:10.1609/aaai.v33i01.33013159 · Cited by 56
Get More with LESS: Synthesizing Recurrence with KV Cache Compression for Efficient LLM InferencePreprint
Dong, H., Yang, X.-Y., Zhang, Z. (., Wang, Z.-Y., Chi, Y., & Chen, B. (2024) · International Conference on Machine Learning · doi:10.48550/arxiv.2402.09398 · Cited by 103
“While its dilution of information restricts its performance when specific tokens need to be recalled with strong signals (Khandelwal et al., 2018), this is exactly what a sparse KV cache algorithm can do, so we can fully take advantage of its infinite compression capability to obtain some high…”
BackgroundRNNs can generate bounded hierarchical languages with optimal memory
Hewitt, J., Hahn, M., Ganguli, S., Liang, P., & Manning, C. D. (2020) · Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.156 · Cited by 86
Context-Aware Attentive Multilevel Feature Fusion for Named Entity Recognition
Yang, Z., Ma, J., Chen, H., Zhang, J., & Chang, Y. (2022) · IEEE Transactions on Neural Networks and Learning Systems · doi:10.1109/tnnls.2022.3178522 · Cited by 58
“As we known, LSTM language models use only 200 context words on average [21].”
MethodLattice Transformer for Speech Translation
Zhang, P., Ge, N., Chen, B., & Fan, K. (2019) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/p19-1649 · Cited by 63
“However, the inherently sequential nature still remains in Lattice-LSTMs due to the topological representation of the lattice graph, precluding long-path dependencies (Khandelwal et al., 2018) and parallelization within training examples that are the fundamental constraint of LSTMs.”
BackgroundHe, T., Zhang, J., Zhou, Z., & Glass, J. R. (2021) · Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2021.emnlp-main.415 · Cited by 88
“Note that similar techniques have been used in Khandelwal et al. (2018) to study how LMs utilize context.”
MethodSpatial-Temporal Interval Aware Sequential POI Recommendation
Wang, E., Jiang, Y., Xu, Y., Wang, L., & Yang, Y. (2022) · IEEE International Conference on Data Engineering (ICDE) · doi:10.1109/icde53745.2022.00202 · Cited by 65
“Note that these models’ performance might be limited by issues caused the characteristics of the original framework, such as gradient vanishing [44] and data sparsity [45].”
BackgroundKauf, C., Tuckute, G., Lévy, R., Andreas, J., & Fedorenko, E. G. (2024) · Neurobiology of Language · doi:10.1162/nol_a_00116 · Cited by 80
“…on ANN next-word prediction performance within local sentence contexts (because they help ensure grammaticality; Khandelwal et al., 2018), content words strongly influence prediction performance both within local and more extended contexts (Khandelwal et al., 2018; O ’ Connor & Andreas, 2021).”
BackgroundLanguage Repository for Long Video Understanding
Kahatapitiya, K., Ranasinghe, K., Park, J., & Ryoo, M. S. (2025) · Findings of the Association for Computational Linguistics: ACL (Findings of ACL) · doi:10.18653/v1/2025.findings-acl.294 · Cited by 81
Approximating How Single Head Attention LearnsPreprint
Snell, C., Zhong, R., Klein, D., & Steinhardt, J. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2103.07601 · Cited by 48
“…about word x l , we should expect: However, if we accept the conventional wisdom that hidden states contain information about nearby words (Khandelwal et al., 2018), we should expect: To verify these hypotheses, we plot how γ l ∗ , γ l ∗ +1 , ¯ γ , and γ L evolve as training proceeds in…”
A Model-agnostic Data Manipulation Method for Persona-based Dialogue Generation
Cao, Y., Bi, W., Fang, M., Shi, S., & Tao, D. (2022) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2022.acl-long.550 · Cited by 64
Peng, C., & Fanchao, M. (2022) · IEEE Transactions on Neural Networks and Learning Systems · doi:10.1109/tnnls.2022.3224804 · Cited by 50
“First and foremost, as the trained time-series data increases, it is difficult for recurrent neural networks to effectively capture the long-term temporal correlation of data [35], [36].”
BackgroundNeural Language Generation: Formulation, Methods, and Evaluation
Gârbacea, C., & Mei, Q. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2007.15780 · Cited by 24
Neural Approaches to Conversational AI
Gao, J., Galley, M., & Li, L. (2019) · Foundations and Trends® in Information Retrieval · doi:10.1561/1500000074 · Cited by 209
Computational Language Modeling and the Promise of In Silico Experimentation
Jain, S., Vo, V. A., Wehbe, L., & Huth, A. G. (2024) · Neurobiology of Language · doi:10.1162/nol_a_00101 · Cited by 75
“For example, in the in silico semantic composition experiment, Jain and Huth (2023) found that the lower layers of the neural language model were generally indifferent to ablating words farther in the past (Khandelwal et al., 2018).”
BackgroundExamining the Limits of Predictability of Human Mobility
Kulkarni, V., Mahalunkar, A., Garbinato, B., & Kelleher, J. D. (2019) · Entropy · doi:10.3390/e21040432 · Cited by 52
How Furiously Can Colorless Green Ideas Sleep? Sentence Acceptability in Context
Lau, J. H., Armendariz, C. S., Lappin, S., Purver, M., & Shu, C. (2020) · Transactions of the Association for Computational Linguistics · doi:10.1162/tacl_a_00315 · Cited by 65
Do Long-Range Language Models Actually Use Long-Range Context?
Sun, S., Krishna, K., Mattarella-Micke, A., & Iyyer, M. (2021) · Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/2021.emnlp-main.62 · Cited by 43
“In this paper, we conduct a series of fine-grained analysis experiments to answer these questions, several of which are inspired by the context analysis of LSTM LMs conducted by Khandelwal et al. (2018).”
BackgroundMethodInfluentialHutchins, D., Schlag, I., Wu, Y., Dyer, E., & Neyshabur, B. (2022) · arXiv · doi:10.48550/arxiv.2203.07852 · Cited by 43
“In practice, this means that LSTMs struggle to send a clear signal over more than a few hundred tokens, far less than the typical size of the attention window in a transformer [3].”
BackgroundCan LSTM Learn to Capture Agreement? The Case of Basque
Ravfogel, S., Goldberg, Y., & Tyers, F. M. (2018) · BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP (BlackboxNLP) · doi:10.18653/v1/w18-5412 · Cited by 50
“RNNs were shown to be able to capture longterm dependencies and statistical regularities in input sequences (Karpathy et al., 2015; Linzen et al., 2016; Shi et al., 2016; Jurafsky et al., 2018; Gulordava et al., 2018).”
BackgroundSelf-attention-based time-variant neural networks for multi-step time series forecasting
Gao, C., Zhang, N., Li, Y., Bian, F., & Wan, H. (2022) · Neural Computing and Applications · doi:10.1007/s00521-021-06871-1 · Cited by 44
“As an example, [10] indicated that the effective context size of the language model using LSTM was about 200 tokens on average, but can only clearly distinguish 50 tokens nearby, showing that even LSTM was difficult to capture long-term dependencies.”
MethodDynamic Global Memory for Document-level Argument Extraction
Du, X., Li, S., & Ji, H. (2022) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2022.acl-long.361 · Cited by 56
“, 2021) and ignores the global context partially because of the pretrained models’ length limit and their lack of attention for distant context (Khandelwal et al., 2018).”
Background100th Anniversary of Macromolecular Science Viewpoint: Data-Driven Protein Design
Ferguson, A. L., & Ranganathan, R. (2021) · ACS Macro Letters · doi:10.1021/acsmacrolett.0c00885 · Cited by 43
SCROLLS: Standardized CompaRison Over Long Language Sequences
Shaham, U., Segal, E., Ivgi, M., Efrat, A., Yoran, O., Haviv, A., Gupta, A., Xiong, W., Geva, M., Berant, J., et al. (2022) · Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/2022.emnlp-main.823 · Cited by 40
On the Blind Spots of Model-Based Evaluation Metrics for Text Generation
He, T., Zhang, J., Wang, T., Kumar, S., Cho, K., Glass, J. R., & Tsvetkov, Y. (2023) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2023.acl-long.674 · Cited by 85
Studying the Inductive Biases of RNNs with Synthetic Variations of Natural Languages
Ravfogel, S., Goldberg, Y., & Linzen, T. (2019) · Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) · doi:10.18653/v1/n19-1356 · Cited by 39
“These findings align with the results of Khandelwal et al. (2018), who demonstrated that RNN language models are more sensitive to perturbations in recent input words compared with perturbations to more distant parts of the input.”
ResultYu, D., Choi, W., Kim, M., & Liu, L. (2020) · Energies · doi:10.3390/en13154017 · Cited by 44
“Since the elevation angle of the sun is calculated by the formula in [35], we can use the future elevation angle of the sun without forecasting.”
MethodHe, H. W., & Choi, J. D. (2019) · arXiv (Cornell University) · doi:10.48550/arxiv.1908.04943 · Cited by 52
“45 Ling et al. (2015) 97.”
BackgroundSelf-citationairBP: Monitor Your Blood Pressure with Millimeter-Wave in the Air
Liang, Y., Zhou, A., Wen, X., Huang, W., Shi, P., Pu, L., Zhang, H., & Ma, H. (2023) · ACM Transactions on Internet of Things · doi:10.1145/3614439 · Cited by 41
“For the seek of BP estimation, we ind the widely-used BLSTM [21, 47] fails to capture long-term dependencies [51].”
BackgroundMethodSimple, Fast, Accurate Intent Classification and Slot Labeling for Goal-Oriented Dialogue Systems
Gupta, A., Hewitt, J., & Kirchhoff, K. (2019) · Annual Meeting of the Special Interest Group on Discourse and Dialogue · doi:10.18653/v1/w19-5906 · Cited by 49
“Given the generally small datasets in IC+SL, we use the following relative position function, which buckets relative positions together in exponentially larger groups as distance increases, following the results of Khandelwal et al. (2018), that LSTMs represent position fuzzily at long relative distances.”
Application of large language models to intelligently analyze long construction contract texts
Gao, Y., Gan, Y., Chen, Y., & Chen, Y. (2024) · Construction Management and Economics · doi:10.1080/01446193.2024.2415676 · Cited by 42
“When the length of a contract exceeds the context length of LLM, the model’s performance significantly declines, failing to effectively respond to the needs of practitioners (Khandelwal et al .”
Exposing Attention Glitches with Flip-Flop Language Modeling
Liu, B., Ash, J. T., Goel, S., Krishnamurthy, A., & Zhang, C. (2023) · neural information processing systems · doi:10.52202/075280-1112 · Cited by 84
Using ChatGPT to annotate a dataset: A case study in intelligent tutoring systems
Vujinović, A., Luburić, N., Сливка, Ј., & Kovačević, A. (2024) · Machine Learning with Applications · doi:10.1016/j.mlwa.2024.100557 · Cited by 45
DreamLoc: A Deep Relevance Matching-Based Framework for bug Localization
Qi, B., Sun, H., Yuan, W., Zhang, H., & Meng, X. (2021) · IEEE Transactions on Reliability · doi:10.1109/tr.2021.3104728 · Cited by 47
Guiding Extractive Summarization with Question-Answering Rewards
Arumae, K., & Liu, F. (2019) · Proceedings of the 2019 Conference of the North · doi:10.18653/v1/n19-1264 · Cited by 36
“A recent study by Khandelwal et al. (2018) reported that the recurrent networks are capable of memorizing a recent context of about 20 tokens and the model is highly sensitive to word order, whereas this is less the case for CNN whose max-pooling operation makes it agnostic to word order.”
BackgroundMalibari, N., Katib, I. A., & Mehmood, R. (2021) · International Journal of Advanced Computer Science and Applications · doi:10.14569/ijacsa.2021.01212106 · Cited by 46
“However, according to [21], LSTM has an adequate context size of 200 tokens on average, but they are only able to distinguish 50 tokens within a context, suggesting that even it is incapable of capturing long-term trends.”
BackgroundEffective Low-Cost Time-Domain Audio Separation Using Globally Attentive Locally Recurrent Networks
Lam, M. W. Y., Wang, J., Su, D., & Yu, D. (2021) · IEEE Spoken Language Technology Workshop (SLT) · doi:10.1109/slt48900.2021.9383464 · Cited by 39
“RNNs are also limited by its nature of recursively processing and memorizing context [23, 24, 25].”
BackgroundHessel, J., & Schofield, A. (2021) · doi:10.18653/v1/2021.acl-short.27 · Cited by 60
“Khandelwal et al. (2018) show that shuffling distant context words (e.g., beyond 50 tokens) has little effect in outcome for LM-LSTMs.”
BackgroundLanguage Through a Prism: A Spectral Approach for Multiscale Language RepresentationsPreprint
Tamkin, A., Jurafsky, D., & Goodman, N. D. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2011.04823 · Cited by 80
“Other work conducts analytic studies of models that illuminate their scale-awareness, including the sensitivity of LSTM language models to relationships at different scales [58] and the attention patterns of Transformer models [59].”
BackgroundSelf-citationLi, Y., Zeng, X., & Shi, Y. (2023) · Optics & Laser Technology · doi:10.1016/j.optlastec.2023.109658 · Cited by 35
Trajectory-User Linking via Hierarchical Spatio-Temporal Attention Networks
Chen, W., Huang, C., Yu, Y., Jiang, Y., & Dong, J. (2023) · ACM Transactions on Knowledge Discovery from Data · doi:10.1145/3635718 · Cited by 42
“Second, existing methods generally rely on the recurrent neural frameworks to model trajectory sequence, and thus can hardly capture the long-term dependencies among the long sequence mobility traces [14].”
MethodMohammadi, E., Stokholm-Bjerregaard, M., Hansen, A. A., Nielsen, P. H., Ortíz-Arroyo, D., & Durdevic, P. (2024) · Engineering Applications of Artificial Intelligence · doi:10.1016/j.engappai.2024.107992 · Cited by 34
“Despite the power of LSTM in time series forecasting, it sometimes has trouble capturing long-term dependencies, for example, in language modeling [81], and the model cannot be parallelized.”
BackgroundHoltzman, A., West, P., & Zettlemoyer, L. (2025) · Journal of Social Computing · doi:10.23919/jsc.2025.0009 · Cited by 38
Metadata
- Authors
- Khandelwal, U., He, H., Qi, P., & Jurafsky, D.
- Affiliations
- Stanford University (US)
- Venue
- Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
- Published
- 2018
- Pages
- 284-294
- ISSN
- 0736-587X (ISSN-L)
- OpenAlex
- W2963951265
- Cited by
- 303
- References
- 34
- Citations by year
- 2026: 9 · 2025: 9 · 2024: 24 · 2023: 42 · 2022: 43 · 2021: 56 · 2020: 48 · 2019: 57 · 2018: 15
- FWCI
- 17.96
- Type
- conference paper
- Language
- en
- Open access
- hybrid
- doi.org
- Licence
- cc-by
- Locations
- Proceedings of the conference - Association for Computational Linguistics. Meeting (publishedVersion, cc-by)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Funders
- National Science Foundation (1514268)
- Defense Advanced Research Projects Agency
- Army Research Office
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Physical Sciences › Computer Science › Artificial Intelligence › Speech Recognition and Synthesis
- Keywords
- neural language models, long-range context, LSTM, context length, perplexity, semantic field, topic modeling, ablation study, Penn Treebank, WikiText-2
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.