leyili6666 commited on
Commit
a8d9028
·
verified ·
1 Parent(s): 8521ab9

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 +40 -29
README.md CHANGED
@@ -17,24 +17,46 @@ tags:
17
  - safetensors
18
  ---
19
 
20
- # PhAI-IDE-9B
21
 
22
- **PhAI-IDE-9B** is a supervised fine-tune of [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) 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.
23
 
24
- The training data is sourced from [AItonomy/ScienceIDE](https://huggingface.co/datasets/AItonomy/ScienceIDE).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
  ## Quick start
27
 
28
- Use Transformers 5.16.1, PyTorch and Accelerate. The example loads the model, configuration and tokenizer directly from this repository.
29
 
30
  ```python
31
- from transformers import AutoTokenizer, AutoModelForImageTextToText
32
 
33
- model_id = "AItonomy/PhAI-IDE-9B"
 
34
  tokenizer = AutoTokenizer.from_pretrained(model_id)
35
- model = AutoModelForImageTextToText.from_pretrained(
36
- model_id, dtype="bfloat16", device_map="auto",
37
- )
38
  inputs = tokenizer.apply_chat_template(
39
  [{"role": "user", "content": "Explain how to verify a numerical simulation."}],
40
  add_generation_prompt=True, enable_thinking=False, return_dict=True, return_tensors="pt",
@@ -43,29 +65,13 @@ output = model.generate(**inputs, max_new_tokens=128, do_sample=False)
43
  print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
44
  ```
45
 
46
- BF16 weights occupy approximately 18.82 GB, plus runtime memory and KV cache.
47
-
48
- ## ScienceAccelBench performance
49
-
50
- Across all 27 ScienceAccelBench environments, the task-pooled pass rate increases from **17.09% to 20.89% (+3.80 percentage points)** on **158 valid paired tasks**.
51
-
52
- Task-held-out, localized scientific-code repair on familiar codebases, with original numerical verification. Pass rates (%); gains in percentage points.
53
-
54
- | Environment | Tasks | Qwen3.5-9B | PhAI-IDE-9B | Gain (pp) |
55
- | --- | ---: | ---: | ---: | ---: |
56
- | laps | 16 | 31.25 | **50.00** | **+18.75** |
57
- | mitgcm-biogeo | 8 | 0.00 | **12.50** | **+12.50** |
58
- | pluto-rmhd-resrmhd | 7 | 0.00 | **28.57** | **+28.57** |
59
-
60
  ## Training procedure
61
 
62
  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.
63
 
64
- 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.
65
 
66
- Fine-tuning uses text trajectories with the vision tower and aligner frozen. The merged export supports standard autoregressive Qwen3.5 generation.
67
-
68
- | Setting | Value |
69
  | --- | --- |
70
  | Training dataset | Codex trajectories |
71
  | Training examples / tasks | 4,567 segments / 564 tasks |
@@ -74,6 +80,13 @@ Fine-tuning uses text trajectories with the vision tower and aligner frozen. The
74
  | Training epochs | 3 |
75
  | LoRA rank / alpha / dropout | 32 / 64 / 0.05 |
76
  | Released weights | LoRA merged into BF16 Safetensors |
 
 
 
 
 
 
 
77
  | Maximum training sequence length | 36,864 tokens |
78
  | Learning rate / schedule | 2e-5 / cosine |
79
  | Warmup ratio | 0.03 |
@@ -82,8 +95,6 @@ Fine-tuning uses text trajectories with the vision tower and aligner frozen. The
82
  | Optimizer steps | 216 |
83
  | Packing | Disabled |
84
 
85
- Long trajectories are organized into segments. Source partition assignments are preserved, with no task identifiers shared between training and validation.
86
-
87
  ### Framework versions
88
 
89
  The release was validated with the following environment.
 
17
  - safetensors
18
  ---
19
 
20
+ # PhAI-IDE
21
 
22
+ **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.
23
 
24
+ The **training dataset is Codex trajectories**, sourced from [AItonomy/ScienceIDE](https://huggingface.co/datasets/AItonomy/ScienceIDE).
25
+
26
+ ## Models
27
+
28
+ | Model | Base model | BF16 weights | License |
29
+ | --- | --- | ---: | --- |
30
+ | [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 |
31
+ | [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 |
32
+ | [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) |
33
+
34
+ Weight sizes are approximate; inference also requires memory for runtime allocations and the KV cache.
35
+
36
+ ## ScienceAccelBench performance
37
+
38
+ **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**.
39
+
40
+ 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.
41
+
42
+ | Model | Environment | Tasks | Initial model | PhAI-IDE | Gain (pp) |
43
+ | --- | --- | ---: | ---: | ---: | ---: |
44
+ | 4B | PLUTO-Particles-Dust | 3 | 0.00 | **33.33** | **+33.33** |
45
+ | 9B | LAPS | 16 | 31.25 | **50.00** | **+18.75** |
46
+ | 9B | MITgcm-biogeo | 8 | 0.00 | **12.50** | **+12.50** |
47
+ | 9B | PLUTO-RMHD | 7 | 0.00 | **28.57** | **+28.57** |
48
 
49
  ## Quick start
50
 
51
+ 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.
52
 
53
  ```python
54
+ from transformers import AutoTokenizer, AutoModelForCausalLM, AutoModelForImageTextToText
55
 
56
+ model_id = "AItonomy/PhAI-IDE-4B"
57
+ loader = AutoModelForCausalLM if model_id.endswith("72B") else AutoModelForImageTextToText
58
  tokenizer = AutoTokenizer.from_pretrained(model_id)
59
+ model = loader.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
 
 
60
  inputs = tokenizer.apply_chat_template(
61
  [{"role": "user", "content": "Explain how to verify a numerical simulation."}],
62
  add_generation_prompt=True, enable_thinking=False, return_dict=True, return_tensors="pt",
 
65
  print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
66
  ```
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  ## Training procedure
69
 
70
  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.
71
 
72
+ 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.
73
 
74
+ | Shared setting | Value |
 
 
75
  | --- | --- |
76
  | Training dataset | Codex trajectories |
77
  | Training examples / tasks | 4,567 segments / 564 tasks |
 
80
  | Training epochs | 3 |
81
  | LoRA rank / alpha / dropout | 32 / 64 / 0.05 |
82
  | Released weights | LoRA merged into BF16 Safetensors |
83
+
84
+ Long trajectories are organized into segments. Source partition assignments are preserved, with no task identifiers shared between training and validation.
85
+
86
+ For **4B and 9B**, fine-tuning uses text trajectories with the vision tower and aligner frozen. Their additional settings are:
87
+
88
+ | Setting | 4B and 9B |
89
+ | --- | --- |
90
  | Maximum training sequence length | 36,864 tokens |
91
  | Learning rate / schedule | 2e-5 / cosine |
92
  | Warmup ratio | 0.03 |
 
95
  | Optimizer steps | 216 |
96
  | Packing | Disabled |
97
 
 
 
98
  ### Framework versions
99
 
100
  The release was validated with the following environment.