---
license: mit
library_name: pytorch
tags:
- physics
- string-theory
- calabi-yau
- algebraic-geometry
- triangulation
- transformer
datasets:
- jhtyip/cytransformer-frst-datasets
---
# CYTransformer — trained weights
Encoder–decoder transformers that generate **Fine, Regular, Star Triangulations (FRSTs)** of
4-dimensional reflexive polytopes — the combinatorial data behind smooth Calabi–Yau threefolds.
These are the trained models from *"Transforming Calabi–Yau Constructions: Generating New
Calabi–Yau Manifolds with Transformers"* ([arXiv:2507.03732](https://arxiv.org/abs/2507.03732)),
and the first released weights for [**AICY**](https://aicy.physics.wisc.edu).
Code: [github.com/jhtyip/cytransformer](https://github.com/jhtyip/cytransformer) ·
Data: [jhtyip/cytransformer-frst-datasets](https://huggingface.co/datasets/jhtyip/cytransformer-frst-datasets)
## Checkpoints
One model per polytope size. They are **not interchangeable** — vocabulary and sequence length
grow with the number of vertices, so each file loads only into its own configuration.
| File | h1,1 | Nvert | Step | Vocab | Max simplices | Params | Train loss | Val loss |
|---|---|---|---|---|---|---|---|---|
| `chkpt_9+1` | 5 | 9+1 | 1,120,108 | 129 | 30 | 118.9 M | 2.170 | **2.203** |
| `chkpt_10+1` | 6 | 10+1 | 1,019,736 | 213 | 35 | 119.0 M | 2.389 | **2.416** |
| `chkpt_11+1` | 7 | 11+1 | 861,838 | 333 | 45 | 119.1 M | 2.579 | **2.575** |
| `chkpt_12+1` | 8 | 12+1 | 1,438,540 | 498 | 55 | 119.3 M | 2.757 | **2.829** |
| `chkpt_14+1` | 10 | 14+1 | 1,218,169 | 1,004 | 65 | 119.8 M | 2.985 | **2.971** |
Losses are read from the curves stored inside each checkpoint, not from external logs.
**Naming.** Nvert is written as *vertices + origin*: `9+1` is 9 polytope vertices plus
the origin, i.e. 10 lattice points, which is the paper's Nvert = 10.
## Architecture
Identical across all configurations: **16 encoder + 16 decoder layers, d_model 512, 16 attention
heads, FFN hidden 2048 (4×), dropout 0.1** — roughly 119 M parameters. Only the target vocabulary
(`C(vertices, 4) + 3`) and maximum sequence length vary. Trained with Adam
(lr 5e-5, β = (0.9, 0.98), ε = 1e-9) and exponential decay.
Each checkpoint carries `model_state_dict`, `optimizer_state_dict`, `scheduler_state_dict`,
`n_vertices`, `last_step`, `hyperparams`, and the full `loss` / `validation` histories, so training
can be resumed or inspected.
## Usage
```bash
git clone https://github.com/jhtyip/cytransformer && cd cytransformer
pip install -e .
```
```python
from huggingface_hub import hf_hub_download
ckpt = hf_hub_download("jhtyip/cytransformer-frst-models", "chkpt_9+1")
```
```bash
cyt-infer --checkpoint "$ckpt" --polys examples/polytopes.json --num-per-poly 100
```
Every generated candidate is verified as a genuine FRST in real time — fine, star, valid and
regular. **CYTools is not required**: verification uses an exact rational intersection test
(pycddlib) plus a linear program for regularity (SciPy), cross-checked against CYTools on a labeled
set with full agreement.
Input polytopes are `[POLYID, DRESVERTS]` records; see the dataset repository for the format.
## Notes
Generated triangulations are emitted as an unordered set of simplices, so the same FRST can appear
in different simplex orders. **Canonicalise before counting distinct results** — otherwise
duplicates are counted as new triangulations.
## Citation
```bibtex
@article{Yip:2025hon,
author = {Yip, Jacky H. T. and Arnal, Charles and Charton, Fran\c{c}ois and Shiu, Gary},
title = {Transforming Calabi-Yau Constructions: Generating New Calabi-Yau Manifolds with Transformers},
journal = {arXiv e-prints},
eprint = {2507.03732},
year = {2025},
doi = {10.48550/arXiv.2507.03732}
}
```
MIT licensed. Department of Physics, University of Wisconsin–Madison.