Skip to content
AI.info

Research

Out-of-Distribution Generalization with a SPARC: Racing 100 Unseen Vehicles with a Single Policy

Overview Research area: Reinforcement learning for control — specifically contextual reinforcement learning and out-of-distribution (OOD) generalization in robotics and driving. Technical level: Inter

arXiv
2511.09737
Published
2025-11-12
Authors
Bram Grooten, Patrick MacAlpine, Kaushik Subramanian, Peter Stone, Peter R. Wurman

AI summary

Overview

Research area: Reinforcement learning for control — specifically contextual reinforcement learning and out-of-distribution (OOD) generalization in robotics and driving.

Technical level: Intermediate. The paper assumes familiarity with reinforcement learning, contextual MDPs, off-policy actor-critic methods, and the Rapid Motor Adaptation (RMA) framework it builds on.

Scope: The paper introduces SPARC (single-phase adaptation for robust control), a one-stage training method that unifies context encoding and history-based adaptation, and evaluates it on wind-perturbed MuJoCo tasks and the Gran Turismo 7 racing simulator against four baselines.

What This Paper Is About

Reinforcement learning agents trained in one set of conditions often fail badly when deployed in conditions they have not seen, such as new vehicle dynamics, different terrain, or changed wind. The standard fix, exemplified by Rapid Motor Adaptation (RMA), requires two separate training phases: first train an expert that can see privileged context information, then freeze it and train a second module that infers that context from recent observations and actions. SPARC collapses this into a single training phase, so the expert policy and the history-based adapter are trained simultaneously, and the adapter is the model deployed at test time with no access to context.

Key Contributions

  1. SPARC, a single-phase training method for context-adaptive reinforcement learning that eliminates the separate encoder pre-training and the second adapter-training stage required by RMA. The context encoding becomes a moving target for the history adapter instead of a fixed one.
  2. Empirical validation of OOD generalization across two domains — wind-perturbed MuJoCo environments (HalfCheetah, Hopper, Walker2d) and Gran Turismo 7 — showing competitive or superior performance relative to Only Obs, History Input, RMA, and Oracle baselines.
  3. Ablation studies on design choices including history length and the selection of which policy (expert or adapter) collects rollout experience during training.
  4. A demonstration of transferability to updated game dynamics, where policies trained on an older version of Gran Turismo are evaluated zero-shot after a physics update.

Main Findings

  • Gran Turismo — car models: Averaged over 3 seeds, SPARC achieved the fastest OOD built-in-AI (BIAI) lap-time ratio on 2 of 3 tracks and completed the most OOD laps in aggregate. On Grand Valley, SPARC reached a BIAI ratio of 1.0491 ± 0.0055 with 98.06 ± 0.56% success, versus RMA at 1.0560 ± 0.0134 with 97.09 ± 1.12%. On Nürburgring, SPARC reached 1.1199 ± 0.0076 with 89.00 ± 0.86% success, versus RMA at 1.2995 ± 0.0306 with 77.99 ± 3.19%. On Catalunya Rallycross, SPARC reached 0.9631 ± 0.0026 with 100.00 ± 0.00% success.
  • SPARC outperformed its two-phase counterpart: The authors hypothesize this occurs because SPARC avoids the "brittle selection of a phase-1 checkpoint" that RMA requires; training an adapter against a single frozen checkpoint of the context encoder can overfit to parts of the context space, while SPARC learns against multiple strong checkpoints over time.
  • IND versus OOD trade-off: On in-distribution settings SPARC is described as competitive but not dominant; the paper states it is "particularly designed to handle OOD dynamics."
  • Gran Turismo — power and mass: Averaged over 3 seeds, SPARC achieved a BIAI lap-time ratio of 0.9907 ± 0.0011 with 99.90 ± 0.10% success, the best of all methods including the Oracle (0.9962 ± 0.0067, 99.27 ± 0.58%). RMA scored 1.0004 ± 0.0030 with 99.17 ± 0.28%. The authors note the Oracle does not receive history as input and suggest history helps mitigate partial observability.
  • MuJoCo wind perturbations: Averaged over 5 seeds, SPARC outperformed all baselines in 2 of 3 environments. HalfCheetah-v5: SPARC 10017.90 ± 476.19 versus RMA 9033.87 ± 634.11. Walker2d-v5: SPARC 2528.25 ± 263.58 versus RMA 2306.23 ± 222.09. On Hopper-v5, SPARC scored 1348.22 ± 53.67 while the Oracle scored highest at 1710.14 ± 98.98.
  • Transfer to updated game physics: On the newest Gran Turismo dynamics, with policies trained only on older dynamics, the Oracle failed to finish laps with around 10% of OOD cars while SPARC reduced this to less than 5%, with significantly faster lap times. The context given to the Oracle contained only car-model information, not the simulator physics adjustments, which the authors cite as evidence of SPARC's value when contextual details are incomplete.

Methodology in Plain English

The problem is framed as a contextual Markov decision process with a set of in-distribution contexts used for training and a disjoint set of out-of-distribution contexts held out for testing. During training the agent can see privileged context information such as car parameters; at test time it cannot.

