arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.20147cs.SE
收藏

并非所有标记都重要:面向高效代码摘要的数据导向优化

Not All Tokens Matter: Data-Centric Optimization for Efficient Code Summarization

William & Mary(威廉玛丽学院);Dalhousie University(达尔豪斯大学);Eindhoven University of Technology(埃因霍温理工大学);University of Sannio(桑尼奥大学)

Saima Afrin, Zaiyu Cheng, Tushar Sharma, Alexander Serebrenik, Massimiliano Di Penta, Antonio Mastropaolo

AI总结:

本研究探讨了系统提示对代码生成任务中ILMs和CLMs性能的影响,发现模型规模越大影响越显著,少样本提示效果优于零样本提示,且Java对提示变化更敏感。

摘要:

经过指令微调的语言模型ILMs已成为现代人工智能系统的重要组成部分,在各种自然语言和推理任务中表现出卓越的通用性。其中最具有影响力的应用是代码生成,其中ILMs--通常称为代码语言模型CLMs--展示了显著的能力。这种优势源于其定义特征:在微调过程中使用显式的任务指令,使它们能够通过将人类意图转化为可执行代码来连接自然语言和代码。尽管许多进展源于扩展定律和训练方法的进步,但一个关键方面仍被忽视--系统提示对通用ILMs和专用CLMs在代码生成任务中性能的影响。在本研究中,我们首次尝试弥合这一差距,通过系统评估不同详细程度的系统提示、模型规模、提示策略和编程语言如何影响ILMs和CLMs在代码生成任务中的表现。我们的评估框架覆盖了120种模型配置,揭示了以下发现:(1)系统提示的影响随着模型规模的增加而增加;(2)少样本提示相比零样本提示减少了这种影响;(3)编程语言起作用,Java对系统提示的变化比Python更敏感。

英文摘要:

The rapid advancement of Large Language Models (LLMs) has revolutionized software engineering automation, particularly in automated code summarization, which enhances program comprehension and supports development activities. However, training LLMs for code summarization remains computationally expensive, with performance deteriorating on longer inputs-challenges that intensify when handling millions of code-comment pairs. We investigate strategic data optimization through targeted token reduction to minimize computational overhead while maintaining summary quality. We compare three token-level reduction techniques-(i) Abstract Syntax Tree (AST) representations, (ii) Function Signatures, and (iii) CrystalBLEU-guided pruning-combined with semantic filtering, evaluating them on Java and Python in standalone and cascaded reduction settings. Our findings reveal highly language-dependent optimal strategies: AST-based optimization achieves 37% performance improvements in Java with 56-73% token reduction but shows up to 49% degradation in Python. Conversely, Function Signatures perform poorly in Java but optimally in Python, achieving 83% token reduction while maintaining quality. CrystalBLEU demonstrates cross-language robustness with 60-72% reduction. These results challenge assumptions about cross-language transferability, demonstrating that which tokens are kept matters more than how many are removed, making language-aware token curation essential for efficient code summarization.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