Run this model with HF Jobs

Run twothsnd/ReTerm-9B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/twothsnd/ReTerm-9B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/twothsnd/ReTerm-9B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/twothsnd/ReTerm-9B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/twothsnd/ReTerm-9B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

ReTerm-9B

This repository contains ReTerm-9B, presented in ReTerm: Recovery Training for Self-Improving Terminal Agents. ReTerm-9B is a self-improving terminal agent built on Qwen3.5-9B through SFT and ReTerm-GRPO. The model uses the Qwen3.5 architecture and chat template.

Paper · Training code · ReTerm-10K dataset · Base model

👀 About ReTerm

We introduce ReTerm, a self-improving terminal agent trained to recover from errors produced during its own execution.

We construct ReTerm-10K, a high-quality recovery trajectory dataset generated through a dedicated data pipeline for SFT cold start. Moreover, we propose ReTerm-GRPO, an online RL algorithm that branches into multiple independent self-recovery attempts from the agent's own failure states. Their verifier outcomes provide group-relative learning signals, enabling the agent to self-improve through its own recovery experience.

Built on Qwen3.5-9B, ReTerm-9B demonstrates strong performance on challenging terminal and software engineering tasks, with generalization across out-of-domain benchmarks and different agent harnesses.

🏆 Performance

ReTerm-9B achieves strong results on terminal and software engineering benchmarks:

Benchmark Pass@1
OpenThoughts-TBLite 60.6%
Terminal-Bench 2.0 34.8%
SWE-bench Verified 58.4%
AIME 2024 86.7%
AIME 2025 93.3%
Aider Polyglot 20.4%
SpreadsheetBench Verified 48.8%

Beyond these core evaluations, ReTerm also generalizes to out-of-domain tasks, including mathematical reasoning and spreadsheet processing. The improvement trend persists across different agent harnesses, suggesting transferable capabilities across interaction setups.

🎥 Recovery Example

Recovery behavior of GRPO and ReTerm-GRPO on a PyStan installation task

🔧 Using the model

ReTerm-9B can be loaded with Qwen3.5-compatible inference frameworks. For terminal-agent use, apply the Qwen3.5 chat template and tool-call protocol with an agent harness that executes commands and returns environment observations. Training code and configurations are available in the ReTerm repository.

Downloads last month
49
Safetensors
Model size
9B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for twothsnd/ReTerm-9B

Finetuned
Qwen/Qwen3.5-9B
Finetuned
(1,655)
this model
Quantizations
1 model

Dataset used to train twothsnd/ReTerm-9B

Paper for twothsnd/ReTerm-9B