INITIALIZING NEURAL CORE INICJALIZACJA RDZENIA NEURONOWEGO

overcl
RACING
cked

Technical Case Study

From Soft Actor-Critic to Teacher–Student Distillation

A full engineering account of how we built a neural driver for TORCS — from exploratory reinforcement learning to an Optuna-tuned analytic teacher distilled into a 429 KB network.

Read the full report (PDF, 14 pages)

01 Abstract

We document the end-to-end development of a neural-network driving agent for the Corkscrew circuit (Laguna Seca, 3,602 m) in TORCS, interfaced through the SCR protocol at 50 Hz. The project progressed through five stages — from exploratory Soft Actor-Critic baselines, through a curriculum with LayerNorm-stabilised networks (which exposed a critic divergence), to a residual-RL stack whose five-layer failure cascade we diagnosed and repaired.

The final pipeline optimises a 54-parameter analytic teacher with a distributed Optuna search (~15,000 trials) and distills it into a 109k-parameter MLP via behavioural cloning and DAgger. The delivered network (bc_v6.pth, 429 KB) scored a 92.04 s standing-start lap under submission conditions. A residual Soft Actor-Critic policy on top of the same frozen network reaches the same ~92 s, so the result stands on both imitation learning and reinforcement learning.

02 The pipeline

🏎️ Analytic teacher 54 tunable parameters
🎛️ Optuna search ~15,000 headless trials
📋 Behavioural cloning 500k transitions, anti-copycat noise
🔁 DAgger 5 iterations, teacher-relabelled
🧠 bc_v6.pth 109k-param MLP · 429 KB

03 Key results

Lap replay — recorded telemetry

0 km/h 0 m
250 125 0
0 m Corkscrew chicane 3600 m
Controller evolution
Controller evolution: best standing-start lap per generation, ending in the distilled submission network.
Top speed unlock
The 174 km/h ceiling was a shift-scheduling artefact; decoupling straight/corner speed targets unlocked 244.5 km/h.
S2 divergence
A documented negative result: the S2 critic diverged by six orders of magnitude, fixed with γ=0.99, reward clipping and LayerNorm.
Lap speed profile
Speed profile of a recorded lap (telemetry): the deep minima are the Corkscrew chicane and final hairpin.

04 Lap-time progression

Agent Best lap [s]
From-scratch SAC (S1) ~105–115
DAgger NN (S3) 106.96
Teacher v3 (2,210 trials) 118.81
Teacher v5 (gear + decoupling) 91.24
Teacher v6 (racing line) ≈88.8
Submitted network bc_v6.pth (imitation) 92.04
Residual SAC on the same base (RL) ≈92

The submitted network is scored under stricter physics (fuel + damage); the teacher search ran with them disabled for throughput.

The full paper covers the MDP formulation, all equations, the reward function, the five-bug residual post-mortem, and the complete bibliography.

Open the PDF