tadata

Transformeur

Intelligence artificielle · Avancé

L'architecture de réseau de neurones derrière les grands modèles de langage, fondée sur le mécanisme d'attention.

Comment ça marche

Pour chaque mot, l'attention calcule à quels autres mots du texte il doit prêter attention (« il » renvoie à quel nom ?). Des blocs répétés d'attention et de calcul s'empilent. Contrairement aux anciens modèles, tout le texte est traité en parallèle, ce qui permet d'entraîner de très grands modèles.

tadata
token ids B×T (T ≤ 8,192) Token embedding V×d B×T×4096 RMSNorm Masked self-attention GQA · h = 32, h_kv = 8 · d_h = 128Q B×32×T×128 · K, V B×8×T×128scores B×32×T×T (causal mask)RoPE rotates Q and K + B×T×4096 residualstream RMSNorm Feed-forward (SwiGLU) d → d_ff → d · d_ff = 14,336hidden B×T×14336 (gate × up) + B×T×4096 × 32 layers Final RMSNorm LM head d×V (tied to embedding) logits B×T×128,256 → softmax → next token Part Formula Params Token embedding V·d 525.3 M Attention Q, K, V, O (GQA) 2d² + 2d·h_kv·d_h 41.9 M Feed-forward (SwiGLU) 3d·d_ff 176.2 M 2 × RMSNorm 2·d 8,192 One layer sum of the above 218.1 M All 32 layers L × layer 6.98 B Final RMSNorm d 4,096 Output head 0 (tied) 0 Total 7.50 B exact total 7,504,924,672 · layers 93 % · embeddings + head 7 % no linear-layer biases Parameters = token embedding + L × one layer + final norm + output head (weights as d_in × d_out matrices) where d = d_model = 4,096 (residual-stream width); h = 32 query heads; h_kv = 8 key/value heads; d_h = d/h = 128 (head size); d_ff = 14,336(feed-forward hidden size); L = 32 layers; V = 128,256 vocabulary tokens; T = 8,192 tokens of context; B = batch size (sequences) Un bloc de transformeur : attention puis calcul
token ids B×T (T ≤ 8,192) Token embedding V×d B×T×4096 RMSNorm Masked self-attention GQA · h = 32, h_kv = 8 · d_h = 128Q B×32×T×128 · K, V B×8×T×128scores B×32×T×T (causal mask)RoPE rotates Q and K + B×T×4096 residualstream RMSNorm Feed-forward (SwiGLU) d → d_ff → d · d_ff = 14,336hidden B×T×14336 (gate × up) + B×T×4096 × 32 layers Final RMSNorm LM head d×V (tied to embedding) logits B×T×128,256 → softmax → next token Part Formula Params Token embedding V·d 525.3 M Attention Q, K, V, O (GQA) 2d² + 2d·h_kv·d_h 41.9 M Feed-forward (SwiGLU) 3d·d_ff 176.2 M 2 × RMSNorm 2·d 8,192 One layer sum of the above 218.1 M All 32 layers L × layer 6.98 B Final RMSNorm d 4,096 Output head 0 (tied) 0 Total 7.50 B exact total 7,504,924,672 · layers 93 % · embeddings + head 7 % no linear-layer biases Parameters = token embedding + L × one layer + final norm + output head (weights as d_in × d_out matrices) where d = d_model = 4,096 (residual-stream width); h = 32 query heads; h_kv = 8 key/value heads; d_h = d/h = 128 (head size); d_ff = 14,336(feed-forward hidden size); L = 32 layers; V = 128,256 vocabulary tokens; T = 8,192 tokens of context; B = batch size (sequences) Un bloc de transformeur : attention puis calcul

Qui l'utilise, et pourquoi

Chercheurs et ingénieurs ; base de GPT, Claude, Gemini, Llama.

Sur le site

BlogÉvolution du Transformer : De "Attention Is All You Need" aux Variantes ModernesRéseaux de neurones convolutifs : de LeNet aux architectures modernesRéseaux de neurones récurrents : modélisation séquentielle avant les Transformers

Termes liés

Autres termes : Intelligence artificielle

Affinage (fine-tuning)Agent d'IAAgent ReActAlgorithme génétiqueAnalyse de sentimentAnalyse en composantes principales (ACP)Appel de fonctions (tool use)Apprentissage auto-superviséApprentissage automatiqueApprentissage en contexteApprentissage fédéréApprentissage non superviséApprentissage par renforcementApprentissage par transfert

Nous utilisons des cookies analytiques pour améliorer votre expérience. Aucune donnée personnelle n'est collectée.