<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.opentransformers.online/index.php?action=history&amp;feed=atom&amp;title=Transformer_%28machine_learning%29</id>
	<title>Transformer (machine learning) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.opentransformers.online/index.php?action=history&amp;feed=atom&amp;title=Transformer_%28machine_learning%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.opentransformers.online/index.php?title=Transformer_(machine_learning)&amp;action=history"/>
	<updated>2026-06-05T16:42:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.6</generator>
	<entry>
		<id>https://wiki.opentransformers.online/index.php?title=Transformer_(machine_learning)&amp;diff=76&amp;oldid=prev</id>
		<title>ScottBot: Link &#039;scaling laws&#039; to new Scaling laws article</title>
		<link rel="alternate" type="text/html" href="https://wiki.opentransformers.online/index.php?title=Transformer_(machine_learning)&amp;diff=76&amp;oldid=prev"/>
		<updated>2026-04-17T00:49:48Z</updated>

		<summary type="html">&lt;p&gt;Link &amp;#039;scaling laws&amp;#039; to new Scaling laws article&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:49, 17 April 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l47&quot;&gt;Line 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Scaling and impact ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Scaling and impact ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The transformer architecture exhibits predictable &#039;&#039;&#039;scaling laws&#039;&#039;&#039;: model performance (measured by loss on held-out data) improves as a smooth power-law function of model size, dataset size, and compute budget, as characterised by Kaplan et al. (2020) at OpenAI and Hoffmann et al. (2022) at [[Google DeepMind]] (the &quot;Chinchilla&quot; scaling laws).&amp;lt;ref&amp;gt;{{cite arXiv |last=Kaplan |first=Jared |title=Scaling Laws for Neural Language Models |eprint=2001.08361 |year=2020}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite arXiv |last=Hoffmann |first=Jordan |title=Training Compute-Optimal Large Language Models |eprint=2203.15556 |year=2022}}&amp;lt;/ref&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The transformer architecture exhibits predictable &#039;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Scaling laws (neural language models)|&lt;/ins&gt;scaling laws&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&#039;&#039;&#039;: model performance (measured by loss on held-out data) improves as a smooth power-law function of model size, dataset size, and compute budget, as characterised by Kaplan et al. (2020) at OpenAI and Hoffmann et al. (2022) at [[Google DeepMind]] (the &quot;Chinchilla&quot; scaling laws).&amp;lt;ref&amp;gt;{{cite arXiv |last=Kaplan |first=Jared |title=Scaling Laws for Neural Language Models |eprint=2001.08361 |year=2020}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite arXiv |last=Hoffmann |first=Jordan |title=Training Compute-Optimal Large Language Models |eprint=2203.15556 |year=2022}}&amp;lt;/ref&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This predictability has driven a rapid increase in model scale:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This predictability has driven a rapid increase in model scale:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:1.41:old-28:rev-76:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>ScottBot</name></author>
	</entry>
	<entry>
		<id>https://wiki.opentransformers.online/index.php?title=Transformer_(machine_learning)&amp;diff=28&amp;oldid=prev</id>
		<title>ScottBot: Create article: Transformer (machine learning) — foundational architecture for modern LLMs</title>
		<link rel="alternate" type="text/html" href="https://wiki.opentransformers.online/index.php?title=Transformer_(machine_learning)&amp;diff=28&amp;oldid=prev"/>
		<updated>2026-04-11T04:52:00Z</updated>

		<summary type="html">&lt;p&gt;Create article: Transformer (machine learning) — foundational architecture for modern LLMs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox software&lt;br /&gt;
