bingran-you commited on
Commit
575a490
·
verified ·
1 Parent(s): 87462fa

Document v0.0.1 LoRA training recipe and results

Browse files

Records completed seq2048 LoRA SFT data recipe, training parameters, held-in eval results, and release caveats. Excludes the in-progress QLoRA run.

Files changed (1) hide show
  1. README.md +90 -62
README.md CHANGED
@@ -5,100 +5,124 @@ datasets:
5
  - benchflow/general-agent-qwen35-9b-azure-gpt54mini-sft
6
  tags:
7
  - lora
8
- - qlora
9
  - sft
10
  - general-agent
11
- - env-0
12
  - qwen
13
  ---
14
 
15
- # Qwen3.5-9B General-Agent SFT Adapter
16
 
17
- This repository publishes the current PEFT adapter for the Prime `general-agent` SFT reproduction. It does not include the frozen base weights. Load the adapter on top of the full, non-prequantized `Qwen/Qwen3.5-9B` checkpoint.
18
 
19
- ## Current Published Adapter
 
 
20
 
21
  | Field | Value |
22
  | --- | --- |
 
 
23
  | Base checkpoint | `Qwen/Qwen3.5-9B` |
24
- | Base checkpoint form | Full, non-quantized source checkpoint; frozen during adapter training |
25
- | Adapter type | LoRA |
26
- | Adapter rank / alpha / dropout | `r=16`, `alpha=32`, `dropout=0.0` |
27
- | Target modules | `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` |
28
- | Trainable params | about `29.1M` |
29
- | Source run id | `general-agent-qwen35-9b-sft-seq2048-fresh-20260624T131847Z` |
30
  | W&B project | `general-agent-qwen35-9b-sft-seq2048-fresh-20260624T131847Z` |
31
- | Raw artifacts | `benchflow/env0-experiment-trajectories/experiments/general-agent/general-agent-qwen35-9b-sft-seq2048-fresh-20260624T131847Z` |
 
 
 
 
 
32
 
33
- ## Completed SFT Training Recipe
 
 
 
 
 
 
34
 
35
  | Field | Value |
36
  | --- | --- |
37
- | Trainer | Prime-RL SFT |
38
  | Dataset | `benchflow/general-agent-qwen35-9b-azure-gpt54mini-sft` |
39
- | Dataset rows | `4414` valid Azure GPT-5.4-mini teacher traces |
40
- | Source tasks | Prime `general_agent` open-source task corpus |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  | Sequence length | `2048` |
42
  | Global batch size | `8` |
43
  | Micro batch size | `1` |
44
  | Pack function | `cat` |
45
- | Shuffle / seed | `true` / `0` |
46
- | Max steps | `200` |
47
  | Optimizer | `AdamW` |
48
  | Learning rate | `5e-5` |
49
  | Weight decay | `0.01` |
50
- | Grad norm clip | `1.0` |
51
  | Betas | `0.9`, `0.999` |
 
52
  | Scheduler | Linear |
53
  | Warmup steps | `20` |
54
- | Loss mask | Assistant messages only; system/user/tool context masked |
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  | Final loss | `0.11897` |
56
- | NaN count | `0` |
57
  | Peak GPU memory | about `40.8 GiB` |
 
 
 
58
 
59
  ## Evaluation Results
60
 
61
- All evaluations below use `general-agent-solver-local`, native `vf-eval --save-results`, `max_model_len=4096`, `--enable-auto-tool-choice`, and `--tool-call-parser qwen3_xml`.
62
 
63
- | Task set | Base pass rate | SFT pass rate | Delta | Notes |
64
  | --- | ---: | ---: | ---: | --- |
65
- | Held-in 36 tier-0/1 tasks | `20/36 = 55.56%` | `23/36 = 63.89%` | `+8.33%` | No regressions; recovered `3d_print_shop_t1`, `accounting_firm_t1`, `allergy_clinic_t0` |
66
- | Held-in 50 tier-0/1 tasks | `27/50 = 54.00%` | `30/50 = 60.00%` | `+6.00%` | Latest assembled result; the final 14-task slice had no net delta |
 
 
67
  | Held-in 50 final 14-task slice | `7/14 = 50.00%` | `7/14 = 50.00%` | `+0.00%` | Recovered `animation_studio_t0`; regressed `antiquarian_bookshop_t0` |
