TL;DR
State-Action Distillation (SAD) is a new pretraining approach that enables In-Context Reinforcement Learning (ICRL) using only random policies. By distilling high-performing state-action pairs within a "trust horizon," SAD removes the need for expensive expert or well-trained behavior data, outperforming current state-of-the-art methods by over 135% in online evaluations.
What Problem Does This Paper Address?
In-Context Reinforcement Learning (ICRL) is a powerful paradigm where a foundation model (FM) learns to solve a new task simply by looking at a few examples of interactions (the "context"), without any parameter updates. However, the "secret sauce" for current ICRL methods is high-quality pretraining data.
Existing algorithms like Algorithm Distillation (AD) or Decision Pretrained Transformer (DPT) have a major bottleneck: they require pretraining datasets generated by optimal or near-optimal policies. In the real world, obtaining an expert policy for thousands of different training environments is often prohibitively expensive or physically impossible. The authors tackle this "expert data bottleneck" by asking: Can we train a model to be a good reinforcement learner using only data from a completely random, untrained policy?
Methods
The authors introduce State-Action Distillation (SAD). The core idea is to generate a high-quality pretraining dataset by "distilling" the best possible actions out of random noise.
The process works in four steps (illustrated in Figure 1):
- Context Collection: Use a random policy to interact with an environment and collect a sequence of state-action-reward tuples.
- Query State Sampling: Pick a random state from the environment's state space.
- Trust Horizon Distillation: This is the novel part. For every possible action in the query state, the system runs a short "trust horizon"—a few steps of interaction under a random policy. It then identifies the action that yielded the highest return during that short window.
- Supervised Pretraining: The FM is trained to predict that "distilled" best action, given the random context and the query state.
The "Trust Horizon" works because, in many tasks (like navigation), the action that gets you closer to a reward fastest is optimal, even if the subsequent moves are random. The authors provide theoretical proofs showing that for Multi-Armed Bandits and certain Markov Decision Processes (MDPs), a random policy is "probabilistically trustworthy" for identifying these optimal actions if the horizon is long enough.
Datasets
The researchers evaluated SAD on five popular ICRL benchmark problems:
- Gaussian Bandits: A 5-armed bandit task where rewards follow a Gaussian distribution.
- Bernoulli Bandits: Used to test out-of-distribution (OOD) generalization (training on Gaussian, testing on Bernoulli).
- Darkroom: A 2D grid navigation task (7x7) with a single sparse reward at a hidden goal.
- Darkroom-Large: An expanded 10x10 version of Darkroom.
- Miniworld: A challenging 3D pixel-based navigation task.
Key Insights and Ideas
- Expertise is not required for pretraining: You don't need an expert to teach a model how to learn. You just need a way to label "good" moves. SAD shows that "good" moves can be identified by simply looking ahead a few steps, even if those steps are random.
- The Trust Horizon Trade-off: In navigation tasks, a small horizon might make the model short-sighted, while an excessively large horizon under a random policy might never hit the goal, leading to poor labels. The paper demonstrates that there is a "sweet spot" for this horizon (e.g., $N=7$ for the Darkroom task).
- Sparse Reward Synergy: SAD is particularly effective in sparse reward environments. In these settings, the optimal action is essentially the one that reaches the goal in the fewest steps. Since rewards are discounted over time, the "distilled" action from the trust horizon naturally aligns with the optimal policy.
Key Results
SAD significantly outperformed all existing ICRL baselines that were restricted to random pretraining data:
- Massive Performance Gains: On average across all tasks, SAD outperformed the best baseline (DIT) by 236.3% in offline evaluations and 135.2% in online evaluations.
- Closing the Gap with Oracles: SAD achieved performance comparable to "Oracle" models (DPT*) that were trained using actual optimal policies. In the Darkroom tasks, SAD reached roughly 88-90% of the Oracle's performance.
- Robustness: SAD showed superior performance in out-of-distribution tests (Bernoulli Bandits) and high-dimensional pixel-based tasks (Miniworld).
Limitations and Future Work
- Discrete Actions: Currently, SAD is limited to environments with discrete action spaces. Extending this to continuous actions (like robotic joint control) is a key next step.
- Reward Structure Assumptions: The method relies on "Assumption 2," which posits that the best action under a random policy aligns with the optimal action. While true for many navigation and bandit tasks, this might not hold in complex environments with multiple conflicting rewards or "trap" states.
- Computational Cost: While SAD saves time by not requiring expert training, the "trust horizon" rollouts during dataset generation add their own computational overhead compared to simple random sampling.
For a visual intuition of the environments SAD excels in, Figure 2 shows the simple grid-world logic where moving toward the goal is always the best move, regardless of whether the next move is random or planned.
Summary updated