Original paperSourceNo author review
Make your paper interactiveCreate

Text from the interactive explanation

MOCLIP: a foundation model for large-scale nanophotonic inverse design

Rodionov S, Burguete-Lopez A, Makarenko M, Wang Q, Getman F, Fratalocchi A.

Each dot is one real metasurface measured by the authors, from their released 10,000-sample subset. Dots are placed by a 2D map of MOCLIP's 64-number shape codes and coloured by the approximate colour of light each one lets through. Glowing dots are the closest matches to the target. The inset magnifies the best match's repeating silicon pattern and compares its measured spectra with the dashed target.

AI models learned to connect words and pictures by studying millions of examples. MOCLIP brings the same idea to the tiny silicon structures that filter light: describe the light you want, and it finds shapes that make it. It works fast enough that the authors designed every structure on a 4-inch wafer in 20 minutes.

A colour filter made of tiny silicon shapes

A metasurface is a patch of glass covered with a repeating pattern of silicon shapes, each narrower than a wavelength of visible light. In this study every patch is 6 µm square, about a twelfth of a hair's width. Each one repeats a single pattern, called the unit cell, every 300 to 600 nanometres. A unit cell holds up to four ellipses, rectangles or rings, cut from silicon 150, 178 or 195 nm thick.

Shine white light through the patch and some colours pass while others are held back. The pass-or-hold-back pattern across wavelengths is the patch's transmission spectrum . Light vibrates in a direction, its polarization, and an elongated shape can treat light vibrating along x differently from light vibrating along y. So every metasurface has two spectra.

Going from shape to light is physics. Going from light to shape is the hard part.

Given a shape, a computer can predict its spectrum by solving the equations of light. That is slow: the paper cites roughly one simulated sample per minute even on high-performance computers, and the authors' own solver needed 3 minutes per run. Designers face the opposite problem. They know the light they want and need a shape that makes it.

Try it. This spectrum was measured from one of the four metasurfaces below, all sharing the same period and thickness. Which one made it?

After you choose, the bars show MOCLIP's similarity score for each candidate. MOCLIP compares the 64-number code of the spectrum with the code of each shape; you'll see how in chapter 5.

To learn the backwards map, a model needs an ocean of examples

Large "foundation models" learn general skills from huge, varied datasets. How much data they need grows with the number of independent knobs, or degrees of freedom , in the things being learned. The authors fit an empirical rule, N = 442 · d1.72, where d is the degrees of freedom and N the dataset size. Image datasets like ImageNet-1K have about 40 degrees of freedom and around 30,000 examples per degree. Typical nanophotonics datasets have fewer than 10 degrees of freedom and only 10 to 1,000 examples per degree.

The curve, "this work" and the typical nanophotonics zone are re-plotted from values stated in the paper. Times are arithmetic from the reported rates: about 1 simulated sample per minute, versus about 35 structures per minute for the authors' fabricate-and-measure pipeline.

So they built the data instead of simulating it

Rather than compute spectra, the team wrote shapes onto glass with an electron beam and measured every one. Fabrication ran at about 40 samples per minute and optical measurement at 380 per minute.

That is more than 11,000 samples per degree of freedom, approaching ImageNet-1K. Electron-microscope checks found fabricated features within 4 nm of the design on average (10 nm standard deviation). Because the data are real measurements, they already include fabrication imperfections and measurement noise.

A microscope that photographs every colour, one at a time

The team built an automated hyperspectral microscope. A tunable filter lets through one narrow band of colour at a time, stepping from 450 to 730 nm in 10 nm steps, first for x-polarized light, then for y. At each step a camera photographs a whole array of up to 22,755 metasurfaces. Each patch looks bright where it lets that colour through and dark where it holds it back.

Brightness values are the authors' measurements from the released subset. The tile arrangement is only for display, and between the 10 nm measurement steps the display blends neighbouring steps. Each metasurface ends up as 58 numbers : 29 wavelengths × 2 polarizations. Those 58 numbers are exactly what MOCLIP reads.

Teach shapes and spectra to speak the same 64 numbers

MOCLIP builds on CLIP, the AI model that learned to match captions with pictures and later became a backbone of image generators such as Stable Diffusion. It has two translators, called encoders. One reads a spectrum, the other reads a shape, and each writes out a list of 64 numbers, a code . Training shows the model pairs, rewarding it when a shape's code points the same way as its own spectrum's code and penalizing it when the codes of mismatched pairs line up.

