Text Generation
Transformers
Safetensors
qwen3
code
software-engineering
agent
conversational
text-generation-inference
ubowang commited on
Commit
1987c8f
·
verified ·
1 Parent(s): f82da66

Update model card: official GitHub/dataset links, unified training configs, results, citation

Browse files
Files changed (1) hide show
  1. README.md +41 -14
README.md CHANGED
@@ -4,31 +4,49 @@ library_name: transformers
4
  pipeline_tag: text-generation
5
  base_model:
6
  - Qwen/Qwen3-8B
 
 
 
7
  tags:
8
  - code
9
  - software-engineering
10
  - agent
11
  ---
12
 
13
- # FIM-8B Inference on SWE-Bench Verified
14
 
15
- This guide describes how to run the **FIM-8B** checkpoint on SWE-Bench Verified (and Lite). Unlike FIM-7B and FIM-14B (R2E-Gym scaffold), this model is post-trained on SWE-Lego trajectories and is evaluated with the SWE-Lego setup: OpenHands `CodeActAgent` for inference and the official SWE-bench harness for scoring.
16
 
17
- ## Model
18
 
19
- Local path: `models/FIM-8B/` (checkpoints are gitignored; do not commit them).
20
 
21
- - Base model: `Qwen/Qwen3-8B`
22
- - FIM mid-training: FIM v2/v3 data
23
- - Post-training: SFT on SWE-Lego trajectories
24
 
 
25
 
26
- ## 1. Serve the model with vLLM
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  ```bash
29
  CUDA_VISIBLE_DEVICES=0 \
30
  python -m vllm.entrypoints.openai.api_server \
31
- --model models/FIM-8B \
32
  --served-model-name FIM-8B \
33
  --host 127.0.0.1 \
34
  --port 8400 \
@@ -39,17 +57,15 @@ python -m vllm.entrypoints.openai.api_server \
39
  > vllm_fim8b.log 2>&1 &
40
  ```
41
 
42
- The checkpoint ships `max_position_embeddings: 163840` and its own chat template, so no rope or template overrides are needed.
43
-
44
  Wait until the server is up (model load takes ~1 minute):
45
 
46
  ```bash
47
  curl -s http://127.0.0.1:8400/v1/models
48
  ```
49
 
50
- ## 2. Run the agent on SWE-Bench Verified
51
 
52
- Inference uses OpenHands 0.53.0. Define the LLM in `config.toml`:
53
 
