Offline Model-Based Reinforcement Learning for Tokamak Control

Ian Char, Joseph Abbate, Laszlo Bardoczi, Mark D. Boyer, Youngseog Chung, Rory Conlin, Keith Erickson, Viraj Mehta, Nathan Richner, Egemen Kolemen, Jeff G. SchneiderL4DC 2023

TL;DR

This paper demonstrates one of the first successful applications of offline model-based reinforcement learning (MBRL) to control a real-world nuclear fusion reactor. By training a neural dynamics model on 18 years of historical data from the DIII-D tokamak, the authors created a surrogate simulator to train a reinforcement learning policy, which was then successfully deployed on the actual reactor to control plasma pressure ($\beta_N$) and rotation.

What Problem Does This Paper Address?

Nuclear fusion holds the promise of virtually unlimited clean energy, and the tokamak—a device that confines plasma in a donut shape using massive magnetic fields—is the leading technology to achieve it. However, controlling the plasma inside a tokamak is incredibly difficult due to highly complex, non-linear fluid and magnetic dynamics.

The complex magnetic field structure of a tokamak, showing the toroidal and poloidal components required for plasma confinement.

Deep Reinforcement Learning (RL) is great at solving complex control problems, but standard RL algorithms require millions of trial-and-error interactions with the environment. You cannot do trial-and-error on a $100M+ fusion reactor; a bad action can cause a plasma disruption that damages the machine. Furthermore, existing physics simulators for tokamaks are either too computationally expensive or not accurate enough for RL training. The authors tackle this by asking: Can we learn a safe, effective RL controller entirely offline using only historical logged data, and deploy it zero-shot to the real reactor?

Methods

The authors frame tokamak control as a partially observable Markov decision process (POMDP) and solve it using an offline Model-Based Reinforcement Learning (MBRL) approach:

  1. Learning a Dynamics Model: Instead of relying on a physics simulator, they trained a fully connected neural network to predict the plasma's state 100ms into the future, given the current state and planned actuator commands. To capture the uncertainty necessary for safe "sim2real" transfer, they trained an ensemble of networks using a technique called network simplices, which provides better-calibrated uncertainty than standard ensembling.
  2. State and Action Spaces: The state includes scalar values (like electron density and $\beta_N$, the ratio of plasma pressure to magnetic pressure) and PCA-reduced radial profiles (like pressure and ion rotation). The actions are the total power and torque injected by the tokamak's neutral beams.
  3. Controller Training: They used the learned dynamics model as a fictitious simulator to generate experience. A policy was then trained on this simulated experience using Proximal Policy Optimization (PPO) to track specific targets for $\beta_N$ and Differential Rotation (DR).
  4. Real-World Deployment: The PyTorch-trained policy was converted to C using the Keras2c library and deployed directly into the DIII-D Plasma Control System for live testing.

Datasets

The authors utilized a massive historical dataset from the DIII-D tokamak (operated by General Atomics in San Diego).

  • The dataset consists of 15,534 historical shots (runs of the reactor), which translates to 268,702 time steps of data.
  • The data spans 18 years of operation, providing a highly diverse, undirected set of plasma behaviors and actuator settings.

Key Insights and Ideas

  • Undirected Data is Enough: Many offline RL benchmarks assume the dataset contains sub-trajectories of "good" behavior that just need to be stitched together. This work proves you can learn a robust global dynamics model from highly varied, undirected historical data, and use it to synthesize entirely new control strategies.
  • Uncertainty is Key for Sim2Real: When an RL agent trains against a learned model, it tends to exploit the model's blind spots. By using an ensemble of network simplices, the authors forced the RL agent to learn a policy robust to different physical possibilities, which was critical for ensuring the policy didn't fail catastrophically on the real machine.
  • Coupled Dynamics Make Multi-Objective Control Hard: The controller struggled to track Differential Rotation (DR). The authors hypothesize this is because changing the beam torque to fix DR also impacts $\beta_N$. Because $\beta_N$ is easier to predict and track, the RL optimizer implicitly prioritized it, refusing to make drastic torque changes that might compromise $\beta_N$ stability.

Key Results

The authors tested their models live on the DIII-D tokamak with two main experiments:

  • Feedforward Control: To test the dynamics model's predictive power, they used it to search for optimal static beam settings. The model suggested 3.6 MW of power and 2.1 Nm of torque. When applied to the real reactor, these settings hit the target $\beta_N$ of 1.75 remarkably well and successfully elevated the differential rotation.
  • Feedback Control: The PPO-trained policy was deployed live to dynamically adjust beam power to track step-increases in $\beta_N$ targets. The controller successfully increased power to hit the targets.
Experimental results showing the tracking of Differential Rotation (DR) and plasma pressure ($\beta_N$) alongside the corresponding beam power and torque actuators.

Limitations and Future Work

  • Limitations: The learned dynamics model still exhibited some overconfidence (miscalibration). Additionally, due to strictly limited experimental time on the DIII-D reactor, the authors could not benchmark their RL controller against pre-existing classical controllers (like PID). Finally, a bug in the experimental setup for beam power scaling exacerbated plasma disruptions during the feedback tests.
  • Future Work: The authors suggest exploring test-time adaptation—using the diverse predictions of the model ensemble to adapt the policy on the fly during a live shot. They also highlight the need for better offline policy evaluation metrics to confidently predict which RL policies will succeed before deploying them on multi-million dollar hardware.

Summary updated

BibTeX
@inproceedings{char2023offline,
  author = {Ian Char and Joseph Abbate and Laszlo Bardoczi and Mark D. Boyer and Youngseog Chung and Rory Conlin and Keith Erickson and Viraj Mehta and Nathan Richner and Egemen Kolemen and Jeff G. Schneider},
  title = {{Offline Model-Based Reinforcement Learning for Tokamak Control}},
  booktitle = {L4DC},
  year = {2023},
}
Figure