Instructions to use jonathanhe123/iapo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jonathanhe123/iapo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jonathanhe123/iapo")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("jonathanhe123/iapo", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jonathanhe123/iapo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jonathanhe123/iapo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jonathanhe123/iapo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jonathanhe123/iapo
- SGLang
How to use jonathanhe123/iapo 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 "jonathanhe123/iapo" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jonathanhe123/iapo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "jonathanhe123/iapo" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jonathanhe123/iapo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jonathanhe123/iapo with Docker Model Runner:
docker model run hf.co/jonathanhe123/iapo
Update metadata and improve model card
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,72 +1,64 @@
|
|
| 1 |
---
|
| 2 |
-
license: mit
|
| 3 |
-
datasets:
|
| 4 |
-
- HuggingFaceH4/MATH-500
|
| 5 |
-
- BytedTsinghua-SIA/DAPO-Math-17k
|
| 6 |
-
- openai/gsm8k
|
| 7 |
base_model:
|
| 8 |
- Qwen/Qwen2.5-0.5B-Instruct
|
| 9 |
- Qwen/Qwen2.5-1.5B-Instruct
|
| 10 |
- Qwen/Qwen2.5-7B-Instruct
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
-
# IAPO: Information-Aware Policy Optimization for Token-Efficient Reasoning
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
|
| 18 |
-
(CoT) reasoning. Instead of shaping rewards at the sequence level — as in standard RL methods such as GRPO — IAPO
|
| 19 |
-
assigns **token-wise advantages** based on each token's **conditional mutual information (MI)** with the final
|
| 20 |
-
answer. This yields an explicit, principled mechanism for identifying informative reasoning tokens and suppressing
|
| 21 |
-
low-utility exploration, producing shorter reasoning traces without sacrificing accuracy.
|
| 22 |
|
| 23 |
-
|
| 24 |
-
mathematical reasoning datasets (GSM8K, MATH-500, and DAPO-Math-17k).
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
**Code:** [Official GitHub Repository](https://github.com/YinhanHe123/IAPO)
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
- ⚡ **Efficient Conditional MI Estimation:** Introduces an *early-exit–based* MI estimator combined with *KV-cache
|
| 38 |
-
preloading* and *chunk-wise forwarding*, reducing the naive `O(L³d)` cost of per-token MI estimation to a
|
| 39 |
-
tractable cost suitable for long reasoning.
|
| 40 |
-
- 📉 **Provable Length Reduction:** Theoretical analysis shows that, under mild assumptions, IAPO monotonically
|
| 41 |
-
reduces expected completion length without harming correctness.
|
| 42 |
-
- 🏆 **Strong Empirical Results:** Reduces reasoning length by up to **47%** while improving accuracy across math
|
| 43 |
-
reasoning datasets, outperforming token-efficient RL baselines such as DAPO, GFPO, GTPO, and S-GRPO.
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
| 48 |
-
Each subfolder corresponds to a `{base_model}_{dataset}` combination. For example:
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
|
|
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
|
|
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
```
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
base_model:
|
| 3 |
- Qwen/Qwen2.5-0.5B-Instruct
|
| 4 |
- Qwen/Qwen2.5-1.5B-Instruct
|
| 5 |
- Qwen/Qwen2.5-7B-Instruct
|
| 6 |
+
datasets:
|
| 7 |
+
- HuggingFaceH4/MATH-500
|
| 8 |
+
- BytedTsinghua-SIA/DAPO-Math-17k
|
| 9 |
+
- openai/gsm8k
|
| 10 |
+
license: mit
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
library_name: transformers
|
| 13 |
---
|
|
|
|
| 14 |
|
| 15 |
+
# IAPO: Information-Aware Policy Optimization for Token-Efficient Reasoning
|
| 16 |
|
| 17 |
+
🚀 **Overview**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
IAPO is an information-theoretic post-training framework designed to improve the **token efficiency** of Chain-of-Thought (CoT) reasoning. Instead of shaping rewards at the sequence level—as seen in standard RL methods like GRPO—IAPO assigns **token-wise advantages** based on each token's **conditional mutual information (MI)** with the final answer. This identifies informative reasoning steps and suppresses low-utility exploration, resulting in significantly shorter reasoning traces without sacrificing accuracy.
|
|
|
|
| 20 |
|
| 21 |
+
- **Paper:** [IAPO: Information-Aware Policy Optimization for Token-Efficient Reasoning](https://huggingface.co/papers/2602.19049)
|
| 22 |
+
- **Code:** [Official GitHub Repository](https://github.com/YinhanHe123/IAPO)
|
|
|
|
| 23 |
|
| 24 |
+
🎯 **Key Features**
|
| 25 |
|
| 26 |
+
- 🧠 **Information-Aware Advantage Shaping:** Assigns token-level advantages based on conditional MI, amplifying informative tokens and suppressing redundant ones.
|
| 27 |
+
- 🔍 **Exploration Adjustment:** Rewards confident tokens in correct trajectories and penalizes them in incorrect ones to prevent reasoning collapse.
|
| 28 |
+
- ⚡ **Efficient Estimation:** Introduces an early-exit–based MI estimator with KV-cache preloading to keep computational costs tractable for long-context reasoning.
|
| 29 |
+
- 📉 **Provable Length Reduction:** Demonstrates monotonic reductions in reasoning verbosity while preserving correctness.
|
| 30 |
+
- 🏆 **Performance:** Reduces reasoning length by up to 36-47% while improving accuracy across various mathematical reasoning benchmarks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
🔧 **Loading the Checkpoints**
|
| 33 |
|
| 34 |
+
This repository contains multiple checkpoints fine-tuned from different base models (Qwen2.5-0.5B, 1.5B, 7B). You can load a specific checkpoint using the `subfolder` argument corresponding to the `{base_model}_{dataset}` combination.
|
|
|
|
| 35 |
|
| 36 |
+
```python
|
| 37 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 38 |
+
import torch
|
| 39 |
|
| 40 |
+
model_id = "jonathanhe123/iapo"
|
| 41 |
+
# Example: Load the Qwen2.5-0.5B-Instruct checkpoint fine-tuned on MATH-500
|
| 42 |
+
subfolder = "Qwen2.5-0.5B-Instruct_MATH-500"
|
| 43 |
|
| 44 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, subfolder=subfolder)
|
| 45 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 46 |
+
model_id,
|
| 47 |
+
subfolder=subfolder,
|
| 48 |
+
torch_dtype=torch.bfloat16,
|
| 49 |
+
device_map="auto"
|
| 50 |
+
)
|
| 51 |
+
```
|
| 52 |
|
| 53 |
+
**Citation**
|
| 54 |
|
| 55 |
+
If you find this work useful, please cite the paper:
|
| 56 |
|
| 57 |
+
```bibtex
|
| 58 |
+
@inproceedings{he2026iapo,
|
| 59 |
+
title={IAPO: Information-Aware Policy Optimization for Token-Efficient Reasoning},
|
| 60 |
+
author={He, Yinhan and Zhu, Yaochen and Shi, Mingjia and Zheng, Wendy and Su, Lin and Wang, Xiaoqing and Guo, Qi and Li, Jundong},
|
| 61 |
+
booktitle={International Conference on Machine Learning (ICML 2026)},
|
| 62 |
+
year={2026}
|
| 63 |
+
}
|
| 64 |
+
```
|
|
|