ApX logoApX logo

Qwen2-7B

Parameters

7B

Context Length

131K

Modality

Text

Architecture

Dense

KV Cache Rate

56 KB/tok

License

Apache 2.0

Release Date

7 Jun 2024

Knowledge Cutoff

Dec 2023

API Pricing (per 1M)

Self-hosted only

Hardware Sizing

Precision

Context

Workload Memory: 6.20 GB

INT4 · 8K context

Base Weights: 3.26 GB

KV Cache: 0.44 GB

Runtime & Graphs: 2.50 GB

Minimum Required Hardware

1x NVIDIA L4 24GB

6.2 / 21.6 GB usable

1x RTX 3060 12GB

6.2 / 10.8 GB usable

Apple M4 24GB

6.2 / 18.0 GB usable

Determine requirements for your specific workload:

Open in VRAM Calculator

Architecture Diagram

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

Evaluation Benchmarks

Rank

#234

BenchmarkScoreRank

Professional Knowledge

MMLU Pro

0.441

59

Graduate-Level QA

GPQA

0.253

122

General Knowledge

Reference
MMLU

0.705

26

Rankings

Overall Rank

#234

Coding Rank

-

About Qwen2-7B

Qwen2-7B is a foundational open-weights dense model from Alibaba Cloud engineered for general language understanding, coding, and mathematical reasoning. It supports multilingual inputs across 29 languages and context extrapolation up to 131K tokens.

Technical Specifications

Attention

Attention Structure

Grouped-Query Attention

Attention Heads

64

Key-Value Heads

8

Position Embedding

ROPE

RoPE Theta

1,000,000

Sliding Window Attention

No

Sliding Window Size

131,072

Normalization

RMS Normalization

Activation Function

SwigLU

Dimensions

Hidden Dimension Size

3,584

Number of Layers

32

FFN Intermediate Size (Dense)

18,944

Tokenizer

Vocabulary Size

152,064

About Qwen2

The Alibaba Qwen2 model family comprises large language models built upon the Transformer architecture. It includes both dense and Mixture-of-Experts (MoE) variants, designed for diverse language tasks. Technical features include Grouped Query Attention and support for extended context lengths up to 131,072 tokens, optimizing memory footprint for inference.


Other Qwen2 Models