COLORS.chat network
colorschat.com · YouTube colors.chat · Order now terminal.glass · Deploy
💨 HuggingFace · October 2023

Zephyr: What dDPO teaches us
about alignment without labellers

Getting a language model to follow instructions helpfully requires alignment — teaching it human preferences. The conventional method (RLHF) needs expensive human labellers. Zephyr 7B β showed that synthetic AI feedback, combined with Direct Preference Optimisation, could match or beat RLHF models at the same scale — at a fraction of the cost. The result is a clean, well-understood 7B model that runs locally, has an Apache 2.0 licence, and remains a useful teaching reference for how modern alignment works.

🏢 Creator: HuggingFace
📅 Released: October 2023 (β) · February 2024 (Gemma)
⚖️ Licence: MIT (7B β) · Apache 2.0 (141B)
🧠 Base: Mistral 7B (β) · Mixtral 8x7B (141B) · Gemma (2B/7B)
📏 Context: 8K (7B) · 32K (141B)
💾 Min RAM: 5 GB (7B INT4)
7.34
MT-Bench (7B β)
90.6%
AlpacaEval win rate (7B β)
200K
UltraFeedback training pairs
0
Human labellers required
MIT
Licence (7B β)
8K
Context window (7B)

The Alignment Problem Zephyr Solves

Training a language model on next-token prediction gives you a model that can generate text — but not necessarily text that is helpful, honest, or appropriately cautious. Alignment is the process of nudging the model's behaviour toward human preferences. The standard approach, Reinforcement Learning from Human Feedback (RLHF), requires three expensive steps: collect human preference labels, train a reward model on those labels, then use RL to fine-tune the language model against the reward model. This is what InstructGPT (the basis of ChatGPT) uses, and it costs significant money and time.

Zephyr introduces two changes that make alignment cheaper and more reproducible:

The dDPO Training Pipeline

1
SFT on UltraChat
Supervised fine-tuning on UltraChat 200K — high-quality multi-turn conversations generated by GPT-3.5. Establishes the instruction-following scaffold before preference learning begins.
→
2
UltraFeedback scoring
GPT-4 scores four completions per prompt from different models across four dimensions. Best and worst completions are paired into 200K (chosen, rejected) preference pairs. No human in the loop.
→
3
dDPO fine-tuning
Direct Preference Optimisation trains the model to increase the likelihood of chosen responses relative to rejected ones — using a simple cross-entropy objective, no reward model required.

RLHF vs dDPO: Why It Matters for Local AI

⚙ Traditional RLHF

  • Requires paid human annotators for preference labels
  • Train a separate reward model on those labels
  • RL fine-tuning loop — computationally expensive and unstable
  • Difficult to reproduce without significant infrastructure
  • Proprietary data pipelines at companies like OpenAI
  • Not reproducible by the research community

💨 dDPO (Zephyr approach)

  • AI-generated preference labels via GPT-4 scoring
  • No separate reward model needed
  • Simple classification loss — stable and fast to train
  • Fully reproducible: datasets and training code are public
  • UltraFeedback dataset released openly on HuggingFace
  • Enables community research into alignment techniques
💨
Why Zephyr matters beyond its benchmark scores

Zephyr 7B β was not the highest-scoring 7B model when it released, and it is not in 2025. Its significance is methodological: it demonstrated that fully synthetic preference data plus DPO could produce competitive alignment results. This opened the door to a wave of open-source alignment research that did not depend on proprietary human annotation pipelines. Many of the models in this guide — including Starling 7B (which uses RLAIF, a related approach) — build on the foundations Zephyr established.

Zephyr Versions

α · Earlier

Zephyr 7B α

First Zephyr release. Used only SFT without DPO — released as a baseline to measure the DPO contribution. Not recommended for use; reference only.

MT-Bench6.88
Context8K
PurposeAblation baseline
LicenceMIT
141B · Large

Zephyr 141B (Mixtral)

Mixtral 8x7B base with dDPO alignment. Strong across reasoning and knowledge tasks. Requires substantial hardware — ~50GB RAM for quantised inference.

MT-Bench~8.6
Context32K
RAM (INT4)~50 GB
LicenceApache 2.0
Gemma · 2024

Zephyr Gemma 7B

Google's Gemma 7B base with dDPO. Released February 2024. Gemma licence (permissive for research/commercial, some restrictions). Good instruction following, lower benchmark scores than β.

Context8K
RAM (INT4)5–6 GB
LicenceGemma ToS
StatusExperimental
⚠️
Zephyr 7B α vs β: always use β

The α release used supervised fine-tuning only, without the dDPO step. It scores 6.88 on MT-Bench versus 7.34 for β — a meaningful gap. The α exists in the literature as an ablation baseline to prove that dDPO adds value. If you see "Zephyr" without a version suffix in an older tutorial or repository, verify which version is referenced before using it.

Benchmark Comparison

Model Size MT-Bench AlpacaEval Context Licence
Zephyr 7B β ★ 7B 7.34 90.6% 8K MIT
Zephyr 7B α 7B 6.88 ~75% 8K MIT
OpenChat 3.5 7B 7.81 ~88% 8K Apache 2.0
Starling 7B 7B 8.09 ~91% 8K Apache 2.0
WizardLM-2 7B 7B 8.01 N/A 32K Apache 2.0
Vicuna 1.5 7B 7B 7.92 N/A 4K Non-commercial
Mistral 7B Instruct v0.2 7B 7.60 N/A 32K Apache 2.0
Llama 3.1 8B Instruct 8B 8.22 N/A 128K Llama 3.1

MT-Bench scores from LMSYS Chatbot Arena leaderboard. AlpacaEval win rate vs text-davinci-003. Zephyr 7B β was competitive at release (Oct 2023); Llama 3.1 and later models now lead at similar sizes.

