Instructions to use Yulin-Li/ReBalance with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Yulin-Li/ReBalance with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Yulin-Li/ReBalance")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Yulin-Li/ReBalance", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Yulin-Li/ReBalance with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Yulin-Li/ReBalance" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Yulin-Li/ReBalance", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Yulin-Li/ReBalance
- SGLang
How to use Yulin-Li/ReBalance 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 "Yulin-Li/ReBalance" \ --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": "Yulin-Li/ReBalance", "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 "Yulin-Li/ReBalance" \ --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": "Yulin-Li/ReBalance", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Yulin-Li/ReBalance with Docker Model Runner:
docker model run hf.co/Yulin-Li/ReBalance
| language: | |
| - en | |
| license: mit | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| tags: | |
| - rebalance | |
| - steering-vector | |
| - reasoning | |
| - llm | |
| - iclr-2026 | |
| <h1 align="center">ReBalance Steering Vectors</h1> | |
| <p align="center"> | |
| Steering vectors for <strong>Efficient Reasoning with Balanced Thinking</strong> (ICLR 2026) | |
| </p> | |
| <p align="center"> | |
| <a href="https://huggingface.co/papers/2603.12372"><img src="https://img.shields.io/badge/Paper-Hugging_Face-b31b1b.svg" alt="Paper (Hugging Face)"></a> | |
| <a href="https://openreview.net/forum?id=cJseWJJ5IM"><img src="https://img.shields.io/badge/Paper-Open_Review-8D1B12.svg" alt="Paper (Open Review)"></a> | |
| <a href="https://github.com/yu-lin-li/ReBalance"><img src="https://img.shields.io/badge/Code-GitHub-black.svg" alt="Code (GitHub)"></a> | |
| <a href="https://rebalance-ai.github.io"><img src="https://img.shields.io/badge/Project-Page-2EA44F.svg" alt="Project Page"></a> | |
| <a href="https://github.com/yu-lin-li/ReBalance/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a> | |
| </p> | |
| ## Description | |
| This repository contains the steering vectors presented in the paper **"Efficient Reasoning with Balanced Thinking"** (ICLR 2026). | |
| **Authors**: Yulin Li, Tengyao Tu, Li Ding, Junjie Wang, Huiling Zhen, Yixin Chen, Yong Li, Zhuotao Tian. | |
| ReBalance is a training-free framework that achieves efficient reasoning by identifying and mitigating "overthinking" (redundant computational steps) and "underthinking" (insufficient exploration) in Large Reasoning Models (LRMs). It leverages confidence as a dynamic indicator to modulate reasoning trajectories using the steering vectors provided here. | |
| ## Overview | |
| This repository provides **steering vectors only** for ReBalance. | |
| It does **not** include: | |
| - base model weights, | |
| - inference/training code, | |
| - datasets. | |
| Use this repository together with the official codebase: | |
| - Code: https://github.com/yu-lin-li/ReBalance | |
| - Inference script: `transformer_inference_steer_dp.py` | |
| ## Available Steering Vectors | |
| | Base model | Vector path | Recommended `--steer_layer` | | |
| |---|---|---| | |
| | DeepSeek-R1-Distill-Qwen-1.5B | `vectors/DeepSeek-R1-Distill-Qwen-1.5B/steer_vector_layer19_conf_mixed.pt` | `19` | | |
| | DeepSeek-R1-Distill-Qwen-7B | `vectors/DeepSeek-R1-Distill-Qwen-7B/steer_vector_layer22_conf_mixed.pt` | `22` | | |
| | QwQ-32B | `vectors/QwQ-32B/steer_vector_layer58_conf_mixed.pt` | `58` | | |
| ## Local Directory Layout (after download) | |
| ```text | |
| ReBalance/ | |
| βββ transformer_inference_steer_dp.py | |
| βββ vectors/ | |
| βββ DeepSeek-R1-Distill-Qwen-1.5B/ | |
| β βββ steer_vector_layer19_conf_mixed.pt | |
| βββ DeepSeek-R1-Distill-Qwen-7B/ | |
| β βββ steer_vector_layer22_conf_mixed.pt | |
| βββ QwQ-32B/ | |
| βββ steer_vector_layer58_conf_mixed.pt | |
| ``` | |
| ## Download | |
| ### Option 1: Clone the full model repository | |
| ```bash | |
| git lfs install | |
| git clone https://huggingface.co/Yulin-Li/ReBalance | |
| ``` | |
| Then copy the `vectors/` folder into your local `ReBalance/` root directory. | |
| ### Option 2: Download only the vectors with `huggingface_hub` | |
| ```python | |
| from huggingface_hub import snapshot_download | |
| snapshot_download( | |
| repo_id="Yulin-Li/ReBalance", | |
| repo_type="model", | |
| allow_patterns="vectors/*", | |
| local_dir="." | |
| ) | |
| ``` | |
| ## Quick Usage with ReBalance | |
| ```bash | |
| python transformer_inference_steer_dp.py \ | |
| --model_name_or_path 'DeepSeek-R1-Distill-Qwen-1.5B' \ | |
| --dataset_dir "./Data/" \ | |
| --output_path "./outputs" \ | |
| --dataset "Math_AIME2024" \ | |
| --max_generated_tokens 16000 \ | |
| --num_gpus 8 \ | |
| --steer_vector_path ./vectors/DeepSeek-R1-Distill-Qwen-1.5B/steer_vector_layer19_conf_mixed.pt \ | |
| --steer_layer 19 \ | |
| --steer_coef -1 | |
| ``` | |
| ## Paper, Code, and Project Links | |
| - Paper (Hugging Face): https://huggingface.co/papers/2603.12372 | |
| - Paper (Open Review): https://openreview.net/forum?id=cJseWJJ5IM | |
| - Code: https://github.com/yu-lin-li/ReBalance | |
| - Project page: https://rebalance-ai.github.io | |
| ## Intended Use | |
| - Research and reproducibility for ReBalance. | |
| - Experiments on reasoning efficiency and accuracy trade-offs. | |
| - Comparative studies on overthinking mitigation. | |
| ## Citation | |
| If you find ReBalance useful in your research, please cite our paper: | |
| ```bibtex | |
| @article{li2026efficient, | |
| title={Efficient Reasoning with Balanced Thinking}, | |
| author={Li, Yulin and Tu, Tengyao and Ding, Li and Wang, Junjie and Zhen, Huiling and Chen, Yixin and Li, Yong and Tian, Zhuotao}, | |
| booktitle={Proceedings of the 14th International Conference on Learning Representations}, | |
| year={2026} | |
| } | |
| ``` |