📋Running Benchmarks
This guide covers how to run reproducible benchmarks with SLM Lab, including hyperparameter search methodology and best practices.
Quick Start
After installation, copy SPEC_FILE and SPEC_NAME from result tables in the benchmark pages.
Running Benchmarks
Local - runs on your machine (Classic Control: minutes):
slm-lab run SPEC_FILE SPEC_NAME trainRemote - cloud GPU via dstack, auto-syncs to HuggingFace:
source .env && slm-lab run-remote --gpu SPEC_FILE SPEC_NAME train -n NAMERemote setup: cp .env.example .env then set HF_TOKEN. See Remote Training for dstack config.
Atari
PPO, SAC, and A2C all support Atari. Each algorithm has a template spec file. Use -s env=ENV to substitute:
source .env && slm-lab run-remote --gpu -s env=ALE/Pong-v5 slm_lab/spec/benchmark_arc/ppo/ppo_atari_arc.yaml ppo_atari_arc train -n pongDownload Results
Trained models and metrics sync to HuggingFace. Pull locally:
Replay Trained Model
Standardized Settings
Fair comparison requires consistent configurations across environment categories:
Category
num_envs
max_frame
log_frequency
max_session
Classic Control
4
2e5-3e5
500
4
Box2D
8
3e5
1000
4
MuJoCo
16
1e6-10e6
10000
4
Atari
16
10e6
10000
4
Three-Stage Search Process
When tuning hyperparameters or adding new environments, use this systematic approach:
1. ASHA
search
max_session=1, search_scheduler enabled
Wide exploration with early termination
2. Multi
search
max_session=4, NO search_scheduler
Validate top configs with multiple seeds
3. Final
train
Best hyperparameters committed to spec
Confirmation run for benchmark table
Stage 1: ASHA Search
ASHA (Asynchronous Successive Halving) terminates unpromising trials early, focusing compute on promising configurations.
Stage 2: Multi-Seed Validation
After ASHA, validate top 3-5 configurations with multiple seeds (no early stopping):
Single runs can be lucky—averaging 4 independent runs reveals true performance.
Stage 3: Final Validation
Update spec defaults with best hyperparameters, then run in train mode:
Search Space Sizing
Rule: ~3-4 trials per search dimension minimum.
max_trial
Max Dimensions
Use Case
8
2-3
Focused refinement
12-16
3-4
Typical search
20
5
Wide exploration
30
6-7
Broad ASHA search
High-Impact Hyperparameters
Focus on these first—they have the largest effect on performance:
1
Learning rate
agent.net.optim_spec.lr
1e-5 to 1e-3
2
Discount factor
agent.algorithm.gamma
0.98-0.999
3
GAE lambda
agent.algorithm.lam
0.9-0.99
4
Entropy coefficient
agent.algorithm.entropy_coef_spec.start_val
0.001-0.1
5
Clip epsilon
agent.algorithm.clip_eps_spec.start_val
0.1-0.3
Less impactful (fix based on successful runs): minibatch_size, training_epoch, network architecture.
Grace Period by Environment
The grace_period determines minimum frames before ASHA can terminate trials:
Environment
grace_period
Reasoning
Classic Control
10000-50000
Fast learning, quick signal
Box2D
50000-100000
Medium complexity
MuJoCo
100000-1000000
Slower learning curves
Atari
500000-1000000
Need significant training for signal
Template Specs
Template specs use ${var} placeholders for flexibility across similar environments:
ppo_mujoco_arc.yaml
env, max_frame
All 11 MuJoCo
ppo_atari_arc.yaml
env
All 57 Atari games
sac_atari_arc.yaml
env
All Atari games
a2c_atari_arc.yaml
env
All Atari games
MuJoCo Tips
Unified vs Individual Specs
ppo_mujoco: HalfCheetah, Walker2d, Humanoid, HumanoidStandup (gamma=0.99, lam=0.95)ppo_mujoco_longhorizon: Reacher, Pusher (gamma=0.997, lam=0.97)Individual specs: Hopper, Swimmer, Ant—each has environment-specific tuning
Common Issues
Reward not improving
Try higher training_iter (8-16) for more gradient updates
Unstable learning
Try lower learning rate or enable clip_vloss: true
Large reward variance
Enable normalize_v_targets: true for value normalization
Atari Tips
Lambda Variants
Different games benefit from different lambda values:
ppo_atari_arc
0.95
Strategic games (Qbert, Seaquest)
ppo_atari_lam85_arc
0.85
Mixed games (MsPacman)
ppo_atari_lam70_arc
0.70
Action games (Breakout, Pong)
Best practice: Test all three variants per game; use the best result.
v5 Environment Difficulty
Gymnasium ALE v5 uses sticky actions (25% repeat probability) per Machado et al. 2018. This makes environments harder than OpenAI Gym v4—expect 10-40% lower scores.
Troubleshooting
When Progress Stalls
Check GPU metrics (
dstack metrics <run-name>)—low GPU util means bottleneck in env stepping or config issueCompare with successful specs—review what worked for similar environments
Look for patterns—same failure across runs suggests framework issue, not hyperparameters
Research reference implementations—check CleanRL or Stable-Baselines3 configs
Kill unpromising runs early—iterate faster with new approaches
Common Mistakes
Too many search dimensions
Focus on 2-3 high-impact parameters per search
Skipping multi-seed validation
Always run max_session=4 before finalizing
Using search results directly
Always run final train mode with committed spec
Inconsistent settings
Verify spec matches standardized settings table
Recording Results
After a successful run:
Extract final score from logs:
Pull results:
Update spec defaults with best hyperparameters
Commit spec file for reproducibility
Algorithms
REINFORCE
On-policy
Learning/teaching
Classic
SARSA
On-policy
Tabular-like
Classic
DQN/DDQN+PER
Off-policy
Discrete actions
Classic, Box2D, Atari
A2C
On-policy
Fast iteration
Classic, Box2D, Atari (57)
PPO
On-policy
General purpose
Classic, Box2D, MuJoCo (11), Atari (57)
SAC
Off-policy
Continuous + discrete
Classic, Box2D, MuJoCo, Atari (48)
Environments
Benchmark Spec Reference
All benchmark specs are in slm_lab/spec/benchmark_arc/, organized by algorithm.
REINFORCE / SARSA
Simple algorithms for learning fundamentals. CartPole only.
DQN Family
Value-based algorithms for discrete action spaces.
Classic
dqn_boltzmann_cartpole_arc, dqn_epsilon_greedy_acrobot_arc, ddqn_per_acrobot_arc, etc.
A2C
On-policy actor-critic with synchronized updates using GAE (Generalized Advantage Estimation).
Classic
a2c_gae_cartpole_arc, a2c_gae_acrobot_arc, a2c_gae_pendulum_arc, a2c_gae_lunar_arc
PPO
Proximal Policy Optimization -- robust across all environment types.
SAC
Soft Actor-Critic -- works for both continuous and discrete action spaces.
Performance Results
For scores, training curves, and trained models:
Discrete Benchmark — Classic Control, Box2D
Continuous Benchmark — MuJoCo
Atari Benchmark — 57 Atari games
Public Benchmark Data — HuggingFace download links
Last updated
Was this helpful?