Skip to main content

Chat-Aligned Models

Qwen-Chat models are fine-tuned versions of the base Qwen models, aligned with human preferences for conversational interactions. These models are optimized for chatbot applications, content generation, and interactive AI assistants.

Overview

Chat models are built on top of base models through supervised fine-tuning (SFT) using the ChatML format:
  • Qwen-1.8B-Chat, Qwen-7B-Chat, Qwen-14B-Chat, Qwen-72B-Chat
  • Aligned with human intent through curated instruction data
  • Enhanced safety and service-oriented capabilities
  • Support for tool usage, code interpretation, and agent behavior

Fine-tuning Process

Training Data

The alignment dataset includes three major categories:
Covers broad capabilities for practical applications:
  • Writing: Content creation, story generation, copywriting
  • Question Answering: Factual queries, explanations, knowledge retrieval
  • Brainstorming & Planning: Idea generation, task planning
  • Content Understanding: Summarization, analysis, interpretation
  • Natural Language Processing: Text manipulation, extraction, transformation
  • Coding: Code generation, debugging, explanation
Prevents harmful and inappropriate content generation:
  • Refusal of harmful requests
  • Bias mitigation
  • Safety-aligned responses
  • Content filtering
Enables specific conversation patterns for external system integration:
  • Tool invocation protocols
  • API calling patterns
  • Search integration
  • Multi-step reasoning (ReAct)

ChatML Format

Conversations are formatted using ChatML, a meta language for structured dialogue:
Roles:
  • system: Sets behavior and context
  • user: Human input
  • assistant: Model responses

Training Configuration

  • Objective: Causal language modeling (user content tokens excluded from loss)
  • Optimizer: AdamW (β₁=0.9, β₂=0.95, ε=10⁻⁶)
  • Sequence Length: 2048 tokens
  • Batch Size: 128
  • Training Steps: 4000
  • Learning Rate: Peak 1×10⁻⁵ with 1430-step warm-up
  • Regularization: Weight decay 0.1, dropout 0.1, gradient clipping 1.0

Benchmark Performance

Chinese Language Understanding

C-Eval (Zero-shot, generative) - Validation set: C-Eval Test Set (Zero-shot):

English Language Understanding

MMLU (Zero-shot):

Coding

HumanEval (Zero-shot Pass@1):

Mathematical Reasoning

GSM8K (Math word problems):

Tool Usage

Qwen-Chat excels at tool invocation through ReAct prompting: Custom Tool Usage Benchmark:
Evaluation plugins do not appear in Qwen’s training data, demonstrating genuine generalization.
HuggingFace Agent Benchmark:

Core Capabilities

Conversational AI

Qwen-Chat models excel at multi-turn conversations with context awareness:

Tool Integration

Qwen-Chat supports tool usage through ReAct prompting:
The model can reason about which tools to use and generate appropriate calls:

Code Interpretation

Chat models can generate, explain, and debug code:

System Prompt Enhancement

Qwen-1.8B-Chat and Qwen-72B-Chat have strengthened system prompt capabilities:

Quantized Variants

Chat models are available in quantized formats for efficient deployment:

Performance Comparison

Qwen-7B-Chat: Qwen-14B-Chat: Qwen-72B-Chat:
Quantization causes minimal performance degradation while significantly reducing memory requirements.

Batch Inference

Chat models support batch inference for improved throughput:
With Flash Attention enabled, batch inference provides ~40% speedup over sequential processing.

Streaming Responses

Chat models support streaming for real-time response generation:

Hardware Requirements

Inference Memory (Generating 2048 tokens)

Fine-tuning Memory (Q-LoRA, batch_size=1, gradient_accumulation=8)

Model Downloads

Qwen-1.8B-Chat

🤗 HF | 🤖 MS | Int4 | Int8

Qwen-7B-Chat

🤗 HF | 🤖 MS | Int4 | Int8

Qwen-14B-Chat

🤗 HF | 🤖 MS | Int4 | Int8

Qwen-72B-Chat

🤗 HF | 🤖 MS | Int4 | Int8

Safety Considerations

While Qwen-Chat models include safety alignment, they may still generate inappropriate content in some cases. Developers should:
  • Perform red teaming before deployment
  • Implement content filtering for production use
  • Monitor outputs for harmful content
  • Comply with local regulations and policies

Next Steps

Model Selection

Choose the right chat model for your needs

Tool Usage

Learn to integrate external tools

Fine-tuning Chat

Customize chat models for your domain

Deployment

Deploy chat models to production