Text Generation
Transformers
Safetensors
English
qwen3_5
image-text-to-text
reinforcement-learning
dppo
grpo
swe-agent
code
coding-agent
frognano
openfrognano
conversational
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.
Instructions to use Tiiny/OpenFrogNano-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tiiny/OpenFrogNano-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tiiny/OpenFrogNano-4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Tiiny/OpenFrogNano-4B") model = AutoModelForMultimodalLM.from_pretrained("Tiiny/OpenFrogNano-4B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Tiiny/OpenFrogNano-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tiiny/OpenFrogNano-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tiiny/OpenFrogNano-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Tiiny/OpenFrogNano-4B
- SGLang
How to use Tiiny/OpenFrogNano-4B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Tiiny/OpenFrogNano-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tiiny/OpenFrogNano-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Tiiny/OpenFrogNano-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tiiny/OpenFrogNano-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Tiiny/OpenFrogNano-4B with Docker Model Runner:
docker model run hf.co/Tiiny/OpenFrogNano-4B
File size: 10,321 Bytes
50f1215 cbc6e30 50f1215 5a7c0ef c341666 cbc6e30 50f1215 fd09407 509ef3b 50f1215 c341666 509ef3b 5a7c0ef fd09407 c341666 509ef3b 50f1215 6a577a8 c341666 6a577a8 fd09407 6a577a8 fd09407 50f1215 f6ed1f5 50f1215 c341666 50f1215 c341666 50f1215 fd09407 50f1215 f6ed1f5 50f1215 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | ---
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> |
<a href="https://huggingface.co/Tiiny/OpenFrogNano-4B-Round0">Round 0</a> |
<a href="https://huggingface.co/Tiiny/OpenFrogNano-4B-Round1">Round 1</a> |
<a href="https://huggingface.co/Tiiny/OpenFrogNano-4B"><b>Round 2 (Latest)</b></a> |
<a href="https://huggingface.co/datasets/Tiiny/OpenFrogNano-Tasks">π Dataset (794 Tasks)</a> |
π 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}
}
```
|