CodeAlchemy:大规模合成代码重写
CodeAlchemy: Synthetic Code Rewriting at Scale
AI总结:
提出CodeAlchemy框架,通过5种策略生成超过500B token的合成代码数据,引入DevEval和TraceEval基准,3B模型在多项任务上超越10倍大小的前沿模型。
摘要:
在原始代码上预训练可以学习语法,但为多样化的真实世界任务格式提供的信号稀疏。虽然合成数据已被证明对语言模型具有变革性,但代码领域除有限的质量改进外仍基本未被探索。我们提出CodeAlchemy,一个合成数据生成框架,通过5种策略将公开来源的代码转换为语义丰富的训练数据:CodeEnhance(质量感知重写)、CodeQA(基于模板的问题)、CodeDev(开发者任务)、CodeDialogue(多轮对话)和CodeTrace(执行轨迹)。我们处理了15种语言的3个语料库,生成了超过500B token的合成数据以及350B推理token,数量级远超先前工作。CodeTrace对14种语言和5K个库的1.3M+文件进行插桩和执行,捕获控制流、状态跟踪和库知识。我们引入了DevEval(开发者任务)和TraceEval(执行预测)基准;前沿模型如Claude Sonnet 4.5在TraceEval上仅达到5.6%的精确匹配,揭示了语义理解的关键差距。我们的3B模型在HumanEval上达到83.5%,在MBPP上达到63.2%,在DevEval上达到8.09%的胜率,在TraceEval上达到15.36 ROUGE-2,超越了包括27B Gemma-3和32B Granite-4.0在内的10倍大小的前沿模型。
英文摘要:
Pre-training on raw code teaches syntax but provides sparse signal for diverse real-world task formats. While synthetic data has proven transformative for language models, code remains largely unexplored beyond limited quality improvements. We present CodeAlchemy, a synthetic data generation framework that transforms publicly sourced code into semantically-rich training data through 5 strategies: CodeEnhance (quality-aware rewriting), CodeQA (template-based problems), CodeDev (developer tasks), CodeDialogue (multi-turn conversations), and CodeTrace (execution traces). We process 3 corpora across 15 languages to generate 500B+ tokens of synthetic data plus 350B reasoning tokens, orders of magnitude more than prior efforts. CodeTrace instruments and executes 1.3M+ files across 14 languages and 5K libraries, capturing control flow, state tracking, and library knowledge. We introduce DevEval (developer tasks) and TraceEval (execution prediction) benchmarks; frontier models like Claude Sonnet 4.5 achieve only 5.6% exact match on TraceEval, revealing critical gaps in semantic understanding. Our 3B models achieve 83.5% on HumanEval, 63.2% on MBPP, 8.09% win rate on DevEval, and 15.36 ROUGE-2 on TraceEval, outperforming frontier models 10x the size including 27B Gemma-3 and 32B Granite-4.0.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。