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:
- 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.
- 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.
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$.
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-Basemust combine numbers with arithmetic operations to hit a target. Trained on a 20k subset ofCountdown-34and evaluated on bothCountdown-34and the harderCountdown-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
Walker2dVelMeta-RL, ICRPM improves $\text{CVaR}_{0.9}$ return from -27.9 (vanilla MPTS) to -1.5. OnLunarLanderDR, 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-Basewith GRPO on Countdown, ICRPM hits 55.7% accuracy on the harderCountdown-4split (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%).
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