Running Zephyr Locally

Via Ollama (recommended)

bash — Ollama
# Install Ollama first: https://ollama.com

# Zephyr 7B β — the reference version
ollama pull zephyr

# Start interactive chat
ollama run zephyr

# One-shot query
ollama run zephyr "Explain the difference between precision and recall in three sentences."

Python via Ollama client

python — Zephyr chat
import ollama

response = ollama.chat(
    model='zephyr',
    messages=[
        {
            'role': 'system',
            'content': 'You are a concise technical assistant. Provide accurate, well-structured answers.'
        },
        {
            'role': 'user',
            'content': 'What is Direct Preference Optimisation and how does it differ from RLHF?'
        }
    ]
)

print(response['message']['content'])

Chat template: Zephyr uses a specific format

text — Zephyr chat template (important for raw inference)
# Zephyr uses the ChatML-adjacent format with special tokens.
# Ollama handles this automatically. If calling the model directly
# (e.g., via llama.cpp or Transformers), use this structure:

<|system|>
You are a helpful assistant.</s>
<|user|>
Your question here.</s>
<|assistant|>

# Note the </s> end-of-sequence tokens after each turn.
# Omitting these causes degraded output quality.
ℹ️
Chat template matters for raw inference

If you are calling Zephyr directly through llama.cpp or the Transformers library rather than through Ollama, the chat template is critical. Ollama applies it automatically. The HuggingFace tokenizer.apply_chat_template() method also handles it correctly when using the HuggingFaceH4/zephyr-7b-beta checkpoint. Using the wrong template produces garbled or unhelpful output.

HuggingFace Transformers (direct)

python — HuggingFace Transformers pipeline
from transformers import pipeline
import torch

# Requires ~14GB VRAM for BF16, ~5GB for 4-bit quantisation
pipe = pipeline(
    "text-generation",
    model="HuggingFaceH4/zephyr-7b-beta",
    torch_dtype=torch.bfloat16,
    device_map="auto"
)

messages = [
    {"role": "system",  "content": "You are a helpful assistant."},
    {"role": "user",    "content": "Summarise the key advantages of DPO over RLHF."}
]

# apply_chat_template handles the special tokens automatically
prompt = pipe.tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)

outputs = pipe(
    prompt,
    max_new_tokens=512,
    do_sample=True,
    temperature=0.7,
    top_k=50,
    top_p=0.95
)

print(outputs[0]["generated_text"])

Hardware Requirements

Variant Quantisation RAM / VRAM Speed (CPU) Speed (GPU)
Zephyr 7B β Q4_K_M (INT4) 5–6 GB 8–15 tok/s 40–80 tok/s
Zephyr 7B β Q8_0 (INT8) 8–9 GB 5–10 tok/s 30–60 tok/s
Zephyr 7B β BF16 (full) 14–16 GB 2–4 tok/s 50–90 tok/s
Zephyr 141B (Mixtral) Q4_K_M ~50 GB 1–3 tok/s 10–25 tok/s

CPU speeds on modern 8-core systems with fast RAM. GPU speeds on RTX 4090 (24GB). Q4_K_M recommended for most local deployments — minimal quality loss at half the memory footprint of BF16.

✓
Runs on modest hardware

Zephyr 7B β quantised to INT4 fits in 5–6GB of RAM — meaning it runs on virtually any modern laptop built after 2020 that has 8GB of system memory. On Apple Silicon (M1/M2/M3 with unified memory), it uses the Neural Engine and achieves GPU-class speeds without a discrete GPU. See the quickstart guide for platform-specific setup.

Honest Assessment

✓ Genuine Strengths

  • MIT licence — cleanest, most permissive option in this guide
  • Well-documented training pipeline; reproducible by researchers
  • Excellent AlpacaEval score (90.6%) for a 7B model at release
  • dDPO training makes it a useful reference for alignment study
  • Runs on 5–6GB RAM — accessible hardware requirement
  • 8K context window (double Llama 2-era models)
  • Strong HuggingFace ecosystem support; first-class Transformers integration
  • The α vs β comparison makes the DPO contribution quantifiable

✗ Real Limitations

  • MT-Bench 7.34 is below OpenChat (7.81), Starling (8.09), and WizardLM-2 (8.01)
  • Llama 3.1 8B (8.22 MT-Bench, 128K context) is now the stronger general choice
  • Preference data generated by GPT-4 — inherits GPT-4's biases and blindspots
  • 4K effective context in some configurations (depends on quantisation method)
  • Development focus has shifted to newer HuggingFace alignment work (Zephyr Gemma, etc.)
  • Can be over-cautious on edge-case instructions — a known dDPO alignment artefact
  • Multilingual performance is limited; primarily English

💨 When to choose Zephyr vs alternatives

You need the most permissive possible licence at 7B
→ Zephyr 7B β (MIT) is the cleanest option; no attribution requirements beyond the licence text
You are studying alignment techniques
→ Zephyr's published training pipeline and the α/β ablation make it the best teaching reference in this guide
Best benchmark scores at 7B for production use
→ Starling 7B (8.09) or OpenChat 3.5 (7.81), both Apache 2.0
Long-context tasks (>8K tokens)
→ Llama 3.1 8B Instruct (128K) or WizardLM-2 7B (32K)
Running Mixtral-scale locally (large server)
→ Zephyr 141B (Apache 2.0) is a strong aligned option; compare to Mixtral 8x7B Instruct
First local model, just getting started
→ ollama run zephyr is one of the simplest entry points with good out-of-box quality

You've reached the end of the model guide

You've now read through every model in the ChatGPT Alternatives series — from Alpaca to Zephyr. Head back to the index for a side-by-side comparison table, or explore the deployment and privacy guides to put these models to work.