leyili6666 commited on
Commit
53d2a7e
·
verified ·
1 Parent(s): e646fba

Unify README for the PhAI-IDE model family

Browse files

Present PhAI-IDE-4B, PhAI-IDE-9B, and PhAI-IDE-72B together with a shared model table, verified ScienceAccelBench results, training description, and concise quick start. Retain repository-specific base-model and license metadata.

Files changed (1) hide show
  1. README.md +45 -14
README.md CHANGED
@@ -19,24 +19,46 @@ tags:
19
  - safetensors
20
  ---
21
 
22
- # PhAI-IDE-72B
23
 
24
- **PhAI-IDE-72B** is a supervised fine-tune of [Qwen/Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct) for scientific coding and interaction with tools, trained using [ms-swift](https://github.com/modelscope/ms-swift). The release contains full BF16 weights with the final LoRA adapter merged.
25
 
26
- The training data is sourced from [AItonomy/ScienceIDE](https://huggingface.co/datasets/AItonomy/ScienceIDE).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  ## Quick start
29
 
30
- Use Transformers 5.16.1, PyTorch and Accelerate. The example loads the model, configuration and tokenizer directly from this repository.
31
 
32
  ```python
33
- from transformers import AutoTokenizer, AutoModelForCausalLM
34
 
35
- model_id = "AItonomy/PhAI-IDE-72B"
 
36
  tokenizer = AutoTokenizer.from_pretrained(model_id)
37
- model = AutoModelForCausalLM.from_pretrained(
38
- model_id, dtype="bfloat16", device_map="auto",
39
- )
40
  inputs = tokenizer.apply_chat_template(
41
  [{"role": "user", "content": "Explain how to verify a numerical simulation."}],
42
  add_generation_prompt=True, enable_thinking=False, return_dict=True, return_tensors="pt",
@@ -45,16 +67,13 @@ output = model.generate(**inputs, max_new_tokens=128, do_sample=False)
45
  print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
46
  ```
47
 
48
- BF16 weights occupy approximately 145.41 GB, plus runtime memory and KV cache.
49
-
50
  ## Training procedure
51
 
52
  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.
53
 
54
- Training uses **ms-swift** supervised fine-tuning with **LoRA across trainable linear layers for three epochs**. The release merges the final checkpoint's adapter into the base model. Retained assistant targets provide the next-token training signal, while conversation history and tool observations provide context. The Codex-only data retains the native `exec` / `wait` interaction format. Heuristic target masking selects assistant actions for supervision while preserving the surrounding interaction history.
55
-
56
 
57
- | Setting | Value |
58
  | --- | --- |
59
  | Training dataset | Codex trajectories |
60
  | Training examples / tasks | 4,567 segments / 564 tasks |
@@ -66,6 +85,18 @@ Training uses **ms-swift** supervised fine-tuning with **LoRA across trainable l
66
 
67
  Long trajectories are organized into segments. Source partition assignments are preserved, with no task identifiers shared between training and validation.
68
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  ### Framework versions
70
 
71
  The release was validated with the following environment.
 
19
  - safetensors
20
  ---
21
 
22
+ # PhAI-IDE
23
 
24
+ **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](https://github.com/modelscope/ms-swift) and released as full BF16 weights with the final LoRA adapter merged, together with its configuration and tokenizer.
25
 
26
+ The **training dataset is Codex trajectories**, sourced from [AItonomy/ScienceIDE](https://huggingface.co/datasets/AItonomy/ScienceIDE).
27
+
28
+ ## Models
29
+
30
+ | Model | Base model | BF16 weights | License |
31
+ | --- | --- | ---: | --- |
32
+ | [PhAI-IDE-4B](https://huggingface.co/AItonomy/PhAI-IDE-4B) | [Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) | 9.08 GB | Apache-2.0 |
33
+ | [PhAI-IDE-9B](https://huggingface.co/AItonomy/PhAI-IDE-9B) | [Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) | 18.82 GB | Apache-2.0 |
34
+ | [PhAI-IDE-72B](https://huggingface.co/AItonomy/PhAI-IDE-72B) | [Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct) | 145.41 GB | [Qwen](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct/blob/495f39366efef23836d0cfae4fbe635880d2be31/LICENSE) |
35
+
36
+ Weight sizes are approximate; inference also requires memory for runtime allocations and the KV cache.
37
+
38
+ ## ScienceAccelBench performance
39
+
40
+ **PhAI-IDE-9B** improves the task-pooled pass rate from **17.09% to 20.89% (+3.80 percentage points)** across all **27 ScienceAccelBench environments**, using **158 valid paired tasks**.
41
+
42
+ Task-held-out, localized scientific-code repair on familiar codebases, with original numerical verification. Each row compares the initial model with its corresponding fine-tuned model on identical tasks. Pass rates are percentages; gains are percentage points.
43
+
44
+ | Model | Environment | Tasks | Initial model | PhAI-IDE | Gain (pp) |
45
+ | --- | --- | ---: | ---: | ---: | ---: |
46
+ | 4B | PLUTO-Particles-Dust | 3 | 0.00 | **33.33** | **+33.33** |
47
+ | 9B | LAPS | 16 | 31.25 | **50.00** | **+18.75** |
48
+ | 9B | MITgcm-biogeo | 8 | 0.00 | **12.50** | **+12.50** |
49
+ | 9B | PLUTO-RMHD | 7 | 0.00 | **28.57** | **+28.57** |
50
 
51
  ## Quick start
52
 
53
+ 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.
54
 
55
  ```python
56
+ from transformers import AutoTokenizer, AutoModelForCausalLM, AutoModelForImageTextToText
57
 
58
+ model_id = "AItonomy/PhAI-IDE-4B"
59
+ loader = AutoModelForCausalLM if model_id.endswith("72B") else AutoModelForImageTextToText
60
  tokenizer = AutoTokenizer.from_pretrained(model_id)
61
+ model = loader.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
 
 
62
  inputs = tokenizer.apply_chat_template(
63
  [{"role": "user", "content": "Explain how to verify a numerical simulation."}],
64
  add_generation_prompt=True, enable_thinking=False, return_dict=True, return_tensors="pt",
 
67
  print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
68
  ```
69
 
 
 
70
  ## Training procedure
71
 
72
  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.
73
 
74
+ 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.
 
75
 
76
+ | Shared setting | Value |
77
  | --- | --- |
78
  | Training dataset | Codex trajectories |
79
  | Training examples / tasks | 4,567 segments / 564 tasks |
 
85
 
86
  Long trajectories are organized into segments. Source partition assignments are preserved, with no task identifiers shared between training and validation.
87
 
88
+ For **4B and 9B**, fine-tuning uses text trajectories with the vision tower and aligner frozen. Their additional settings are:
89
+
90
+ | Setting | 4B and 9B |
91
+ | --- | --- |
92
+ | Maximum training sequence length | 36,864 tokens |
93
+ | Learning rate / schedule | 2e-5 / cosine |
94
+ | Warmup ratio | 0.03 |
95
+ | Batch size per device / accumulation | 1 / 16 |
96
+ | LoRA targets | Linear modules in the unfrozen language model |
97
+ | Optimizer steps | 216 |
98
+ | Packing | Disabled |
99
+
100
  ### Framework versions
101
 
102
  The release was validated with the following environment.