A lot of accelerator tuning is one job done over and over. The beam coming into a transfer line shifts a little, and the best corrector settings shift with it. So we run the optimizer again, as if we'd never seen the problem. You could train a network to jump straight to the settings. But every training example would need its answer, and each answer is one more optimizer run (which may not have found the best one). My idea was to leave the answers out. Put a reward model you can differentiate after the policy network, and let the gradient of the reward do the teaching. I called it a single-shot policy. We tried it in simulation, and on one laser bench at LBNL. The write-up is LBNL-led (Dan Wang et al., I'm fifth of seven) and isn't published yet.
- 0optimal actions needed to train the policy
- 0.9038mean simulated injection efficiency on incoming beams the policy had never seen
- 63.96centre intensity, out of a possible 64, in the eight-beam combining simulation
One step
A reinforcement-learning agent acts, looks at what happened, acts again, and adds up its reward over the episode. A lot of tuning problems don't need the second look. Once the monitors tell you the state, the state already decides the best action (the paper calls these deterministic problems). So the episode can be a single action, scored on its own. That's the single shot.

Training through the reward
There are two networks. R-Net () takes a state and an action and predicts the reward. P-Net () takes a state and proposes an action. Feed P-Net's action into R-Net, and the predicted reward can be differentiated all the way back into P-Net's weights.
is the state, the policy network and the reward model, so is the reward predicted for the action the policy itself proposed.
So the loss is just minus the mean reward over a batch of states. Nowhere does it ask what the right action was.
The transfer line
The first test was the line that takes electrons from the booster into SPEAR3 at SSRL, in simulation. (RCDS-S had chased a drift on the same line in simulation.) The policy set four correctors near the start (two horizontal, two vertical) and read x and y at all nine BPMs. What it wanted was injection efficiency at the far end. It couldn't see the incoming beam. We randomized its position and angle.

Accelerator Toolbox, the MATLAB code we simulated it in, can't be differentiated, so this case needed an R-Net, fitted on a few thousand Latin-hypercube samples. The test was 1,000 incoming beams neither network had seen. Before the step, efficiency was often close to zero. After it, the mean was close to the best possible (about 0.904).

Combining laser beams
Coherent beam combining is the laser version of the same kind of problem. Several beams overlap on a diffractive optic, and how much power lands in the centre spot depends on their relative phases. Those drift (heat alone will do it). The camera only shows you the pattern they make. In our simulation eight beams sat in a 3×3 grid with no centre beam. The policy saw a 5×5 patch of the camera and set eight phases, and the reward was the centre pixel, 64 at most. We wrote the simulation in PyTorch, so it could be differentiated and needed no R-Net.
Trained on only 100 random starts, the policy already landed just under 64. More starts helped. With 3,000 it got closer still, and the spread tightened a lot.


Then 9×9, 81 beams, the size LBNL's group is working toward. No 9×9 setup was available yet, so this only checked that the method scales. The policy read a 17×17 patch and set 81 phases. We trained it on 30,000 starts, none more than 30 degrees out of phase. It raised the mean centre intensity from about 5,990 to about 6,510, and the paper says outright that it did worse than the small case. Why it did worse is still just a note of mine in the draft.


The bench at LBNL
The hardware tests were on LBNL's eight-way combining bench, and the trace below is from 7 September 2023. The bench belongs to LBNL's laser-control group, and so does DDRM, the method they had for keeping it combined. It was built for fibre amplifiers that weren't in yet. So for this test one CW laser was split eight ways (same 3×3 grid, no centre) and piezo mirrors set the phases.
No differentiable model of the real bench exists, so this time R-Net had to learn from data. We ran SPGD on the bench (stochastic parallel gradient descent, which jiggles all the phases and follows whatever raises the centre). We logged 20,000 camera patterns, each with the phase step that followed. R-Net trained on them in under a minute. P-Net needed no live data (we generated its patterns) and was done within a minute too. The fiddly part was the scale on P-Net's output. Too large and the policy wanders where R-Net has never been, too small and good answers are out of reach. We settled on 1.5 after a few tries.

With the policy on, the centre power held steady. Paused, it sagged and jittered. Then we threw the phases off on purpose, switched the policy back on, and the power came straight back to where it had been. Against DDRM at the end, the manuscript reads it as more combined power with similar, slightly worse stability. The draft has no numbers for this run yet, only the trace.
The unfinished paper
Everything on the SLAC side is simulation, and nothing was deployed. The draft has no timing against a search, so there's no speed-up to report. The paper hopes the policy can ride out drift without retraining. No result shows that yet. The draft isn't finished or submitted, and so far there's only an abstract, at IPAC'24.
Numbers and figures are from the draft manuscript, "Simplified reinforcement learning enabled deterministic feedback controls in lasers and accelerators: experimental demonstration on laser combining" (Wang, Du, Zhou, Wilcox, Zhang, Huang and Ratner, not yet published), shown here with Dan Wang's permission. The one-step sketch is mine.