68
 
69
- Held-in 50 provenance:
70
 
71
- - Held-in36 comparison: `benchflow/env0-experiment-trajectories/experiments/general-agent/general-agent-qwen35-eval-heldin36-compare-20260624`
72
- - Held-in50 final 14-task run: `benchflow/env0-experiment-trajectories/experiments/general-agent/general-agent-qwen35-eval-heldin50-gap-20260624T190517Z`
73
-
74
- ## Current QLoRA Seq8192 Training Run
75
-
76
- A longer-context QLoRA ablation is currently running and is not the adapter published on `main` yet. Its final metrics should replace this section only after `train_summary.json`, merged serving, and held-in eval finish.
77
-
78
- | Field | Current value |
79
- | --- | --- |
80
- | Run id | `general-agent-qwen35-qlora-seq8192-20260624T215352Z` |
81
- | Prime pod | `e0d97ec9c2db4b3f93529f1bbf61da60` |
82
- | GPU | `1x H100 80GB`, `$2.35/hr` |
83
- | Trainer | Custom Transformers + PEFT + bitsandbytes QLoRA |
84
- | Base checkpoint | `Qwen/Qwen3.5-9B` full, non-prequantized source checkpoint |
85
- | Quantization | `4bit NF4`, double quantization, BF16 compute |
86
- | Dataset | `benchflow/general-agent-qwen35-9b-azure-gpt54mini-sft/train.jsonl` |
87
- | Dataset rows | `4414` |
88
- | Sequence length | `8192` |
89
- | Max steps | `200` |
90
- | Micro batch size | `1` |
91
- | Gradient accumulation | `8` |
92
- | Effective batch size | `8` |
93
- | Learning rate | `5e-5` |
94
- | Warmup steps | `20` |
95
- | Weight decay | `0.01` |
96
- | Seed | `0` |
97
- | LoRA | `r=16`, `alpha=32`, `dropout=0.0` |
98
- | Target modules | `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` |
99
- | Loss mask | Assistant turns only, built by chat-template prefix diff |
100
- | W&B project | `general-agent-qwen35-qlora-seq8192-20260624T215352Z` |
101
- | Current status at model-card update | In tokenization/training startup; no final loss or eval metric committed yet |
102
 
103
  ## Loading
104
 
@@ -106,14 +130,18 @@ A longer-context QLoRA ablation is currently running and is not the adapter publ
106
  from peft import PeftModel
107
  from transformers import AutoModelForCausalLM, AutoTokenizer
108
 
109
- base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-9B", torch_dtype="auto", trust_remote_code=True)
 
 
 
 
110
  model = PeftModel.from_pretrained(base, "benchflow/benchflow-qwen35-9b")
111
  tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3.5-9B", trust_remote_code=True)
