Text Generation
Transformers
Safetensors
English
qwen2
reasoning
chain-of-thought
math
rlvr
conversational
text-generation-inference
Instructions to use PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think") model = AutoModelForCausalLM.from_pretrained("PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think", 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 PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think
- SGLang
How to use PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think 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 "PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think" \ --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": "PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think", "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 "PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think" \ --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": "PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think with Docker Model Runner:
docker model run hf.co/PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think
Argonne-Qwen1.5-0.5B-think: 0.5B CoT reasoner (Argonne recipe); beats 2.88B 3.0-think on self-cons/pass@K/GSM-Plus
Browse files- .gitattributes +1 -0
- README.md +122 -0
- chat_template.jinja +4 -0
- config.json +58 -0
- generation_config.json +11 -0
- model.safetensors +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +20 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen1.5-0.5B
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- reasoning
|
| 10 |
+
- chain-of-thought
|
| 11 |
+
- math
|
| 12 |
+
- qwen2
|
| 13 |
+
- argonne
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Argonne-Qwen1.5-0.5B-think
|
| 17 |
+
|
| 18 |
+
A **0.46B-parameter chain-of-thought reasoner** — the base model **Qwen1.5-0.5B** fine-tuned with the
|
| 19 |
+
**Argonne reasoning recipe** (general SFT → DPO → CoT-SFT). It emits an explicit `<think> … </think>`
|
| 20 |
+
reasoning trace and a final `\boxed{}` answer on math word problems.
|
| 21 |
+
|
| 22 |
+
> **Why this model exists.** It is the controlled test of a single question from the Argonne reasoning
|
| 23 |
+
> project: *is a from-scratch 2.88B model's reasoning wall about size, or about how well the base was
|
| 24 |
+
> pretrained?* Applying the **identical** downstream recipe to a **well-pretrained 0.5B base** (Qwen1.5-0.5B,
|
| 25 |
+
> ~2.4T tokens) yields a reasoner that **matches or beats the 6×-larger from-scratch [Argonne-3.0-think](https://huggingface.co/PursuitOfDataScience/Argonne-3.0-think)** on held-out math. The bottleneck was
|
| 26 |
+
> **pretraining quality (tokens/parameter), not parameter count.** This model is a research demonstrator of
|
| 27 |
+
> that finding, not a production-grade math solver.
|
| 28 |
+
|
| 29 |
+
## Headline result (honest, held-out)
|
| 30 |
+
|
| 31 |
+
Evaluated on **contamination-free** elementary math-word-problem benchmarks — SVAMP, ASDiv, MAWPS (clean) and
|
| 32 |
+
GSM-Plus (semi-clean, adversarial) — that appear in **none** of the training stages. `n=500/set`, with-think.
|
| 33 |
+
Metrics: **greedy / +budget-forcing / self-consistency@32 / pass@32**.
|
| 34 |
+
|
| 35 |
+
| set | Argonne-Qwen1.5-**0.5B**-think | Argonne-3.0-think (**2.88B**, v4) |
|
| 36 |
+
|---|---|---|
|
| 37 |
+
| SVAMP | 20.4 / 26.6 / **43.0** / **82.8** | 21.4 / 21.6 / 36.4 / 77.0 |
|
| 38 |
+
| ASDiv | 29.4 / 34.8 / **57.8** / **80.2** | 32.2 / 36.4 / 49.0 / 79.2 |
|
| 39 |
+
| MAWPS | 23.6 / 29.6 / **42.8** / 76.2 | 22.2 / 22.6 / 38.4 / 77.2 |
|
| 40 |
+
| GSM-Plus | **13.0** / **14.6** / **22.4** / **52.4** | 6.6 / 6.8 / 15.0 / 47.0 |
|
| 41 |
+
| **mean (clean 3)** | 24.5 / **30.3** / **47.9** / **79.7** | **25.3** / 26.9 / 41.3 / 77.8 |
|
| 42 |
+
|
| 43 |
+
Read plainly: **greedy is a tie**, but at **1/6 the parameters** this model is **higher on self-consistency
|
| 44 |
+
(+6.6 mean), pass@32 (+1.9), and on the hardest adversarial set GSM-Plus (+5 to +8 on every metric)**. These
|
| 45 |
+
are absolute-modest numbers for a 0.5B model — it is a small reasoner — but the *relative* result is the point.
|
| 46 |
+
|
| 47 |
+
## How it was trained (the Argonne recipe)
|
| 48 |
+
|
| 49 |
+
Base **Qwen1.5-0.5B** → three stages (base-agnostic harness `reasoning/reason_control/` in the
|
| 50 |
+
[ArgonneAI repo](https://github.com/PursuitOfDataScience/ArgonneAI)):
|
| 51 |
+
|
| 52 |
+
1. **General SFT** on [HuggingFaceH4/ultrachat_200k](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k) (45k examples, LR 2e-5).
|
| 53 |
+
2. **DPO** preference alignment on [argilla/dpo-mix-7k](https://huggingface.co/datasets/argilla/dpo-mix-7k) (LR 5e-6, β 0.1).
|
| 54 |
+
3. **CoT-SFT** on `cot_sft_mix_v3` — a `<think>…</think>` + `\boxed{}` reasoning mix (the same data used for
|
| 55 |
+
Argonne-3.0-think), LR 1e-5, 1 epoch.
|
| 56 |
+
|
| 57 |
+
The **intermix-midtraining** stage (FineWeb+FineMath) used for the from-scratch Argonne bases was **skipped**
|
| 58 |
+
here — it is *base-repair* for weak from-scratch models and mildly *hurts* a well-pretrained base like this one.
|
| 59 |
+
|
| 60 |
+
## Inference
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 64 |
+
import torch
|
| 65 |
+
|
| 66 |
+
mid = "PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think"
|
| 67 |
+
tok = AutoTokenizer.from_pretrained(mid)
|
| 68 |
+
model = AutoModelForCausalLM.from_pretrained(mid, dtype=torch.bfloat16).to("cuda").eval()
|
| 69 |
+
|
| 70 |
+
msgs = [{"role": "user", "content": "Ana has 3 boxes with 12 pencils each. She gives away 8. How many are left?"}]
|
| 71 |
+
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to("cuda")
|
| 72 |
+
out = model.generate(ids, max_new_tokens=512, do_sample=False)
|
| 73 |
+
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
|
| 74 |
+
# -> <think> ... </think>\n\nThe answer is $\boxed{28}$.
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
The model was CoT-trained to open a `<think>` block itself; if it doesn't, prefill `"<think>\n"` after the
|
| 78 |
+
generation prompt to force a reasoning trace.
|
| 79 |
+
|
| 80 |
+
### Getting the most out of it (test-time compute)
|
| 81 |
+
|
| 82 |
+
Single-shot greedy leaves a lot on the table — the model **can** solve far more than it reliably answers in one
|
| 83 |
+
pass (pass@32 ≈ 80% vs greedy ≈ 25%). The dominant single-shot failure is **non-termination** (the `<think>`
|
| 84 |
+
block runs long), so the cheap wins are:
|
| 85 |
+
|
| 86 |
+
- **Self-consistency:** sample `K≈16–32` traces (`temperature 0.8, top_p 0.95`), majority-vote the `\boxed{}`
|
| 87 |
+
answers → ≈ **2× greedy** at zero training cost (the 47.9% column above).
|
| 88 |
+
- **Budget-forcing:** force-close `</think>` past a token budget so it commits to an answer.
|
| 89 |
+
|
| 90 |
+
## Limitations
|
| 91 |
+
|
| 92 |
+
- **0.46B parameters** — a small reasoner. Absolute accuracy on clean grade-school math is ~24% greedy /
|
| 93 |
+
~48% self-consistency; expect errors, especially on multi-step or adversarial problems.
|
| 94 |
+
- **Non-termination:** greedy traces sometimes fail to close `<think>` — budget-forcing / self-consistency
|
| 95 |
+
mitigate this.
|
| 96 |
+
- **Scope:** trained and evaluated on English elementary math word problems + general chat. Not a
|
| 97 |
+
general-purpose or competition-math model.
|
| 98 |
+
- **GSM8K is *not* a valid benchmark here** — the CoT mix overlaps GSM8K; use the clean SVAMP/ASDiv/MAWPS
|
| 99 |
+
numbers above as the honest signal.
|
| 100 |
+
|
| 101 |
+
## Base model & license
|
| 102 |
+
|
| 103 |
+
Derived from [Qwen/Qwen1.5-0.5B](https://huggingface.co/Qwen/Qwen1.5-0.5B) (Apache-2.0). This fine-tune is
|
| 104 |
+
released under Apache-2.0; please also observe the base model's terms.
|
| 105 |
+
|
| 106 |
+
## Provenance
|
| 107 |
+
|
| 108 |
+
Training + evaluation code: [PursuitOfDataScience/ArgonneAI](https://github.com/PursuitOfDataScience/ArgonneAI)
|
| 109 |
+
(`reasoning/reason_control/` recipe; `reasoning/clean_eval.py` honest evaluator). Companion from-scratch model:
|
| 110 |
+
[Argonne-3.0-think](https://huggingface.co/PursuitOfDataScience/Argonne-3.0-think).
|
| 111 |
+
|
| 112 |
+
## Citation
|
| 113 |
+
|
| 114 |
+
```bibtex
|
| 115 |
+
@misc{argonne_qwen05b_think_2026,
|
| 116 |
+
title = {Argonne-Qwen1.5-0.5B-think: a small chain-of-thought reasoner via the Argonne recipe},
|
| 117 |
+
author = {Yu, Youzhi},
|
| 118 |
+
year = {2026},
|
| 119 |
+
note = {Qwen1.5-0.5B fine-tuned (SFT->DPO->CoT); demonstrates pretraining quality > parameter count for small-model reasoning},
|
| 120 |
+
url = {https://huggingface.co/PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think}
|
| 121 |
+
}
|
| 122 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% for m in messages %}{{ '<|im_start|>' + m['role'] + '
|
| 2 |
+
' + (m['content'] | trim) + '<|im_end|>' + '
|
| 3 |
+
' }}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
| 4 |
+
' }}{% endif %}
|
config.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": 151643,
|
| 7 |
+
"dtype": "float32",
|
| 8 |
+
"eos_token_id": 151645,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 1024,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 2816,
|
| 13 |
+
"layer_types": [
|
| 14 |
+
"full_attention",
|
| 15 |
+
"full_attention",
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention"
|
| 38 |
+
],
|
| 39 |
+
"max_position_embeddings": 32768,
|
| 40 |
+
"max_window_layers": 21,
|
| 41 |
+
"model_type": "qwen2",
|
| 42 |
+
"num_attention_heads": 16,
|
| 43 |
+
"num_hidden_layers": 24,
|
| 44 |
+
"num_key_value_heads": 16,
|
| 45 |
+
"pad_token_id": null,
|
| 46 |
+
"rms_norm_eps": 1e-06,
|
| 47 |
+
"rope_parameters": {
|
| 48 |
+
"rope_theta": 1000000.0,
|
| 49 |
+
"rope_type": "default"
|
| 50 |
+
},
|
| 51 |
+
"sliding_window": null,
|
| 52 |
+
"tie_word_embeddings": true,
|
| 53 |
+
"transformers_version": "5.6.2",
|
| 54 |
+
"use_cache": false,
|
| 55 |
+
"use_sliding_window": false,
|
| 56 |
+
"vocab_size": 151936,
|
| 57 |
+
"torch_dtype": "bfloat16"
|
| 58 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 151643,
|
| 3 |
+
"do_sample": false,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
151645,
|
| 6 |
+
151643
|
| 7 |
+
],
|
| 8 |
+
"max_new_tokens": 2048,
|
| 9 |
+
"transformers_version": "5.6.2",
|
| 10 |
+
"pad_token_id": 151643
|
| 11 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6e1e70808f200cce247da57fd575e8024e5287e91d1bdc247e722a814df1500a
|
| 3 |
+
size 928008104
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:48f722bc04c884e2fe1525fdcd85a1293a8499b6e620c1ac7c083c49632305fb
|
| 3 |
+
size 11418262
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|endoftext|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|im_start|>",
|
| 10 |
+
"<|im_end|>"
|
| 11 |
+
],
|
| 12 |
+
"is_local": true,
|
| 13 |
+
"local_files_only": true,
|
| 14 |
+
"model_max_length": 32768,
|
| 15 |
+
"pad_token": "<|endoftext|>",
|
| 16 |
+
"split_special_tokens": false,
|
| 17 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 18 |
+
"unk_token": null,
|
| 19 |
+
"chat_template": "{% for m in messages %}{{ '<|im_start|>' + m['role'] + '\n' + (m['content'] | trim) + '<|im_end|>' + '\n' }}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}"
|
| 20 |
+
}
|