Instructions to use AmareshHebbar/ShortThink_Qwen3_1.7B_TIES with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AmareshHebbar/ShortThink_Qwen3_1.7B_TIES with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AmareshHebbar/ShortThink_Qwen3_1.7B_TIES") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AmareshHebbar/ShortThink_Qwen3_1.7B_TIES") model = AutoModelForCausalLM.from_pretrained("AmareshHebbar/ShortThink_Qwen3_1.7B_TIES", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AmareshHebbar/ShortThink_Qwen3_1.7B_TIES with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AmareshHebbar/ShortThink_Qwen3_1.7B_TIES" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AmareshHebbar/ShortThink_Qwen3_1.7B_TIES", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AmareshHebbar/ShortThink_Qwen3_1.7B_TIES
- SGLang
How to use AmareshHebbar/ShortThink_Qwen3_1.7B_TIES 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 "AmareshHebbar/ShortThink_Qwen3_1.7B_TIES" \ --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": "AmareshHebbar/ShortThink_Qwen3_1.7B_TIES", "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 "AmareshHebbar/ShortThink_Qwen3_1.7B_TIES" \ --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": "AmareshHebbar/ShortThink_Qwen3_1.7B_TIES", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AmareshHebbar/ShortThink_Qwen3_1.7B_TIES with Docker Model Runner:
docker model run hf.co/AmareshHebbar/ShortThink_Qwen3_1.7B_TIES
ShortThink TIES (Qwen3 1.7B)
Reasoning models spend far more tokens than they need on easy problems. ShortThink teaches Qwen/Qwen3-1.7B to keep its accuracy while thinking less, and to compress easy problems more than hard ones. This model is one of six in the ShortThink collection, all trained on the same self generated data with a different algorithm, and all evaluated on the same table.
Method
TIES merge of the two strongest ShortThink models: each task vector is trimmed to its largest entries, a sign is elected per parameter, and only agreeing entries are averaged.
Training data: AmareshHebbar/ShortThink_Traces_Qwen3_1.7B. Weights: merged, no gradient steps.
Why finetune instead of prompting
A prompt can ask for brevity, and the base model can switch thinking off entirely. The table below includes both of those, plus budget forcing (cap the thinking at 1024 tokens and force an answer), so you can see exactly what training buys over prompting.
Results
All rows use the same prompts, sampling settings and math_verify grading. MATH500 and GSM8K use 1 samples per problem, AIME 2024 uses 4. Tokens are generated tokens including the thinking. Tokens per correct is total tokens divided by correct answers, averaged over MATH500 and GSM8K. Latency is measured at batch size 1 with vLLM; cost assumes $1.0/hour GPU at the measured batched throughput.
| Model | MATH500 acc | MATH500 tokens | GSM8K acc | GSM8K tokens | Tokens per correct | Token change vs thinking base | AIME24 acc | MMLU | Latency p50 (s) | Cost per 1k queries (USD) |
|---|---|---|---|---|---|---|---|---|---|---|
| Qwen3 1.7B (thinking) | 70.0 | 3958 | 87.5 | 2205 | 4087 | same | 36.8 | 0.419 | ||
| Qwen3 1.7B (thinking + concise prompt) | 78.6 | 3061 | 88.6 | 1370 | 2721 | 28.1% fewer | 23.4 | 0.277 | ||
| Qwen3 1.7B (no thinking) | 72.8 | 901 | 80.4 | 313 | 813 | 80.3% fewer | 6.3 | 0.056 | ||
| Qwen3 1.7B (budget forcing 1024) | 45.4 | 1473 | 70.0 | 1219 | 2494 | 56.3% fewer | 10.6 | 0.101 | ||
| ShortThink SFT | 73.4 | 3767 | 89.0 | 2041 | 3713 | 5.8% fewer | 44.2 | 0.386 | ||
| ShortThink DPO | 81.8 | 2831 | 88.9 | 1288 | 2455 | 33.2% fewer | 27.9 | 0.236 | ||
| ShortThink GRPO | 83.0 | 2016 | 85.7 | 612 | 1571 | 57.4% fewer | 15.4 | 0.132 | ||
| ShortThink TIES | 83.0 | 2204 | 87.8 | 818 | 1793 | 51.0% fewer | 12.3 | 0.160 |
Compression by difficulty (MATH500)
| MATH level | Base acc | This model acc | Base tokens | This model tokens | Token change |
|---|---|---|---|---|---|
| Level 1 | 95.3 | 97.7 | 2507 | 981 | 60.9% fewer |
| Level 2 | 91.1 | 90.0 | 2935 | 1327 | 54.8% fewer |
| Level 3 | 78.1 | 93.3 | 3687 | 1701 | 53.9% fewer |
| Level 4 | 67.2 | 84.4 | 4176 | 2359 | 43.5% fewer |
| Level 5 | 44.0 | 64.2 | 5114 | 3430 | 32.9% fewer |
Training hyperparameters
| method | ties |
| models | ['grpo', 'dpo'] |
| repos | ['AmareshHebbar/ShortThink_Qwen3_1.7B_GRPO', 'AmareshHebbar/ShortThink_Qwen3_1.7B_DPO'] |
| weights | [0.5, 0.5] |
| density | 0.5 |
| changed_tensors | 196 |
Usage
from vllm import LLM, SamplingParams
llm = LLM("AmareshHebbar/ShortThink_Qwen3_1.7B_TIES")
tok = llm.get_tokenizer()
question = "What is 15% of 80?"
msgs = [{"role": "user", "content": question + "\nPlease reason step by step, and put your final answer within \\boxed{}."}]
prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True, enable_thinking=True)
out = llm.generate([prompt], SamplingParams(temperature=0.6, top_p=0.95, top_k=20, max_tokens=8192))
print(out[0].outputs[0].text)
Use the same prompt format and sampling settings as the base model's thinking mode.
Files
The repository root holds merged bf16 safetensors. adapter/ holds the LoRA adapter where one was trained, training/ holds loss curves and logs, and eval/ holds raw evaluation results and sample generations.
- Downloads last month
- 181

