Machine learning is helping address a long-standing magnetic stability issue in tokomak reactors.