mlsanityData to 14 Oct 2026

Sense and Sensitivity: Examining the Influence of Semantic Recall on Long Context Code Understanding

arXiv 2505.13353 ↗First posted 19 May 2025cs.CL cs.LG cs.SEcited by 2

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) are increasingly deployed for understanding large codebases, but whether they understand operational semantics of long code context or rely on pattern matching shortcuts remains unclear. We distinguish between lexical recall (retrieving code verbatim) and semantic recall (understanding operational semantics). Evaluating 10 state-of-the-art LLMs, we find that while frontier models achieve near-perfect, position-independent lexical recall, semantic recall degrades severely when code is centrally positioned in long contexts. We introduce semantic recall sensitivity to measure whether tasks require understanding of code's operational semantics vs. permit pattern matching shortcuts. Through a novel counterfactual measurement method, we show that models rely heavily on pattern matching shortcuts to solve existing code understanding benchmarks. We propose a new task SemTrace, which achieves high semantic recall sensitivity through unpredictable operations; LLMs' accuracy exhibits severe positional effects, with median accuracy drops of 92.73% versus CRUXEval's 53.36% as the relevant code snippet approaches the middle of the input code context. Our findings suggest current evaluations substantially underestimate semantic recall failures in long context code understanding.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 30 of its 50 references that are in the map. First posted on arXiv 19 May 2025.

Builds on

30 of 50 references.

References · 30

  1. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
  2. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  3. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
  4. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  5. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  6. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  7. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
  8. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  9. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
  10. 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
  11. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
  12. 2024LongBench v2: Towards Deeper Understanding and Reasoning on Realistic Long-context Multitaskscited by 379
18 more
  1. 2024∞Bench: Extending Long Context Evaluation Beyond 100K Tokenscited by 367
  2. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 353
  3. 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 300
  4. 2023Reasoning or Reciting? Exploring the Capabilities and Limitations of Language Models Through Counterfactual Taskscited by 246
  5. 2024BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystackcited by 215
  6. 2023ZeroSCROLLS: A Zero-Shot Benchmark for Long Text Understandingcited by 176
  7. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
  8. 2025NoLiMa: Long-Context Evaluation Beyond Literal Matchingcited by 126
  9. 2023Speak, Memory: An Archaeology of Books Known to ChatGPT/GPT-4cited by 125
  10. 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 112
  11. 2025MATH-Perturb: Benchmarking LLMs' Math Reasoning Abilities against Hard Perturbationscited by 89
  12. 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encodingcited by 72
  13. 2025On the Emergence of Position Bias in Transformerscited by 59
  14. 2024Insights into LLM Long-Context Failures: When Transformers Know but Don't Tellcited by 36
  15. 2024RepoQA: Evaluating Long Context Code Understandingcited by 35
  16. 2024CRUXEval-X: A Benchmark for Multilingual Code Reasoning, Understanding and Executioncited by 31
  17. 2025Rethinking Invariance in In-context Learningcited by 8
  18. 2025Evaluating the Generalization Capabilities of Large Language Models on Code Reasoningcited by 7

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 2.

2 papers.