Language models discover non-intuitive reactor core designs through emergent physical reasoning
ReactorFold reformulates pressurized-water-reactor (PWR) fuel assembly design as a sequence modeling problem for language models. The model learns to generate candidate 17×17 fuel assembly layouts that satisfy neutronic constraints directly in the discrete design space.
- Sequence-based reactor design: 2D fuel assembly → 1D token sequence
- Curriculum learning: Base FFT → LoRA fine-tuning → Online DPO
- Physics-in-the-loop: OpenMC Monte Carlo validation at every step
- Emergent behavior: Model autonomously expands Gd inventory beyond training distribution
ReactorFold/
├── data_generation_100K.py # Low-fidelity dataset (100k samples)
├── data_generation_10K.py # High-fidelity dataset (10k samples)
├── sequence_length_check.py # Token length validation
├── train_base.py # Full fine-tuning on 100k dataset
├── train_lora.py # LoRA fine-tuning on 10k dataset
├── dpo_10K_with_grid.py # Online DPO with OpenMC-in-the-loop
├── ga_benchmark_hifi.py # Genetic Algorithm baseline
└── symmetry_validation.py # Symmetric benchmark generation
- Python ≥ 3.10
- GPU with bfloat16 support (recommended)
- OpenMC with cross-section library
pip install numpy pandas tqdm datasets deap \
torch transformers accelerate peft openmcimport os
os.environ["OPENMC_CROSS_SECTIONS"] = "/path/to/your/cross_sections.xml"Low-fidelity dataset (100k samples)
python data_generation_100K.py
# Output: reactor_100k_final.csvHigh-fidelity dataset (10k samples)
python data_generation_10K.py
# Output: reactor_10k_final.csvStage 1: Base model (Full Fine-Tuning)
python train_base.py
# Output: reactor_base_training_output/final_model/Stage 2: LoRA Fine-Tuning
python train_lora.py
# Output: reactor_lora_training_output/final_model/Stage 3: Online DPO
python dpo_10K_with_grid.py
# Output: dpo_results.csv, dpo_optimized_model/Genetic Algorithm
python ga_benchmark_hifi.py
# Output: ga_results.csv, ga_best_grid.txtSymmetric Benchmarks
python symmetry_validation.py
# Output: symmetry_results_full.csv| Stage | Data | Method | Output |
|---|---|---|---|
| 1 | 100k low-fidelity | Full Fine-Tuning | Base model |
| 2 | 10k high-fidelity | LoRA (r=32) | LoRA adapter |
| 3 | Online generation | DPO + OpenMC | Aligned model |
Reactor Core Design (k=1.05000, fq=1.0000, fdh=1.0000):
f f f g f f f f c f f f f g f f f
f f f f f f f f f f f f f f f f f
...
f: Fuel rod (UO₂)g: Gadolinium burnable absorber (UO₂-Gd₂O₃)c: Guide tube / Instrument tube
fitness = 0.6 × Fq + 0.4 × F_ΔH + P(k_eff)
where P(k_eff) penalizes deviations from target range [1.02, 1.08].
ReactorFold achieves 6× improvement in fitness over GA baseline within the same computational budget (1,000 high-fidelity evaluations).
| Method | Fitness | k_eff | Fq | F_ΔH | Gd Count |
|---|---|---|---|---|---|
| GA (fixed) | 9.32 | 1.157 | 1.42 | 1.28 | 16 |
| Sym-16 | 10.1 | 1.162 | 1.45 | 1.30 | 16 |
| Sym-24 | 3.82 | 1.068 | 1.38 | 1.25 | 24 |
| ReactorFold | 1.55 | 1.052 | 1.32 | 1.21 | 29 |
@article{lee2025reactorfold,
title={Language models discover non-intuitive reactor core designs
through emergent physical reasoning},
author={Lee, Yoonpyo},
journal={arXiv preprint},
year={2025}
}- Dataset: Hugging Face
- Code: This repository
License information will be added later.
Yoonpyo Lee
Department of Nuclear Engineering, Hanyang University
📧 lukeyounpyo@hanyang.ac.kr