What to notice

Each row is a measured spectrum and each column a unit cell, all drawn from the released library. Cell brightness is the cosine similarity between the two codes, computed live with the released model: 1 means the codes point the same way, 0 means unrelated. Shuffled, the bright cells are scattered. Ask MOCLIP to pair them and every spectrum finds its own shape, so the brightest cells line up on the diagonal.

Run the retrieval test yourself

Pick 1,000 random spectra and, for each one, rank all 10,000 shapes by similarity. How often is the true shape ranked first? In the top 5? In the top 10?

Reported in the paper on a held-out test set of 46,653 samples: about 75% Top-1, 95% Top-5 and 98% Top-10. The original CLIP scored 68.7%, 90.6% and 95.2% on a caption-to-image task (Flickr30k). With only 10,000 candidates the task is easier, and the paper does not say whether the released samples were used in training, so your numbers will run higher.

Cosine similarity between a shape code A and a spectrum code B:

During training, a batch of shapes and spectra gives a square matrix of similarities like the one on the left. A cross-entropy loss compares it with the identity matrix, rewarding the diagonal (true pairs) and penalizing everything else. MOCLIP has about 11.8 million trainable parameters and was trained for 140 epochs on 373,230 pairs. "Top-k accuracy" is the fraction of queries whose true match lands within the first k results.

Draw the light you want. MOCLIP finds the shapes.

This is zero-shot inverse design. Your target spectrum goes through the spectrum encoder, and its code is compared with the precomputed codes of all 10,000 measured shapes. The best scorers are your design candidates, and the plots below show each candidate's real measured spectrum.

Compare with plain library search

The traditional approach skips the codes and compares your target with every stored spectrum directly, keeping the one with the smallest mean-squared error (MSE). A third option uses cosine similarity on the raw spectra, which ignores how bright the light is overall. Run all three on the current target.

Results appear here.

In the paper's benchmark on its full library, direct MSE search took 23 ms per target. MOCLIP's latent search took 1.67 ms, over 10× faster, with similar accuracy: middle-half MSE of 1.09–2.15 × 10⁻³ versus 1.05–2.05 × 10⁻³. Raw-spectrum cosine was as fast but less accurate (1.4–6.6 × 10⁻³). Timings in your browser are not comparable. This page holds only about 2% of the 466,537 pairs, so neighbours are sparser, and MOCLIP's #1 is sometimes worse than the exact-MSE pick. One of its top five is usually close.

Does a bigger library help?

Shrink the library to a random sample of 100 or 1,000 shapes and see how close the best match gets to your target.

For typical targets, more shapes mean closer matches. For unusual hand-drawn targets the trend can be noisy, because MOCLIP ranks shapes by code similarity, not by MSE directly. At scale, the paper reports that once the probe library exceeds 10⁴ measured shapes, 95% of zero-shot designs land below an MSE of 10⁻², roughly a 10% transmission deviation.

The good answers form a neighbourhood, not a single point

Here is the map from the top of the page again, now glowing for your current target from chapter 6. Good matches cluster together: MOCLIP's code space has a "trust region" where similarity stays high. The authors used it to look between library entries for designs that were never fabricated.

This 2D layout (t-SNE) of the 64-number shape codes was made for this page; the paper's map used a different projection (PCA). Nearby dots have similar codes, but distances are only approximate.

What the paper did with the space between dots

The authors took the 50 best library matches for a target and generated 10,000 slightly altered versions of those shapes. Scoring them with MOCLIP showed a region of high similarity, and shapes interpolated between two library entries had simulated spectra (FDTD) close to the target. The discrete library became a continuous design space.

For the highest accuracy they went further with latent-space optimization . A swarm of candidate shapes from the shape generator is nudged, round after round, toward a higher MOCLIP similarity. The shape encoder scores each candidate in milliseconds, so no slow light simulation is needed inside the loop.

Reported milestones on 500 custom targets, with spectra checked by FDTD simulation. The chart marks when optimization overtakes library search at each quartile; it is not the paper's curve.

If a code can pick a shape, a shape can store a code

The shared code space also works for memory. To write, turn data into codes and fabricate shapes whose codes match. To read, measure each spectrum, run it through the spectrum encoder and round its code to the nearest entry in a codebook. Below is a small working version, using the released model and the measured spectra of real library metasurfaces.

