Search arXiv⌕ Search

arXiv · 2611.23875

In Situ Training of Optical Neural Networks by Coding Agents

Abstract

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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Ilker Oguz, Colin Christian, Christophe Moser, Demetri Psaltis, Gordon Wetzstein. 2026-11-18. In Situ Training of Optical Neural Networks by Coding Agents. https://searcharxiv.org/abs/2611.23875

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search arXiv by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

Light propagation in dielectric materials: a microscopic derivation of the refractive index and of the extinction theorem

We present a compact, self-contained derivation of the field established inside a dielectric by an incident light wave, starting from the picture of the material as a collection of polarizable atoms (or molecules) in vacuum, each driven by the incident field and by the fields re-radiated by all the others. Following the integral-equation route of Goldberger and Watson, the same few lines of calculation yield the Lorentz local field, the Lorentz-Lorenz relation between the refractive index and the atomic polarizability, and the Ewald-Oseen extinction theorem: the incident wave is cancelled inside the medium by a field radiated by the induced dipoles and replaced by a wave travelling at $c/n$. The dilute limit is connected to the forward-scattering amplitude, the optical theorem and Rayleigh scattering. We then discuss, for a planar interface, in what sense reflection and refraction are a bulk effect for s-polarized light and a combination of bulk and surface (bound-charge) effects for p-polarized light, and why that surface term must not be confused with the local-field correction, although both stem from the same depolarization mathematics. Finally, a small coupled-dipole simulation of a random, finite collection of point dipoles checks the self-consistent local-field relation numerically. SI units are used throughout. The material is intended for an advanced undergraduate course on electromagnetism and optics.

physics.optics↗

Full-field-of-view aberration correction for large arrays of focused beams

We propose and implement an aberration correction method for the creation of extended arrays of spots well beyond the isoplanatic region of any optical system. The method relies on an extensive calibration of aberrations in terms of Zernike polynomials over the full accessible field of an optical system. We introduce a modified Gerchberg-Saxton algorithm for generating holographic phase masks creating fully corrected arbitrary arrays of spots. By applying the method to an aspherical lens, and using a liquid-crystal spatial light modulator (SLM), we increase the aberration-free field of view from 50 to 500 $μ$m, only limited by the largest diffraction angles accessible to the SLM. This opens new perspectives for the generation of large arrays of optical tweezers, especially for neutral atom based quantum processors and simulators.

physics.optics↗

Doubly resonant nonlinear metasurfaces enabling NIR-to-UV upconversion for reconfigurable Fourier optical processing

Fourier optical processing underpins optical information manipulation, yet extending such operations to short wavelengths within compact platforms remains challenging. Here, we address this challenge by embedding reconfigurable Fourier-domain processing within NIR-to-UV upconversion in a doubly resonant nonlinear metasurface. When coherently illuminated at the Fourier plane with an image-bearing signal and a spatially structured pump, the metasurface generates UV images via degenerate four-wave mixing. Crucially, the spatial-frequency content of these upconverted images is selectively shaped by the tailored spectrum of the pump. To boost the efficiency of this nonlinear process, the metasurface is designed to simultaneously support a toroidal dipole bound state in the continuum and a magnetic dipole resonance, providing spectrally aligned and independently enhanced field localization for signal and pump beams, respectively. Building on this architecture, we experimentally demonstrate directional and continuously tunable filtering at the upconverted UV wavelengths. These results establish nonlinear metasurfaces as a versatile platform for Fourier optics and reconfigurable all-optical image processing.

physics.optics↗