GLM · 2023-10 · Dense

ChatGLM3 6B

ChatGLM3 6B is a grouped-query attention (GQA) transformer released by GLM in 2023-10, with 28 layers, hidden size 4096 and a context window of 8,192 tokens.

Layer stack

Attention ×28 · Layers 28

Key facts

FamilyGLM
Released2023-10
Params6.2 B
Context8,192 tokens
AttentionGQA (32:2)
Layers28
Hidden4,096
Heads32
Vocab
Position
Norm
Activation
Dtypebf16
Architecture classChatGLMModel

Architecture overview

t₁ t₂ t₃ t₄ input tokens Embedding · Vocab — → Hidden 4,096 Q1 Q2 Q3 Qn KV1 KV2 Heads 32 KV heads 2 head dim 128 · FFN · FFN dim 13,696 × 28 transformer block Attention Feed-forward / MoE pre-norm Final norm · LM head → Vocab — p p p → next token Position Dtype BF16 Context 8K tok
Drawn from the shipped config.json · 28 layers / width 4,096 / context 8,192. Original diagram by this atlas.

Attention

grouped-query attention (GQA) — 32 q-heads / 2 kv-heads.

Feed-forward / MoE

It is a dense model: all 6.2B parameters participate in computing every token.

Field-level comparison

Compared against the previous model of the same lab; where none exists, against the structurally closest model. The ratio column is this model divided by the comparison model.

Full-field comparison vs most-similar GLM-4 9B
ModelChatGLM3 6BGLM-4 9BRatio
model_typechatglmchatglm
architecturesChatGLMModelChatGLMModel
hidden_size40964096≈1
num_attention_heads3232≈1
torch_dtypefloat16bfloat16
_name_or_pathTHUDM/chatglm3-6bTHUDM/glm-4-9b
add_bias_linearfalsefalse
add_qkv_biastruetrue
apply_query_key_layer_scalingtruetrue
apply_residual_connection_post_layernormfalsefalse
attention_dropout00
attention_softmax_in_fp32truetrue
bias_dropout_fusiontruetrue
ffn_hidden_size1369613696≈1
fp32_residual_connectionfalsefalse
hidden_dropout00
kv_channels128128≈1
layernorm_epsilon0.000011.5625e-7×64.00
multi_query_attentiontruetrue
multi_query_group_num22≈1
num_layers2840×0.700
original_ropetruetrue
padded_vocab_size65024151552×0.429
post_layer_normtruetrue
rmsnormtruetrue
seq_length81928192≈1

Most similar architectures

Similarity values range from 0 (no shared categorical features) to 1 (identical profiles).

Raw config fields

31 fields
_name_or_pathTHUDM/chatglm3-6b
model_typechatglm
architecturesChatGLMModel
add_bias_linearfalse
add_qkv_biastrue
apply_query_key_layer_scalingtrue
apply_residual_connection_post_layernormfalse
attention_dropout0
attention_softmax_in_fp32true
bias_dropout_fusiontrue
ffn_hidden_size13696
fp32_residual_connectionfalse
hidden_dropout0
hidden_size4096
kv_channels128
layernorm_epsilon0.00001
multi_query_attentiontrue
multi_query_group_num2
num_attention_heads32
num_layers28
original_ropetrue
padded_vocab_size65024
post_layer_normtrue
rmsnormtrue
seq_length8192
use_cachetrue
torch_dtypefloat16
transformers_version4.30.2
tie_word_embeddingsfalse
eos_token_id2
pad_token_id0