Bridging Risk Approximation Gaps in Model Predictive Task Sampling via In-Context Modeling

Jiarong Wen, Qi Tao, Zhang Kaiyu, Yun Qu, Lizhou Cai, Heming Zou, Yuhang Jiang, Cheems WangNeurIPS 2026

TL;DR

When training reinforcement learning agents or fine-tuning reasoning LLMs, evaluating every possible task or prompt to find the most useful ones is prohibitively expensive. Existing "task-sampling" models try to guess task difficulty on the fly, but they accidentally rely on outdated snapshots of the agent—like shooting at where a moving target was rather than where it is going to be. This paper introduces an in-context, look-ahead predictor that anticipates how task difficulty shifts as the agent learns, boosting sample efficiency and worst-case robustness across both robotics and LLM reasoning with negligible extra compute.

What Problem Does This Paper Address?

Whether you are teaching a robot to walk across slippery surfaces or post-training a Large Language Model (LLM) on math problems using reinforcement learning, not all training tasks are created equal. For robust control, you want to prioritize worst-case, high-risk scenarios; for LLMs, you want "Goldilocks" prompts of intermediate difficulty (around a 50% success rate).

Finding these ideal tasks usually requires running the agent on a massive pool of candidates—meaning expensive physics rollouts or long Chain-of-Thought token generations. Model Predictive Task Sampling (MPTS) bypasses this bottleneck by training a lightweight surrogate—a Risk Predictive Model (RPM)—to guess how hard a task will be based on historical training losses.

However, standard RPMs suffer from two blind spots:

  1. Temporal Lag Bias: Standard RPMs learn the difficulty landscape under the current policy ($\theta_t$), but their predictions are used to pick tasks for the updated policy ($\theta_{t+1}$). Because the agent is actively learning, the difficulty landscape shifts. A task that looked hard a moment ago might suddenly become easy, causing rank-flipping—where the relative difficulty order of tasks inverts right under the sampler's nose.
  2. Sparse Histories: Because we only evaluate small batches of tasks per step to save compute, the RPM is starved for data, hurting its ability to generalize across the broader task space.
As the policy updates from step t to t+1, the risk landscape shifts, causing task difficulty rankings to flip.

Methods

Instead of treating risk prediction as static interpolation (guessing task difficulty right now), the authors reframe it as extrapolative sequence modeling (predicting what task difficulty will be one step into the future). They call their drop-in replacement In-Context RPM (ICRPM).

While standard MPTS relies on Variational Autoencoders (VAEs) trained on the latest batch, ICRPM introduces two novel mechanisms:

  • One-Step Look-Ahead via Cross-Attention: ICRPM uses a Transformer architecture. It takes the most recent batch of evaluated task-loss pairs ($H_t$) as an in-context sequence, pairs it with a candidate task for step $t+1$, and directly predicts the post-update risk. During training, it learns these dynamics for free using historical transitions ($H_{s-1} \rightarrow H_s$) without needing extra environment rollouts.
  • Exponentially Decayed Sliding Window: To fix data scarcity without polluting the model with ancient history, ICRPM maintains a buffer of the $W$ most recent task batches (e.g., $W=3$). It reuses consecutive batch pairs for training while exponentially discounting older transitions via a decay factor $\gamma$.
Figure 2: Left: The risk landscape evolves from θt to θt+1, with historical prompt-loss pairs Ht modeling temporal risk dynamics and predicting future risk using an attention mechanism. Right: The Transformer-based ICRPM tokenizes prompt-loss sequences with a target prompt at time t + 1, and a regression head estimates the future risk ˆℓt+1 by minimizing the discrepancy with ground-truth ℓt+1 through gradient optimization.

Datasets

No new benchmarks were introduced; the authors evaluated ICRPM across established benchmarks spanning three distinct regimes:

  • Few-Shot Regression: Classic sinusoid regression (tasks parameterized by amplitude and phase).
  • Continuous Robotic Control: Three MuJoCo Meta-RL environments (HalfCheetahVel, Walker2dVel, ReacherPos) and two zero-shot Domain Randomization (DR) environments (LunarLander, ErgoReacher).
  • LLM Post-Training (RLVR): The Countdown symbolic reasoning dataset, where Qwen3-4B-Base must combine numbers with arithmetic operations to hit a target. Trained on a 20k subset of Countdown-34 and evaluated on both Countdown-34 and the harder Countdown-4.

