DHRCL Boosts Code LLM Training with Hierarchical Rewards.

Shuhang Wang, Ziming Li, Hui Cheng· July 30, 2026 View original

Summary

DHRCL is a reinforcement learning framework that trains code-oriented large language models using dense hierarchical rewards and curriculum learning. It decomposes feedback into syntax, execution, unit tests, and structural similarity, organizing these signals through a three-stage curriculum with automatic stage duration and stage-aware token credit redistribution.

Training large language models (LLMs) for code generation often uses reinforcement learning, where generated programs are evaluated. However, existing methods frequently rely on sparse outcome rewards or combine dense signals statically, overlooking the progressive dependencies between programming capabilities like syntax, executability, and functional correctness. Researchers propose DHRCL, a novel reinforcement learning framework that employs Dense Hierarchical Rewards and Curriculum Learning. DHRCL breaks down feedback into distinct levels: syntax validation, execution success, unit-test pass rates, and abstract syntax tree (AST)-based structural similarity. These signals are then structured into a three-stage curriculum: Syntax, Execution, and Pass & Structural. A key innovation is the automatic determination of stage duration based on recent validation trends, eliminating manual thresholding. DHRCL also introduces stage-aware probability-based token credit redistribution, which adapts how credit or blame is assigned to tokens based on the current curriculum stage, emphasizing established patterns early and refining less-established decisions later. Experiments across various Qwen3 backbones demonstrate DHRCL's consistent advantage over other reward baselines.

Why it matters

This framework significantly improves the training of code LLMs, leading to more accurate, robust, and functionally correct code generation, which is crucial for software development, automated programming, and developer tools.

How to implement this in your domain

  1. 1Adopt DHRCL's hierarchical reward structure for fine-tuning code generation LLMs.
  2. 2Implement the three-stage curriculum (Syntax, Execution, Pass & Structural) in your RL training pipeline.
  3. 3Integrate automatic stage duration determination based on model performance metrics.
  4. 4Apply stage-aware token credit redistribution to optimize learning efficiency.
  5. 5Evaluate the generated code quality using DHRCL against current baselines.

Who benefits

Software DevelopmentEdTechIT ServicesCybersecurityAutomotive

Key takeaways

  • DHRCL uses hierarchical rewards and curriculum learning for code LLMs.
  • It decomposes feedback into syntax, execution, and structural similarity.
  • The framework features an adaptive, three-stage curriculum.
  • Stage-aware token credit redistribution optimizes learning.

Original post by Shuhang Wang, Ziming Li, Hui Cheng

"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…"

View on X

Originally posted by Shuhang Wang, Ziming Li, Hui Cheng on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses