Large Language Models (LLMs) have demonstrated exceptional code generation capabilities, yet their token-level mechanisms remain underexplored, particularly in compressed models. Through systematic analysis of programming language token representations, we characterize how programming languages are encoded in LLM tokenizers by analyzing their vocabulary distribution and keyword coverage patterns. We introduce a novel cold-start probability analysis method that provides insights into model behavior without requiring explicit prompts. Additionally, we present a comprehensive evaluation of how different model optimization techniques - including quantization, distillation, model scaling, and task-specific fine-tuning - affect token-level representations and code generation quality. Our experiments, supported by comprehensive probability distribution analysis and evaluation metrics, reveal critical insights into token-level behavior and provide empirically-validated guidelines for maintaining code generation quality under various optimization constraints. These findings advance both theoretical understanding of LLM code generation and practical implementation of optimized models in production environments.


翻译:大型语言模型(LLM)已展现出卓越的代码生成能力,但其标记层面的工作机制仍未得到充分探索,尤其是在压缩模型中。通过对编程语言标记表示的系统性分析,我们通过分析词汇分布与关键词覆盖模式,刻画了编程语言在LLM分词器中的编码方式。我们提出了一种新颖的冷启动概率分析方法,该方法无需显式提示即可洞察模型行为。此外,我们对不同模型优化技术——包括量化、蒸馏、模型缩放和任务特定微调——如何影响标记级表示及代码生成质量进行了全面评估。基于综合概率分布分析和评估指标的实验,揭示了标记级行为的关键洞见,并为在各种优化约束下保持代码生成质量提供了经验验证的指导原则。这些发现不仅推进了对LLM代码生成的理论理解,也为生产环境中优化模型的实践部署提供了依据。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
稀疏自编码器综述:解释大语言模型的内部机制
专知会员服务
17+阅读 · 2025年12月27日
【CMU博士论文】大型语言模型的隐性特性
专知会员服务
15+阅读 · 2025年10月18日
通过强化学习增强代码生成中的代码大语言模型:综述
专知会员服务
29+阅读 · 2025年1月1日
大型语言模型的知识蒸馏综述:方法、评估与应用
专知会员服务
78+阅读 · 2024年7月4日
《大型语言模型代码生成》综述
专知会员服务
68+阅读 · 2024年6月4日
模型压缩 | 知识蒸馏经典解读
AINLP
11+阅读 · 2020年5月31日
基于知识蒸馏的BERT模型压缩
大数据文摘
18+阅读 · 2019年10月14日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
超全总结:神经网络加速之量化模型 | 附带代码
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员