Researchers introduce "optics as code," a method where a coding agent — a large language model that writes and executes programs — trains an optical neural network (ONN) directly from hardware measurements without requiring per-device calibration or differentiable models. The agent interacts with the physical ONN through a harness that returns camera images of optical probes in response to programmatic hypotheses, iteratively forming a physical understanding of the system and reparametrizing the network with interpretable optical elements tuned on the hardware. Evaluated on classification and image encoding tasks, the approach outperforms gradient-free optimization baselines and approaches the performance of backpropagation through a calibrated digital twin, but at a fraction of the engineering cost. By eliminating the need for expert-built calibrated models or hardware gradients, and improving with more capable language models, this method offers a scalable, practical pathway for deploying large ONNs and a general tool for calibrating and optimizing optical experiments in situ.
Read original
huggingface/daily-papers