Daily Tech Briefing
AI 科技速览
每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。
arXiv Machine Learning · 2026/7/30 04:00:00
DHRCL:Training Code LLMs with Dense Hierarchical Rewards and Curriculum Learning
AI 中文解读
AI写代码终于学会了“循序渐进”的学习方式!这项新研究提出的DHRCL方法,像老师批改作业一样,从语法对不对、能不能运行、测试通不通,到代码结构好不好,分层次给AI打分,并自动安排先学什么后学什么,整个过程不再需要人工设定进度,AI自己就能判断该在哪个阶段多花功夫。
简单来说,以前训练AI写代码,要么只看最终结果对不对,要么把各种检查标准胡乱混在一起。而DHRCL就像一位耐心的教练:先盯语法格式,再盯代码能否跑通,然后看单元测试通过率,最后用AI特有的“结构相似度”来评判代码是否优雅。更聪明的是,每个阶段学多久完全由AI近期的表现决定,不会死板地规定时间。在内部反馈机制上,早期注重巩固已掌握的写法,后期则更精准地奖励或惩罚那些还不稳定的决策模式。
这项技术将直接让各类编程助手变得更可靠。未来当你用AI生成一段Python代码时,它不再只是表面看起来正确,而是从底层逻辑到执行效率都经过层层把关。普通用户能更放心地用AI写小程序,专业程序员也能获得更高质量的草稿,减少调试时间。随着模型不断升级,这种分阶段精炼的训练方式有望让AI真正成为靠谱的编程伙伴。
arXiv:2607.26457v1 Announce Type: new
Abstract: Reinforcement learning is a natural post-training paradigm for code-oriented large language models because generated programs can be evaluated through parsing, execution, unit tests, and structural analysis.However, existing methods often rely on sparse outcome rewards or statically combine heterogeneous dense signals, even though syntax validity, executability, functional correctness, and structural organization describe different and progressively dependent programming capabilities. We propose DHRCL, a reinforcement learning framework with Dense Hierarchical Rewards and Curriculum Learning. DHRCL decomposes feedback into syntax validation, execution success, unit-test pass rate, and AST-based structural similarity, and organizes these signals through a three-stage Syntax, Execution, Pass & Structural curriculum. Stage duration is determined automatically from recent validation trends rather than manually specified capability thresholds. We further introduce stage-aware probability-based token credit redistribution. The mechanism follows a consolidation-to-refinement principle: it emphasizes established token patterns during syntax-oriented optimization, applies uniform propagation for non-local execution feedback, and allocates more credit or blame to less-established token decisions during final functional optimization. Under a unified Qwen3-8B and KodCode protocol, the experiments compare DHRCL with binary, pass-rate, reward-model-based, and verifiable dense-reward baselines. We further evaluate DHRCL across Qwen3-4B, Qwen3-8B, and Qwen3-14B backbones, showing that its advantage remains consistent as model capacity increases.
分享
阅读原文 ↗