All models

ERNIE 3.0

Knowledge-enhanced Chinese pre-training framework; captured here as the small ernie-3.0-mini-zh encoder.

Language · 162 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (17 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
26.9M
Operations
162
Framework
PyTorch
Recurrent
No
Published
2021
Cited by
839 (as of 24 November 2026)
Authors
Yu Sun, Shuohuan Wang, Shikun Feng and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m14376
Graph hash
43d564c876e60ae38dc61e16d60c38ea57fe928e9e79dad1a521e753bd675b0d
Skeleton hash
a4cc25c252ef35f7b6e742f7f71219ffa484f2e96f085aadd8f0ee07d0d8bf14
Architecture hash
3583213f2d08028fbef6be50bfa3f257d4e19858c7011bc47471d36f46fbad70
Diagram SHA-256
7087f5fbe953c56c4923f89f8efb0efcf2c39c14652c7a9d297031598a75ac4c
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

transformers.ErnieModel()

What it is

ERNIE 3.0 is a pre-training framework for large Chinese language models that are fed a knowledge graph as well as plain text, so the model learns facts and not only word statistics. Its complaint about GPT-3-style models is that they are trained on plain text with no linguistic or world knowledge, and auto-regressively, which leaves them comparatively weak once fine-tuned for understanding tasks. The fix is to fuse an auto-regressive network with an auto-encoding one, so the same pre-trained model can be tailored to understanding or generation by zero-shot, few-shot or fine-tuning.

Architecturally, a large shared Universal Representation Module sits under two smaller Task-specific Representation Modules, one bi-directional for understanding and one uni-directional for generation. All of them are Transformer-XL stacks: the full model's shared module has 48 layers, 4096 hidden units and 64 heads, and each task module 12 layers, 768 hidden units and 12 heads. Only a task module needs updating at fine-tuning time, which is the paper's answer to the cost of adapting a 10-billion-parameter model. The knowledge comes in through a universal knowledge-text prediction task: given a knowledge-graph triple and the encyclopedia sentence it came from, the model must recover a masked relation or masked words. The training corpus is 4TB of Chinese text in 11 categories, which the authors describe as the largest Chinese pre-training corpus they knew of. The paper reports state-of-the-art results on 54 Chinese NLP tasks and an English version that took first place on SuperGLUE on July 3, 2021, scoring 90.6 against a human baseline of 89.8.

The captured member is a much smaller relative: ernie-3.0-mini-zh, a 6-layer encoder with hidden size 384 and a 40,000-token Chinese vocabulary, loaded through the transformers ErnieModel class. Its PyTorch weights were converted from the officially released PaddlePaddle ERNIE model, with experiments run to check the conversion's accuracy. The paper's full model was trained for 375 billion tokens on 384 V100 GPU cards in the PaddlePaddle framework.

Key idea. A unified pre-training framework that fuses auto-regressive and auto-encoding networks under a shared Transformer-XL backbone and injects knowledge-graph triples through universal knowledge-text prediction.

  • ERNIE 3.0
  • ERNIE-3.0
  • ernie-3.0-mini-zh
  • ERNIE
  • knowledge enhanced pre-training
  • Chinese language model
  • Chinese BERT
  • universal knowledge-text prediction
  • Transformer-XL
  • SuperGLUE
  • PaddleNLP

AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{sun2021ernie30largescaleknowledge,
      title={ERNIE 3.0: Large-scale Knowledge Enhanced Pre-training for Language Understanding and Generation}, 
      author={Yu Sun and Shuohuan Wang and Shikun Feng and Siyu Ding and Chao Pang and Junyuan Shang and Jiaxiang Liu and Xuyi Chen and Yanbin Zhao and Yuxiang Lu and Weixin Liu and Zhihua Wu and Weibao Gong and Jianzhong Liang and Zhizhou Shang and Peng Sun and Wei Liu and Xuan Ouyang and Dianhai Yu and Hao Tian and Hua Wu and Haifeng Wang},
      year={2021},
      eprint={2107.02137},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2107.02137}, 
}