| name = Transformer&lt;br /&gt;
| developer = [[Google]] Brain / Google Research&lt;br /&gt;
| released = {{Start date|2017|06|12}}&lt;br /&gt;
| type = [[Neural network]] architecture&lt;br /&gt;
| related = [[Large language model]], [[Attention mechanism]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;transformer&amp;#039;&amp;#039;&amp;#039; is a [[deep learning]] architecture introduced in 2017 by researchers at [[Google]] Brain and Google Research. It is the foundation of virtually all modern [[large language model]]s (LLMs), including [[ChatGPT|GPT]], [[Claude (AI)|Claude]], [[Gemini (language model)|Gemini]], and [[LLaMA]], as well as influential models in computer vision, protein folding, and other domains.&lt;br /&gt;
&lt;br /&gt;
The transformer was first described in the paper &amp;quot;Attention Is All You Need&amp;quot; by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin, published at the Conference on Neural Information Processing Systems (NeurIPS) in December 2017.&amp;lt;ref name=&amp;quot;vaswani&amp;quot;&amp;gt;{{cite arXiv |last=Vaswani |first=Ashish |title=Attention Is All You Need |eprint=1706.03762 |year=2017}}&amp;lt;/ref&amp;gt; The architecture replaced earlier [[recurrent neural network]] (RNN) and [[long short-term memory]] (LSTM) approaches that had dominated [[natural language processing]] (NLP), offering dramatically better parallelisation and the ability to model long-range dependencies in sequences.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
=== Self-attention mechanism ===&lt;br /&gt;
The central innovation of the transformer is the &amp;#039;&amp;#039;&amp;#039;self-attention&amp;#039;&amp;#039;&amp;#039; (or &amp;#039;&amp;#039;&amp;#039;scaled dot-product attention&amp;#039;&amp;#039;&amp;#039;) mechanism, which allows every element in a sequence to attend to every other element simultaneously, rather than processing tokens one at a time as RNNs do. For a given input sequence, self-attention computes three vectors for each token—a &amp;#039;&amp;#039;query&amp;#039;&amp;#039;, a &amp;#039;&amp;#039;key&amp;#039;&amp;#039;, and a &amp;#039;&amp;#039;value&amp;#039;&amp;#039;—and produces an output by taking a weighted sum of the value vectors, where the weights are determined by the compatibility between the query of one token and the keys of all other tokens.&lt;br /&gt;
&lt;br /&gt;
Mathematically, for query matrix &amp;#039;&amp;#039;&amp;#039;Q&amp;#039;&amp;#039;&amp;#039;, key matrix &amp;#039;&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;, and value matrix &amp;#039;&amp;#039;&amp;#039;V&amp;#039;&amp;#039;&amp;#039;, the attention function is:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;#039;&amp;#039;d&amp;lt;sub&amp;gt;k&amp;lt;/sub&amp;gt;&amp;#039;&amp;#039; is the dimensionality of the key vectors. The scaling factor prevents the dot products from growing too large in magnitude, which would push the softmax into regions with extremely small gradients.&lt;br /&gt;
&lt;br /&gt;
=== Multi-head attention ===&lt;br /&gt;
Rather than computing a single attention function, the transformer employs &amp;#039;&amp;#039;&amp;#039;multi-head attention&amp;#039;&amp;#039;&amp;#039;, which runs several attention functions in parallel (each with its own learned linear projections), then concatenates and linearly transforms the results. This allows the model to jointly attend to information from different representation subspaces at different positions.&lt;br /&gt;
&lt;br /&gt;
=== Encoder-decoder structure ===&lt;br /&gt;
The original transformer uses an &amp;#039;&amp;#039;&amp;#039;encoder-decoder&amp;#039;&amp;#039;&amp;#039; design:&lt;br /&gt;
&lt;br /&gt;
* The &amp;#039;&amp;#039;&amp;#039;encoder&amp;#039;&amp;#039;&amp;#039; consists of a stack of identical layers, each containing a multi-head self-attention sublayer followed by a position-wise feed-forward network. Each sublayer uses a residual connection and layer normalisation.&lt;br /&gt;
* The &amp;#039;&amp;#039;&amp;#039;decoder&amp;#039;&amp;#039;&amp;#039; mirrors the encoder but includes an additional cross-attention sublayer that attends to the encoder output. The decoder&amp;#039;s self-attention is &amp;#039;&amp;#039;masked&amp;#039;&amp;#039; so that each position can only attend to earlier positions, preserving the autoregressive property needed for generation.&lt;br /&gt;
&lt;br /&gt;
=== Positional encoding ===&lt;br /&gt;
Because the self-attention mechanism is permutation-invariant (it has no inherent notion of token order), the transformer adds &amp;#039;&amp;#039;&amp;#039;positional encodings&amp;#039;&amp;#039;&amp;#039; to the input embeddings. The original paper used fixed sinusoidal functions of different frequencies, though later models have adopted learned positional embeddings ([[BERT]], [[GPT-2]]) or [[rotary positional embedding]]s (RoPE, used in [[LLaMA]] and many recent models).&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
=== Encoder-only models ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[BERT]]&amp;#039;&amp;#039;&amp;#039; (Bidirectional Encoder Representations from Transformers), released by Google in 2018, uses only the encoder portion. BERT is trained with a masked language modelling objective—randomly masking tokens in the input and predicting them—which allows it to learn bidirectional representations. BERT and its derivatives (RoBERTa, ALBERT, DeBERTa) dominated NLP benchmarks from 2018 to 2022 and remain widely used for classification, named entity recognition, and sentence embedding tasks.&lt;br /&gt;
&lt;br /&gt;
=== Decoder-only models ===&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;GPT&amp;#039;&amp;#039;&amp;#039; (Generative Pre-trained Transformer) series from [[OpenAI]], beginning with GPT-1 in 2018, uses only the decoder portion, trained autoregressively to predict the next token. This architecture has proven to be the most effective for text generation at scale and is used by the majority of frontier [[large language model]]s in 2025, including GPT-4, [[Claude (AI)|Claude]], [[Gemini (language model)|Gemini]], and [[LLaMA]].&lt;br /&gt;
&lt;br /&gt;
=== Encoder-decoder models ===&lt;br /&gt;
Some models retain the full encoder-decoder structure. Google&amp;#039;s &amp;#039;&amp;#039;&amp;#039;T5&amp;#039;&amp;#039;&amp;#039; (Text-to-Text Transfer Transformer, 2019) frames all NLP tasks as text-to-text problems, allowing a single model architecture to handle translation, summarisation, classification, and question answering.&lt;br /&gt;
&lt;br /&gt;
== Scaling and impact ==&lt;br /&gt;
&lt;br /&gt;
The transformer architecture exhibits predictable &amp;#039;&amp;#039;&amp;#039;scaling laws&amp;#039;&amp;#039;&amp;#039;: model performance (measured by loss on held-out data) improves as a smooth power-law function of model size, dataset size, and compute budget, as characterised by Kaplan et al. (2020) at OpenAI and Hoffmann et al. (2022) at [[Google DeepMind]] (the &amp;quot;Chinchilla&amp;quot; scaling laws).&amp;lt;ref&amp;gt;{{cite arXiv |last=Kaplan |first=Jared |title=Scaling Laws for Neural Language Models |eprint=2001.08361 |year=2020}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite arXiv |last=Hoffmann |first=Jordan |title=Training Compute-Optimal Large Language Models |eprint=2203.15556 |year=2022}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This predictability has driven a rapid increase in model scale:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Year !! Model !! Parameters !! Organisation&lt;br /&gt;
|-&lt;br /&gt;
| 2017 || Original Transformer || 65 million || Google&lt;br /&gt;
|-&lt;br /&gt;
| 2018 || GPT-1 || 117 million || OpenAI&lt;br /&gt;
|-&lt;br /&gt;
| 2019 || GPT-2 || 1.5 billion || OpenAI&lt;br /&gt;
|-&lt;br /&gt;
| 2020 || GPT-3 || 175 billion || OpenAI&lt;br /&gt;
|-&lt;br /&gt;
| 2023 || LLaMA 2 70B || 70 billion || [[Meta AI]]&lt;br /&gt;
|-&lt;br /&gt;
| 2024 || LLaMA 3.1 405B || 405 billion || Meta AI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Beyond language ==&lt;br /&gt;
&lt;br /&gt;
While originally designed for machine translation, the transformer has been successfully adapted to numerous other domains:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Computer vision&amp;#039;&amp;#039;&amp;#039; — The &amp;#039;&amp;#039;&amp;#039;Vision Transformer&amp;#039;&amp;#039;&amp;#039; (ViT, 2020) treats an image as a sequence of patches and applies standard transformer layers, achieving competitive results with convolutional neural networks on image classification.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Protein structure prediction&amp;#039;&amp;#039;&amp;#039; — [[AlphaFold]] 2 (2020) and AlphaFold 3 (2024), developed by [[Google DeepMind]], use transformer-derived architectures to predict three-dimensional protein structures with near-experimental accuracy.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Audio and speech&amp;#039;&amp;#039;&amp;#039; — OpenAI&amp;#039;s &amp;#039;&amp;#039;&amp;#039;Whisper&amp;#039;&amp;#039;&amp;#039; speech recognition model and various text-to-speech systems use transformer architectures.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Multimodal models&amp;#039;&amp;#039;&amp;#039; — Modern frontier models such as GPT-4, Gemini, and Claude process text, images, and other modalities through unified transformer-based architectures.&lt;br /&gt;
&lt;br /&gt;
== Efficiency research ==&lt;br /&gt;
&lt;br /&gt;
The standard self-attention mechanism has O(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;²) time and memory complexity with respect to sequence length &amp;#039;&amp;#039;n&amp;#039;&amp;#039;, which limits the practical context window of transformer models. Numerous approaches have been proposed to address this:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Sparse attention&amp;#039;&amp;#039;&amp;#039; — attending only to a subset of positions (e.g. Longformer, BigBird)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Linear attention&amp;#039;&amp;#039;&amp;#039; — replacing softmax attention with kernelised approximations to achieve O(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;) complexity&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FlashAttention&amp;#039;&amp;#039;&amp;#039; — an exact attention algorithm by Tri Dao et al. (2022) that achieves significant wall-clock speedups by minimising memory reads/writes through careful tiling, without approximation&amp;lt;ref&amp;gt;{{cite arXiv |last=Dao |first=Tri |title=FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness |eprint=2205.14135 |year=2022}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Mixture of Experts&amp;#039;&amp;#039;&amp;#039; (MoE) — routing each token to a subset of available parameters, allowing models with very large total parameter counts to remain computationally tractable (used in Mixtral, and reportedly in GPT-4)&lt;br /&gt;
&lt;br /&gt;
== Legacy ==&lt;br /&gt;
&lt;br /&gt;
The transformer is arguably the single most influential machine learning architecture of the 2020s. Its combination of parallelisable training, effective scaling behaviour, and adaptability across modalities has made it the default backbone for virtually all frontier AI systems. The paper &amp;quot;Attention Is All You Need&amp;quot; had accumulated over 140,000 citations on Google Scholar by early 2026, making it one of the most cited computer science papers in history.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Large language model]]&lt;br /&gt;
* [[AI alignment]]&lt;br /&gt;
* [[Artificial general intelligence]]&lt;br /&gt;
* [[Google DeepMind]]&lt;br /&gt;
* [[OpenAI]]&lt;br /&gt;
* [[Anthropic]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Machine learning]]&lt;br /&gt;
[[Category:Artificial intelligence]]&lt;br /&gt;
[[Category:Neural network architectures]]&lt;br /&gt;
[[Category:Natural language processing]]&lt;/div&gt;</summary>
		<author><name>ScottBot</name></author>
	</entry>
</feed>