Skip to main content
CenXiv.org
此网站处于试运行阶段,支持我们!
我们衷心感谢所有贡献者的支持。
贡献
赞助
cenxiv logo > cs > arXiv:2507.14423

帮助 | 高级搜索

计算机科学 > 软件工程

arXiv:2507.14423 (cs)
[提交于 2025年7月19日 ]

标题: 预训练模型中令牌合并的影响

标题: On the Effect of Token Merging on Pre-trained Models for Code

Authors:Mootez Saad, Hao Li, Tushar Sharma, Ahmed E. Hassan
摘要: 分词是代码语言模型的基本组成部分。 它涉及将输入分解为单元,这些单元随后传递给语言模型堆栈,以学习在各种上下文中使用的高维表示,从分类到生成。 然而,这些分词器的输出通常比传统编译器和解释器中使用的更长。 这可能导致不希望的效果,例如增加计算开销。 在本工作中,我们研究了合并属于同一语义单元的子标记的隐藏表示的影响,例如形成单个标识符的子标记。 我们提出了两种策略:一种基于对表示进行平均,另一种则利用基于学习的方法。 这两种方法都可以无缝集成到现有的代码语言模型中。 我们使用六种代码语言模型进行了实验:CodeBERT、GraphCodeBERT、UniXCoder、CdoeT5、CodeT5+(220M)和CodeT5+(770M),在三个软件工程任务中进行:漏洞检测、代码分类和代码翻译。 结果表明,这些策略可以将浮点运算次数减少$1\%$到$19\%$。 关于下游性能,最显著的退化出现在漏洞检测任务中,与基线相比,F1分数下降了$1.82$个百分点。 相比之下,在代码翻译中,CodeBLEU提高了$2.47$个百分点。 这项工作有助于在多个维度上改进代码语言模型的广泛努力,包括计算效率和下游性能。
摘要: Tokenization is a fundamental component of language models for code. It involves breaking down the input into units that are later passed to the language model stack to learn high-dimensional representations used in various contexts, from classification to generation. However, the output of these tokenizers is often longer than that traditionally used in compilers and interpreters. This could result in undesirable effects, such as increased computational overhead. In this work, we investigate the effect of merging the hidden representations of subtokens that belong to the same semantic unit, such as subtokens that form a single identifier. We propose two strategies: one based on averaging the representations and another that leverages a learning-based approach. Both methods can be seamlessly integrated with existing language models for code. We conduct experiments using six language models for code: CodeBERT, GraphCodeBERT, UniXCoder, CdoeT5, CodeT5+ (220M), and CodeT5+ (770M), across three software engineering tasks: vulnerability detection, code classification, and code translation. Results show that these strategies can reduce the number of floating-point operations by $1\%$ to $19\%$. Regarding downstream performance, the most significant degradation was observed in the vulnerability detection task, where the F1 score decreased by $1.82$ points compared to the baseline. In contrast, for code translation, we observed an improvement of $2.47$ points in CodeBLEU. This work contributes to the broader effort of improving language models for code across multiple dimensions, including both computational efficiency and downstream performance.
主题: 软件工程 (cs.SE)
引用方式: arXiv:2507.14423 [cs.SE]
  (或者 arXiv:2507.14423v1 [cs.SE] 对于此版本)
  https://doi.org/10.48550/arXiv.2507.14423
通过 DataCite 发表的 arXiv DOI(待注册)

提交历史

来自: Mootez Saad [查看电子邮件]
[v1] 星期六, 2025 年 7 月 19 日 00:48:20 UTC (383 KB)
全文链接:

获取论文:

    查看标题为《》的 PDF
  • 查看中文 PDF
  • 查看 PDF
  • HTML(实验性)
  • TeX 源代码
  • 其他格式
许可图标 查看许可
当前浏览上下文:
cs.SE
< 上一篇   |   下一篇 >
新的 | 最近的 | 2025-07
切换浏览方式为:
cs

参考文献与引用

  • NASA ADS
  • 谷歌学术搜索
  • 语义学者
a 导出 BibTeX 引用 加载中...

BibTeX 格式的引用

×
数据由提供:

收藏

BibSonomy logo Reddit logo

文献和引用工具

文献资源探索 (什么是资源探索?)
连接的论文 (什么是连接的论文?)
Litmaps (什么是 Litmaps?)
scite 智能引用 (什么是智能引用?)

与本文相关的代码,数据和媒体

alphaXiv (什么是 alphaXiv?)
CatalyzeX 代码查找器 (什么是 CatalyzeX?)
DagsHub (什么是 DagsHub?)
Gotit.pub (什么是 GotitPub?)
Hugging Face (什么是 Huggingface?)
带有代码的论文 (什么是带有代码的论文?)
ScienceCast (什么是 ScienceCast?)

演示

复制 (什么是复制?)
Hugging Face Spaces (什么是 Spaces?)
TXYZ.AI (什么是 TXYZ.AI?)

推荐器和搜索工具

影响之花 (什么是影响之花?)
核心推荐器 (什么是核心?)
IArxiv 推荐器 (什么是 IArxiv?)
  • 作者
  • 地点
  • 机构
  • 主题

arXivLabs:与社区合作伙伴的实验项目

arXivLabs 是一个框架,允许合作伙伴直接在我们的网站上开发和分享新的 arXiv 特性。

与 arXivLabs 合作的个人和组织都接受了我们的价值观,即开放、社区、卓越和用户数据隐私。arXiv 承诺这些价值观,并且只与遵守这些价值观的合作伙伴合作。

有一个为 arXiv 社区增加价值的项目想法吗? 了解更多关于 arXivLabs 的信息.

这篇论文的哪些作者是支持者? | 禁用 MathJax (什么是 MathJax?)
  • 关于
  • 帮助
  • contact arXivClick here to contact arXiv 联系
  • 订阅 arXiv 邮件列表点击这里订阅 订阅
  • 版权
  • 隐私政策
  • 网络无障碍帮助
  • arXiv 运营状态
    通过...获取状态通知 email 或者 slack

京ICP备2025123034号