Inside a tokamak, a giant magnetic donut, plasma is heated to hundreds of millions of degrees. It doesn't touch the walls; it floats in a vacuum, held by invisible magnetic fields. But plasma is finicky: a slight change in current or pressure and its shape starts to wobble like jelly on a plate. To keep it in place, you need to know its exact position every millisecond.
Conventional programs are too slow for this. They solve complex equations, like an accountant recalculating every number by hand. Scientists found a faster way: they taught the computer to "feel" the plasma indirectly, through magnetic fields outside the chamber, and instantly infer its shape. For this, they used off-the-shelf machine learning tools, PyTorch and TensorRT, which speed up computations on graphics cards.
The new algorithm is called PTEFIT. It runs on the EXL-50U tokamak and takes just 0.268 milliseconds per frame — faster than a fly's wingbeat. That's enough to control the magnetic coils in real time: keep the plasma centered in the chamber and maintain the desired shape of the magnetic field lines.
This approach is like switching from manual driving to autopilot. Instead of solving equations from scratch every time, the program learns from examples and then acts instantly. This paves the way for more stable operation of future fusion reactors, where plasma must be controlled continuously, without pauses.
The temperature of plasma in a tokamak is several times higher than at the center of the Sun, but it is held not by walls but by a magnetic field, like an invisible bottle.