Qwen2.5-3B-Instruct, compressed for edge devices
Built with Qwen.
Two structurally pruned and distilled versions of Qwen2.5-3B-Instruct, made to run fast on a CPU and, in the smaller case, to fit the 300 to 700 MB range of a phone model. The code, the evaluation set, every result and the technical report are on GitHub: https://github.com/Arsh1978/llm_distill.
| Model | What it is | Parameters | Q4_K_M file |
|---|---|---|---|
| ours44-kd | Qwen2.5-3B-Instruct with every MLP cut from 11,008 to 4,864 neurons (44% of all parameters removed), recovered with LoRA and logit distillation from the original 3B on 187M tokens | 1.73B | 1.11 GB |
| ours15-kd (edge model) | Qwen2.5-1.5B-Instruct with every MLP cut from 8,960 to 3,840 neurons (43% removed), distilled from the 3B on 115M tokens | 0.88B | 0.59 GB |
Both keep the standard Qwen2 architecture (only intermediate_size changes), so they load in transformers, vLLM and llama.cpp with no custom code.
Results
700 fixed questions (IFEval instruction following, GSM8K math, BIG-Bench Hard logic and multistep), scored by code against known answers. Speed: laptop CPU (AMD Ryzen 5 5600U, 6 threads), llama.cpp b12808, 256 generated tokens per request, medians.
| Model | Accuracy, full precision | Accuracy, Q4_K_M | CPU speed, Q4_K_M | Time to first token, short prompt | Peak RAM, Q4_K_M |
|---|---|---|---|---|---|
| Original Qwen2.5-3B-Instruct | 71.4% | 70.3% | 12.4 tokens/s | 1.33 s | 4.20 GB |
| ours44-kd | 59.9% | 61.1% | 18.0 tokens/s | 0.66 s | 2.60 GB |
| Official Qwen2.5-1.5B-Instruct | 55.0% | 53.4% | 22.3 tokens/s | 0.73 s | 2.37 GB |
| ours15-kd | 51.3% | 48.6% | 32.1 tokens/s | 0.30 s | 1.62 GB |
| Official Qwen2.5-0.5B-Instruct | 36.1% | 33.7% | 50.6 tokens/s | 0.35 s | 0.77 GB |
ours44-kd beats the official 1.5B by 7.7 points at Q4_K_M (McNemar p = 0.0006). ours15-kd is the best model we measured inside 300 to 700 MB, 14.9 points above the official 0.5B (p < 0.0001).
Files
| Path | What it is |
|---|---|
gguf/ours44-kd-Q4_K_M.gguf, gguf/ours44-kd-Q8_0.gguf | ours44-kd for llama.cpp |
gguf/ours15-kd-Q4_K_M.gguf, gguf/ours15-kd-Q8_0.gguf | ours15-kd for llama.cpp |
kdbig_w4864/ | ours44-kd in bf16 safetensors, for transformers and vLLM |
kd15_w3840/ | ours15-kd in bf16 safetensors, for transformers and vLLM |
gguf/qwen3b-Q4_K_M.gguf, gguf/qwen1.5b-Q4_K_M.gguf, gguf/qwen0.5b-Q4_K_M.gguf | The unmodified official models at Q4_K_M, converted with the same llama.cpp version, for side by side comparison in the demo |
SHA256SUMS.txt | sha256 of every file above |
The GGUF files were made with llama.cpp's converter at commit 8e23278 and quantized with release b12808. f16 GGUF files are not uploaded; they can be rebuilt from the safetensors folders byte for byte (see the GitHub README).
Usage
Download everything into the models/ folder of the GitHub repository and check it:
git clone https://github.com/Arsh1978/llm_distill.git
cd llm_distill
pip install -r requirements.txt
python scripts/download_our_models.py
llama.cpp:
llama-server -m models/gguf/ours15-kd-Q4_K_M.gguf -t 6 -c 4096 --port 8090
transformers:
from transformers import AutoModelForCausalLM, AutoTokenizer
from huggingface_hub import snapshot_download
path = snapshot_download("Arsh1978/qwen2.5-3b-compressed-kd", allow_patterns="kd15_w3840/*")
tok = AutoTokenizer.from_pretrained(f"{path}/kd15_w3840")
model = AutoModelForCausalLM.from_pretrained(f"{path}/kd15_w3840", torch_dtype="auto")
msgs = [{"role": "user", "content": "What is 17 * 23? End with 'Final answer: <number>'."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")
print(tok.decode(model.generate(ids, max_new_tokens=200, do_sample=False)[0][ids.shape[1]:]))
Recommended decoding (used in every benchmark): Qwen chat template, greedy, repetition penalty 1.05.
Limitations
The models are research artifacts. They lose accuracy against the original 3B (ours44-kd keeps 87% of its Q4 accuracy) and are more likely to run on without a final answer on hard questions. They were evaluated in English only.
License
Qwen2.5-3B-Instruct is released under the Qwen Research License (non-commercial). ours44-kd is derived from it and ours15-kd was distilled from its outputs, so both are distributed under the same research-only terms; see LICENSE and NOTICE. The official 1.5B and 0.5B reference files are Apache 2.0.