--- license: mit pipeline_tag: other --- # PRISM: Position-encoded Regressive Inverse Spectral Model PRISM is a unified decoder-only autoregressive transformer designed for **inverse thin-film optical design**. Given a target optical spectrum, it generates a multilayer thin-film stack (specifying materials and thicknesses) whose physical response matches the target. - **Paper:** [PRISM: Position-encoded Regressive Inverse Spectral Model for Multilayer Thin-Film Design](https://huggingface.co/papers/2605.26502) - **Project Page:** [PRISM Playground](https://www.prism-playground.com/) - **Code:** [GitHub Repository](https://github.com/wang-henry4/prism) ## Architecture Key Innovations PRISM introduces three primary architectural ideas that distinguish it from prior sequence-to-sequence approaches: 1. **Spectrum prefix conditioning**: The target spectrum is projected into a single learned token and prepended to the decoder sequence, utilizing causal self-attention for target injection. 2. **Cumulative-depth RoPE**: Instead of standard sequential token indices, Rotary Position Embeddings (RoPE) use the running cumulative physical depth (in nm) of the film stack. This provides the attention mechanism with a physically meaningful distance metric related to optical path length. 3. **Dual output heads**: A shared transformer backbone feeds two specialized heads: - **Material Head**: Predicts discrete material selection. - **Thickness Head**: A multi-layer MLP that treats thickness as a continuous regression target (nm), predicting a thickness for *every* material in the vocabulary at each position to enable joint beam search. ## Getting Started ### Installation ```bash git clone https://github.com/wang-henry4/prism cd prism pip install -e . ``` ### Evaluation You can evaluate a checkpoint using the provided script. It decodes structures, re-simulates them via the Transfer Matrix Method (TMM), and compares them against target spectra. ```bash python evaluate.py \ --checkpoint saved_models/inverse/inverse_v1/best.pt \ --val_path ./data/val/part_000.arrow \ --nk_dir ./nk --n_samples 1000 \ --beam_width 5 --length_penalty 0.3 \ --plot_dir ./plots/inverse_eval ``` ## Citation ```bibtex @article{wang2026prism, title={PRISM: Position-encoded Regressive Inverse Spectral Model for Multilayer Thin-Film Design}, author={Wang, Runtian and Xue, Renhao and Chen, Baige and Wu, Hao}, journal={arXiv preprint arXiv:2605.26502}, year={2026} } ```