Run this model with HF Jobs

Run Tiiny/OpenFrogNano-4B 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/Tiiny/OpenFrogNano-4B. 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/Tiiny/OpenFrogNano-4B 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/Tiiny/OpenFrogNano-4B. 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/Tiiny/OpenFrogNano-4B. 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.
OpenFrogNano-4B / README.md
jeremyii's picture
Fill exact Base Qwen3.5-4B SWE-bench Pro V2 numerator (615/1,926)
5a7c0ef verified
|
Raw History Blame Contribute Delete
10.3 kB
---
license: apache-2.0
base_model: Qwen/Qwen3.5-4B
library_name: transformers
pipeline_tag: text-generation
language:
- en
tags:
- qwen3_5
- reinforcement-learning
- dppo
- grpo
- swe-agent
- code
- coding-agent
- frognano
- openfrognano
---
<div align="center">
# OpenFrogNano-4B
**An Open-Source 4B Coding Agent Trained with Pure Multi-Round RL on 794 Synthesized SWE Tasks**
<p>
<a href="https://huggingface.co/Tiiny">πŸ€— Tiiny AI</a> &nbsp;|&nbsp;
<a href="https://huggingface.co/Tiiny/OpenFrogNano-4B-Round0">Round 0</a> &nbsp;|&nbsp;
<a href="https://huggingface.co/Tiiny/OpenFrogNano-4B-Round1">Round 1</a> &nbsp;|&nbsp;
<a href="https://huggingface.co/Tiiny/OpenFrogNano-4B"><b>Round 2 (Latest)</b></a> &nbsp;|&nbsp;
<a href="https://huggingface.co/datasets/Tiiny/OpenFrogNano-Tasks">πŸ“Š Dataset (794 Tasks)</a> &nbsp;|&nbsp;
πŸ“„ License: Apache-2.0
</p>
</div>
> **Disclaimer**: **OpenFrogNano** is an independent open-source reproduction of FrogNano-4B by **Tiiny AI**, initialized from [`Qwen/Qwen3.5-4B`](https://huggingface.co/Qwen/Qwen3.5-4B). It is not affiliated with or endorsed by Microsoft or the official FrogNano team.
---
## Highlights
- **Pure RL, zero teacher distillation**: Post-trained exclusively with executable-test reinforcement learning from `Qwen/Qwen3.5-4B`β€”no SFT or trajectory distillation from stronger teacher models.
- **Outperforms Base & FrogNano on SWE-bench Pro V2**: Achieves **51.61% `avg@3`** (`994 / 1,926` rollouts across 642 tasks), improving **+19.68 pp** over `Qwen/Qwen3.5-4B` (**31.93%**, `615 / 1,926`) and surpassing `FrogNano-4B-2609` (**49.22%**, `948 / 1,926`) by **+2.39 pp** under the same evaluation harness.
- **High sample efficiency on SWE-bench Verified**: Using **3 RL rounds and only 794 synthesized SWE tasks** (roughly half the ~1,500 tasks and 5 rounds of official FrogNano), **OpenFrogNano-4B** boosts **SWE-bench Verified (500 tasks, `avg@3`)** from **40.73% β†’ 61.33%** (**+20.60 pp / +50.6% relative gain**).
- **Full-trajectory open release**: We release **all three sequential round checkpoints** (`Round 0` β†’ `Round 1` β†’ `Round 2`) together with **[`Tiiny/OpenFrogNano-Tasks`](https://huggingface.co/datasets/Tiiny/OpenFrogNano-Tasks)** (all 794 executable tasks with hidden test patches & grading metadata) and the full training recipe.
<p align="center">
<img src="assets/benchmark_overview.png" alt="OpenFrogNano-4B Benchmark Performance" width="100%"/>
</p>
---
## Benchmark Results
All evaluations below use **Qwen3.5's native tool-calling format** inside isolated Docker sandboxes (`131,072` max context, `8,192` max tokens/turn, up to `150` turns, `temperature = 0.6`, `seed = 42`, truncated rollouts scored as `0`) unless noted otherwise.
### SWE-bench Pro V2 (642 Tasks, `avg@3`)
| Model | RL Rounds | Synthesized Tasks | Tasks | Rollouts | Passed | `avg@3` | Gain vs. Base |
| --- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [`Qwen/Qwen3.5-4B`](https://huggingface.co/Qwen/Qwen3.5-4B) (Base) | 0 | β€” | 642 | 1,926 | 615 | 31.93% | β€” |
| `microsoft/FrogNano-4B-2609` (same harness) | 5 | ~1,500 | 642 | 1,926 | 948 | 49.22% | +17.29 pp |
| **[`Tiiny/OpenFrogNano-4B`](https://huggingface.co/Tiiny/OpenFrogNano-4B) (Ours)** | **3** | **794** | **642** | **1,926** | **994** | **51.61%** | **+19.68 pp (+2.39 vs. FrogNano)** |
### SWE-bench Verified (500 Tasks, `avg@3`)
| Model | Params | RL Rounds | Synth. Tasks | Valid Tasks | `avg@3` (Native) | `avg@3` (Full-500) | Gain vs. Base |
| --- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [`Qwen/Qwen3.5-4B`](https://huggingface.co/Qwen/Qwen3.5-4B) (Base) | 4B | 0 | β€” | 500 / 500 | 40.73% | 40.73% | β€” |
| [`Tiiny/OpenFrogNano-4B-Round0`](https://huggingface.co/Tiiny/OpenFrogNano-4B-Round0) (`step100`) | 4B | 1 | 194 | 498 / 500 | 51.41% | 51.20% | +10.68 pp |
| [`Tiiny/OpenFrogNano-4B-Round1`](https://huggingface.co/Tiiny/OpenFrogNano-4B-Round1) (`step200`) | 4B | 2 | 494 cum. | 497 / 500 | 57.61% | 57.33% | +16.88 pp |
| **[`Tiiny/OpenFrogNano-4B`](https://huggingface.co/Tiiny/OpenFrogNano-4B) (`round2-step70`)** | **4B** | **3** | **794 cum.** | **500 / 500** | **61.33%** | **61.33%** | **+20.60 pp** |
| *Ref: `microsoft/FrogNano-4B-2609` (reported Leaf harness)*\* | *4B* | *5* | *~1,500* | *500 / 500* | *61.5%* | *61.5%* | *+22.1 pp (vs. 39.4%)* |
| *Ref: `microsoft/FrogNano-4B-2609` (same harness)*\* | *4B* | *5* | *~1,500* | *499 / 500* | *57.98%* | *57.87%* | *+17.25 pp* |
| *Larger Ref: `openai/gpt-oss-120b` (official card)*\*\* | *120B MoE* | *β€”* | *β€”* | *500 / 500* | *62.4%* | *62.4%* | *β€”* |
| *Larger Ref: `Qwen/Qwen3.5-35B-A3B` (official card)*\*\* | *35B-A3B* | *β€”* | *β€”* | *500 / 500* | *69.2%* | *69.2%* | *β€”* |
| *Larger Ref: `Qwen/Qwen3.5-27B` (official card)*\*\* | *27B* | *β€”* | *β€”* | *500 / 500* | *72.4%* | *72.4%* | *β€”* |
<sub>*Harness note: Official `FrogNano-4B-2609` was trained and reported under its native Leaf harness (where base `Qwen3.5-4B` scores 39.4% and FrogNano reaches 61.5%). On Verified-500, `OpenFrogNano-4B` completed 1,500/1,500 valid rollouts with 0 excluded tasks, 3.8% truncation rate, and 28.6K mean response tokens.<br>**Larger open-weight reference scores are taken directly from their respective official Model Cards under their native evaluation scaffolds: `openai/gpt-oss-120b` reports 62.4% at high reasoning effort (cited as 62.0% in Qwen3.5's table), `Qwen/Qwen3.5-35B-A3B` reports 69.2%, and `Qwen/Qwen3.5-27B` reports 72.4%.</sub>
---
## Model Family & 3-Round Training Recipe
OpenFrogNano-4B is trained in three sequential rounds with **asynchronous partial-rollout DPPO** ($\delta = 0.2$, $C = 3.0$) and **GRPO** group-relative advantage ($\epsilon = 10^{-6}$, $\beta_{\text{KL}} = 0$, 32 prompts Γ— 8 rollouts = 256 trajectories/step, Adam `lr = 1e-6` constant, BF16 compute / FP32 master weights, frozen vision encoder).
| Stage | Checkpoint | Init From | Tasks | Context / Turns | Presence Penalty | Truncation Reward | Steps (Selected) | Verified 500 (`avg@3`) |
| --- | --- | --- | :---: | :---: | :---: | :---: | :---: | :---: |
| Round 0 | [`OpenFrogNano-4B-Round0`](https://huggingface.co/Tiiny/OpenFrogNano-4B-Round0) | `Qwen3.5-4B` | 194 | 64K / 75t | `0.0` | Strict `0.0` | 120 (`step 100`) | 51.41% |
| Round 1 | [`OpenFrogNano-4B-Round1`](https://huggingface.co/Tiiny/OpenFrogNano-4B-Round1) | `Round 0` | 300 | 64K / 75t | `0.0` | Strict `0.0` | 200 (`step 200`) | 57.61% |
| **Round 2** | **[`OpenFrogNano-4B`](https://huggingface.co/Tiiny/OpenFrogNano-4B)** | **`Round 1`** | **300** | **96K / 150t** | **`0.0`** | **Strict `0.0`** | **121 (`step 70`)** | **61.33%** |
<p align="center">
<img src="assets/training_dynamics.png" alt="OpenFrogNano-4B Multi-Round Training Dynamics" width="100%"/>
</p>
**Training dynamics (370 cumulative RL steps)**: Across all three rounds, training uses binary outcome rewards (`zero_reward_on_truncation`, no presence penalty). Across Round 0 (steps `0–100`), online Verified-200 truncation drops rapidly from `28.4%` to `7.1%` while `avg@3` rises `+12.6 pp`. Rotating to 300 unseen tasks in Round 1 (steps `100–300`) breaks training-set saturation and keeps truncation near `2%`. In Round 2 (steps `300–370`), expanding context/turns to 96K / 150t enables deeper multi-turn reasoning (mean response length grows steadily from `21.2K` β†’ `29.1K` tokens while truncation stays below `3.6%`), reaching **61.98%** on online Verified-200 at `step 70` (**61.33%** on full Verified-500). *(Online evals during Round 2 steps 30–60 were affected by an evaluation-infrastructure incident and are masked in the plot above.)*
---
## Quick Start
### Serving with vLLM
```bash
vllm serve Tiiny/OpenFrogNano-4B \
--dtype bfloat16 \
--max-model-len 131072
```
### Serving with SGLang
```bash
python -m sglang.launch_server \
--model-path Tiiny/OpenFrogNano-4B \
--dtype bfloat16 \
--context-length 131072
```
### Inference with Transformers
```python
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer
model_id = "Tiiny/OpenFrogNano-4B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "user", "content": "Explain why Python's asyncio.Lock should not be shared across different event loops."}
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.6,
top_p=1.0,
do_sample=True,
)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
```
> **Agentic SWE tip**: To reproduce benchmark performance on repository-level issues, run the model inside an isolated Docker sandbox with **Qwen3.5's native tool-calling format** (`131,072` context, `8,192` max tokens/turn, `150` max turns, `temperature = 0.6`).
---
## Technical Notes & Limitations
- **No MTP head**: The 15 Multi-Token Prediction (`mtp.*`) tensors from `Qwen3.5-4B` were not exported during RL training (`text_config.mtp_num_hidden_layers = 0`). Standard inference works out of the box without MTP speculative decoding.
- **Vision encoder frozen**: Visual encoder weights are inherited bit-for-bit from `Qwen/Qwen3.5-4B` and were not post-trained or evaluated on multimodal tasks.
- **Domain focus**: Post-training focused primarily on English, Python-heavy repository debugging and patch generation; performance may vary under different agent scaffolds or non-Python languages.
- **Safety & review**: Candidate patches generated by the model should always be executed in an isolated sandbox and reviewed by a human developer before merging or deploying.
---
## License & Citation
Released under the **Apache-2.0** license, inheriting the upstream license of `Qwen/Qwen3.5-4B`.
```bibtex
@misc{openfrognano2026,
title = {OpenFrogNano: Open-Source 4B Coding Agents via Closed-Loop Task Synthesis and Asynchronous RL},
author = {Tiiny AI},
year = {2026},
url = {https://huggingface.co/Tiiny/OpenFrogNano-4B}
}
```