ApX logoApX logo
CalculatorCoursesPricing

Gemma 1 2B

Closed Source
Open Weights

Parameters

2B

Context Length

8K

Modality

Text

Architecture

Dense

KV Cache Rate

9 KB/tok

License

Gemma Terms of Use

Release Date

21 Feb 2024

Knowledge Cutoff

-

API Pricing (per 1M)

Input: $0.10 · Output: $0.10

Hardware & System Requirements

Precision

Context

Workload Memory: 3.50 GB

vLLM

INT4 · 8K context · 1 user

Base Weights: 0.93 GB

KV Cache: 0.07 GB

Runtime & Graphs: 2.50 GB

Minimum Required Hardware

1x NVIDIA L4 24GB

vLLM

3.5 / 21.6 GB

1x RTX 3060 12GB

llama.cpp

3.5 / 11.2 GB

Apple M4 24GB

llama.cpp

3.5 / 18.0 GB

Determine requirements for concurrent users or multi-node clusters:

Runtime compatibility

Verified on hardware and checkpoint files.

Checkpoint format

BF16

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 18 layersRMSNormPre-AttentionMulti-Query Attention16Q / 1KV headsHead dim: 128+RMSNormPre-FFNFeed-Forward NetworkActivation+Final RMSNormOutput Logits

Evaluation Benchmarks

Rank

#256

BenchmarkScoreRank

General Text

Text Arena

1093.73

#199

Rankings

Overall Rank

#256

Coding Rank

-

About Gemma 1 2B

Gemma 1 2B is a lightweight open language model by Google designed for on-device conversational tasks, summarization, and local NLP prototyping. It features Multi-Query Attention for low-latency inference on consumer-grade hardware.

Specifications

Attention

Attention Structure

Multi-Query Attention

Attention Heads

16

Key-Value Heads

1

Position Embedding

ROPE

Normalization

RMS Normalization

Dimensions

Base Precision

FP16

Hidden Dimension Size

2,048

Number of Layers

18

About Gemma 1

Gemma 1 is a family of lightweight, decoder-only transformer models from Google, available in 2B and 7B parameter sizes. Designed for various text generation tasks, they incorporate rotary positional embeddings, shared input/output embeddings, GEGLU activation, and RMSNorm. The 2B model uses multi-query attention, while 7B uses multi-head attention.


Other Gemma 1 Models