Skip to main content
Browse Models

Alibaba Cloud

Qwen 2.5 Coder 7B

Released

2024-09-19

Family

Qwen 2

Type

Foundation Model

Downloads

External Download

You are about to open a link to an external source. Verify the URL before continuing.

Download

Instruct model, 4-bit GGUF (Q4_K_M)

GGUF · Qwen2.5-Coder-7B-Instruct-Q4_K_M.gguf

Instruct model, 5-bit GGUF (Q5_K_M)

GGUF · Qwen2.5-Coder-7B-Instruct-Q5_K_M.gguf

Instruct model, 6-bit GGUF (Q6_K)

GGUF · Qwen2.5-Coder-7B-Instruct-Q6_K.gguf

Instruct model, 8-bit GGUF (Q8_0)

GGUF · Qwen2.5-Coder-7B-Instruct-Q8_0.gguf

Instruct model, 16-bit GGUF (F16)

GGUF · Qwen2.5-Coder-7B-Instruct-f16.gguf

Ollama Model (q4_K_M)

Ollama

Model Report

Overview

Qwen2.5-Coder-7B is a large language model (LLM) developed by the Qwen Team at Alibaba Group, designed to address complex code generation, reasoning, and repair across a wide spectrum of programming languages. It is a member of the Qwen2.5-Coder model family, which serves as a successor to the CodeQwen1.5 series, and specifically targets high-performance coding tasks, while also retaining advanced mathematical and general reasoning abilities. As an open-source model, Qwen2.5-Coder-7B incorporates architectural innovations and demonstrates notable performance in coding benchmarks, providing a foundation for automated code understanding and generation.

Qwen3 Logo

Figure 1. Official logo representing the Qwen3 and Qwen2.5-Coder model family from Alibaba.

Architecture and Technical Features

Qwen2.5-Coder-7B employs a transformer-based architecture enhanced with several advanced features, including Rotary Position Embeddings (RoPE), SwiGLU activation, and Root Mean Square Normalization (RMSNorm). This model uses 28 transformer layers and contains approximately 7.61 billion parameters, with 6.53 billion attributed to non-embedding layers. It utilizes separate attention heads for query and key-value processing, allocating 28 heads for queries and 4 for key-value pairs, a configuration described in the Qwen2.5-Coder Technical Report.

A significant aspect of Qwen2.5-Coder-7B is its extensive context window, supporting up to 128,000 tokens per prompt, made possible by the YaRN position encoding extension. This allows for handling of large documents, repository-wide code completion, and long-range code understanding. The model is trained to interpret and process code in 92 programming languages and includes specialized support for code completion methodologies such as fill-in-the-middle (FIM), using unique prompt tokens to designate task structure.

Training Data and Optimization

Qwen2.5-Coder-7B has been trained on a vast corpus comprising 5.5 trillion tokens, consisting of source code, synthetic data, and grounded text-code datasets. The scale and diversity of the training material are detailed in the Qwen2.5-Coder Technical Report, which emphasizes the inclusion of multi-programming language data and comprehensive mathematical benchmarks. The training regime incorporates post-training strategies such as supervised fine-tuning (SFT) and reinforcement learning from human feedback (RLHF), contributing to instruction-following and generalization.

Instruction-tuned variants, denoted as "Qwen2.5-Coder-Instruct", are further optimized with high-quality instruction data, enhancing capabilities in following detailed prompts and achieving user-aligned responses. This fine-tuning approach aligns with modern practices for instruction adaptation in language models aimed at interactive and assistant-like use cases.

Benchmark Performance

Qwen2.5-Coder-7B demonstrates competitive results on a broad array of code-centric and general reasoning benchmarks. In studies, it achieves high scores in code generation and completion tasks on industry-standard datasets such as HumanEval, EvalPlus, MultiPL-E, and BigCodeBench. The model's instruction-tuned variant exhibits multilingual proficiency in practical coding scenarios, as evaluated by McEval.

Qwen2.5-Coder benchmark radial bar chart

Figure 2. Radial bar chart comparing Qwen2.5-Coder’s performance to other models across multiple coding benchmarks such as HumanEval, EvalPlus, and MultiPL-E.

Quantitative comparisons indicate Qwen2.5-Coder-7B-Base performs strongly in a variety of tasks, including those where it achieves scores comparable to or exceeding some larger open-source models in areas such as code completion, fill-in-the-middle generation, and mathematical problem solving.

Benchmark comparison data table

Figure 3. Tabular comparison showing Qwen2.5-Coder 7B-Base’s scores across numerous code evaluation tasks relative to peer models.

Notably, the instruction-tuned version achieves high marks on code reasoning datasets, such as CRUXEval, and performs well in mathematical benchmarks like MATH and AMC23. Its multilingual capabilities extend to more than 40 languages, with sustained strong performance across both common and less frequently encountered programming environments.

