跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 软件工程

arXiv:2510.02917 (cs)
[提交于 2025年10月3日]

标题:Mechanistic Interpretability of Code Correctness in LLMs via Sparse Autoencoders

作者:Kriz Tahimic, Charibeth Cheng
查看论文《Mechanistic Interpretability of Code Correctness in LLMs via Sparse Autoencoders》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:As Large Language Models become integral to software development, with substantial portions of AI-suggested code entering production, understanding their internal correctness mechanisms becomes critical for safe deployment. We apply sparse autoencoders to decompose LLM representations, identifying directions that correspond to code correctness. We select predictor directions using t-statistics and steering directions through separation scores from base model representations, then analyze their mechanistic properties through steering, attention analysis, and weight orthogonalization. We find that code correctness directions in LLMs reliably predict incorrect code, while correction capabilities, though statistically significant, involve tradeoffs between fixing errors and preserving correct code. Mechanistically, successful code generation depends on attending to test cases rather than problem descriptions. Moreover, directions identified in base models retain their effectiveness after instruction-tuning, suggesting code correctness mechanisms learned during pre-training are repurposed during fine-tuning. Our mechanistic insights suggest three practical applications: prompting strategies should prioritize test examples over elaborate problem descriptions, predictor directions can serve as error alarms for developer review, and these same predictors can guide selective steering, intervening only when errors are anticipated to prevent the code corruption from constant steering.
主题: 软件工程 (cs.SE); 机器学习 (cs.LG)
引用方式: arXiv:2510.02917 [cs.SE]
  (或者 arXiv:2510.02917v1 [cs.SE] 对于此版本)
  https://doi.org/10.48550/arXiv.2510.02917

提交历史

来自:Kriz Tahimic
[v1] 2025年10月3日 星期五 11:44:21 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.SE
< 上一篇   |   下一篇 >
最新 | 近期 | 2025-10
切换浏览方式为:
cs
cs.LG

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站