EMA Policy Gradient: Taming Reinforcement Learning for LLMs with EMA Anchor and Top-k KL

TL;DR

EMA anchor and Top-k KL improve RL training for LLMs, achieving 53.9% accuracy on math reasoning.

cs.LG 🔴 Advanced 2026-02-04 68 views
Lunjun Zhang Jimmy Ba
Reinforcement Learning Large Language Models Policy Gradient KL Estimation Model Stability

Key Findings

Methodology

This work introduces a combined approach of EMA-based target networks and Top-k KL estimators within policy gradient algorithms for LLMs. EMA acts as a smoothed target network, akin to deep Q-learning, enhancing training stability. The Top-k KL estimator selectively computes exact KL on top-k logits, with the rest estimated via sampling, balancing bias and variance. These techniques are integrated into the GRPO framework, optimizing token-level KL regularization. Theoretical analysis derives stability conditions for EMA, ensuring convergence. Empirical results on reasoning and agentic tasks demonstrate significant performance gains, with models reaching new state-of-the-art metrics.

Key Results

  • The R1-distilled Qwen-1.5B model achieves 53.9% accuracy on OlympiadBench, surpassing the 50.8% of baseline GRPO.
  • In search-based QA tasks, Qwen-3B with EMA-PG improves average success rates by 33.3%, with HotpotQA rising from 29.7% to 44.1%, and 2WikiMultiHopQA from 27.4% to 40.1%.
  • Top-k KL estimators maintain unbiasedness while reducing gradient variance, leading to more sample-efficient training, especially in long sequences and large vocabularies.

Significance

This research addresses core challenges in RL training of large models, notably instability, high memory costs, and biased KL estimation. By integrating EMA smoothing and adaptive Top-k KL, it provides a robust framework that enhances training stability, sample efficiency, and model performance. The theoretical guarantees and extensive empirical validation demonstrate its potential to advance RL applications across diverse NLP tasks, paving the way for more autonomous, reasoning-capable AI systems.

Technical Contribution

The paper's main contributions include a rigorous stability analysis of EMA targets in policy gradient updates, the design of unbiased Top-k KL estimators that interpolate between exact and sampled KL, and the development of a practical algorithm that leverages these innovations. Theoretical derivations establish conditions for convergence and stability, while the implementation demonstrates compatibility with existing RL algorithms like GRPO. These advances enable more reliable and efficient training of large-scale language models, especially in reasoning and agentic domains.

Novelty

This work is the first to systematically incorporate EMA-based target networks with token-level Top-k KL estimators in large-scale RL for LLMs. Unlike prior methods relying solely on sequence-level KL or full logits, this approach offers a bias-free, memory-efficient, and theoretically grounded solution. Its ability to dynamically interpolate between exact and sampled KL, combined with rigorous stability analysis, distinguishes it from existing techniques, marking a significant step forward in RL methodology for NLP.

Limitations

  • Despite improvements, the method still faces challenges with extremely long sequences or very large vocabularies, where memory and computational costs remain high. Adaptive parameter tuning for EMA and k remains an open problem, potentially affecting robustness across tasks.
  • The experiments are primarily focused on text reasoning and question-answering, leaving its effectiveness in multi-modal or multi-task settings to be validated. Further research is needed to generalize these techniques beyond NLP.
  • The approach assumes access to logits for exact KL computation, which may be infeasible in some deployment scenarios with limited model access or privacy constraints.

Future Work

Future directions include developing adaptive schemes for EMA parameters, extending Top-k KL to multi-modal data, and exploring more memory-efficient implementations. Additionally, integrating these techniques into broader RL frameworks and applying them to real-world applications such as dialogue systems, autonomous agents, and multi-modal reasoning will be valuable. Further theoretical work on convergence guarantees and robustness under distribution shifts is also anticipated.

AI Executive Summary

Large language models (LLMs) have revolutionized NLP, yet their training via reinforcement learning (RL) faces significant hurdles. Instability, high memory demands, and biased KL estimation hinder progress. This paper introduces EMA Policy Gradient (EMA-PG), a novel approach combining EMA-based target networks with Top-k KL estimators to address these issues.

EMA, inspired by deep Q-learning, provides a smoothed target that stabilizes policy updates. By maintaining an exponential moving average of model parameters, the approach reduces oscillations and accelerates convergence. Simultaneously, the Top-k KL estimator selectively computes exact KL on the most probable logits, with the remaining probability mass estimated via sampling. This hybrid method maintains unbiasedness while drastically reducing memory footprint and variance.

