NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Note on Hybrid Online Reinforcement and Imitation Learning for LLMs: Formulations and Algorithms

Yingru Li, Ziniu Li, Jiacai LiuarXiv 2025 · DOI

This paper provides a theoretical bridge between two dominant paradigms in AI training: Imitation Learning (learning from an expert) and Reinforcement Learning (learning from rewards). By deriving a unified gradient for Large Language Model (LLM) fine-tuning, the authors offer a framework that combines the stability of imitation with the goal-oriented nature of RL.

The Problem: Exposure Bias vs. Reward Instability

Training LLMs typically involves two stages: supervised fine-tuning (SFT/Knowledge Distillation) and alignment (RLHF). However, both have inherent flaws:

  1. Knowledge Distillation (KD) suffers from "exposure bias." Because the model only learns on static, "gold-standard" data, it fails to recover when it makes small mistakes during its own generation—errors compound over time.
  2. Reinforcement Learning (RL) addresses this by letting the model learn from its own generations, but it is notoriously unstable, suffers from high variance (since rewards are often sparse and delayed), and is prone to "reward hacking."

Gradient Decomposition: Dense and Sparse Terms

The core technical contribution is the Gradient Decomposition (Theorem 1). The authors prove that the gradient of a hybrid objective—one that minimizes trajectory-level KL divergence while maximizing task reward—splits into two distinct parts at any given step $t$:

  • Dense Term: An analytically computable gradient for the current token's imitation signal. This term is deterministic given the context and has zero variance.
  • Sparse Term: A Monte Carlo estimated gradient (similar to standard Policy Gradient) that accounts for future rewards and future KL costs. This term scales with the horizon $T$.
Comparison of the properties of Dense (Imitation) and Sparse (RL) gradient terms.

This decomposition allows for a more stable "cold start" during training. By starting with a low reward weight, the stable Dense term dominates, pulling the model toward expert behavior. As training progresses, the Sparse term can take over, allowing the model to discover behaviors that potentially surpass the teacher.

Reframing the Role of the Reference Model

A significant conceptual shift proposed in this note is the reinterpretation of KL-regularized RLHF. In traditional RLHF, the reference model is often viewed as an "anchor" to prevent the model from drifting too far from its initialization. In this hybrid framework, the reference model is viewed as a "target" or expert teacher that actively attracts the student model.

Conceptual shift in the role of the reference policy and KL divergence between standard RLHF and the proposed framework.

Computational Efficiency and Implementation

To make this framework practical for modern LLMs with massive vocabularies (100k+ tokens), the authors derive a closed-form Logit-Level Gradient (Proposition 5) for the KL term: $$\nabla_z D_{KL}(p\|q) = p \odot (\log p - \log q - D_{KL}(p\|q) \cdot \mathbf{1})$$

This formula is highly amenable to GPU kernels (like Triton or CUDA). Furthermore, they provide a Top-K Approximation that focuses only on the most likely tokens. For a vocabulary of 128,000, using $K=32$ can reduce the storage and computation required for the gradient tensor by approximately 4000x.

Conclusion and Future Directions

While this note is primarily theoretical and algorithmic, it provides a rigorous foundation for hybrid training. The proposed unified gradient offers a path toward more stable alignment by leveraging exact analytical signals where possible and sampled signals only where necessary. Future work will involve large-scale empirical validation to compare this approach against standard PPO or DPO in real-world LLM tasks.

Summary updated

BibTeX
@misc{li2025note,
  author = {Yingru Li and Ziniu Li and Jiacai Liu},
  title = {{A Note on Hybrid Online Reinforcement and Imitation Learning for LLMs: Formulations and Algorithms}},
  year = {2025},
  eprint = {2512.23097},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.23097},
}
Figure