Skip to main content
Back

Alibaba's Qwen2.5-1.5B Fits a Capable Open-Source Model Under 1GB

Alibaba's compact 1.5B parameter base model brings coding, math, and 128K context to edge deployments under an Apache 2.0 license.

Pro

  • Qwen2.5-1.5B is a 1.54B parameter Apache 2.0 base model from Alibaba, part of the Qwen2.5 family
  • Architecture uses RoPE, SwiGLU, RMSNorm, grouped-query attention with 12 Q heads and 2 KV heads, 28 layers
  • Ships with 32K context length; larger Qwen2.5 siblings extend to 128K tokens and 29+ languages
  • Improved coding, math, JSON output, and instruction following versus Qwen2 predecessors
  • Nearly 1M downloads, 424 fine-tunes, and 79 quantizations on Hugging Face
  • Base checkpoint aimed at fine-tuning; use Qwen2.5-1.5B-Instruct for direct chat

Alibaba's Qwen team quietly dropped one of the more interesting small language models in the open-source lineup: Qwen2.5-1.5B, a 1.54 billion parameter base model that has already racked up close to a million downloads on Hugging Face. It sits at the smaller end of the Qwen2.5 family, which spans seven sizes from 0.5B up to 72B parameters. The pitch is straightforward: give edge deployments and fine-tuning shops a compact base checkpoint that punches above its weight on coding, math, and structured outputs, without the licensing headaches that plague some competitors.

Inside the 1.5B

Architecturally, this is a standard decoder-only transformer with a few now-conventional refinements: RoPE positional embeddings, SwiGLU activations, RMSNorm, QKV attention bias, and tied word embeddings. The checkpoint has 1.54B total parameters (1.31B non-embedding), 28 layers, and uses grouped-query attention with 12 query heads mapped to just 2 key/value heads, which meaningfully shrinks the KV cache during inference. Context length is 32,768 tokens.

The broader Qwen2.5 series brings concrete upgrades over Qwen2. There is significantly more knowledge and improved capabilities in coding and mathematics thanks to specialized expert models in those domains, along with better instruction following, long text generation past 8K tokens, understanding of structured data like tables, generating structured outputs like JSON, and more resilience to varied system prompts. The bigger family members support up to 128K token context windows and can generate up to 8K tokens, with multilingual coverage across more than 29 languages including Chinese, English, French, Spanish, Japanese, Korean, and Arabic.

The base model catch

One important detail worth flagging up front: this is the pretraining checkpoint, not an instruct model. The model card is blunt that base language models are not recommended for direct chat use, and suggests running SFT, RLHF, or continued pretraining on top of it. If you want to just prompt something and get useful answers, grab Qwen2.5-1.5B-Instruct instead. This repo is aimed at teams building their own fine-tunes.

How it holds up on benchmarks

At this parameter scale, expectations should be calibrated. On the MMLU-Pro leaderboard tracked by Hugging Face, Qwen2.5-1.5B scores 32.1. The Qwen team's own framing is that for edge-side models, Qwen2.5-0.5B, 1.5B, and 3B continue to maintain strong performance across nearly all benchmarks.

The 1.5B tier also shows up as a strong backbone for domain specialization. The code-focused variant demonstrates the ceiling here: Qwen2.5-Coder surpasses alternative models at similar sizes, with Qwen2.5-Coder-1.5B posting an average performance improvement of 3.7% on infilling benchmarks. On the math side, Qwen2.5-Math-1.5B, 7B, and 72B all improved significantly over Qwen2-Math across benchmarks, with the 1.5B version gaining 5.4 points on MATH.

Getting it running

The model ships under Apache 2.0 and integrates with the usual serving stacks. You will need transformers>=4.37.0 or you'll hit a KeyError: 'qwen2'. A minimal load looks like this:

from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B")
model = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen2.5-1.5B", device_map="auto"
)
out = model.generate(**tok("def fib(n):", return_tensors="pt").to(model.device), max_new_tokens=64)
print(tok.decode(out[0]))

For production, vLLM and SGLang both serve it out of the box with an OpenAI-compatible API. The community has also produced 79 quantized variants for llama.cpp, Ollama, and LM Studio, along with 424 fine-tunes and 447 adapters built on top of it.

Why teams keep picking this size

A 1.5B base model in BF16 fits in roughly 3GB of VRAM, and quantized down to 4-bit it drops under 1GB. That opens up a few concrete workflows:

  • On-device inference for laptops, mobile, and Raspberry Pi class hardware
  • Draft models for speculative decoding paired with a larger Qwen2.5-72B target
  • Cheap-to-train specialization: domain SFT or continued pretraining on modest GPU budgets
  • Structured extraction pipelines where JSON reliability matters more than raw reasoning
  • Distillation targets when compressing behavior from larger teacher models

Where it fits in the small-model race

The sub-3B open-weight tier has become genuinely competitive, with Meta's Llama 3.2, Microsoft's Phi-3.5-mini, Google's Gemma 2, and Alibaba's Qwen2.5 all trading blows. What Qwen2.5-1.5B specifically brings is the combination of Apache 2.0 licensing, the multilingual footprint of the larger Qwen family, and a well-documented training recipe outlined in the Qwen2 technical report. For anyone building a small model into a shipping product, that combination of permissive license and active ecosystem often matters more than a two-point delta on MMLU.