112
  ```
113
 
114
  ## Caveats
115
 
116
- - This is an SFT-stage reproduction artifact, not the full Prime paper recipe with the original teacher/model stack.
117
- - The training data was regenerated from open-source tasks with Azure GPT-5.4-mini teacher traces; three Azure-filtered source prompts were excluded from the trainable dataset.
118
- - Held-in eval lift is positive but modest: the latest held-in50 assembled result is `+6.00 pp`.
119
- - The active seq8192 QLoRA run is still in progress as of `2026-06-24 22:26:04 UTC` and should not be treated as a released checkpoint.
 
5
  - benchflow/general-agent-qwen35-9b-azure-gpt54mini-sft
6
  tags:
7
  - lora
8
+ - peft
9
  - sft
10
  - general-agent
 
11
  - qwen
12
  ---
13
 
14
+ # Qwen3.5-9B General-Agent SFT LoRA Adapter
15
 
16
+ `v0.0.1` is the completed LoRA SFT release for the Prime `general-agent` reproduction using the full, non-prequantized `Qwen/Qwen3.5-9B` base checkpoint. It does **not** include the base weights; load this adapter on top of `Qwen/Qwen3.5-9B`.
17
 
18
+ This release intentionally excludes the next QLoRA run that is currently in progress. That run will be documented and tagged separately after its training and eval finish.
19
+
20
+ ## Release Summary
21
 
22
  | Field | Value |
23
  | --- | --- |
24
+ | Release tag | `v0.0.1` |
25
+ | Adapter repo | `benchflow/benchflow-qwen35-9b` |
26
  | Base checkpoint | `Qwen/Qwen3.5-9B` |
27
+ | Base checkpoint form | Full, non-quantized source checkpoint; frozen during LoRA SFT |
28
+ | Adapter type | LoRA / PEFT |
29
+ | Source completed run | `general-agent-qwen35-9b-sft-seq2048-fresh-20260624T131847Z` |
 
 
 
30
  | W&B project | `general-agent-qwen35-9b-sft-seq2048-fresh-20260624T131847Z` |
31
+ | HF training artifacts | `benchflow/env0-experiment-trajectories/experiments/general-agent/general-agent-qwen35-9b-sft-seq2048-fresh-20260624T131847Z` |
32
+ | Published at | `2026-06-24 22:27:07 UTC` |
33
+
34
+ ## Research Reproduction Scope
35
+
36
+ The goal of this adapter is to reproduce the SFT-stage lift from Prime Intellect's `general-agent` work as closely as possible while using a smaller student model that can train on one H100. The stack keeps the Prime-style task and verifier path:
37
 
38
+ - Source tasks: open-source `PrimeIntellect-ai/research-environments/environments/general_agent` task corpus.
39
+ - Teacher trace generation: `general-agent-solver-rlm` + Azure GPT-5.4-mini through native Verifiers / `vf-eval --save-results` artifacts.
40
+ - SFT trainer: Prime-RL SFT.
41
+ - Student: full, non-quantized `Qwen/Qwen3.5-9B` loaded in BF16 with LoRA adapters.
42
+ - Eval: `general-agent-solver-local` through native `vf-eval --save-results` on the same held-in task sets before and after SFT.
43
+
44
+ ## Data Recipe
45
 
46
  | Field | Value |
47
  | --- | --- |
 
48
  | Dataset | `benchflow/general-agent-qwen35-9b-azure-gpt54mini-sft` |
49
+ | Dataset rows | `4414` |
50
+ | Original source task count | `4417` |
51
+ | Teacher model | Azure GPT-5.4-mini |
52
+ | Teacher harness | Prime/Verifiers `general-agent-solver-rlm` |
53
+ | Artifact format | Native `vf-eval --save-results` trajectories converted to Prime-RL `messages` + `tool_defs` SFT rows |
54
+ | Excluded source tasks | `dog_breeding_t1`, `skydiving_center_t1`, `skydiving_center_t2` |
55
+ | Exclusion reason | Stable Azure content-filter blocks during teacher trace generation |
56
+ | Full teacher sweep artifact | `benchflow/env0-experiment-trajectories/experiments/general-agent/general-agent-daytona-teacher-full4417-tunnel8-20260624T015706Z` |
57
+ | Data validation | Prime SFT JSONL validator rejected non-leading system messages and leakage fields before training |
58
+
59
+ ## Training Parameters
60
+
61
+ | Field | Value |
62
+ | --- | --- |
63
+ | Trainer | Prime-RL SFT |
64
+ | Model loaded for SFT | `Qwen/Qwen3.5-9B` full BF16 base weights |
65
+ | Quantization | None for the completed `v0.0.1` LoRA run |
66
+ | Adapter | LoRA |
67
+ | LoRA rank | `16` |
68
+ | LoRA alpha | `32` |
69
+ | LoRA dropout | `0.0` |
70
+ | Target modules | `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` |
71
+ | Trainable params | about `29.1M` |
72
+ | Adapted base params | about `5.30B` |
73
+ | Total base params loaded | about `9.44B` |
74
  | Sequence length | `2048` |
75
  | Global batch size | `8` |
76
  | Micro batch size | `1` |
77
  | Pack function | `cat` |
78
+ | Shuffle | `true` |
79
+ | Seed | `0` |
80
  | Optimizer | `AdamW` |
81
  | Learning rate | `5e-5` |
82
  | Weight decay | `0.01` |
 
83
  | Betas | `0.9`, `0.999` |
84
+ | Grad norm clip | `1.0` |
85
  | Scheduler | Linear |
86
  | Warmup steps | `20` |
87
+ | Decay steps | `180` |
88
+ | Minimum LR | `0.0` |
89
+ | Max steps | `200` |
90
+ | Checkpoint interval | `20` |
91
+ | Keep last | `3` |
92
+ | Keep interval | `100` |
93
+ | Save format | `safetensors` |
94
+ | Loss mask | Assistant messages only; system, user, and tool messages are context-only |
95
+
96
+ ## Training Result
97
+
98
+ | Metric | Value |
99
+ | --- | ---: |
100
+ | Completed step | `200` |
101
  | Final loss | `0.11897` |
102
+ | `loss/nan_count` | `0` |
103
  | Peak GPU memory | about `40.8 GiB` |
104
+ | Final adapter | `adapter_model.safetensors` in this repo |
105
+
106
+ The initial `data.seq_len=8192` Prime-RL BF16 LoRA attempt OOMed on one H100. The completed `v0.0.1` run used `data.seq_len=2048`, system CUDA 12.8 `nvcc`/`ptxas`, and `g++-12` for the required FLA/TileLang kernels.
107
 
108
  ## Evaluation Results
109
 
110
+ All evaluations below use native Verifiers `vf-eval --save-results`, `general-agent-solver-local`, serving context length `4096`, `--enable-auto-tool-choice`, and `--tool-call-parser qwen3_xml`. Dynamic vLLM LoRA loading was not reliable for this stack, so eval served a merged local checkpoint built from this adapter plus `Qwen/Qwen3.5-9B`.
111
 
112
+ | Task set | Base pass rate | LoRA SFT pass rate | Delta | Notes |
113
  | --- | ---: | ---: | ---: | --- |
114
+ | Held-in 5 smoke | `1/5 = 20.00%` | `2/5 = 40.00%` | `+20.00 pp` | First serving/eval smoke |
115
+ | Held-in 20 | `11/20 = 55.00%` | `13/20 = 65.00%` | `+10.00 pp` | Recovered `3d_print_shop_t1`, `accounting_firm_t1` |
116
+ | Held-in 36 | `20/36 = 55.56%` | `23/36 = 63.89%` | `+8.33%` | No regressions; recovered `3d_print_shop_t1`, `accounting_firm_t1`, `allergy_clinic_t0` |
117
+ | Held-in 50 assembled | `27/50 = 54.00%` | `30/50 = 60.00%` | `+6.00%` | Latest wider held-in result; final 14-task slice had no net delta |
118
  | Held-in 50 final 14-task slice | `7/14 = 50.00%` | `7/14 = 50.00%` | `+0.00%` | Recovered `animation_studio_t0`; regressed `antiquarian_bookshop_t0` |
119
 
120
+ Evaluation artifact prefixes:
121
 
122
+ - Held-in 5 smoke: `benchflow/env0-experiment-trajectories/experiments/general-agent/general-agent-qwen35-eval-smoke4096-20260624T152150Z`
123
+ - Held-in 20 comparison: `benchflow/env0-experiment-trajectories/experiments/general-agent/general-agent-qwen35-eval-heldin20-compare-20260624`
124
+ - Held-in 36 comparison: `benchflow/env0-experiment-trajectories/experiments/general-agent/general-agent-qwen35-eval-heldin36-compare-20260624`
125
+ - Held-in 50 final 14-task run: `benchflow/env0-experiment-trajectories/experiments/general-agent/general-agent-qwen35-eval-heldin50-gap-20260624T190517Z`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
  ## Loading
128
 
 
130
  from peft import PeftModel
131
  from transformers import AutoModelForCausalLM, AutoTokenizer
132
 
133
+ base = AutoModelForCausalLM.from_pretrained(
134
+ "Qwen/Qwen3.5-9B",
135
+ torch_dtype="auto",
136
+ trust_remote_code=True,
137
+ )
138
  model = PeftModel.from_pretrained(base, "benchflow/benchflow-qwen35-9b")
139
  tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3.5-9B", trust_remote_code=True)
140
  ```
141
 
142
  ## Caveats
143
 
144
+ - This is an SFT-stage reproduction artifact, not the full Prime paper recipe with the original teacher and student model stack.
145
+ - The trainable dataset has `4414` rows rather than `4417` because three Azure teacher prompts were blocked by content filtering.
146
+ - The latest held-in50 assembled lift is positive but modest at `+6.00 pp`; gains are concentrated in a small number of tasks rather than broad across-the-board recovery.
147
+ - The next QLoRA seq8192 experiment is excluded from `v0.0.1` and should receive its own update/tag only after it completes.