Qwen3-4B, post-trained with GSPO for long-horizon agentic coding. The model learns from multi-turn coding trajectories involving repository inspection, code editing, terminal execution, and test-based verification, with execution-verified terminal rewards assigned at the end of each trajectory.
The model was post-trained on multi-turn agentic coding trajectories. During each trajectory, the agent can inspect repository contents, search and read source files, apply code changes, execute terminal commands, run tests, and submit a final solution.
A terminal reward is assigned at the end of each trajectory using execution and test outcomes, encouraging the policy to complete coding tasks that are verifiably correct.
This repository contains a PEFT adapter and requires its direct Stage 2 base checkpoint.
1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4base_model_id = "Daniel031203/qwen-4b-thinking-stage2-merged"
5adapter_id = "Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO"
6
7tokenizer = AutoTokenizer.from_pretrained(adapter_id)
8
9base_model = AutoModelForCausalLM.from_pretrained(
10 base_model_id,
11 torch_dtype="auto",
12 device_map="auto",
13)
14
15model = PeftModel.from_pretrained(base_model, adapter_id)
16model.eval()