Qwen3-4B-Thinking-Agentic-Coding-GSPO

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.

Model Details

Training

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.

Intended Use

This adapter is intended for research and experimentation with:

  • Long-horizon coding agents
  • Multi-turn repository-level code modification
  • Tool-using language models
  • Execution-guided reinforcement learning

Usage

This repository contains a PEFT adapter and requires its direct Stage 2 base checkpoint.

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base_model_id = "Daniel031203/qwen-4b-thinking-stage2-merged"
adapter_id = "Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO"

tokenizer = AutoTokenizer.from_pretrained(adapter_id)

base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype="auto",
    device_map="auto",
)

model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()

Limitations

  • This model is intended for experimental agentic coding workflows and should not be assumed to produce correct or secure code.
  • Generated patches and terminal commands should be reviewed and executed in an isolated environment.
  • Performance may vary across repositories, programming languages, tool interfaces, and trajectory-length limits.
Downloads last month
41
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO

Adapter
(1)
this model
Merges
1 model