Key Insights and Ideas

  • More data per batch won't fix a moving target: The authors prove theoretically (Theorem 3.1) that vanilla RPMs suffer from an irreducible $\mathcal{O}(\eta)$ lagging error proportional to the policy learning rate $\eta$. Even with infinite task samples at step $t$, a standard RPM will still misrank tasks at step $t+1$.
  • Look-ahead crushes first-order drift: By conditioning on recent optimization context to capture local risk drift, ICRPM replaces that $\mathcal{O}(\eta)$ lag with a much smaller second-order $\mathcal{O}(\eta^2)$ smoothness residual (Proposition 3.2).
  • Cross-prompt sharing beats per-prompt tracking in LLMs: Existing LLM curriculum samplers often track difficulty per individual prompt, leaving them blind on unseen prompts. ICRPM shares context across prompts, maintaining a remarkably high Spearman Rank Correlation (~0.6–0.7) with ground-truth prompt difficulty while baselines hover near zero.
  • The magic is in the look-ahead, not just the Transformer: Ablations show that swapping ICRPM's Transformer for a simple MLP still beats vanilla MPTS, whereas giving vanilla MPTS the sliding-window history buffer without look-ahead falls flat. Extrapolation is doing the heavy lifting.

Key Results

Across the board, ICRPM improves rank correlation with ground-truth difficulty, translating directly into stronger worst-case robustness ($\text{CVaR}_{0.9}$, the average performance on the hardest 10% of tasks) and faster LLM learning:

  • Robotic Control: On Walker2dVel Meta-RL, ICRPM improves $\text{CVaR}_{0.9}$ return from -27.9 (vanilla MPTS) to -1.5. On LunarLander DR, it boosts $\text{CVaR}_{0.9}$ return at convergence by over 40% compared to standard Empirical Risk Minimization (ERM), reaching 265.8 (vs. 251.8 for MPTS).
  • Negligible Compute Overhead: On Walker2dVel, ICRPM adds only 8% runtime overhead ($1.08\times$ ERM), virtually identical to vanilla MPTS ($1.07\times$) and much faster than importance-weighting baselines like DRM ($1.34\times$).
  • LLM Reasoning: Fine-tuning Qwen3-4B-Base with GRPO on Countdown, ICRPM hits 55.7% accuracy on the harder Countdown-4 split (and 65.4% overall average), beating uniform sampling (51.1%) and state-of-the-art curriculum methods like GRESO (53.8%) and MoPPS (52.9%).
Figure 6: Test accuracy (left) and SRC (right) on Count- down 4B. ICRPM demonstrates significantly faster conver- gence and higher correlation with ground-truth difficulty throughout RL post-training.

Limitations and Future Work

While the provided main text (pages 1–10) does not include a dedicated limitations section, two theoretical constraints are explicitly noted in the authors' analysis:

  • Smoothness and Step-Size Assumptions: ICRPM's theoretical advantage relies on the task loss landscape being $\beta$-smooth and policy updates ($\Delta_t$) being bounded. Very large policy jumps could amplify the $\mathcal{O}(\eta^2)$ second-order residual error.
  • Context Approximation Capacity: The error bound still depends on an in-context approximation error ($\epsilon_{\text{IC}}$)—meaning the model's success hinges on whether the recent batch history actually contains informative enough signals to infer how the policy just changed.

Summary updated

Abstract

Reinforcement learning (RL) is essential for adaptive decision-making, e.g., robust Meta-RL and domain randomization (DR), and efficient post-training of large language models (LLMs), where tasks are commonly structured as Markov decision processes or prompts. A central bottleneck in all these settings is the cost of agent-environment interactions required for task selection and policy optimization. Model predictive task sampling (MPTS) has emerged as a promising approach to improve sample efficiency by querying informative tasks via a risk predictive model (RPM) trained on optimization history. However, existing RPMs suffer from two failure modes: (i) sparse optimization histories, which limit RPMs' generalization across the task space, and (ii) a one-step lag in risk approximation, which causes biased difficulty estimation as the policy evolves. This work formalizes these failure modes, derives lagged-risk decompositions that expose the resulting temporal bias, and recasts risk prediction as an in-context sequence modeling problem. The developed RPM integrates a one-step look-ahead mechanism with a temporal-weighted sliding window to mitigate data non-stationarity and scarcity, without requiring additional rollouts. Empirically, our approach yields more reliable difficulty estimates and consistent performance gains across robust Meta-RL, DR, and prompt curriculum RL post-training of LLMs.
BibTeX
@inproceedings{wen2026bridging,
  author = {Jiarong Wen and Qi Tao and Zhang Kaiyu and Yun Qu and Lizhou Cai and Heming Zou and Yuhang Jiang and Cheems Wang},
  title = {{Bridging Risk Approximation Gaps in Model Predictive Task Sampling via In-Context Modeling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=hJMwdk9jfG},
}
Figure