CoolFace
Modelpublic

AItonomy/PhAI-IDE-9B

sourceHugging Faceapache-2.0updated 10d agoView on Hugging Face
0likes84downloads
Model Card

PhAI-IDE

PhAI-IDE is a family of models for scientific coding and interaction with tools, available in 4B, 9B, and 72B sizes. Each model is supervised fine-tuned with ms-swift and released as full BF16 weights with the final LoRA adapter merged, together with its configuration and tokenizer.

The training dataset is Codex trajectories, sourced from ScienceIDE.

Models

ModelBase modelBF16 weightsLicense
PhAI-IDE-4BQwen3.5-4B9.08 GBApache-2.0
PhAI-IDE-9BQwen3.5-9B18.82 GBApache-2.0
PhAI-IDE-72BQwen2.5-72B-Instruct145.41 GBQwen

Weight sizes are approximate; inference also requires memory for runtime allocations and the KV cache.

ScienceAccelBench performance

Task-held-out, localized scientific-code repair on familiar codebases, with original numerical verification. Qwen3.5-4B and Qwen3.5-9B are compared with PhAI-IDE-4B and PhAI-IDE-9B, respectively, on identical tasks. Pass rates are percentages; gains are percentage points.

SizeEnvironmentTasksQwen3.5PhAI-IDEGain (pp)
4BPLUTO-Particles-Dust30.0033.33+33.33
9BLAPS1631.2550.00+18.75
9BMITgcm-biogeo80.0012.50+12.50
9BPLUTO-RMHD70.0028.57+28.57

Comparison with published models

Scores (%), grouped by benchmark and model size. Each reference entry gives its published score and the PhAI-IDE score difference in percentage points. Reference models are approximately the same size: 3–4B, 7–9B, and 67–72B, respectively.

PhAI-IDEBenchmarkScoreReference models: score (difference)
4BBBH multistep-arithmetic-two97.60Llama-3.2-3B-Instruct (3.21B): 53.2 (+44.40); Phi-3.5-mini-8k-instruct (3.82B): 95.6 (+2.00)
9BBBH word-sorting60.40Llama-3.1-8B-Instruct (8.03B): 51.2 (+9.20); Qwen2.5-7B-Instruct (7.62B): 15.6 (+44.80)
9BMATH-50092.20InternLM3-8B-Instruct (8B): 83 (+9.20); Qwen2.5-7B-Instruct (7B): 72.4 (+19.80); Llama-3.1-8B-Instruct (8B): 48.4 (+43.80)
72BAQuA-RAT77.56Llama-2-70B-Chat (70B): 31.32 (+46.24)
72BARC-Easy84.64Llama-2-70B (70B): 76.5 (+8.14); DeepSeek-LLM-67B-Chat (67B): 81.6 (+3.04)
72BARC-Challenge64.42Llama-2-70B (70B): 59.5 (+4.92); DeepSeek-LLM-67B-Chat (67B): 64.1 (+0.32)

Reference scores come from the linked publications, model cards, and independent evaluation reports; evaluation settings and sample counts vary by source. Differences describe reported scores across evaluations, rather than matched-protocol head-to-head gains. BBH entries refer to the named tasks.

Quick start

Use Transformers 5.16.1, PyTorch and Accelerate. Set model_id to any model in the table above; the example selects the matching model class.

python
from transformers import AutoTokenizer, AutoModelForCausalLM, AutoModelForImageTextToText

model_id = "AItonomy/PhAI-IDE-4B"
loader = AutoModelForCausalLM if model_id.endswith("72B") else AutoModelForImageTextToText
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = loader.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
inputs = tokenizer.apply_chat_template(
    [{"role": "user", "content": "Explain how to verify a numerical simulation."}],
    add_generation_prompt=True, enable_thinking=False, return_dict=True, return_tensors="pt",
).to(model.device)
output = model.generate(**inputs, max_new_tokens=128, do_sample=False)
print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Training procedure

ScienceIDE demonstrations were collected with GPT-5.6-sol and filtered using a numerical-equivalence verifier. They capture code inspection, tool use, and responses to execution feedback.

All three models use ms-swift supervised fine-tuning with LoRA across trainable linear layers for three epochs. The release merges each final checkpoint's adapter into its base model. Retained assistant targets provide the next-token training signal, while conversation history and tool observations provide context. The trajectories retain the native exec / wait interaction format. Heuristic target masking selects assistant actions for supervision while preserving the surrounding interaction history.

Shared settingValue
Training datasetCodex trajectories
Training examples / tasks4,567 segments / 564 tasks
Validation examples / tasks544 segments / 81 tasks
Train/validation task overlap0
Training epochs3
LoRA rank / alpha / dropout32 / 64 / 0.05
Released weightsLoRA merged into BF16 Safetensors

Long trajectories are organized into segments. Source partition assignments are preserved, with no task identifiers shared between training and validation.

Framework versions

The release was validated with the following environment.

ComponentVersion
Python3.11
ms-swift4.5.3
Transformers5.16.1
PyTorch2.6.0+cu124
PEFT0.20.0
Datasets4.8.4
Tokenizers0.23.2
Accelerate1.14.0