ApX logoApX logo

Qwen2.5-7B

Parameters

7B

Context Length

131K

Modality

Text

Architecture

Dense

License

Apache 2.0

Release Date

19 Sept 2024

Knowledge Cutoff

-

System Requirements

VRAM requirements for different quantization methods and context sizes

1,024 tokens

16.34 GB VRAM

Consumer

1x RTX 4090

24GB VRAM

Datacenter

1x NVIDIA A100

80GB VRAM

Apple Silicon

1x Apple M3 Max

128GB VRAM

131,072 tokens

34.24 GB VRAM

Consumer

2x RTX 4090

24GB VRAM

Datacenter

1x NVIDIA A100

80GB VRAM

Apple Silicon

1x Apple M3 Max

128GB VRAM

Architecture Diagram

Input TokensToken EmbeddingPosition: RoPEHidden: 4.1k · Context: 131K · Vocab: 152.1kx 32 layersRMSNormPre-AttentionGrouped-Query Attention64Q / 8KV headsHead dim: 64+RMSNormPre-FFNFeed-Forward NetworkSwiGLUIntermediate: 18.9k+Final RMSNormOutput Logits

Evaluation Benchmarks

No evaluation benchmarks for Qwen2.5-7B available.

Rankings

Overall Rank

-

Coding Rank

-

About Qwen2.5-7B

Qwen2.5-7B is a foundational large language model developed by Alibaba Cloud, forming a part of the Qwen2.5 series. This model is a causal language model engineered for general-purpose applications, serving as a robust base for subsequent fine-tuning and specialized tasks. It is designed to extend the linguistic capabilities of its predecessors by incorporating an expanded knowledge base and enhancing performance in core language understanding and generation tasks. The model provides multilingual support, enabling processing across more than 29 languages. This versatility positions Qwen2.5-7B as a foundational component for diverse natural language processing systems.

Architecturally, Qwen2.5-7B employs a transformer-based encoder-decoder framework. Key architectural components include the integration of Rotary Position Embeddings (RoPE) for effective handling of sequence length and position, SwiGLU as its activation function for non-linearity, and RMSNorm for stable normalization across layers. The attention mechanism features Grouped Query Attention (GQA), optimizing computational efficiency by sharing key and value projections across multiple query heads. Specifically, the 7B variant utilizes 28 attention heads for queries and 4 for key/value pairs, distributed across 28 layers. This configuration facilitates efficient processing of long sequences.

The Qwen2.5-7B model is suitable for pretraining, providing a base for developers to build upon through further training stages such as Supervised Fine-Tuning (SFT) or Reinforcement Learning from Human Feedback (RLHF). While it is a base model, the Qwen2.5 family exhibits enhanced capabilities in areas such as coding and mathematics, benefiting from specialized expert models. It also demonstrates improved proficiency in instruction following, processing structured data, and generating extended text outputs, including formatted data like JSON. The model's capacity to handle context lengths up to 131,072 tokens supports the processing of substantially long inputs.

Technical Specifications

Attention

Attention Structure

Grouped-Query Attention

Attention Heads

64

Key-Value Heads

8

Attention Head Dimension

-

Position Embedding

ROPE

RoPE Theta

1,000,000

Sliding Window Attention

No

Sliding Window Size

-

Sliding Window Ratio

-

Linear Attention

-

Linear Attention Ratio

-

Normalization

RMS Normalization

Activation Function

SwigLU

Dimensions

Hidden Dimension Size

4,096

Number of Layers

32

FFN Intermediate Size (Dense)

18,944

Multi-Token Prediction Heads

-

Tokenizer

Vocabulary Size

152,064

About Qwen2.5

Qwen2.5 by Alibaba is a family of dense, decoder-only language models available in various sizes, with some variants utilizing Mixture-of-Experts. These models are pretrained on large-scale datasets, supporting extended context lengths and multilingual communication. The family includes specialized models for coding, mathematics, and multimodal tasks, such as vision and audio processing.


Other Qwen2.5 Models