paperbot · PL 论文追踪

全部论文 待读 收藏

P2 How Effectively Do Code Language Models Understand Poor-Readability Code?

代码语言模型对低可读性代码的理解效果如何?
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 3/10 · 论文研究代码语言模型在低可读性代码上的摘要鲁棒性,并发布代码摘要评测基准,属于代码LLM评测方向,与用户关注的静态分析、Agentic程序、形式化验证、浮点/贝叶斯程序分析及其与LLM交叉的核心问题关联较弱。其研究目标本身是评估LLM能力而非用LLM/Agent改进程序分析,因此匹配度较低。引用 5 inbox
Chao Hu, Yitian Chai, Hao Zhou, Fandong Meng, Jie Zhou, Xiaodong Gu
crossref: 2026-09-12

AI 速览

一句话:揭示代码摘要模型对低可读性代码脆弱,并发布考虑可读性差异的评测基准 PoorCodeSumEval。

现有代码理解基准几乎都由高可读性代码构成,无法反映真实世界中大量低可读性代码,因而难以衡量模型对可读性变化的鲁棒性。本文系统分析了代码摘要模型在不同可读性代码上的表现,构建了七个由现有基准经混淆得到的数据集。结果显示,当前摘要模型对低可读性代码十分脆弱,其性能主要依赖代码中的语义线索,常常忽略句法信息;而现有基准偏向评估语义特征,因而掩盖了模型理解非敏感句法特征的能力。基于这些发现,作者提出 PoorCodeSumEval,将可读性引入测试过程,同时覆盖语义混淆、句法混淆及二者的交叉混淆,为代码摘要模型提供更全面严格的评测。文章还给出构建多可读性基准、可读性感知指标以及代码数据自动清洗与规范化等未来研究方向。

问题
现有代码理解基准局限于高可读性代码,无法评估代码摘要模型面对不同可读性(尤其是低可读性)代码时的鲁棒性。
方法
从现有基准派生七个混淆数据集,系统评测代码摘要模型对不同可读性代码的表现,并提出引入语义、句法及交叉混淆的评测基准 PoorCodeSumEval。
评估
在七个混淆数据集上评测现有代码摘要模型,发现其性能主要依赖语义线索、忽视句法方面,对低可读性代码普遍脆弱。
原文摘要(Abstract)

Code language models such as CodeT5 and CodeLlama have demonstrated substantial achievement in code comprehension. While the majority of research efforts have focused on improving model architectures and training processes, we find that the current benchmarks used for evaluating code comprehension models are confined to high-readability code, regardless of the popularity of low-readability code in reality. As such, they are inadequate to demonstrate the full spectrum of the model's ability, particularly the robustness to varying readability degrees. In this paper, we analyze the robustness of code summarization models to code with varying readability, including seven obfuscated datasets derived from existing benchmarks. Our findings indicate that current code summarization models are vulnerable to code with poor readability. In particular, their performance predominantly depends on semantic cues within the code, often neglecting the syntactic aspects. Existing benchmarks are biased toward evaluating semantic features, thereby overlooking the models' ability to understand nonsensitive syntactic features. Based on the findings, we present Poor-CodeSumEval, a new evaluation benchmark on code summarization tasks. PoorCodeSumEval innovatively introduces readability into the testing process, considering semantic, syntactic, and their cross-obfuscation, thereby providing a more comprehensive and rigorous evaluation of code summarization models. Our studies also provide more insightful suggestions for future research, such as constructing multi-readability benchmarks to evaluate the robustness of models on poor-readability code, proposing readability-awareness metrics, and automatic methods for code data cleaning and normalization.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8442,
  title = {How Effectively Do Code Language Models Understand Poor-Readability Code?},
  author = {Chao Hu and Yitian Chai and Hao Zhou and Fandong Meng and Jie Zhou and Xiaodong Gu},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695072}
}