Empirical evaluations on reasoning benchmarks like OlympiadBench and multi-hop QA datasets demonstrate the effectiveness of EMA-PG. The R1-distilled Qwen-1.5B model achieves 53.9% accuracy, outperforming the baseline GRPO at 50.8%. In agentic search tasks, models show a 33.3% average success rate increase, with HotpotQA rising from 29.7% to 44.1%. The experiments validate the theoretical stability conditions derived, confirming the method’s robustness.

This work significantly advances RL training for large models, offering a principled, scalable, and efficient framework. It opens avenues for deploying more capable, reasoning, and autonomous AI systems. Future research will focus on adaptive parameter tuning, multi-modal extensions, and real-world applications, promising a new era of stable and sample-efficient RL in NLP.

Deep Analysis

Background

The evolution of large language models (LLMs) has been marked by pretraining on massive corpora, followed by fine-tuning and alignment techniques such as RLHF. Despite these advances, RL training remains challenging due to instability, high variance, and memory constraints, especially when optimizing complex objectives like reasoning or agentic behaviors. Prior work like PPO, GRPO, and WARP has made progress, but issues like biased KL estimation and inefficient sampling persist. Deep Q-learning’s target network and EMA mechanisms have demonstrated success in stabilizing training in reinforcement learning, inspiring their adaptation to NLP. Additionally, the importance of accurate KL regularization for model alignment and robustness has driven research into better estimators, including sequence-level and token-level approaches. However, existing methods often trade bias for variance or require prohibitive memory. This paper builds on these foundations, proposing a unified framework that leverages EMA smoothing and adaptive KL estimation to overcome these limitations, aiming for more stable, sample-efficient RL training for large-scale language models.

Core Problem

The core challenge in RL for LLMs lies in balancing training stability, sample efficiency, and computational feasibility. Sequence-level KL regularization, while straightforward, hampers long-sequence reasoning due to its bias and high memory cost. Token-level KL offers finer control but introduces bias and high variance in estimators like K1, K2, and K3. Moreover, existing estimators either do not provide unbiased gradients or are memory-intensive, limiting scalability. The instability caused by fluctuating targets and biased regularization leads to slow convergence and suboptimal performance. Addressing these issues requires a method that ensures unbiased, low-variance KL estimation, stable training dynamics, and manageable memory footprint, especially for reasoning tasks involving long sequences and large vocabularies.

Innovation

The paper introduces three key innovations: 1) EMA anchor network, which smooths policy parameters over training steps, stabilizing updates; 2) Top-k KL estimator, which computes exact KL on top-k logits and estimates the tail via sampling, maintaining unbiasedness with lower variance; 3) a rigorous stability analysis deriving conditions on learning rate, EMA decay, and Fisher information for convergence. These innovations enable bias-free, memory-efficient KL regularization, improving training stability and sample efficiency. Unlike prior methods relying solely on sampling or sequence-level KL, this approach adaptively interpolates between exact and sampled estimates, providing theoretical guarantees and practical robustness. The combined framework significantly enhances RL performance on reasoning and agentic tasks.

Methodology

  • �� Implement an EMA target network θema, updating via exponential smoothing to serve as a stable reference.
  • �� Design Top-k KL estimators that compute exact KL on the top-k logits, with the remaining probability mass estimated through importance sampling.
  • �� Derive stability conditions for EMA parameters, involving Fisher information and learning rate, ensuring convergence.
  • �� Incorporate token-level KL regularization into policy gradients, replacing sequence-level KL.
  • �� Use theoretical analysis to confirm unbiasedness of estimators and stability of training dynamics.
  • �� Validate on reasoning benchmarks (OlympiadBench) and search-based QA datasets, comparing against baseline algorithms like GRPO.
  • �� Conduct ablation studies on k, EMA decay η, and estimator variants to optimize performance.
  • �� Demonstrate improvements in accuracy, success rate, and training stability across tasks.

Experiments

The experimental setup involves training Qwen-1.5B and Qwen-3B models on RL datasets with 40k question-answer pairs, focusing on math reasoning and agentic search tasks. Evaluation metrics include accuracy on OlympiadBench, success rates on HotpotQA and 2WikiMultiHopQA, and success rate improvements over baseline GRPO. The experiments compare EMA-PG with standard RL algorithms, analyzing the impact of EMA decay η, Top-k parameter k, and different KL estimators. Extensive ablation studies assess the stability conditions, estimator bias, and sample efficiency. The models are trained with hyperparameters tuned for stability, and results are statistically validated to confirm significant improvements. The setup emphasizes real-world reasoning benchmarks and multi-task scenarios to demonstrate robustness.

Results

