Out-of-Distribution Generalization with a SPARC: Racing 100 Unseen Vehicles with a Single Policy
Bram Grooten, Patrick MacAlpine, Kaushik Subramanian, Peter Stone, Peter R. Wurman
Accepted as an oral at AAAI 2026.
Paper: https://arxiv.org/abs/2511.09737
Video: https://youtu.be/rrcj_oovzWE
SPARC is a single-phase adaptation method for robust control. It works especially well in out-of-distribution (OOD) environments, where the agent adapts to new contextual conditions without access to privileged context information at test time. SPARC is able to infer the context through a history of the agent's own actions and observations.
The paper presents experiments on Gran Turismo 7 and MuJoCo environments. The code for Gran Turismo 7 (which runs exclusively on PlayStation) is proprietary and not included in this repository. The MuJoCo code is open source. We include the newly created benchmarks for MuJoCo environments with wind:
WindHalfCheetah-v5WindHopper-v5WindWalker2d-v5
These are all in the environments folder. See all methods in the algorithms directory.
Run the following commands to install:
conda create -n sparc python=3.10
conda activate sparc
pip install -r requirements.txtTo train SPARC on a wind-perturbed MuJoCo environment, run:
python -m train --alg sparc --env WindHalfCheetah-v5 --wandb_mode disabledImplemented algorithms are:
- SPARC
- RMA (note: this baseline must be trained in 2 separate phases, see both files)
- SAC (only observations as input)
- History Input (no context inference, history as input)
- Oracle (privileged context information, even at test time)
To view the wind-perturbed environments, run:
python -m utils.visualize_envsInside that script, you can adjust the environment and the wind strength.
The following table shows the wind ranges that we used in our experiments:
| Environment | Train x | Train z | Test x | Test z |
|---|---|---|---|---|
| HalfCheetah | [-2.5, 2.5] | [-5, 5] | [-5, 5] | [-10, 10] |
| Hopper | [-10, 10] | [-2.5, 2.5] | [-20, 20] | [-5, 5] |
| Walker2d | [-10, 10] | [-2.5, 2.5] | [-20, 20] | [-5, 5] |
If you find our work useful, please consider citing us:
@article{grooten2025sparc,
title={{Out-of-Distribution Generalization with a SPARC: Racing 100 Unseen Vehicles with a Single Policy}},
author={Bram Grooten and Patrick MacAlpine and Kaushik Subramanian and Peter Stone and Peter R. Wurman},
year={2025},
journal={Proceedings of the AAAI Conference on Artificial Intelligence}
}
