paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Inside Out: Uncovering How Comment Internalization Steers LLMs for Better or Worse

由内而外:揭示注释内化如何左右大语言模型的性能表现
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 3/10 · 论文研究 LLM 对代码注释的概念级可解释性及其对代码补全/翻译/精化性能的影响,属于 LLM 与软件工程交叉,但未涉及静态分析、Agentic 程序、浮点或贝叶斯程序分析等用户核心方向。其将注释作为潜在概念进行干预的发现可能对理解 LLM 代码任务有间接参考,但与该研究画像主线匹配度低。引用 0 inbox
Aaron Imani, Mohammad Moshirpour, Iftekhar Ahmed
crossref: 2026-09-12

AI 速览

一句话:首个面向软件工程的LLM概念级可解释性研究,揭示注释被内化为可区分的潜在概念并显著影响任务性能。

注释是源代码中的非功能元素,但大语言模型(LLM)在软件工程(SE)任务中常依赖它们,而这种依赖位于模型何处、如何影响性能仍不清楚。本文提出首个面向SE的LLM概念级可解释性研究,以内部注释表示为切入点分析代码补全、翻译与精化三项任务。作者使用概念激活向量(CAV)表明,LLM不仅将注释内化为独立的潜在概念,还能区分Javadoc、行内与多行注释等子类型。通过在嵌入空间中系统性地激活与停用这些概念,观察到性能出现显著、模型相关且任务相关的变化,幅度从-90%到+67%。此外,作者用同一组代码输入开展受控实验,让LLM执行10种不同的SE任务并测量其潜在表示中注释概念的激活程度,发现代码摘要始终触发最强的注释概念激活,而代码补全的敏感度最低。该结果为构建基于内部概念表示而非仅依赖表层输入的SE工具与模型开辟了新方向。

问题
注释虽为代码的非功能元素,LLM却在SE任务中依赖它们,但模型内部这种依赖的位置与对性能的影响尚缺乏理解。
方法
使用概念激活向量(CAV)识别LLM嵌入空间中的注释概念及其子类型,并通过系统性地激活与停用这些概念来观测性能变化,再对10种SE任务测量注释概念的激活强度。
评估
在代码补全、翻译与精化三项任务上测得-90%至+67%的模型相关、任务相关性能波动;受控实验显示代码摘要触发最强注释概念激活,代码补全最弱。
原文摘要(Abstract)

While comments are non-functional elements of source code, Large Language Models (LLM) frequently rely on them to perform Software Engineering (SE) tasks. Yet, where in the model this reliance resides, and how it affects performance, remains poorly understood. We present the first concept-level interpretability study of LLMs in SE, analyzing three tasks - code completion, translation, and refinement - through the lens of internal comment representation. Using Concept Activation Vectors (CAV), we show that LLMs not only internalize comments as distinct latent concepts but also differentiate between subtypes such as Javadocs, inline, and multiline comments. By systematically activating and deactivating these concepts in the LLMs’ embedding space, we observed significant, model-specific, and task-dependent shifts in performance ranging from -90% to +67%. Finally, we conducted a controlled experiment using the same set of code inputs, prompting LLMs to perform 10 distinct SE tasks while measuring the activation of the comment concept within their latent representations. We found that code summarization consistently triggered the strongest activation of comment concepts, whereas code completion elicited the weakest sensitivity. These results open a new direction for building SE tools and models that reason about and manipulate internal concept representations rather than relying solely on surface-level input.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11586,
  title = {Inside Out: Uncovering How Comment Internalization Steers LLMs for Better or Worse},
  author = {Aaron Imani and Mohammad Moshirpour and Iftekhar Ahmed},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3787776}
}