Empirical results show that EMA-PG achieves 53.9% accuracy on OlympiadBench, outperforming GRPO’s 50.8%. In multi-hop QA tasks, HotpotQA success rate increases from 29.7% to 44.1%, and 2WikiMultiHopQA from 27.4% to 40.1%. The success rate improvements are consistent across datasets, with an average boost of 33.3% in search-based agentic tasks. The Top-k KL estimators demonstrate lower gradient variance and unbiasedness, especially with moderate k values, balancing bias and variance effectively. The stability analysis confirms that proper tuning of EMA decay η and learning rate α ensures convergence, validating the theoretical conditions derived. Ablation on k shows optimal performance at intermediate values, confirming the estimator’s flexibility and efficiency.

Applications

The proposed EMA-PG framework is suitable for training large-scale language models in tasks requiring reasoning, dialogue, and autonomous decision-making. It can be integrated into existing RL pipelines for model alignment, fine-tuning, and multi-task learning, especially where long sequences and large vocabularies are involved. The method enables more stable training with fewer samples, reducing computational costs and improving robustness. Long-term, this approach can facilitate development of autonomous agents capable of complex reasoning, multi-modal understanding, and real-time interaction, impacting industries like virtual assistants, education, and AI research.

Limitations & Outlook

Despite its advantages, the method still faces challenges with extremely long sequences or very large vocabularies, where memory and computation remain bottlenecks. The choice of EMA decay η and k requires careful tuning, lacking adaptive mechanisms. The experiments focus mainly on NLP tasks, and its effectiveness in multi-modal or real-world deployment scenarios needs further validation. Additionally, reliance on logits for exact KL may limit applicability in black-box or privacy-sensitive settings. Future work should address these limitations by developing adaptive algorithms, more memory-efficient estimators, and broader application testing.

Plain Language Accessible to non-experts

Imagine you’re in a busy kitchen where many chefs are cooking different dishes. To keep everything running smoothly, the head chef uses a special method: he keeps a “smooth version” of each chef’s plan that updates gradually, so no one makes sudden changes that cause chaos. This helps the kitchen stay stable even when many dishes are being prepared.

Now, in this kitchen, most ingredients are concentrated in a few popular items, like salt, sugar, and flour. The chefs focus mainly on these, and only estimate the less common ingredients roughly. This way, they save time and resources but still make tasty dishes.

By using these strategies, the kitchen runs more efficiently, with fewer mistakes and faster cooking times. Similarly, the paper’s techniques help large language models learn better and faster, making them more reliable and capable of complex reasoning, just like a well-organized kitchen producing perfect meals.

ELI14 Explained like you're 14

Imagine you’re trying to learn how to play a new video game. At first, you might get overwhelmed by all the buttons and options. So, your older sibling gives you a simple cheat sheet that highlights the most important moves, and updates it as you get better. This way, you focus on the key skills without getting lost.

Also, instead of practicing every single move in detail, you focus mainly on the top few most useful ones, and guess the rest based on what you’ve learned. It’s like focusing on the best weapons or strategies in a game, saving time and energy.

Using these tricks, you get better at the game faster, and soon you’re winning more often. The paper’s techniques do the same for big AI models—they help them learn complex tasks more smoothly and efficiently, making them smarter and more reliable, just like you becoming a gaming pro!

Abstract

Reinforcement Learning (RL) has enabled Large Language Models (LLMs) to acquire increasingly complex reasoning and agentic behaviors. In this work, we propose two simple techniques to improve policy gradient algorithms for LLMs. First, we replace the fixed anchor policy during RL with an Exponential Moving Average (EMA), similar to a target network in deep Q-learning. Second, we introduce Top-k KL estimator, which allows for flexible interpolation between exact KL and sampled KL. We derive the stability conditions for using EMA anchor; moreover, we show that our Top-k KL estimator yields both unbiased KL values and unbiased gradients at any k, while bringing the benefits of exact KL. When combined with GRPO, the two techniques (EMA-PG) lead to a significant performance boost. On math reasoning, it allows R1-distilled Qwen-1.5B to reach 53.9% on OlympiadBench compared to 50.8% by GRPO. On agentic RL domains, with Qwen-3B base, EMA-PG improves GRPO by an average of 33.3% across 7 datasets of Q&A with search engines, including 29.7% $\rightarrow$ 44.1% on HotpotQA, 27.4% $\rightarrow$ 40.1% on 2WikiMultiHopQA. Overall, we show that EMA-PG is a simple, principled, and powerful approach to scaling RL for LLMs. Code: https://github.com/LunjunZhang/ema-pg

cs.LG cs.AI