In performance scaling, Qwen2.5-Coder models demonstrate a favorable performance-to-size ratio, performing effectively in code reasoning and instruction-following at smaller parameter scales.

Scatter plot of performance versus parameter size

Figure 4. Scatter plot illustrating Qwen2.5-Coder-Instruct’s performance in code reasoning benchmarks in relation to model size.

Applications and Use Cases

The versatility of Qwen2.5-Coder-7B enables its deployment for a wide range of software engineering applications. Its core use cases include automated code completion—at both file and repository granularity—with dedicated support for fill-in-the-middle code generation utilizing specialized FIM tokens. This feature is grounded in the efficient fill-in-the-middle methodology, allowing the insertion of code segments within complex codebases.

Furthermore, the model’s understanding of repository context, assisted by prompt tokens designating repository and file separators, makes it suitable for agent-based code suggestion tools and automated refactoring systems. While the base model is primarily aimed at non-conversational code tasks, the instruction-tuned versions are adapted for chat-based interfaces, enabling use as an interactive code assistant or integrated development environment assistant.

Model Family and Release

Qwen2.5-Coder-7B is part of the broader Qwen2.5-Coder series, which includes models ranging from 0.5 billion to 32 billion parameters. The series succeeded the CodeQwen1.5 line and is positioned within the larger Qwen family of language and multimodal models from Alibaba, which span natural language generation, vision, audio, and agent functionalities. The 7B model was officially released on September 19, 2024, with larger variants, including the 32B parameter class, designed to provide similar capabilities to some proprietary LLMs.

Limitations and License

While Qwen2.5-Coder-7B is effective in code and reasoning tasks, the base model is not recommended for conversational or general dialogue use, except in its instruction-tuned variants. Handling of long-context prompts relies on YaRN-based positional scaling; some interfaces (such as vLLM) currently implement only static scaling, which may affect performance on short inputs if global scaling is enabled.

Qwen2.5-Coder-7B is made available under the open Apache 2.0 license, supporting transparent research, development, and commercial deployment.

Helpful Links

About Qwen 2: Qwen 2 (and 2.5) is a family of advanced AI models developed by Alibaba, designed to excel in various tasks including general language understanding, coding, and mathematics.

More in the Qwen 2 Family

Alibaba Cloud /

Qwen2.5 VL 3B

A 3B-parameter multimodal language model that processes images, videos, and text with capabilities for visual reasoning, document analysis, and computer interface interaction.
Alibaba Cloud /

Qwen2.5 VL 7B

A 7-billion parameter multimodal model capable of processing images, documents, and videos with native dynamic resolution support and structured output capabilities.
Alibaba Cloud /

Qwen2.5 VL 72B

A 72-billion parameter multimodal model that processes images, videos, and text for document analysis, object detection, and visual agent tasks.
Alibaba Cloud /

QwQ 32B Preview

Experimental research model focused on advancing AI reasoning capabilities by thinking through problems step by step, continuously questioning assumptions, and exploring different paths of thought. Impressive benchmark scores in math and coding tasks.
Alibaba Cloud /

QwQ 32B

A 32.5-billion parameter transformer model optimized for mathematical reasoning, coding, and complex problem-solving through reinforcement learning training.
Alibaba Cloud /

Qwen 2.5 Math 1.5B

A 1.5 billion parameter specialized model focused on mathematical reasoning and problem-solving capabilities in English and Chinese.
Deepseek AI /

DeepSeek R1 Distill Qwen 1.5B

A 1.5 billion parameter language model created through distillation techniques, focusing on mathematical reasoning and chain-of-thought problem-solving capabilities.
Agentica /

DeepCoder 1.5B Preview

A 1.5B parameter code generation model fine-tuned with reinforcement learning and iterative context lengthening for long-context reasoning tasks.
Alibaba Cloud /

Qwen 2.5 Math 7B

A 7.62-billion parameter mathematical reasoning model supporting English and Chinese with chain-of-thought and tool-integrated reasoning capabilities.
Alibaba Cloud /

Qwen 2.5 Math PRM 7B

A 7B parameter process reward model that evaluates mathematical reasoning steps individually rather than just final answers, achieving 67.6% accuracy on mathematical benchmarks.
Deepseek AI /

DeepSeek R1 Distill Qwen 7B

A 7.62B parameter distilled language model based on Qwen2.5-Math-7B, trained via knowledge distillation for mathematical and logical reasoning tasks.
Alibaba Cloud /

Qwen 2.5 Math 72B

A 72.7 billion parameter language model specialized for solving mathematical problems in English and Chinese using chain-of-thought and tool-integrated reasoning.
Alibaba Cloud /

Qwen 2.5 Math PRM 72B

