一句话:提出 CodeQ 框架,将 token 级归因聚合映射为高层编程类别,为代码大模型提供全局可解释性。
论文指出,面向代码的大语言模型(LM4Code)正深度融入软件工程,但准确率指标掩盖了模型的推理过程,现有的事后可解释方法又多局限于 token 级的局部解释,开发者难以据此形成全局理解。为此,作者提出 code rationales(CodeQ)框架:把 token 级 rationale 映射到高层编程类别(如语法、语义、结构线索),并聚合成千上万条解释以进行统计分析,从而揭示模型系统性的推理偏好。评估表明,这种聚合能从含噪的 token 数据中提炼出清晰信号,将解释不确定性(Shannon 熵)降低 50% 以上;同时发现代码生成模型 codeparrot-small 一贯偏好缩进等浅层句法线索而非深层语义逻辑。此外,37 人用户研究显示,该模型的推理与人类开发者显著不一致——这些现象在传统指标下完全不可见,说明全局可解释性对建立对 LM4Code 的信任至关重要。
As Large Language Models for Code (LM4Code) become integral to software engineering, establishing trust in their output becomes critical. However, standard accuracy metrics obscure the underlying reasoning of generative models, offering little insight into how decisions are made. Although post-hoc interpretability methods attempt to fill this gap, they often restrict explanations to local, token-level insights, which fail to provide a developer-understandable global analysis. Our work highlights the urgent need for global, code-based explanations that reveal how models reason across code. To support this vision, we introduce code rationales (Code\(\mathbb {Q}\)), a framework that enables global interpretability by mapping token-level rationales to high-level programming categories. Aggregating thousands of these token-level explanations allows us to perform statistical analyses that expose systemic reasoning behaviors. We validate this aggregation by showing it distills a clear signal from noisy token data, reducing explanation uncertainty (Shannon entropy) by over 50%. Additionally, we find that a code generation model (codeparrot-small) consistently favors shallow syntactic cues (e.g., indentation) over deeper semantic logic. Furthermore, in a user study with 37 participants, we find its reasoning is significantly misaligned with that of human developers. These findings, hidden from traditional metrics, demonstrate the importance of global interpretability techniques to foster trust in LM4Code.
@inproceedings{paperbot11887,
title = {Enabling Global, Human-Centered Explanations for LLMs: From Tokens to Interpretable Code and Test Generation},
author = {Dipin Khati and Daniel Rodriguez-Cardenas and David N. Palacio and Alejandro Velasco and Michele Tufano and Denys Poshyvanyk},
booktitle = {ICSE},
year = {2026},
doi = {10.1145/3744916.3787764}
}