RL-IF: Tracking Non-local Training Data Influence for Online Reinforcement Learning

Shixuan Liu, Cheng Tang, Yuzheng Hu, Fan Wu, Han Zhao, Jiaqi W. MaNeurIPS 2026

TL;DR

In online reinforcement learning, every action an agent takes ripples into the future—not just by updating its neural network, but by changing the very data it will collect tomorrow. This paper introduces a principled math framework (RL-IF) to track this "butterfly effect" across multiple training rounds without retraining from scratch. By filtering out experiences that look fine locally but hurt long-term learning, their practical algorithm (RINSE) makes RL agents and large language models learn faster and reach higher peak performance.

What Problem Does This Paper Address?

Imagine trying to figure out which specific textbook page helped you ace a final exam. In standard supervised learning, data attribution tools (like influence functions) solve this by asking a counterfactual question: How would the model change if we deleted this one training example?

In online Reinforcement Learning (RL)—the engine behind robotic control and LLM alignment (RLHF)—answering this is vastly harder. Unlike supervised learning, where the dataset sits still, an RL agent collects its own data on the fly. Existing attribution methods for RL take a myopic shortcut: they only look at a single training round, using simple gradient dot products to guess if a data point helped the immediate next update.

Why does this fall short? Because in online RL, a single experience triggers a two-fold chain reaction across rounds:

  1. The Optimization Effect: It nudges the model’s parameters during gradient updates.
  2. The Sampling Effect: Because the parameters changed, the agent behaves differently in the next round, altering all future experiences it collects.
Two-fold data influence in RL, showing how a single sample propagates through both parameter updates (blue) and future data collection (orange).

Judging an action solely on its immediate impact can be actively misleading. A thruster firing that looks wasteful right now might actually be stabilizing a lunar lander for a smooth touchdown ten rounds later.

Methods

To capture long-term value, the authors build from exact counterfactuals down to a fast, practical algorithm:

  • RL-LOO (Leave-One-Out): First, they formalize the ground-truth target: what happens to the final policy after $T$ rounds if we delete one specific sample occurrence from an earlier minibatch and replay the entire optimization and data-collection process?
  • RL-IF (RL Influence): Since re-running RL training for every data point is computationally impossible, they use a first-order Taylor expansion to derive a recursive estimator. RL-IF propagates perturbations forward through time, cleanly separating math terms for the optimization path (via Hessian-vector products) and the sampling path (via policy score functions). Also, because standard PPO's hard "clipping" breaks smooth calculus, they build this atop KL-regularized PPO.
  • RL-IF-opt & RINSE: Motivated by their own theoretical bounds showing the sampling term is surprisingly small, they drop the sampling math to create a fast, optimization-only variant (RL-IF-opt). They wrap this into RINSE (RL-INfluence-based Sample sElection): run standard PPO for a short window (up to 5 rounds, stopping early if rewards dip), use RL-IF-opt to snipe the most harmful samples, and quickly retrain over that window on the cleaned dataset.

Datasets

Rather than static datasets, the paper evaluates on interactive benchmarks and an LLM alignment pipeline (no new benchmarks are introduced):

  • Control & Navigation: Six standard Gym/Gymnasium and MuJoCo environments: Ant-v4, HalfCheetah-v4, Hopper-v4, BipedalWalker-v3, LunarLander-v2, and FrozenLake-v1.
  • RLHF Toxicity Mitigation: Aligning a GPT-Neo 2.7B language model, where prompts generate responses scored by a pretrained toxicity classifier.

Key Insights and Ideas

  • Short-term attribution has a "late-episode bias": Local attribution methods systematically overestimate the value of actions taken late in an episode while penalizing early setup moves—like stabilizing a lander—that only pay off over multi-round horizons.
Figure 2: Left: two LunarLander samples that appear harmful locally but are beneficial in the long run. Right: fraction of late-episode samples labeled harmful vs. attribution hori- zon H.
  • You can safely ignore the sampling effect (mostly): Intuitively, changing future data distributions sounds huge. Yet the authors prove theoretically that under smooth KL assumptions and decaying learning rates, the gap between full RL-IF and optimization-only RL-IF grows only logarithmically over time. Empirically, their correlation with true retraining (LDS score) is virtually identical (e.g., 0.191 vs. 0.192 on Ant-v4), meaning parameter dynamics dominate distribution shift!

Key Results

Across all tasks, RINSE beats standard PPO, random filtering, and local-attribution filtering (IIF):

Training curves across six standard RL benchmarks showing RINSE achieving faster learning and higher returns.
  • Sample Efficiency & Peak Returns: Even though RINSE retrains over short windows, throwing away bad data cuts the number of required environment rollouts by an average of 42.8% to match standard PPO's performance. On tough continuous control tasks, peak rewards skyrocket: on Ant-v4, RINSE hits 1642.8 (vs. 734.3 for standard PPO and 861.6 for local IIF); on BipedalWalker-v3, it reaches 146.0 (vs. 47.5 standard, 111.1 IIF).
  • Wall-Clock Speedups in RLHF: When detoxifying GPT-Neo 2.7B (using a fast Generalized Gauss–Newton approximation for Hessians), RINSE lowers test toxicity faster than baselines, achieving more than a 3× wall-clock speedup over standard RLHF training and >2× over local IIF.

Limitations and Future Work

  • Optimizer mismatch: The math behind RL-IF assumes simple Stochastic Gradient Descent (SGD), whereas actual deep RL and RLHF runs use adaptive optimizers like Adam. While RINSE works great empirically with Adam, explicitly modeling adaptive preconditioning would make the estimator more rigorous.
  • Algorithm scope: The framework relies on smooth, KL-regularized PPO updates and first-order approximations. Extending this to clipped objectives, TRPO, or radically different off-policy architectures remains open.
  • When does sampling bite back? While the sampling effect was negligible in these experiments, it may not hold universally—figuring out the exact regimes where policy-induced data shifts dominate optimization is an exciting open question.

Summary updated

Abstract

Online reinforcement learning (RL) has achieved significant success in decision-making tasks, but modern online RL remains highly sensitive to the quality of training experience. Understanding the contribution of individual training instances is therefore central to data-centric RL, with applications ranging from experience selection to policy interpretation. Existing data attribution methods for online RL primarily focus on local influence within a single training round, overlooking the non-local data influence across multiple training rounds. In this work, we formalize data attribution in online RL through a trajectory-level leave-one-out quantity, RL-LOO, which measures how one training sample influences a downstream target after subsequent online updates have taken place. We then derive RL-IF, a first-order estimator that propagates data influence through both optimization effects and policy-induced sampling effects, and provide theoretical guarantees on its approximation accuracy under smoothness assumptions. Our analysis further disentangles these two effects and shows both theoretically and empirically that the full RL-IF estimator can often be well approximated using the optimization effect alone. Building on this observation, we develop RINSE, a practical data filtering method for online RL. Experiments on standard control benchmarks and an RLHF-style toxicity-mitigation setting show that RINSE improves training efficiency and final performance over standard PPO and local attribution baselines. These results suggest that RL-IF provides a practical and principled framework for understanding and improving online RL.
BibTeX
@inproceedings{liu2026rl,
  author = {Shixuan Liu and Cheng Tang and Yuzheng Hu and Fan Wu and Han Zhao and Jiaqi W. Ma},
  title = {{RL-IF: Tracking Non-local Training Data Influence for Online Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=TDeuf94Klk},
}
Figure