Optical neural networks promise fast, energy-efficient computing, but every device departs from its design and must be trained with the hardware. In situ training relies on an expert-built calibrated digital model of each device or on gradient-free trial and error. Coding agents, large language models that write and run programs, have shown an emergent ability to understand and edit the weights of digital neural networks. Here we introduce optics as code, a method in which a coding agent trains an optical neural network from measurements alone, through a harness that returns camera images of its probes and requires a hypothesis per request. We discovered that the agent forms a physical understanding of the optics and reparametrizes the network with interpretable optical elements tuned on the hardware. It outperforms gradient-free methods in classification and image encoding, approaching backpropagation through a calibrated model at a fraction of the cost. Needing neither per-device calibration nor gradients through the hardware, and improving with more capable models, optics as code offers a practical route to large, scalable optical neural networks and a general tool for calibrating and optimizing optical experiments.
A Survey of Vibe Coding with Large Language Models
Institute of Computing Technology Chinese Academy of Sciences(中国科学院计算技术研究所);Duke University(杜克大学);University of California Merced(加州大学默塞德分校);Peking University(北京大学);University of Queensland(昆士兰大学)
ProjDevBench: Benchmarking AI Coding Agents on End-to-End Project Development
Shanghai Jiao Tong University, Shanghai, China(上海交通大学);Beijing Institute of Technology, Beijing, China(北京理工大学);University of California, Merced, CA, USA(加州大学默塞德分校);Shanghai Innovation Institute, Shanghai, China(上海创新研究院)