GPT-oss-MOF
GPT-oss-MOF is a post finetuned GPT-oss-20B causal language model for predicting whether reaction conditions yield a crystalline metal–organic framework (MOF). This release contains the model weight shards, tokenizer, training/holdout data, and local inference and continuation scripts. The 13 BF16 safetensors shards total approximately 41.8 GB, where the original LoRA adapter is already included.
Setup
Use Python 3.10+ and install script/requirements.txt, which pins Transformers 4.56.2 and PEFT 0.17.1. Use PyTorch 2.6+ with a CUDA build suitable for your GPU.
Continuation training uses CUDA/BF16.
Allow memory beyond the 41.8 GB of weights for activations and training state. Lower batch sizes if needed.
GPU architecture: use NVIDIA Ampere (compute capability 8.0+) or newer for native BF16/TF32: A100/RTX A6000 (Ampere), RTX 6000 Ada (Ada), H100/H200 (Hopper), or RTX PRO 6000 Blackwell 96 GB.
Single-GPU BF16 hardware and batch-size reference settings for reaction prompts whose actual maximum length is 370 tokens, counting the complete rendered prompt, including system instructions and chat-template tokens. Memory use varies with the software stack and training settings.
| Workload | GPU | Batch size | Actual prompt length (tokens) |
|---|---|---|---|
| Inference | A100 / H100 80 GB | 24 | 370 |
| RTX PRO 6000 96 GB | 48 | 370 | |
| LoRA continuation | A100 / H100 80 GB | Start at train 12 / eval 24; increase gradient accumulation as needed | 370 |
| RTX PRO 6000 96 GB | Train 18 / eval 48 | 370 |
The scripts' --max-length defaults to 2048 and is an input validation limit: longer inputs are rejected rather than truncated. Check your data and reduce batch size when using longer prompts.
Recommend downloading the full repository with the Hugging Face CLI:
python -m pip install -U huggingface_hub
hf download StarLiu714/GPT-oss-MOF --local-dir GPT-oss-MOF
cd GPT-oss-MOF
python -m pip install -r script/requirements.txt
Run subsequent commands from this model directory. Script data/output paths are relative to --model-dir (this directory by default); absolute paths also work.
BF16 configuration: this export is normalized as a dense BF16 checkpoint. MXFP4 runtime kernels or quantized expert weight loading are not required.
Inference
As an example, to predict on the supplied holdout set,
python script/inference_pn.py \
--input data/mof_ft_holdout.jsonl \
--output outputs/holdout_predictions.jsonl \
--batch-size 1
It predicts P with probability, using temperature 1 by default.
For your own inputs, use chat-format JSONL matching the supplied data, or one reaction object per line, for example,
{
"metal_precursor":"ZrOCl2·8H2O", "organic_linker":"terephthalic acid","modulator":"acetic acid", "solvent":"dimethylformamide","metal_concentration_mM":30.0, "M_L_ratio":1.0, "temperature_C":120.0,"time_h":24.0
}
Optional gold labels enable scoring.
For comparisons, preserve the exact system prompt and field formatting in the supplied messages records。
Bare reaction objects use the script's default prompt.
Data Split
| File | P | N | Total |
|---|---|---|---|
| Train | 11,968 | 11,560 | 23,528 |
| Holdout | 1,320 | 1,275 | 2,595 |
Different clusters from the same publication can occur in both sets. See the dataset guide for provenance and regeneration.
Continue training
To start a new LoRA run on our model, please first attempt the released learning-rate and LoRA recipe:
python script/continue_lora_pn.py \
--config script/source_training_recipe_step4500.json \
--train-jsonl data/mof_ft_train.jsonl \
--valid-fraction 0.1 \
--output-dir runs/continue_lora
CLI flags override the JSON recipe. Without --config, defaults are learning rate 4e-6, 5000 steps, and halving milestones 1000,2500,4000.
Adjust --batch-size, --eval-batch-size, --gradient-accumulation, and --gradient-checkpointing for memory.
Reference training parameters
The source run's recorded settings are retained in mof_export_manifest.json.
| Setting | Source run |
|---|---|
| Base / objective | GPT-oss-20B / P–N classification through LM logits |
| LoRA | r=32, alpha=64, dropout=0.05; q_proj,k_proj,v_proj,o_proj |
| Learning rate | 1e-5; step halving at 1200, 3200, 6000, 8500 |
| Warmup / weight decay | 0.02 / 0 |
| Train / eval batch; gradient accumulation | 18 / 48; 1 |
| Length / truncation | 2048 / disabled |
| Training budget | max_steps=10000, epochs=3.0 recorded |
| Loss settings | N weight=1.02; label smoothing=0.02; focal gamma=0 |
| Seed / gradient checkpointing | 777 / disabled |
| Evaluation / logging interval | 100 / 25 steps |
The default continuation recipe re-uses these optimization settings with the simpler validation-based selection described above. The scripts support fresh evaluation and further adaptation.
Citation and license
When using these weights, cite MOFinder, identify StarLiu714/GPT-oss-MOF and the Hub revision used, and reference the GPT-oss-20B base model.
This release is licensed under the GNU General Public License v3.0; see LICENSE.
The underlying GPT-oss-20B model retains its upstream Apache-2.0 license, reproduced in LICENSE.base-model. This release includes MOF fine-tuning changes merged into the base model and a BF16 weight export.
MOFinder codebase is separately licensed under MIT.