Image-Text-to-Text
Transformers
Safetensors
qwen3_5
HERO
reinforcement-learning
coding-agent
token-efficiency
conversational
Instructions to use XLearning-SCU/HERO-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XLearning-SCU/HERO-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="XLearning-SCU/HERO-9B") 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("XLearning-SCU/HERO-9B") model = AutoModelForMultimodalLM.from_pretrained("XLearning-SCU/HERO-9B", 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 XLearning-SCU/HERO-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XLearning-SCU/HERO-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XLearning-SCU/HERO-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/XLearning-SCU/HERO-9B
- SGLang
How to use XLearning-SCU/HERO-9B 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 "XLearning-SCU/HERO-9B" \ --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": "XLearning-SCU/HERO-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "XLearning-SCU/HERO-9B" \ --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": "XLearning-SCU/HERO-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use XLearning-SCU/HERO-9B with Docker Model Runner:
docker model run hf.co/XLearning-SCU/HERO-9B
File size: 3,519 Bytes
b903d53 1ba7885 b903d53 1ba7885 b903d53 1ba7885 | 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 | ---
library_name: transformers
license: apache-2.0
license_link: https://huggingface.co/Qwen/Qwen3.5-9B/blob/main/LICENSE
pipeline_tag: image-text-to-text
base_model: Qwen/Qwen3.5-9B
base_model_relation: finetune
tags:
- HERO
- reinforcement-learning
- coding-agent
- token-efficiency
---
<p align="center">
<img src="assets/hero-logo.png" alt="HERO logo" width="760">
</p>
<h1 align="center">HERO-9B</h1>
<p align="center">
<strong>Doing More with Less Tokens: Hierarchical Reinforcement Learning for Efficient Coding Agents</strong>
</p>
<p align="center">
<a href="https://arxiv.org/abs/2609.38885"><img src="https://img.shields.io/badge/arXiv-2609.38885-b31b1b.svg" alt="Paper"></a>
<a href="https://github.com/XLearning-SCU/HERO"><img src="https://img.shields.io/badge/GitHub-Code-181717.svg" alt="Code"></a>
<a href="https://huggingface.co/collections/XLearning-SCU/hero"><img src="https://img.shields.io/badge/%F0%9F%A4%97-Models-f4c430.svg" alt="Hugging Face Models"></a>
<a href="https://huggingface.co/datasets/XLearning-SCU/HERO-Trajectories"><img src="https://img.shields.io/badge/%F0%9F%A4%97-Trajectories-f4c430.svg" alt="Hugging Face Trajectories"></a>
</p>
## 🔍 Overview
**HERO-9B** is post-trained from **Qwen3.5-9B** using HERO (HiErarchical ReinfOrcement learning) to improve token efficiency while prioritizing task resolution.
| Item | Description |
| --- | --- |
| Base model | `Qwen/Qwen3.5-9B` |
| Parameters | 9B (dense) |
| Architecture and tokenizer | Inherited from Qwen3.5-9B |
| Training | HERO on 640 multilingual SWE tasks from SWE-Gym, Multi-SWE-bench, and SWE-rebench |
| Intended use | Repository-level coding agents |
| Format | Hugging Face weights and tokenizer |
HERO combines capability-based efficiency gating, resolution-first clipping,
and efficiency credit at trajectory and turn levels. Qwen3.5 is the backbone;
this release contains the HERO post-trained weights.
## Usage
Follow the [preparation guide](https://github.com/XLearning-SCU/HERO/blob/main/Prepare.md) in the HERO code repository. From that repository's root,
with this model saved under `../models/HERO-9B/`:
```bash
MODEL=../models/HERO-9B bash eval/run_eval_swebench_verified.sh
MODEL=../models/HERO-9B bash eval/run_eval_swebench_multilingual.sh
```
## Evaluation Settings
The released evaluation scripts use the following defaults for both SWE-bench Verified and SWE-bench Multilingual:
| Setting | Value |
| --- | --- |
| Agent scaffold | Claude Code |
| Inference backend | SGLang |
| Temperature | 0.6 |
| Top-p | 0.95 |
| Context length | 131,072 tokens |
| Maximum output per call | 16,000 tokens |
| Maximum agent turns | 200 |
| Automatic context compaction | Disabled |
| Tools | Default tools, excluding WebFetch, WebSearch, and Agent |
See the [evaluation script](https://github.com/XLearning-SCU/HERO/blob/main/eval/run_eval_swe_bench.sh) for configuration options.
## License
Apache-2.0. See `LICENSE`. We acknowledge the Qwen team for the base model.
## 📖 Citation
If you find HERO useful, please cite our [paper](https://arxiv.org/abs/2609.38885):
```bibtex
@misc{li2026hero,
title = {Doing More with Less Tokens: Hierarchical Reinforcement Learning for Efficient Coding Agents},
author = {Haobin Li and Liang Jiang and Zhenyu Huang and Mouxing Yang and Xi Peng},
year = {2026},
eprint = {2609.38885},
archivePrefix = {arXiv},
primaryClass = {cs.SE},
url = {https://arxiv.org/abs/2609.38885}
}
```
|