ApX logoApX logo
CalculatorCoursesPricing

Gemma 2 2B

Closed Source
Open Weights

Parameters

2B

Context Length

8K

Modality

Text

Architecture

Dense

KV Cache Rate

52 KB/tok

License

Gemma License

Release Date

27 Jun 2024

Knowledge Cutoff

Jun 2024

API Pricing (per 1M)

Self-hosted only

Hardware & System Requirements

Precision

Context

Workload Memory: 3.84 GB

vLLM

INT4 · 8K context · 1 user

Base Weights: 0.93 GB

KV Cache: 0.41 GB

Runtime & Graphs: 2.50 GB

Minimum Required Hardware

1x NVIDIA L4 24GB

vLLM

3.8 / 21.6 GB

1x RTX 3060 12GB

llama.cpp

3.8 / 11.2 GB

Apple M4 24GB

llama.cpp

3.8 / 18.0 GB

Determine requirements for concurrent users or multi-node clusters:

Runtime compatibility

Verified on hardware and checkpoint files.

Checkpoint format

FP32

CUDA

13.0

PyTorch

2.14.0

Transformers

≥ 4.40.1

ArchitecturePrecisionKernel

Hopper

Native BF16

FlashAttention-3

Architecture Diagram

Input TokensToken EmbeddingPosition: RoPEHidden: 2k · Context: 8Kx 26 layersRMSNormPre-AttentionGrouped-Query Attention16Q / 4KV headsHead dim: 128+RMSNormPre-FFNFeed-Forward NetworkGELU+Final RMSNormOutput Logits

Evaluation Benchmarks

Rank

#248

BenchmarkScoreRank

General Text

Text Arena

1200.13

#187

Rankings

Overall Rank

#248

Coding Rank

-

About Gemma 2 2B

Gemma 2 2B is a compact, open-weights language model developed by Google for resource-constrained edge and mobile deployments. Distilled from larger Gemini architectures, it provides efficient reasoning and text generation with low memory overhead.

Specifications

Attention

Attention Structure

Grouped-Query Attention

Attention Heads

16

Key-Value Heads

4

Position Embedding

ROPE

Normalization

RMS Normalization

Activation Function

GELU

Dimensions

Base Precision

FP16

Hidden Dimension Size

2,048

Number of Layers

26

About Gemma 2

Gemma 2 is Google's family of open large language models, offering 2B, 9B, and 27B parameter sizes. Built upon the Gemma architecture, it incorporates innovations such as interleaved local and global attention, logit soft-capping for training stability, and Grouped Query Attention for inference efficiency. The smaller models leverage knowledge distillation.


Other Gemma 2 Models