Add model card with paper, code, and project links
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,3 +1,56 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
pipeline_tag: other
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# PRISM: Position-encoded Regressive Inverse Spectral Model
|
| 7 |
+
|
| 8 |
+
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.
|
| 9 |
+
|
| 10 |
+
- **Paper:** [PRISM: Position-encoded Regressive Inverse Spectral Model for Multilayer Thin-Film Design](https://huggingface.co/papers/2605.26502)
|
| 11 |
+
- **Project Page:** [PRISM Playground](https://www.prism-playground.com/)
|
| 12 |
+
- **Code:** [GitHub Repository](https://github.com/wang-henry4/prism)
|
| 13 |
+
|
| 14 |
+
## Architecture Key Innovations
|
| 15 |
+
|
| 16 |
+
PRISM introduces three primary architectural ideas that distinguish it from prior sequence-to-sequence approaches:
|
| 17 |
+
|
| 18 |
+
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.
|
| 19 |
+
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.
|
| 20 |
+
3. **Dual output heads**: A shared transformer backbone feeds two specialized heads:
|
| 21 |
+
- **Material Head**: Predicts discrete material selection.
|
| 22 |
+
- **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.
|
| 23 |
+
|
| 24 |
+
## Getting Started
|
| 25 |
+
|
| 26 |
+
### Installation
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
git clone https://github.com/wang-henry4/prism
|
| 30 |
+
cd prism
|
| 31 |
+
pip install -e .
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
### Evaluation
|
| 35 |
+
|
| 36 |
+
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.
|
| 37 |
+
|
| 38 |
+
```bash
|
| 39 |
+
python evaluate.py \
|
| 40 |
+
--checkpoint saved_models/inverse/inverse_v1/best.pt \
|
| 41 |
+
--val_path ./data/val/part_000.arrow \
|
| 42 |
+
--nk_dir ./nk --n_samples 1000 \
|
| 43 |
+
--beam_width 5 --length_penalty 0.3 \
|
| 44 |
+
--plot_dir ./plots/inverse_eval
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Citation
|
| 48 |
+
|
| 49 |
+
```bibtex
|
| 50 |
+
@article{wang2026prism,
|
| 51 |
+
title={PRISM: Position-encoded Regressive Inverse Spectral Model for Multilayer Thin-Film Design},
|
| 52 |
+
author={Wang, Runtian and Xue, Renhao and Chen, Baige and Wu, Hao},
|
| 53 |
+
journal={arXiv preprint arXiv:2605.26502},
|
| 54 |
+
year={2026}
|
| 55 |
+
}
|
| 56 |
+
```
|