54
  ```toml
55
  [llm.eval_fim]
@@ -83,6 +99,17 @@ poetry run python evaluation/benchmarks/swe_bench/run_infer.py \
83
 
84
  For SWE-Bench Lite, use `--dataset princeton-nlp/SWE-bench_Lite`.
85
 
86
- ## 3. Score with the SWE-bench harness
87
 
88
  Convert the OpenHands `output.jsonl` to a predictions file with `evaluation/benchmarks/swe_bench/scripts/eval/convert_oh_output_to_swe_json.py`, then evaluate it with the official SWE-bench harness (`python -m swebench.harness.run_evaluation`). The reported score is `resolved_instances / total_instances`.
 
 
 
 
 
 
 
 
 
 
 
 
4
  pipeline_tag: text-generation
5
  base_model:
6
  - Qwen/Qwen3-8B
7
+ datasets:
8
+ - TIGER-Lab/FIM-Midtraining-400K
9
+ - SWE-Lego/SWE-Lego-Synthetic-Data
10
  tags:
11
  - code
12
  - software-engineering
13
  - agent
14
  ---
15
 
16
+ # FIM-8B
17
 
18
+ [📄 Paper (PDF)](https://github.com/TIGER-AI-Lab/FIM-Midtraining/blob/main/paper.pdf) · [💻 GitHub](https://github.com/TIGER-AI-Lab/FIM-Midtraining) · [🤗 Dataset](https://huggingface.co/datasets/TIGER-Lab/FIM-Midtraining-400K) · [🤗 Collection](https://huggingface.co/collections/TIGER-Lab/fim-midtraining)
19
 
20
+ **FIM-8B** is the strongest released model of *"Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Models"*: `Qwen3-8B`, mid-trained on function-aware FIM data, then post-trained on SWE-Lego agent trajectories. The mid-training stage is the only difference from a standard SWE-Lego reproduction — worth **+3.2 points on SWE-Bench-Verified and +5.4 on SWE-Bench-Lite**. Unlike FIM-7B and FIM-14B (R2E-Gym scaffold), this model is evaluated with the SWE-Lego setup: OpenHands `CodeActAgent` for inference and the official SWE-bench harness for scoring.
21
 
22
+ ## Training pipeline
23
 
24
+ - **Base model**: [`Qwen/Qwen3-8B`](https://huggingface.co/Qwen/Qwen3-8B)
25
+ - **FIM mid-training**: [`midtraining/configs/fim_midtrain.yaml`](https://github.com/TIGER-AI-Lab/FIM-Midtraining/blob/main/midtraining/configs/fim_midtrain.yaml) on [TIGER-Lab/FIM-Midtraining-400K](https://huggingface.co/datasets/TIGER-Lab/FIM-Midtraining-400K) (as-run copy: [`FIM_Midtrain_8B.yaml`](https://github.com/TIGER-AI-Lab/FIM-Midtraining/blob/main/midtraining/configs/FIM_Midtrain_8B.yaml)) → intermediate checkpoint released as [TIGER-Lab/FIM-Mid-8B](https://huggingface.co/TIGER-Lab/FIM-Mid-8B)
26
+ - **Post-training**: SFT on SWE-Lego trajectories (real + synthetic, `resolved`-filtered, 2 epochs) — [`posttraining/swe_lego/`](https://github.com/TIGER-AI-Lab/FIM-Midtraining/tree/main/posttraining/swe_lego) (as-run copy: [`FIM_Posttrain_8B.yaml`](https://github.com/TIGER-AI-Lab/FIM-Midtraining/blob/main/posttraining/swe_lego/FIM_Posttrain_8B.yaml))
27
 
28
+ ## Results
29
 
30
+ Means over three evaluation seeds, identical harness for both arms (paper Table 1):
31
+
32
+ | Setting | SWE-Bench-Verified | SWE-Bench-Lite |
33
+ |---|---|---|
34
+ | Qwen3-8B + SWE-Lego (reproduced) | 31.80 | 27.30 |
35
+ | **FIM-8B (+ FIM mid-training)** | **35.00** | **32.70** |
36
+ | Δ | +3.20 | +5.40 |
37
+
38
+ ## Evaluate on SWE-Bench Verified
39
+
40
+ The complete pinned walkthrough lives at [`evaluation/swebench/released_checkpoints.md`](https://github.com/TIGER-AI-Lab/FIM-Midtraining/blob/main/evaluation/swebench/released_checkpoints.md).
41
+
42
+ ### 1. Serve the model with vLLM
43
+
44
+ The checkpoint ships `max_position_embeddings: 163840` and its own chat template, so no rope or template overrides are needed:
45
 
46
  ```bash
47
  CUDA_VISIBLE_DEVICES=0 \
48
  python -m vllm.entrypoints.openai.api_server \
49
+ --model TIGER-Lab/FIM-8B \
50
  --served-model-name FIM-8B \
51
  --host 127.0.0.1 \
52
  --port 8400 \
 
57
  > vllm_fim8b.log 2>&1 &
58
  ```
59
 
 
 
60
  Wait until the server is up (model load takes ~1 minute):
61
 
62
  ```bash
63
  curl -s http://127.0.0.1:8400/v1/models
64
  ```
65
 
66
+ ### 2. Run the agent on SWE-Bench Verified
67
 
68
+ Inference uses OpenHands 0.53.0 with `CodeActAgent`. Define the LLM in `config.toml`:
69
 
70
  ```toml
71
  [llm.eval_fim]
 
99
 
100
  For SWE-Bench Lite, use `--dataset princeton-nlp/SWE-bench_Lite`.
101
 
102
+ ### 3. Score with the SWE-bench harness
103
 
104
  Convert the OpenHands `output.jsonl` to a predictions file with `evaluation/benchmarks/swe_bench/scripts/eval/convert_oh_output_to_swe_json.py`, then evaluate it with the official SWE-bench harness (`python -m swebench.harness.run_evaluation`). The reported score is `resolved_instances / total_instances`.
105
+
106
+ ## Citation
107
+
108
+ ```bibtex
109
+ @article{wang2026fim,
110
+ title={Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Models},
111
+ author={Wang, Yubo and Liang, Jiarong and Zhang, Yuxuan and Liu, Xuye and Wei, Cong and Zhang, Yuyu and Nie, Ping and Chen, Wenhu},
112
+ journal={arXiv preprint},
113
+ year={2026}
114
+ }
115
+ ```