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.


翻译:暂无翻译

0
下载
关闭预览

相关内容

174页!《大语言模型》最新综述:能力与局限性分析
专知会员服务
65+阅读 · 2025年1月12日
大型语言模型的知识蒸馏综述:方法、评估与应用
专知会员服务
81+阅读 · 2024年7月4日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
自然语言处理(NLP)知识结构总结
AI100
51+阅读 · 2018年8月17日
Word2Vec 与 GloVe 技术浅析与对比
LibRec智能推荐
25+阅读 · 2017年5月15日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
12+阅读 · 2015年7月1日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
VIP会员
相关主题
最新内容
美国战争部在GenAI.mil上推出OpenAI的ChatGPT Mil
专知会员服务
2+阅读 · 今天15:16
人工智能赋能军事维护:重新定义国防战备
专知会员服务
0+阅读 · 今天15:00
《美陆军野战手册(2026年):特种部队》
专知会员服务
2+阅读 · 今天14:17
受限仓库多智能体取送中的动态安全等待点选择
《国防技术管理》印度智库报告最新45页
专知会员服务
5+阅读 · 8月28日
《美陆军最新条令:保障行动》
专知会员服务
5+阅读 · 8月28日
算法战场:人工智能如何重新定义军事力量
专知会员服务
8+阅读 · 8月28日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员