ApX logoApX logo

ERNIE-4.5-21B-A3B

Active Parameters

21B

Context Length

131K

Modality

Text

Architecture

Mixture of Experts (MoE)

License

Apache 2.0

Release Date

30 Jun 2025

Knowledge Cutoff

Dec 2024

System Requirements

VRAM requirements for different quantization methods and context sizes

1,024 tokens

45.66 GB VRAM

Consumer

2x RTX 4090

24GB VRAM

Datacenter

1x NVIDIA A100

80GB VRAM

Apple Silicon

1x Apple M3 Max

128GB VRAM

131,072 tokens

53.49 GB VRAM

Consumer

3x RTX 4090

24GB VRAM

Datacenter

1x NVIDIA A100

80GB VRAM

Apple Silicon

1x Apple M3 Max

128GB VRAM

Architecture Diagram

Input TokensToken EmbeddingPosition: AbsoluteHidden: 2.6k · Context: 131K · Vocab: 103.4kx 28 layersRMSNormPre-AttentionGrouped-Query Attention20Q / 4KV headsHead dim: 128+RMSNormPre-FFNSparse MoE FFN (6/64 experts)SwishIntermediate: 1.5k+Final RMSNormOutput Logits

Evaluation Benchmarks

Rank

#158

BenchmarkScoreRank

General Knowledge

MMLU

0.419

36

Rankings

Overall Rank

#158

Coding Rank

-

About ERNIE-4.5-21B-A3B

ERNIE-4.5-21B-A3B is a high-efficiency large language model belonging to Baidu's ERNIE 4.5 family, specifically engineered for advanced text understanding and complex reasoning tasks. As a Mixture-of-Experts (MoE) model, it maintains a massive 21 billion total parameter count while activating only 3 billion parameters per token. This architectural strategy allows the model to achieve performance levels typical of larger systems while maintaining a computational footprint suitable for agile deployment. The model is part of a broader multimodal lineage but this specific variant is post-trained to excel in natural language processing, logical deduction, and structured tool usage.

The technical backbone of ERNIE-4.5-21B-A3B utilizes a fine-grained heterogeneous MoE structure designed to mitigate cross-modal interference during initial pre-training. It employs 64 experts per layer, with a routing mechanism that selects 6 active experts per token alongside 2 shared experts that facilitate global knowledge integration. The architecture incorporates Grouped-Query Attention (GQA) for optimized memory throughput and employs Rotary Position Embeddings (RoPE) with a progressive frequency scaling method. This scaling allows the model to natively support a 131,072-token context window, making it effective for processing long-form documentation and multi-step reasoning chains without the degradation often seen in context-extended models.

Optimized for production-grade environments, the model supports advanced quantization techniques including 4-bit and 2-bit convolutional code quantization, which minimizes memory requirements for inference. The training infrastructure leverages FP8 mixed-precision and hierarchical load balancing to ensure expert stability and high throughput. Designed to be interoperable across deep learning ecosystems, ERNIE-4.5-21B-A3B is compatible with the PaddlePaddle framework and provides PyTorch-formatted weights for integration into standard Transformers-based pipelines. Its capabilities are further extended by its native support for function calling and structured data interaction, making it a viable foundation for agentic workflows and automated technical tasks.

Technical Specifications

Attention

Attention Structure

Grouped-Query Attention

Attention Heads

20

Key-Value Heads

4

Attention Head Dimension

-

Position Embedding

Absolute Position Embedding

RoPE Theta

500,000

Sliding Window Attention

No

Sliding Window Size

-

Sliding Window Ratio

-

Linear Attention

-

Linear Attention Ratio

-

Normalization

RMS Normalization

Activation Function

Swish

Dimensions

Hidden Dimension Size

2,560

Number of Layers

28

FFN Intermediate Size (Dense)

1,536

Multi-Token Prediction Heads

1

Tokenizer

Vocabulary Size

103,424

Mixture of Experts

Total Expert Parameters

3.0B

Number of Experts

64

Active Experts

6

Shared Experts

2

FFN Intermediate Size (per Expert)

1,536

Dense Layers Before MoE

1

Model Integrity

Total Score

B+

73 / 100

ERNIE-4.5-21B-A3B Model Integrity Report

Total Score

73

/ 100

B+

Audit Note

ERNIE-4.5-21B-A3B demonstrates strong transparency in its architectural design and licensing, providing precise details on its Mixture-of-Experts structure and a permissive Apache 2.0 license. While the model's technical specifications and hardware requirements are well-documented, it falls short in disclosing granular dataset composition and total training compute resources. Overall, it provides a robust foundation for transparency in the open-weight ecosystem, though more detailed data provenance and environmental impact reporting would be required for an exemplary rating.

