Skip navigation
Optics as code - a new paradigm in physical AI
0:00 / 0:29

Optics as code - a new paradigm in physical AI

Gordon Wetzstein

@GordonWetzstein5.9K followers

Visit on X
417 likesDownloadOriginal post

19,511 views

Optics as code - a new paradigm in physical AI Optical neural networks are notoriously hard to calibrate and suffer from the sim2real gap. We show that a coding agent with the hardware in the loop quickly tunes the optics and improves image classification from 35% to 96.8%. 🧵1/6

15 Comments

Comments from the original post on X (Twitter)

  • Gordon Wetzstein's profile picture

    @GordonWetzstein

    The agent has read every textbook and paper on optics in pretraining and acts like an expert at inference. It reaches the experiment only through a harness, forms a hypothesis, sends probes (phase masks), records camera images, and updates the hypothesis in a closed loop. 2/6

    7 likes

  • Gordon Wetzstein's profile picture

    @GordonWetzstein

    Backpropagation through a calibrated digital twin gets 96.3% but needs ~67,000 calibration images and a lot of GPU training. Gradient-free baselines stop near 52%. Optics as code gets up to 96.8% accuracy with a fraction of the measurements. 3/6

    4 likes

  • Gordon Wetzstein's profile picture

    @GordonWetzstein

    It does the physics first. From 48 probe measurements the agent worked out the geometry of the optics. Then it designs. Instead of updating several hundred thousand pixels, it writes the phase masks as lenses and prisms and tunes a few parameters on the device. 4/6

    5 likes

  • Gordon Wetzstein's profile picture

    @GordonWetzstein

    The same harness also trains an optical image encoder, and more capable agents improve results. The agent only needs a way to set a device's parameters and a way to observe what it does, so this can be used on any physical system that can be controlled and measured. 5/6

    7 likes

  • Gordon Wetzstein's profile picture

    @GordonWetzstein

    Paper: Project page: With @IlkerOguz6, Colin Christian, Christophe Moser, Demetri Psaltis, @GordonWetzstein (Stanford and EPFL). 6/6

    16 likes

  • eth's profile picture

    @SubWvlngth

    For any general network you will need nonlinearity! Otherwise this is just a really convoluted way of doing a small matrix multiplication.

    2 likes

  • Ilker Oguz's profile picture

    @IlkerOguz6

    Training an optical neural network is a nice first demonstration, but I am most excited to see what an optimizer with this kind of insight into the experiment can unlock for prototyping and demonstrating other physical systems quickly.

    1 like

  • GAL1LEO's profile picture

    @GAL1LEOX

    Scoring all methods in one interleaved block is a good detail here. Otherwise a drifting optical setup could make the order of testing look like an optimizer advantage.

  • Anonymous's profile picture

    @WhatMathMeans

    You wouldn't happen to have use for something like this, would you?

  • Andrea Tagliasacchi's profile picture

    @taiyasaki

    @FrancisEngelman Great improvement. How far are we from practical deployment though? What is still missing?

  • Talljack's profile picture

    @Talljackcv

    The 48-probe geometry step caught my attention. If you realign the optics and run it again, does the agent usually recover the geometry with about the same number of measurements?

  • John Rood's profile picture

    @johnroodepic

    the loop isn't the win. 48 probes worked because optics already has a named low-dimensional prior, so the agent writes lenses and prisms, not pixels. does that survive on a device with no textbook parameterization, or does the 67k-image baseline come back?

  • Rodrigo Rosado's profile picture

    @Rodrigo_RosadoR

    Pretty cool! Will definitely read the paper I did some Claude vibe coding during the summer about this, it has a lot of explainers because I meant to have it for my own understanding, but feel free to check it out! Try the draw your digit option :)

  • Selim Emir Can's profile picture

    @selim_e_can

    Great work, Ilker and team! Could a dataset of measurements and corrections across geometries train a sim2real model to predict fabrication deviations and reduce costly iterations? Excited to see how this generalizes to deeper optical cascades and more complex interactions!

  • John K's profile picture

    @JohnKocdr

    Closed-loop tuning directly on the hardware neatly sidesteps modeling the phase errors. Curious how well that 96.8% holds up against thermal drift over time.