Four models for learning and benchmarking semiconductor fab process sequences (next-step prediction, sequence completion, anomaly detection).
Models: markov · transformer · hierarchical · lcm
| Model | Checkpoint location | Notes |
|---|---|---|
markov |
models/markov/markov.json |
We used this as a baseline — transition counts from training data |
transformer |
models/transformer/gpt_ckpt.pt |
Decoder-only GPT trained from scratch |
hierarchical |
models/hierarchical/model_out/ |
GPT-2 fine-tuned with block-boundary tokens |
lcm |
hpc/scp/.save/best_lcm_10000.pt |
Large Concept Model — bidirectional GRU encoder + GRU decoder with Bahdanau attention |
Pre-generated prediction CSVs for the official evaluation:
| Task | File |
|---|---|
| Task 1 — Next-Step | ./task1_predictions.csv |
| Task 2 — Completion | ./task2_predictions.csv |
| Task 3 — Anomaly | ./task3_predictions.csv |
pip install -r requirements.txt
python app.py
# → open http://127.0.0.1:7860The Gradio GUI has four tabs:
Evaluate — one-click evaluation on 30 ground-truth sequences (10 per family). Runs all three tasks and displays metrics: Top-1/3/5 Accuracy, MRR, NED, Exact Match, Token Accuracy, Block Accuracy, Precision, Recall, F1, ROC-AUC. For anomaly detection, 15 sequences are kept valid and 15 are mutated to create labelled anomalies.
Self-Benchmark — score any model against held-out *_extended.csv sequences (no training-data leakage). Pick Task 1 (next-step) or Task 2 (completion), set sequences per family, hit Run. Results include Top-1/3/5, MRR, NED, Exact Match etc. Download the per-row CSV for further analysis.
Official — generate submission CSVs for the three hackathon tasks using eval_input_valid.csv and eval_input_anomaly.csv. Task 3 (anomaly) scores immediately via the rule checker; Tasks 1 & 2 need the organiser's ground-truth file to score.
Custom — interactive inference. Paste or upload a partial sequence, pick a model, and either predict the next step, complete the full sequence, or detect rule violations.
Everything works from the terminal. Source into your virtual environment and run the following:
Generate submission CSVs:
python -m models.infer --model transformer --task 1 --output task1_predictions.csv
python -m models.infer --model transformer --task 2 --output task2_predictions.csv
python -m models.infer --model transformer --task 3 --output task3_predictions.csvSelf-benchmark (scored locally against extended CSVs):
python -m models.infer --model transformer --task self1
python -m models.infer --model transformer --task self2 --n-seqs 15Single sequence:
python -m models.infer --model transformer --next "RECEIVE WAFER LOT|LOT IDENTIFICATION|INITIAL WAFER INSPECTION"
python -m models.infer --model transformer --complete "RECEIVE WAFER LOT|LOT IDENTIFICATION"Score Task 3 locally (Tasks 1 & 2 need the organiser's ground-truth file):
python data/participant_files/eval_metrics.py \
--task anomaly \
--ground-truth data/participant_files/eval_input_anomaly.csv \
--predictions task3_predictions.csv