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

MoSE:分层自蒸馏增强早期层嵌入

MoSE: Hierarchical Self-Distillation Enhances Early Layer Embeddings

Apple(苹果公司)

Andrea Gurioli, Federico Pennino, João Monteiro, Maurizio Gabbrielli

AI总结:

MoSE通过自蒸馏机制增强早期层嵌入,实现代码检索与分类任务中的性能与准确性的平衡。

摘要:

部署语言模型往往需要在准确性和性能之间进行权衡,以满足延迟约束的同时保持实用性。传统模型蒸馏通过训练单独的模型来减少规模,但会带来显著的成本。我们引入了ModularStarEncoder(MoSE),这是一种具有十亿参数的多出口编码器,用于代码检索和分类,采用了新颖的自蒸馏机制。该方法显著增强了底层表示,使不同模型部分的灵活部署具有有利的性能权衡。我们的架构通过将特定编码器层作为退出头来改进文本到代码和代码到代码搜索,在训练过程中较高层指导较早层,从而在最小的额外成本下提高中间表示。我们进一步通过代码翻译创建了一个新的数据集,该数据集通过跨语言代码到代码对扩展了文本到代码基准。评估显示,自蒸馏作为一种系统的方法,在各种代码理解任务中通过牺牲推理成本来换取准确性是有效的。

英文摘要:

Deploying language models often requires navigating accuracy vs. performance trade-offs to meet latency constraints while preserving utility. Traditional model distillation reduces size but incurs substantial costs through training separate models. We introduce ModularStarEncoder (MoSE), a 1-billion-parameter multi-exit encoder for code retrieval and classification that employs a novel Self-Distillation mechanism. This approach significantly enhances lower-layer representations, enabling flexible deployment of different model portions with favorable performance trade-offs. Our architecture improves text-to-code and code-to-code search by targeting specific encoder layers as exit heads, where higher layers guide earlier ones during training, thereby improving intermediate representations at minimal additional cost. We further enhance MoSE with a repository-level contextual loss that maximizes training context window utilization. Additionally, we release a new dataset created through code translation that extends text-to-code benchmarks with cross-language code-to-code pairs. Evaluations demonstrate the effectiveness of Self-Distillation as a principled approach to trading inference cost for accuracy across various code understanding tasks.

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

↑