SPARC trains two networks at once. An expert policy receives the current observation plus privileged context and is trained with QR-SAC, the same off-policy algorithm used in prior Gran Turismo work. An adapter policy receives the current observation plus a history of the last H observation-action pairs and is trained by supervised regression so that its history encoding matches the expert's context encoding, minimizing the squared error between the two. Because both are trained together, the regression target moves as the context encoder improves. The adapter's observation encoder and decision layers periodically copy weights from the expert; the history adapter is learned independently. The adapter policy, not the expert, collects experience in the environment, which the authors argue brings its learning dynamics closer to on-policy and lets the algorithm correct inaccuracies before deployment.

The expert's critic networks also see context during training, but this is acceptable because only the adapter policy is needed at inference.

For Gran Turismo car-model experiments, roughly 500 vehicles were sorted by an isolation forest anomaly score over contextual features such as mass, length, width, weight distribution, power source type, drive train type, and wheel radius; the 20% most outlier vehicles became the OOD test set and the 80% most inlier cars were used for training. The paper's title refers to racing 100 unseen vehicles. For the power-and-mass experiment, one relatively standard racing car had its engine power and mass randomized within [75%, 125%] of default during training, with evaluation on fixed-spaced intervals within [50%, 150%]. Tire type was also randomized uniformly across 9 types, from Comfort Hard to Racing Soft. MuJoCo wind speeds were trained on one range and tested on intervals twice as large.

Evaluation used up to 21² = 441 test environments. Model checkpoints were selected by regularly evaluating on three predetermined IND settings to form a Pareto front. Gran Turismo results are reported as a BIAI ratio (RL lap time divided by the built-in AI lap time, lower is better), with a value of 2.0 assigned when a lap was not completed, plus the percentage of cars with a completed lap.

Experiments used 3 seeds for Gran Turismo and 5 for MuJoCo. Training was asynchronous, with rollouts on up to 20 distributed PlayStations feeding a central replay buffer and a single GPU training the networks; NVIDIA A100 GPUs with 40GB memory were used. Wall-clock training time was about 6 days for an average Gran Turismo run and approximately 14 hours for MuJoCo. Training steps were 3M for MuJoCo, 6M for Gran Turismo power-and-mass, 9M for car models, and 12M for the Nürburgring track.

Why This Matters

Impact on research: SPARC removes an entire training stage from the dominant two-phase recipe for context-adaptive RL, and shows that the moving-target regression it creates does not prevent effective adaptation. It also connects naturally to off-policy training, asynchronous distributed rollouts, and on-device continual learning, which the authors argue RMA cannot support in a straightforward manner. The paper additionally reports a rare zero-shot transfer test onto changed simulator physics.

Real-world applications:

  • Autonomous driving and vehicle control, where road friction, vehicle mass, and powertrain characteristics vary and exact parameters are unknown at deployment.
  • Legged and wheeled robotics operating on terrain or in weather conditions different from training.
  • On-device continual learning in settings where cloud retraining is impractical due to privacy or latency constraints.
  • Sim-to-real transfer, where the deployment environment contains dynamics the simulator never modeled.

Industry relevance: The work comes from Sony AI with academic collaborators at TU Eindhoven and The University of Texas at Austin, and evaluates on Gran Turismo 7, a commercial PlayStation title. It reflects a concrete industrial case where the simulation itself changes through game updates, a situation analogous to firmware or hardware revisions in deployed robotic products. The general method is not racing-specific and applies to any setting where a context can be observed during training but not at test time.

Future Directions

  1. Physical robot validation. The authors explicitly name testing SPARC on physical robotic platforms as an important next step, since all results here come from simulators.
  2. Training efficiency. Optimizing training efficiency is listed as another next step. The reported compute (6 days per Gran Turismo run on up to 20 PlayStations plus an A100 GPU) is substantial.
  3. Understanding why single-phase beats two-phase. The paper attributes SPARC's edge over RMA to avoiding phase-1 checkpoint selection, but this is presented as a belief rather than as an isolated experiment. A direct study of the moving-target regression dynamics would clarify the mechanism.
  4. Extending to settings with no privileged context at all. SPARC still relies on privileged context during training; whether the approach transfers to domains where such information cannot be collected is an open question, as is behavior on richer or higher-dimensional context spaces.

Target Audience

Reinforcement learning researchers working on generalization, domain randomization, or meta-learning; robotics engineers who need controllers that adapt to unseen dynamics without explicit system identification; and practitioners applying off-policy RL in simulation-heavy industrial settings such as autonomous driving, motorsport, and legged locomotion. Readers already familiar with RMA, QR-SAC, and contextual MDPs will get the most from the method section, though the results tables and the high-level comparison to two-phase training are accessible to anyone with a general RL background.

Authors’ abstract

Generalization to unseen environments is a significant challenge in the field of robotics and control. In this work, we focus on contextual reinforcement learning, where agents act within environments with varying contexts, such as self-driving cars or quadrupedal robots that need to operate in different terrains or weather conditions than they were trained for. We tackle the critical task of generalizing to out-of-distribution (OOD) settings, without access to explicit context information at test time. Recent work has addressed this problem by training a context encoder and a history adaptation module in separate stages. While promising, this two-phase approach is cumbersome to implement and train. We simplify the methodology and introduce SPARC: single-phase adaptation for robust control. We test SPARC on varying contexts within the high-fidelity racing simulator Gran Turismo 7 and wind-perturbed MuJoCo environments, and find that it achieves reliable and robust OOD generalization.

Read the original paper