A 72.8 billion parameter process reward model that evaluates intermediate mathematical reasoning steps using consensus filtering and achieves 78.3% F1 on ProcessBench.
Alibaba Cloud /

Qwen 2.5 Coder 32B

Qwen2.5-Coder builds on Qwen2.5 by training on 5.5 trillion additional tokens of code data including source code, text-code grounding data, and synthetic data. This leads to significant improvements in code-related tasks.
Alibaba Cloud /

Qwen 2.5 7B

A 7.61-billion parameter transformer-based language model with 128K token context length, trained on 18 trillion tokens supporting 29+ languages.
Alibaba Cloud /

Qwen2.5 7B 1M

A 7-billion parameter transformer model with 1-million token context capacity utilizing Dual Chunk Attention for long-range text processing.
Alibaba Cloud /

Qwen 2.5 14B

A 14.7 billion parameter transformer model supporting 29 languages with 128K context window, designed as foundation for fine-tuning applications.
Alibaba Cloud /

Qwen2.5 14B 1M

A 14.7B parameter transformer model with 1-million token context capacity, utilizing dual chunk attention and progressive training for extended sequence processing.
Deepseek AI /

DeepSeek R1 Distill Qwen 14B

A 14B dense language model distilled from a mixture-of-experts architecture, optimized for mathematical reasoning and code generation tasks.
Agentica /

DeepCoder 14B Preview

A 14-billion parameter code reasoning model fine-tuned using distributed reinforcement learning with long-context capabilities up to 64,000 tokens.
Deep Cogito /

Cogito V1 Preview 14B

A 14.8 billion parameter instruction-tuned language model trained using Iterated Distillation and Amplification with hybrid reasoning capabilities across 30+ languages.
Alibaba Cloud /

Qwen 2.5 32B

A 32.5 billion parameter multilingual transformer model trained on 18 trillion tokens with 128K context length supporting text generation, coding, and mathematical reasoning.
Deepseek AI /

DeepSeek R1 Distill Qwen 32B

A 32B parameter language model created through knowledge distillation, optimized for mathematical reasoning, code generation, and complex problem-solving tasks.
Deep Cogito /

Cogito V1 Preview 32B

A 32-billion parameter instruction-tuned model based on Qwen2.5 architecture featuring dual operational modes and iterated distillation alignment methodology.
Alibaba Cloud /

Qwen 2.5 72B

This update to Qwen 2, pretrained on 18 trillion tokens, shows impressive performance in benchmarks (MMLU 85+, HumanEval 85+, MATH 80+), outperforming models of similar size. Qwen 2.5 has multilingual support for over 29 languages and can understand and generate structured data.
Alibaba Cloud /

Qwen 2 7B

A 7.6 billion parameter multilingual decoder-only Transformer model designed for further post-training with 32,000-token context and strong coding capabilities.
Alibaba Cloud /

Qwen 2 72B

A 72-billion parameter transformer model supporting extended context lengths up to 128K tokens and demonstrating strong multilingual capabilities across diverse benchmarks.

More from Alibaba Cloud

Alibaba Cloud /

Qwen3 0.6B

A 0.6B parameter language model featuring dual thinking modes, multilingual capabilities, and 32K context length through strong-to-weak distillation training.
Alibaba Cloud /

Qwen3 1.7B

A 1.7 billion parameter multilingual transformer supporting dual-mode reasoning with step-by-step "thinking" and rapid "non-thinking" response capabilities.
Alibaba Cloud /

Qwen3 4B

A 4-billion parameter transformer model featuring dual reasoning modes, extensive multilingual training, and competitive performance across mathematical, coding, and logical reasoning benchmarks.
Alibaba Cloud /

Qwen3 8B

Dense 8.2 billion parameter transformer model featuring hybrid thinking capabilities with 32K token context and multilingual support across 119 languages.
Alibaba Cloud /

Qwen3 14B

A 14.8 billion parameter transformer model featuring hybrid thinking/non-thinking reasoning modes, 32K context length, and multilingual capabilities across 119 languages.
Alibaba Cloud /

Qwen3 32B

A 32.8 billion parameter language model featuring hybrid thinking modes for both rapid responses and step-by-step reasoning across multilingual tasks.
Alibaba Cloud /

Qwen3 30B A3B

Mixture-of-experts model with 30.5B total parameters, 3.3B activated per token, featuring hybrid reasoning modes and multilingual support across 119 languages.
Alibaba Cloud /

Qwen3 235B A22B

Large language model with Mixture-of-Experts architecture featuring dual operational modes for both rapid inference and complex reasoning tasks.
Alibaba Cloud /

Qwen 1.5 32B

Foundation 32B Qwen 1.5 model from Alibaba Cloud.
Alibaba Cloud /

Qwen 1.5 72B

Foundation 72B Qwen 1.5 model from Alibaba Cloud.