Upstream

21.0 / 30

Architectural Provenance

8.5 / 10

The model's architecture is extensively documented in the ERNIE 4.5 Technical Report. It is a Mixture-of-Experts (MoE) system with 21B total parameters and 3B active parameters. The report details a 'multimodal heterogeneous MoE' structure with 64 experts per layer, 6 active experts per token, and 2 shared experts. It specifies the use of Grouped-Query Attention (GQA), Rotary Position Embeddings (RoPE) with progressive frequency scaling, and a 28-layer depth. The training methodology, including the transition from multimodal pre-training to modality-specific post-training (SFT, DPO, and UPO), is clearly described.

Dataset Composition

3.5 / 10

While the technical report mentions a multi-stage training process involving 'trillions of tokens' and general categories like text and visual data, it lacks a specific quantitative breakdown of the dataset composition (e.g., percentages of web, code, or academic data). The documentation describes high-level cleaning and filtering strategies but does not disclose specific data sources or provide a detailed methodology for data collection, citing a 'human-model-in-the-loop' refinement cycle without granular transparency.

Tokenizer Integrity

9.0 / 10

The tokenizer is publicly available via the 'tokenization_ernie4_5.py' file on Hugging Face and is based on SentencePiece. The vocabulary size and special tokens (e.g., <mask:1>, <s>, </s>) are explicitly defined in the code. It supports a 128K context window, and the implementation details for tokenization, including the use of alpha parameters for sampling and the handling of special tokens, are fully transparent and verifiable through the provided source code.

Model

28.5 / 40

Parameter Density

9.5 / 10

Baidu provides exemplary transparency regarding parameter density. The model is explicitly marketed as 21B total / 3B active, and the technical report further breaks this down into 64 total experts per layer with 6 activated, plus 2 shared experts. The architectural configuration (28 layers, 20 query heads, 4 KV heads) is precisely stated, leaving no ambiguity about the sparse vs. dense nature of the model.

Training Compute

4.0 / 10

The technical report mentions the use of NVIDIA H800 GPUs and the PaddlePaddle framework, achieving 47% Model FLOPs Utilization (MFU). However, it does not disclose the total GPU hours, the specific duration of the training run for the 21B variant, or the estimated carbon footprint. While it mentions the infrastructure's efficiency, the lack of concrete resource consumption metrics prevents a higher score.

Benchmark Reproducibility

6.0 / 10

The model provides results on standard benchmarks like BBH, CMATH, IFEval, and SimpleQA. While the technical report names these benchmarks and compares them against competitors like Qwen3, it does not provide the exact evaluation code or the specific prompts/few-shot examples used for all tests. Third-party testing is available on platforms like Hugging Face and YouTube, but official reproduction instructions are limited to general API usage snippets.

Identity Consistency

9.0 / 10

The model consistently identifies as part of the ERNIE 4.5 family across documentation, Hugging Face cards, and GitHub. It distinguishes clearly between its 'Base', 'PT' (Post-trained), and 'Thinking' variants. There is no evidence of identity confusion or claims of being a competitor's model in its official documentation or technical report.

Downstream

23.0 / 30

License Clarity

10.0 / 10

The model is released under the Apache License 2.0, which is a standard, highly permissive open-source license. This is explicitly stated on the official Hugging Face repository, the GitHub repository, and the technical report. The license terms allow for commercial use and derivative works without conflicting proprietary restrictions.

Hardware Footprint

8.0 / 10

Hardware requirements are well-documented. Official sources and third-party guides specify that approximately 48GB of VRAM is required for FP16 inference, recommending 2x RTX 4090 or 1x A6000. The documentation also highlights support for 4-bit and 2-bit 'convolutional code quantization' to reduce memory footprint, providing a clear path for deployment on various hardware tiers.

Versioning Drift

5.0 / 10

The model uses a naming convention that indicates its family and variant (e.g., ERNIE-4.5-21B-A3B-PT), but there is no evidence of a formal semantic versioning system or a detailed public changelog for weight updates. While new variants like the 'Thinking' model are announced via blogs, tracking minor updates or behavioral drift over time remains difficult for external users.

About ERNIE 4.5

The Baidu ERNIE 4.5 family consists of ten large-scale multimodal models. They utilize a heterogeneous Mixture-of-Experts (MoE) architecture, which enables parameter sharing across modalities while also employing dedicated parameters for specific modalities, supporting efficient language and multimodal processing.


Other ERNIE 4.5 Models
ERNIE-4.5-21B-A3B: Specifications and GPU VRAM Requirements