Things to try: raise the noise until errors appear, then switch to 6 bits. Packing in more codes squeezes them closer together in the code space, so the same noise causes more mistakes. The paper's measured noise is about σ = 0.026 per channel. This toy codebook (k-means on the released subset's codes) and the added Gaussian noise were built for this page; the spectra and model are the authors'.

How dense could it get?

The authors found the codes are close to bell-curve (Gaussian) distributed. Using rate-distortion theory and their measured noise, they estimate up to 126 bits per metasurface . Shrink the metasurface and the density climbs.

Estimates, not a built device. The curve follows the paper's anchor points: 3.34 Mbit/mm² at today's 6 µm, and 107.85 Mbit/mm² (about 0.1 Gbit/mm²) at 1.056 µm, the diffraction limit of their optics. DVD and Blu-ray levels are read approximately from the paper's Fig. 9d.

Design a whole chip in one sweep

The opening promise was speed: zero-shot design is just encoding plus a lookup, so it scales to whole wafers. Paint a pattern of target filters in the first grid. Each cell is a band-pass filter whose centre wavelength you pick with the rainbow brush. Then let MOCLIP choose a measured metasurface for every cell.

What this changes

The authors report zero-shot design at about 200,000 target spectra per second on a GPU. With a probe library of more than 10⁴ shapes, 95% of designs fall within MSE 10⁻². At that rate they designed an entire 4-inch wafer of 5 µm metasurfaces in 20 minutes, a job they say would usually take weeks or months. When accuracy matters more than speed, latent-space optimization refines the answer (mean MSE 1.1 × 10⁻³ in FDTD checks; three designs were fabricated and measured).

The deeper shift is where the knowledge comes from. MOCLIP learned from nearly half a million real structures, built and measured at about 35 per minute, including the imperfections that simulations miss.

What could come next

The authors describe paths forward, not results. Adding a reference arm to the microscope would let it measure phase as well as amplitude, without changing the network. Industrial lithography could make far larger datasets. And the storage idea could grow into full read/write optical memory, writing arbitrary bits directly into free-form shapes.

Where everything comes from

Paper: Sergei Rodionov, Arturo Burguete-Lopez, Maksim Makarenko, Qizhou Wang, Fedor Getman & Andrea Fratalocchi. "MOCLIP: a foundation model for large-scale nanophotonic inverse design." Nature Communications 17, 9902 (2026). doi.org/10.1038/s41467-026-76714-x. Published under CC BY-NC-ND 4.0. The paper's figures are not reproduced here; charts on this page re-plot numbers stated in the text.

Model, code and data: the released MOCLIP model weights and the 10,000-sample measured data subset from MOCLIP_release (MIT License, © 2025 Sergei Rodionov). The code is archived on Zenodo (10.5281/zenodo.21160434) and the data on Figshare (10.6084/m9.figshare.30772553). The full dataset is available from the corresponding author on request.

Modifications for this page: the spectrum encoder runs in the browser with its batch-normalization layers folded into the weights; spectra are stored at 8-bit precision and codes at int8; the shape codes were precomputed with the released shape encoder; the 2D map (t-SNE), approximate colours (CIE 1931, 450–730 nm only) and the toy storage codebooks were computed for this page.

Topics in this iPaper

Physics
Deep learning has rapidly permeated nanophotonic inverse design

Introduction, first paragraph

Computer science
encodes metasurfaces’ structural and spectral information into a shared latent space via contrastive learning

Abstract

Engineering
Metasurface fabrication involves electron beam lithography patterning of amorphous silicon layers on fused silica substrates

Results, Dataset generation

metasurfaces
encodes metasurfaces’ structural and spectral information into a shared latent space via contrastive learning

Abstract

inverse design
The study demonstrates MOCLIP’s inverse design capabilities

Abstract

contrastive learning
encodes metasurfaces’ structural and spectral information into a shared latent space via contrastive learning

Abstract

foundation models
a nanophotonic foundation model

Abstract

hyperspectral imaging
A custom automated hyperspectral transmission microscope measures each metasurface

Results, MOCLIP concept (Fig. 2)

electron beam lithography
Metasurface fabrication involves electron beam lithography patterning of amorphous silicon layers on fused silica substrates

Results, Dataset generation

optical data storage
This work further introduces an optical information storage concept

Abstract