Instructions to use amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B") model = AutoModelForCausalLM.from_pretrained("amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B
- SGLang
How to use amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B 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 "amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B" \ --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": "amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B", "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 "amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B" \ --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": "amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B with Docker Model Runner:
docker model run hf.co/amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B
InfoDensity-DeepSeek-R1-Distill-Qwen-7B
deepseek-ai/DeepSeek-R1-Distill-Qwen-7B trained with InfoDensity, a reinforcement-learning reward that favours
information-dense reasoning traces. The reward combines an entropy-trajectory quality term with a
group-relative length scaling term, and is applied only to traces that reach a correct answer, so the
model learns to reach the right answer with markedly less deliberation. Method details are in the paper.
- 📄 Paper: InfoDensity: Rewarding Information-Dense Traces for Efficient Reasoning (EMNLP 2026 Main)
- 💻 Code: https://github.com/amao0o0/InfoDensity
- 🧩 Base model:
deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
Results
Accuracy (pass@1) and mean generated length averaged over AMC23, AIME24, MATH500 and GPQA-Diamond, as reported in the paper. AES is the Accuracy–Efficiency Score (α=1, β=3, γ=5).
| Model | Accuracy | Length | AES |
|---|---|---|---|
| DeepSeek-R1-Distill-Qwen-7B | 58.1 | 8.5k | — |
| InfoDensity-DeepSeek-R1-Distill-Qwen-7B | 72.2 | 4.5k | +1.20 |
Evaluation protocol
Greedy decoding, pass@1, generation capped at 16384 tokens, with the prompt
<question>
Please reason step by step, and put your final answer within \boxed{}
The evaluation scripts that produce these numbers are in the GitHub repository.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto")
question = "What is the smallest positive integer n such that n^2 + n + 41 is not prime?"
messages = [{"role": "user",
"content": f"{question}\n\nPlease reason step by step, and put your final answer within \\boxed{{}}"}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
out = model.generate(**tokenizer(prompt, return_tensors="pt").to(model.device), max_new_tokens=16384)
print(tokenizer.decode(out[0], skip_special_tokens=True))
With vLLM:
from vllm import LLM, SamplingParams
llm = LLM(model="amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B")
print(llm.generate([prompt], SamplingParams(temperature=0, max_tokens=16384))[0].outputs[0].text)
License
Released under mit, inherited from the base model deepseek-ai/DeepSeek-R1-Distill-Qwen-7B.
Citation
@inproceedings{wei2026infodensity,
title = {InfoDensity: Rewarding Information-Dense Traces for Efficient Reasoning},
author = {Wei, Chengwei and Kim, Jung-jae and Zhang, Longyin and Chen, Shengkai and Chen, Nancy F.},
booktitle = {Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing},
year = {2026}
}
- Downloads last month
- -
Model tree for amao0o0/InfoDensity-DeepSeek-R1-Distill-Qwen-7B
Base model
deepseek-ai/DeepSeek-R1-Distill-Qwen-7B