Abstract
Optical neural networks enable massively parallel and energy-efficient computing, making them a promising candidate for future sustainable computing architectures. However, the non-differentiability of these systems prohibits gradient-based optimisation, making training these networks a significant challenge. We introduce a meta-learning scheme that employs reinforcement learning to generate a gradient-free optimiser capable of training physical networks on various tasks in situ. The learned optimiser can improve training time and final accuracy compared to existing gradient-free methods when training a diffractive optical network on a variety of image classification tasks, providing a new option for gradient-free training general neuromorphic systems in situ.
Introduction
As the demand for artificial intelligence compute outpaces the scaling of traditional silicon-based architectures, Physical Neural Networks (PNNs)—particularly optical ones—have emerged as a sustainable alternative. By utilizing light instead of electricity, these systems offer massive parallelism and near-zero energy consumption during inference.
Despite their potential, PNNs face a significant "programming" bottleneck. Standard deep learning relies on the backpropagation algorithm, which requires a differentiable mathematical model of the system. Physical hardware, however, often behaves as a "black box" with complex, non-linear dynamics and misalignments that are difficult to model perfectly. While training in simulation and transferring weights to hardware is common, the "reality gap" between simulation and physical reality often leads to a substantial drop in performance. Existing gradient-free methods, such as evolutionary strategies, often fail to scale effectively as the number of parameters increases.
System Architecture and Methods
The researchers propose a meta-learning scheme that bypasses the need for analytical gradients. Instead, they employ Reinforcement Learning (RL) to evolve a custom optimization policy ($\pi_\phi$) tailored to the specific physical system.
The experimental setup consists of a diffractive optical network. As shown in Figure 1, the system uses a laser source and two Spatial Light Modulators (SLMs). The first SLM encodes input data ($x$), such as MNIST digits, into the phase of the laser beam. The second SLM applies trainable weights ($\theta$). A camera then captures the resulting intensity pattern, $f_\theta(x)$, which represents the network's output. This output is mapped to specific classes (e.g., digits 0-9) based on the intensity in predefined regions of interest.
To train this system, the authors utilize the Soft Actor-Critic (SAC) algorithm to develop an RL agent. The agent's "action" is to predict the optimal parameter update ($\Delta\theta$) for the optical network based on the current loss and state. The agent is rewarded based on its ability to reduce the task's loss function, effectively "learning to learn" the specific optimization landscape of the optical hardware. To enhance efficiency, the RL agent’s internal architecture—a complex-valued CNN with LSTM units—incorporates "Fourier layers" that mirror the physical behavior of light diffraction.
Experimental Results
The approach was evaluated using the MNIST handwritten digit dataset. To ensure the optimizer learned a generalizable strategy rather than a specific solution, the researchers generated 30 distinct tasks by randomly permuting the mapping between output intensity pixels and digit classes.
The meta-trained optimizer, referred to as RLOpt, was tested on 30 unseen tasks. The results demonstrate that RLOpt can achieve final accuracies and training speeds comparable to Stochastic Gradient Descent (SGD), the gold standard for traditional differentiable networks.
As seen in Figure 2, RLOpt (represented by the light blue curves) shows a rapid increase in test accuracy across various tasks, often matching the trajectory of SGD (dashed black line). This indicates that the RL agent successfully learned a robust optimization strategy capable of navigating the non-differentiable landscape of the optical system in situ.
Key Insights and Discussion
A central contribution of this work is the concept of learning "pseudo-gradients." The RL agent does not calculate analytical gradients; instead, it learns a distribution of updates that effectively minimize loss. This allows the system to account for physical imperfections, such as wavefront distortion and sensor noise, which are naturally present during in situ training but difficult to capture in a static digital twin.
Furthermore, the inclusion of physical priors (e.g., Fourier transforms) in the RL agent's architecture was found to be critical for the stability and speed of the meta-learning process. By embedding knowledge of the underlying physics into the optimizer, the researchers bridged the gap between purely data-driven RL and model-based optimization.
Conclusion and Future Work
This meta-learning approach provides a viable path for training complex, non-differentiable physical systems. While meta-training remains computationally intensive and sensitive to task distribution, the ability to achieve performance parity with gradient-based methods on physical hardware is a significant milestone. Future research will focus on model-based reinforcement learning to further refine the balance between physical priors and learned strategies, as well as deploying the system on physical hardware to test its resilience against real-world environmental fluctuations.
Summary updated