TL;DR
This paper introduces Scenic4RL, a framework that uses the SCENIC scenario specification language to programmatically generate diverse, realistic training environments for Reinforcement Learning (RL) in complex real-time strategy settings like soccer. By bridging high-level programmatic control with the Google Research Football (GRF) simulator, the authors demonstrate how to improve agent generalization and incorporate domain knowledge through "semi-expert" programmatic policies.
What Problem Does This Paper Address?
Reinforcement Learning agents are only as good as the data they train on. In complex Real-Time Strategy (RTS) environments—like soccer—agents often struggle to generalize because simulators typically rely on random generation from a few fixed layouts. This leads to two major issues:
- Lack of Diversity: Randomly sampled scenarios often aren't "realistic" or challenging enough to prepare agents for the infinite variety of real-world interactions.
- Lack of Control: Researchers can't easily specify complex behaviors for non-RL agents (like teammates or opponents), making it hard to "debug" specific failure cases or test niche tactical scenarios.
Methods
The authors propose using SCENIC, a domain-specific, probabilistic programming language, to define scenarios. Unlike standard simulator scripts that require hand-coding coordinates, SCENIC uses an intuitive, English-like syntax to describe spatial relationships (e.g., ball ahead of ego by 0.1) and agent behaviors.
Key technical contributions include:
- SCENIC-GRF Interface: A bridge that allows the SCENIC server to govern the Google Research Football simulator, sampling initial states and managing interactive behaviors in real-time.
- Programmatic Behavior Modeling: Using
try/interruptblocks in SCENIC to create sophisticated, hierarchical behaviors for non-RL agents (e.g., an opponent that dribbles until a defender gets close, then attempts a pass). - Stochastic Programmatic Policies: Researchers can write "semi-expert" policies in SCENIC to generate high-quality demonstration data, which is then used to pre-train RL agents via imitation learning.
Datasets
The authors introduced a new benchmark consisting of 32 realistic scenarios encoded in SCENIC. This includes:
- 13 Mini-game Scenarios: Focused tasks like "Hard Crossing" or "3 vs 3 Cross from Side" designed for faster iteration.
- Generalized Test Sets: For each training scenario, they created a "generalized" version (e.g., mirroring the field or changing player distributions) to rigorously test if the agent actually learned the underlying tactic or just memorized coordinates.
Key Insights and Ideas
- Generalization is Brittle: Agents that performed excellently in training often failed completely on "mirrored" versions of the same scenario. This highlights a massive "overfitting" problem in current RL benchmarks.
- SCENIC as a Debugger: The framework allows researchers to "unit test" their agents. If an agent fails a specific tactic, a researcher can program a SCENIC scenario to isolate that failure, fine-tune the agent there, and see immediate improvement.
- Domain Knowledge is a Force Multiplier: Pure RL (like PPO) often fails on complex coordination tasks. By using SCENIC to write simple "semi-expert" rules and generating just 8,000 demonstration samples, the authors could train agents to solve scenarios that were previously "unsolvable" by pure RL.
Key Results
- Generalization Gap: In offense scenarios, agents showed a significant performance drop when tested on generalized versions. For example, a "Pass and Shoot" agent with a ~0.6 goal difference in training dropped to near zero in testing.
- Debugging Success: An RL agent trained on a full 11v11 game failed a specific "open teammate" test scenario (goal difference of 0.1). After fine-tuning on a mirrored version of that scenario for just 5M steps, its performance on the original failure case jumped to 0.67.
- Training Acceleration: Using SCENIC-generated demonstration data for pre-training allowed agents to achieve high performance in difficult scenarios (like "11 vs GK") where standard PPO training barely made progress.
Limitations and Future Work
The primary limitation is computational overhead. Adding the SCENIC layer over the GRF simulator resulted in a 2.99x slowdown in simulation speed. This is largely due to the need to update Python scenario files and disk-access overhead for each episode.
Future work aims to:
- Optimize the interface to reduce this overhead (e.g., avoiding disk-access).
- Expand the library of behaviors and scenarios to create even more complex RTS benchmarks.
- Apply the SCENIC-RL approach to other domains beyond soccer, such as autonomous driving or robotics.
Summary updated