From a 2017 translation paper, generative AI (AI that produces text, pictures, sound and more) grew step by step, and in 2022 it arrived in a form anyone could use. The boom did not start all of a sudden. Let's run the famous mechanisms from that period one by one and check them for ourselves.
012017 · The Transformer
Which words to look at, and how much
How does a machine turn the relationships between words in a sentence into numbers?
In June 2017, eight people from Google and the University of Toronto published the Transformer paper. Attention, born in the 2014 translation work of the previous chapter, had been used together with RNNs (networks that read words one at a time, in order). This paper dropped the RNN and built the network from attention alone.
For each word, three vectors (sets of numbers) are made: a query (Q) for the searching side, a key (K) for the side being searched, and a value (V) for the content. The dot product of the query with the keys of all the words is divided by √d, then turned into weights with a softmax (a calculation that makes every number positive and the total 1). The values are mixed using those weights. In the figure on the right, press "it" and a thick line points to "fish". The paper runs eight of these side by side (multi-head), so that each head can look at a different kind of relationship.
Attention(Q, K, V)=softmax( QKT / √dk ) V
Q, K, V
matrices holding the query, key and value vectors
dk
length of the key vector (64 in the paper)
the numbers in the model
values chosen by hand for this site
What you think you knowThe popular story:A paper for building conversational AI (chatbots) The original source says:The paper tested translation and English constituency parsing. Its closing named extending the method to images, audio and video as the next goal, and conversation never appears in the text.
Translation scores
The first version (June 2017) reports 28.4 BLEU (a score for translation quality) on English-to-German and 41.0 on English-to-French, after training for 3.5 days on 8 GPUs. In the version reissued in 2023, the French figure is 41.8.
A note in the paper says the order of the eight names was decided by a draw.
Sources & confidence (2)Which words to look at, and how much
12 June 2017Verified in the original
The Paper on , the Basis of Today's Text AI, Is Published
Eight people, researchers at Google and a University of Toronto student, presented a new AI architecture (the Transformer) built only from “attention mechanisms,” which pay attention to which words in a sentence relate to which other words. The paper tested it on tasks such as translating English into German and French, and it achieved better results than before with shorter training time. The later GPT and BERT are built on this architecture (confirmed in their respective papers).
The popular story:People tend to think of it as “a paper for building conversational AI (chat AI)” (the popular story is this site's own inference) The original source says:What the paper tested was translation and English syntactic parsing. The next goals it named in its conclusion were applications to images, audio and video, and conversation does not appear in the main text
The origin of attention: translation that decides, each time it outputs one word, how much to focus on each word of the original sentence (Bahdanau et al., 2014)
In September 2014, Dzmitry Bahdanau, KyungHyun Cho and Yoshua Bengio published the paper on arXiv. The older encoder-decoder squeezed the whole input sentence into a single fixed-length vector, and the paper saw this as a bottleneck (a place that narrows like the neck of a bottle) limiting performance. So the encoder keeps, for each input word, a summary (an annotation) made by reading the sentence in both directions, forward and backward. Each time the decoder outputs one translated word, a small neural network gives each word's summary a score for how important it is, turns the scores into weights that add up to 1, and the decoder uses the weighted sum of the summaries. The paper explained that, intuitively, this gives the decoder a mechanism of attention. In English-to-French translation, scores did not drop much even as sentences got longer. When limited to sentences with no unknown words, the scores were about the same as Moses, a statistical machine translation system (BLEU 36.15 and 35.63). When the weights were drawn as a figure, the English European Economic Area could be seen matching the French zone économique européenne, which has the words in the reverse order.
The popular story:People tend to think attention was born in the 2017 Transformer paper (because that paper's title is Attention Is All You Need; this way of putting it is this site's own guess) The original source says:the attention mechanism was already in this 2014 translation paper. The Transformer paper also calls one of the two commonly used forms of attention and lists this paper as reference [2]. What the Transformer paper presented as new was that, whereas attention had until then been , it built the model from attention alone, without an RNN. Note that the key word in the title of the 2014 paper is “align,” and the word attention appears only three times, in one paragraph of the text. The paper also cites Graves's 2013 work on generating handwriting as a similar method for lining up input and output.
What the figure shows:Each word sends out a query and decides which other words to attend to, and how much, by how well it matches their keys. The word “it” pays strong attention to “fish” in the preceding sentence.
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_attention.py
022017 · Positional encoding
Writing word order in as waves
Attention does not look at order. How can it tell "the cat chases the mouse" from "the mouse chases the cat"?
In the attention calculation, shuffling the order of the words does not change the weights. Because it does not read in order the way an RNN does, the position of each word has to be added separately.
The paper builds a vector from sin and cos waves of different periods for each position (the positional encoding) and adds it to the word's vector. The wave periods run from the shortest, 2π, to the longest, 10000·2π. Like the second hand and hour hand of a clock, fast waves tell nearby positions apart and slow waves tell distant ones apart. The graph below shows the dot product between a chosen position and every other position. When the gap between positions is the same, the value comes out almost the same wherever you are.
dimension of the vector (512 in the paper; 32 in the figure)
Learning the positions instead
A later version of the paper also tried learning the positions and reported nearly the same results. It chose the waves because they might work on sentences longer than any seen in training. The later ViT (spread 11 of this chapter) used the learned version.
Sources & confidence (1)Writing word order in as waves
12 June 2017Verified in the original
The Paper on , the Basis of Today's Text AI, Is Published
Eight people, researchers at Google and a University of Toronto student, presented a new AI architecture (the Transformer) built only from “attention mechanisms,” which pay attention to which words in a sentence relate to which other words. The paper tested it on tasks such as translating English into German and French, and it achieved better results than before with shorter training time. The later GPT and BERT are built on this architecture (confirmed in their respective papers).
The popular story:People tend to think of it as “a paper for building conversational AI (chat AI)” (the popular story is this site's own inference) The original source says:What the paper tested was translation and English syntactic parsing. The next goals it named in its conclusion were applications to images, audio and video, and conversation does not appear in the main text
What the figure shows:With attention alone, changing word order leaves the calculation results the same. Adding values from fast and slow waves at each position puts order differences into the numbers.
Dot product between the chosen position and the other positions
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_position.py
032018 · Context
One word, different numbers by context
"Play" can mean a play in baseball or a play on stage. Is one set of numbers per word enough?
word2vec (2013) and similar methods from the previous chapter gave each word a single vector. So "play" had the same vector in a baseball sentence and in a theater sentence. In February 2018, seven people including Matthew Peters of the Allen Institute for AI and the University of Washington introduced ELMo.
On a huge amount of text, it trains an LSTM that reads forward and predicts the next word and an LSTM that reads backward and predicts the previous word (two layers each). A word's representation is the internal states of every layer added together with weights learned for each task. The paper says the lower layers are better at parts of speech and the upper layers at telling word meanings apart (the figure on the right).
On each of six tasks, just adding ELMo beat the best results of the time, cutting errors by up to about 20%.
ELMok =γ Σj sj hk,j
hk,j
state of layer j when reading the k-th word
sj
weight for each layer (softmax, total 1)
γ
overall scale
What you think you knowThe popular story:ELMo was the first to represent words by their context The original source says:The ELMo paper itself names 2017 work and CoVe as earlier examples, and says its own difference is using . Eight months later, the BERT paper called ELMo . The same method was called deep by its makers and shallow by the next paper.
Sources & confidence (1)One word, different numbers by context
15 February 2018Verified in the original
ELMo: Representing the Same Word with Different Vectors Depending on Context (Peters et al., 2018)
In February 2018, Matthew Peters and six others at the Allen Institute for AI and the University of Washington posted the paper on arXiv and named their new word representation method ELMo (short for Embeddings from Language Models). The word vectors that had been the mainstream until then (word2vec, GloVe and others) assign one vector to each word, so play got the same numbers whether it meant a sports play or a theater play. ELMo first pretrains a bidirectional language model on a large amount of text (two layers of LSTM that reads from the start of the sentence and predicts the next word, stacked with two layers of LSTM that reads from the end and predicts the previous word). Then, for a word in a sentence, it adds up the internal states of each layer using weights learned for each task, and treats the result as that word's representation in context. As a result, even the same play gets different vectors in a baseball sentence and in a sentence about a Broadway play (in a table in the paper, sentences with similar usage are chosen for each). Just plugging it into six tasks such as question answering and sentiment analysis set a new state of the art on every one and cut errors by up to about 20%.
The popular story:People tend to say that ELMo (or BERT) was the first to make word representations change with context (the popular story is this site's own inference) The original source says:The ELMo paper itself cites Peters and colleagues' 2017 work and the 2017 CoVe of McCann and colleagues (which uses a translation encoder) as earlier methods that learn context-aware word vectors, and writes that its own difference is that it uses , not only the top layer of the language model, so that . Yet eight months later, the BERT paper described ELMo as . The same method is called deep by its developers and shallow by the next paper. ELMo's deep means stacking layers and using all of them, while BERT's shallow means it does not look at the left and right context at the same time inside one model, so the two words mean different things.
3 sources and how they were checked
Deep contextualized word representations (arXiv:1802.05365v1) (Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, Luke Zettlemoyer · 2018 · PDF page 1 Abstract and 1 Introduction (PDF page 1), Section 3 (PDF pa… · Original source)
What the figure shows:In word2vec, play was 1 point, but in ELMo its point moves with each sentence. Lower layers group it by noun or verb use, while upper layers group it by meanings such as baseball, theater, and music.
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_context_vectors.py
042018 · Language models
Just by guessing the next word
What can a machine learn from text that has no correct answers attached?
In June 2018, OpenAI announced the following approach. First, a 12-layer Transformer is trained to guess the next word on text from 7,000 books (pretraining). Then it is taught each task with a few examples. It beat the best previous results on 9 of the 12 tasks tested.
A system that gives the probability of the word that comes next after the text so far is called a language model. Pick the next word by probability, again and again, and you get a sentence. The idea is old: Shannon's 1948 paper also decides the next letter from the probability given the previous two letters, and produces English-looking strings of letters. The figure on the right shows probabilities from the previous characters to the next 1 character, counted in the text of this site's records. The number of previous characters starts at 2 and can be switched from 1 to 3. Raise the temperature and the probabilities flatten out; lower it and choices concentrate on the more probable characters.
What is different in the fourth boom is that a large neural network (a Transformer) produces the probabilities, and that it learns from far more text.
pi =exp(zi /T)/Σj exp(zj /T)
zi
score of character i (in the figure, the log of the count)
T
temperature
pi
probability of choosing character i
What you think you knowThe popular story:It is called the first GPT (GPT-1) The original source says:The word GPT never appears even once in the June 2018 paper or announcement. Four months later, Google's BERT paper calls it “Generative Pre-trained Transformer (OpenAI GPT)”. Where the name GPT-1 came from has not yet been confirmed.
Sources & confidence (1)Just by guessing the next word
11 June 2018Verified in the original
OpenAI Announces a Text AI (Later Called GPT) That Is Pretrained on Lots of Text and Then Taught Individual Tasks
OpenAI, a research group in the United States, announced a new method using the Transformer architecture. It first does pretraining, predicting the next word, on the text of about 7,000 books, and then teaches individual tasks with a small amount of data. It set a new state of the art on 9 of the 12 tasks it evaluated. The announcement says it combines two ideas that already existed, and (learning broadly first from text that has no answers attached).
The popular story:It is called “the first GPT (GPT-1)” The original source says:The word “GPT” never appears in the June 2018 paper or announcement (searching both gives 0 hits; the paper's title is ). The name was given by others first. Four months later, in October 2018, Google's BERT paper calls it “Generative Pre-trained Transformer (OpenAI GPT)”. The origin of the name “GPT-1” has not been confirmed.
What the figure shows:Simply calculating the probabilities of the next character after the text so far can produce plausible sentences. Raising the temperature evens out probabilities and produces rare characters, while lowering it repeats the same phrases.
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_ngram.py
052018–2019 · Tokens
Cutting a sentence into tokens
Does a language model read a sentence one character at a time, or one word at a time?
The pieces of text a language model works with are called tokens. One character at a time makes the sequence too long; one word at a time causes trouble when a word is not in the dictionary. GPT and GPT-2 used byte pair encoding (BPE). It starts by splitting text into single characters, then merges the pair that sits side by side most often in the text into a new token. It repeats this. In the figure on the right, press "Merge once".
The 2018 GPT used a vocabulary built with 40,000 merges. According to the 2019 GPT-2 paper, working with characters (Unicode) directly would mean a base vocabulary of over 130,000 before any merging. So the text is split into single bytes (256 kinds) first, and BPE is applied to those, which brought the vocabulary to 50,257. The length it can read at once was also widened from 512 to 1,024 tokens.
the pair (a, b) that sits side by side most often → new token ab (repeat)
what is counted
how many times b appeared right after a in the text
The GPT-2 paper added a safeguard against merging across character types. It avoids the waste of the same word becoming separate tokens when it carries punctuation, as in dog. dog! dog?
Sources & confidence (2)Cutting a sentence into tokens
11 June 2018Verified in the original
OpenAI Announces a Text AI (Later Called GPT) That Is Pretrained on Lots of Text and Then Taught Individual Tasks
OpenAI, a research group in the United States, announced a new method using the Transformer architecture. It first does pretraining, predicting the next word, on the text of about 7,000 books, and then teaches individual tasks with a small amount of data. It set a new state of the art on 9 of the 12 tasks it evaluated. The announcement says it combines two ideas that already existed, and (learning broadly first from text that has no answers attached).
The popular story:It is called “the first GPT (GPT-1)” The original source says:The word “GPT” never appears in the June 2018 paper or announcement (searching both gives 0 hits; the paper's title is ). The name was given by others first. Four months later, in October 2018, Google's BERT paper calls it “Generative Pre-trained Transformer (OpenAI GPT)”. The origin of the name “GPT-1” has not been confirmed.
OpenAI Does Not Release the Whole of Its Text AI “GPT-2” , and Rolls It Out in Stages over Nine Months
OpenAI announced “GPT-2,” a text AI with 1.5 billion parameters trained on 40 GB of text from the internet. Worried about misuse for fake articles, impersonation and spam, it did not release the trained model itself, publishing only a smaller version and the paper. It then released larger sizes in stages, and in November 2019 released the largest version too. The announcement of that release says: .
The popular story:The story spread that “OpenAI built an AI too dangerous to release” (the Guardian headline that day: ) The original source says:The word dangerous does not appear in OpenAI's announcement. What it actually said was and . And nine months later it released everything
What the figure shows:Repeatedly joining the 2 most frequent neighboring units combines common groups of Japanese characters, such as ihana and aka, into 1 token and reduces the number of tokens.
Number of merges and number of tokens
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_bpe.py
062018 · Fill in the blank
Predicting a hole from both sides
What changes if, instead of the next word, the machine has to guess a hole in the middle of a sentence?
In October 2018, four people at Google introduced BERT. GPT read from left to right and guessed the next word. BERT instead chose 15% of the tokens in a sentence, hid them, and learned to guess them using both the left and the right as clues (of the chosen spots, 80% got a [MASK] marker, 10% got a different word, and 10% were left as they were). The paper says it drew inspiration from the Cloze test, a fill-in-the-blank test from 1953.
In the figure on the right, take "I drank [MASK]". Looking only at the left, the machine cannot tell water, tea, bread and apple apart. Once it sees the "drank" on the right, it narrows to drinks.
It was trained on 800 million words of books and 2.5 billion words of English Wikipedia, and set the best result on 11 tasks. In October 2019 Google began using it in Search, announcing that it would help with understanding .
loss= −Σhidden spots log p( true word|words on the left and right )
p
probability the model outputs
hidden spots
15% of the tokens chosen
Not an AI that writes text
BERT is not an AI that writes text; it is a leading example of an AI that reads and understands sentences. We placed it in this chapter as a step before text-writing AI. The large version has 340 million parameters.
Sources & confidence (1)Predicting a hole from both sides
11 October 2018Verified in the original
Google Announces , a Text AI That Reads Words from Both Before and After in a Sentence, and Starts Using It in Search the Next Year
Four Google researchers announced a text AI called , which uses the Transformer architecture and learns using the words on both the left and right of a position in a sentence. It achieved the best results on 11 language tasks, and its design was released for anyone to use. A year later, in October 2019, Google put BERT into its search and announced that it would help understand .
What the figure shows:Looking only to the left does not narrow down the word for a blank, but seeing the Japanese words to the right meaning drank narrows it to a drink. BERT learned to predict using clues on both sides.
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_fill_blank.py
072019 · Staged release
Released over 9 months, fearing misuse
What happened when its makers decided not to release the whole AI at once?
In February 2019, OpenAI announced GPT-2, trained on 40 GB of text from the internet. It has 1.5 billion parameters (numbers set by training; in this chapter's formula we also call them parts). Citing (for example fake articles), it released only a small model and the paper. It also wrote: .
After that it released larger and larger sizes in turn, and when the largest version came out in November it wrote: . Move the month in the figure on the right.
number of parts ≈ 12 × layers × d2 +vocabulary size × d+number of positions × d
d
length of the vector
12 × layers × d2
the count for the main body (from the 2020 scaling-laws paper)
the sum of everything
this site's estimate
What you think you knowThe popular story:OpenAI built an AI "too dangerous to release" The original source says:The word "dangerous" does not appear in the announcement. The Guardian's headline that day was . Nine months later the whole thing was released.
Two numbers
For the same four sizes, the paper's table and the announcement give slightly different numbers (117M and 124M, for example). Open “Details: compare numbers and sources” to see the graph, where blue is the paper's table, green is the announcement, and purple is this site's estimate. This site has not checked in the sources why they differ.
Sources & confidence (1)Released over 9 months, fearing misuse
14 February 2019Verified in the original
OpenAI Does Not Release the Whole of Its Text AI “GPT-2” , and Rolls It Out in Stages over Nine Months
OpenAI announced “GPT-2,” a text AI with 1.5 billion parameters trained on 40 GB of text from the internet. Worried about misuse for fake articles, impersonation and spam, it did not release the trained model itself, publishing only a smaller version and the paper. It then released larger sizes in stages, and in November 2019 released the largest version too. The announcement of that release says: .
The popular story:The story spread that “OpenAI built an AI too dangerous to release” (the Guardian headline that day: ) The original source says:The word dangerous does not appear in OpenAI's announcement. What it actually said was and . And nine months later it released everything
What the figure shows:Because of concerns about misuse, GPT-2 was released from smaller versions upward over 9 months. When releasing the final version, its developers wrote, “We’ve seen no strong evidence of misuse so far.”
Number of parameters (scale in steps of 10 times)
082020 · Scaling laws
Add parameters, or add text?
What happens if you only add parameters but there is not enough text to learn from?
In January 2020, ten people from OpenAI and Johns Hopkins University showed that as parameters, amount of text and amount of computation grow, the loss of a text AI (how hard the next word is to guess) falls according to a power law, and that this holds across more than 7 orders of magnitude (more in Chapter 12).
The paper also gave a formula in which both the number of parameters N and the amount of text D matter. If you increase only one, the improvement slows. The paper says that if you multiply the parameters by 8, you lose nothing by multiplying the text by about 5. In the figure on the right, press "8× N, 5× D".
This is one of the foundations of the expectation that bigger means smarter. But the authors themselves wrote: .
L(N, D)= [ (Nc /N)αN/αD +Dc /D ]αD
N
number of parameters
D
amount of text (number of tokens)
αN, αD
the paper's values 0.076 and 0.095
Nc, Dc
the paper's values 8.8×10¹³ and 5.4×10¹³
What you think you knowThe popular story:A law saying that the bigger you make it, the smarter it gets without limit The original source says:The paper itself says that the trend must eventually level off, and that there is no theoretical understanding of it.
Sources & confidence (1)Add parameters, or add text?
23 January 2020Verified in the original
A Paper on a Law Where Performance Rises at a Fixed Rate as Models Grow — but the Authors Themselves Note
Researchers at OpenAI and Johns Hopkins University showed that a language model's results (measured by how hard it is to guess the next word) improve in a clean, fixed form (a power law) as the number of parameters, the amount of training data and the amount of computation increase. This form held over more than seven orders of magnitude (10 million times). This idea became one of the foundations of the later race to build ever larger AI.
The popular story:People tend to take it as “a law that says the bigger you make it, the smarter it gets without limit” (the way it is taken is this site's own inference) The original source says:The original paper itself writes and .
What we still don’t know:What is known: in the range studied up to 2020, performance rose by a fixed rule as scale increased. What is not known: how far this continues and why it happens (the paper itself writes that the trends and that ).
What the figure shows:Increasing parameters alone gives slower improvement if there is too little text; an 8-fold increase in parameters needs about 5 times as much text to avoid wasting the increase. This trend will eventually level off too.
Loss when the amount of text is fixed and only the number of parameters is increased
092020 · Showing examples
Just show examples, with no retraining
Can you teach a new task without changing the numbers (weights) inside the AI?
In May 2020, 31 people at OpenAI announced GPT-3, with 175 billion parameters. It was 10 times the size of any similar AI before it and was trained on 300 billion tokens.
Instead of retraining for each task (changing the weights), you show a description of the task and a few examples inside the text and have it write the continuation. With no examples is zero-shot, with one is one-shot, with several is few-shot. The weights do not change. With this it handled translation, answering questions, 3-digit arithmetic and more. The figure on the right is a small mechanism made by this site (not the inside of GPT-3). It keeps only the rules that fit the examples, so the answer narrows as examples increase.
When people were asked to tell news articles written by GPT-3 from articles written by people, they were right 52% of the time, hardly different from guessing (50%).
the text shown=task description+example 1+ … +example k+question → write the continuation
k
number of examples shown
length read at once
2,048 tokens (GPT-3)
Computation used for training
With the same design, the paper made eight models, from 125 million to 175 billion parameters. According to the paper's table, the amount of computation used for training was 5.33×10²⁰ for BERT-Large and 3.14×10²³ for GPT-3, about 590 times more. Prompted by the result of the experiment on telling articles apart, the paper also has a section on the risk of misuse.
Sources & confidence (1)Just show examples, with no retraining
28 May 2020Verified in the original
“GPT-3”, a Text AI with 175 Billion Parameters, Does Many Kinds of Work After Seeing Just a Few Examples
31 people at OpenAI announced “GPT-3,” a language model with 175 billion parameters, 10 times the scale of earlier AI of its kind. Without being retrained for each task, it handled translation, answering questions, three-digit arithmetic and more just from a few examples shown in the text. In an experiment in which people tried to tell news articles written by GPT-3 from articles written by humans, accuracy was only 52%, almost the same as guessing (50%).
What the figure shows:Showing a few examples in the text narrows down the requested task without changing the numbers inside the model. More examples reduce the number of possible answers.
Number of parameters (scale in steps of 10 times; the numbers in the records)
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_fewshot.py
102020 · Self-supervised learning
No labels: pull similar images together
Can a machine learn features useful for recognition from photos without correct labels attached?
Self-supervised learning is a way of learning with no human-made correct answers (labels), using problems made from the data itself. Guessing the next word and filling in blanks belong to this family. In February 2020, four people at Google, including Ting Chen and Geoffrey Hinton, announced SimCLR, a simplified take on contrastive learning for images.
Apply two rounds of editing to one photo, such as cropping, color changes and blurring, to make a correct pair of two images. The model is trained so that this pair comes out close together (high cosine similarity) and far from other photos. In the figure on the right, press "Keep learning".
On features learned with no answers, training only a simple classification layer with answers gave 76.5% on ImageNet. That matches a ResNet-50 trained with answers.
What you think you knowThe popular story:SimCLR started contrastive learning, which learns images without answers The original source says:The paper itself says , and its first example of contrastive learning is a 2006 paper from New York University. That paper wrote that .
Sources & confidence (1)No labels: pull similar images together
13 February 2020Verified in the original
Self-Supervised and Contrastive Learning (SimCLR): Learning Image Features Just by Practicing Putting Two Edits of the Same Photo Close Together and Other Photos Far Apart, Using Photos with No Answers (Chen et al., 2020)
Self-supervised learning is a way of learning from tasks made from the data itself, without people attaching correct labels. In February 2020, Ting Chen, Simon Kornblith, Mohammad Norouzi and Geoffrey Hinton of a Google research team (Google Research, Brain Team) presented SimCLR, a simple form of contrastive learning for images (a method that learns to put similar things close together and different things far apart). To each photo, random edits such as cropping and resizing, color distortion and blurring are applied twice, and the two images made from the same photo form a pair. A CNN (ResNet-50) and a small network after it (a projection head) turn each image into a set of numbers, and training makes the two in a pair close (high cosine similarity) and far from the other 2(N−1) images in the same minibatch. The minibatch size went up to 8,192 images. When only a linear classifier was trained with labels on top of the features learned without labels, it reached 76.5% accuracy on ImageNet, matching a supervised ResNet-50. Even using only 1% of the labels, its top-5 accuracy reached 85.8%, beating AlexNet with 100 times fewer labels.
The popular story:People tend to think that contrastive learning, which learns images without labels, is a new method started by SimCLR in 2020 (the popular story is this site's own inference) The original source says:The paper itself writes: . As the first example of contrastive learning, it cites a 2006 paper by Hadsell, Chopra and LeCun (New York University). That 2006 paper, using a contrastive loss, writes that . What the paper claimed as new in SimCLR was showing the importance of combining edits, the small network after the main one, and large batches and long training, which raised performance without special architectures or a memory bank.
What the figure shows:Learning only the rule that 2 images made from the same photo should be close and other photos far apart creates features that group each photo's images together, without anyone supplying correct answers.
Loss (by number of training rounds)
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_contrastive.py
112020 · Transformers for images
Turning an image into 16×16 squares
How can you get a Transformer built for text to read pictures?
In October 2020, 12 people at Google, including Alexey Dosovitskiy, introduced ViT (Vision Transformer). It cuts an image into small squares (patches) of equal size and turns each one into a single row of numbers (a vector). A position vector is added, and the patches go into the Transformer just like the words of a sentence. One extra marker is added at the front, to produce the answer.
The images the paper used for training were 224×224. Cutting them into 16×16 pieces gives a sequence of 196 patches. In the figure on the right, make the squares smaller and the sequence gets longer and the attention calculation heavier (the length of the sequence is inversely proportional to the square of a patch's side).
Trained on ImageNet alone (about 1.3 million images), it scored a few points below the CNN (convolutional) ResNet of the previous chapter. Pretrained on 14 million to 300 million images, it matched or beat CNNs, and the best model reached 88.55%. The paper summed it up this way: large-scale training beats the image-specific built-in structure that CNNs start with.
N=H × W/P2
H, W
height and width of the image in pixels
P
length of a side of a square
N
length of the sequence (number of squares)
What you think you knowThe popular story:ViT was the first to cut an image into small squares and feed them to a Transformer The original source says:The final version submitted to the conference names Cordonnier et al. (2020) as the closest work, and added that it and that . What the paper claimed as new was showing that, with pretraining on large-scale data, a plain Transformer with no special tricks can match CNNs.
Sources & confidence (1)Turning an image into 16×16 squares
22 October 2020Verified in the original
Vision Transformer (ViT): Cutting an Image into 16×16-Pixel Squares, Lining Them Up Like Words, and Recognizing Them with the Text Transformer as It Is (Dosovitskiy et al., 2020)
In October 2020, Alexey Dosovitskiy and 11 others of a Google research team (Google Research, Brain Team) published the paper on arXiv. Until then CNNs (convolutional neural networks) were the mainstream for image recognition, and attention was used in combination with CNNs. ViT cuts an image into small squares of the same size (patches, for example 16×16 pixels) and turns each one into a row of numbers. It adds numbers that show which place each came from (position embeddings), lines them up like words, and feeds them as they are into the encoder of a Transformer for text. The class of the image is decided from the output of a classification token added at the start. When trained only on data the size of ImageNet (about 1.3 million images), it was a few points worse than a ResNet (a representative CNN) of similar size. But when pretrained on 14 million to 300 million images, it matched or beat CNNs, and the best model reached 88.55% accuracy on ImageNet. The paper summarized this as large-scale training beating the image-specific built-in structure of CNNs (inductive bias).
The popular story:People tend to say ViT was the first to cut an image into small squares and feed them to a Transformer (the popular story is this site's own inference) The original source says:In the related work of the final version submitted to the conference (June 2021), the authors name the model of Cordonnier et al. (2020) as the closest to theirs. It and then applies attention on top, and they added (the first version of October 2020 did not have this sentence and only listed the name alongside other studies). What the paper claimed as new was not the way of splitting images but showing that a standard Transformer pretrained on large-scale data can match CNNs, and that squares larger than 2 × 2 let it handle medium-resolution images too.
What the figure shows:Cutting an image into equal-sized squares and arranging them in 1 sequence lets it be read like words in a sentence. Smaller squares make a longer sequence, and computation grows with its length squared, to the power of 2.
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_patches.py
122018 · 2020 · Proteins
Building a shape from a map of distances
Can the 3D structure of a protein be predicted from the sequence of amino acids alone?
It is not an AI that writes text or draws pictures, but around the same time, AI as a tool for science also advanced greatly. A protein's shape is decided when a chain of amino acids folds up. At the 2018 structure-prediction contest CASP13, DeepMind's first AlphaFold used a CNN to predict a map of the distances between amino acids. From that map it built a scoring formula and used gradient descent to adjust the shape little by little.
The figure on the right is this method in its smallest form. A chain in a random shape moves to fit the map on the left (numbers chosen by this site).
Two years later, at CASP14 (2020), AlphaFold 2 was, according to the Nobel Committee's explanation, . It dropped convolution, used Transformer attention, and produced atom positions directly. The score on the hard problems rose from about 60% to about 90%.
E=Σi<j ( |xi − xj| − dij )2 x ← x − η ∂E/∂x
xi
position of the i-th amino acid
dij
distance on the map
η
step size for moving (learning rate)
the real scoring formula
a different form from this squared error
What you think you knowThe popular story:AI solved the mystery of protein folding The original source says:The paper itself draws the line at .
2018 and 2020
In the category with no similar-shape templates, the first AlphaFold scored a total of 68.3 in the judging, far above the runner-up's 48.2. But high accuracy came on only 11 of 43. The 2021 AlphaFold 2 paper describes the system entered in CASP14 as .
According to that paper, the median error of the backbone (the frame of the chain) was 0.96 angstroms (smaller than one atom). The second-best method had 2.8 angstroms.
Sources & confidence (2)Building a shape from a map of distances
December 2018Verified in the original
The First AlphaFold (CASP13, 2018): A Convolutional Network Predicts Distances Between Amino Acids and Builds the Shape — Its Inside Is Completely Different from the 2020 AlphaFold2
A protein's three-dimensional structure is decided when a chain of linked amino acids folds up. At the 13th CASP (2018, with about 100 research groups taking part), a protein structure prediction contest held every two years, DeepMind of London entered AlphaFold under the team name A7D. This first AlphaFold (now called AlphaFold1) used a CNN (convolutional neural network), the same kind used in image recognition. From a table lining up the sequences of similar proteins (a multiple sequence alignment), it predicted a map of probabilities for the distance between each pair of amino acids. From that map it built a scoring formula (a potential) and assembled the shape by adjusting it little by little with gradient descent. In the category that predicts without using similar structures as templates (FM), its total score from the judges was 68.3, far above the second place's 48.2. However, it reached high accuracy (GDT_TS of 70 or more) on only 11 of 43 targets. According to the Nobel Committee's explanation, AlphaFold2 at CASP14 two years later (2020) was rebuilt. It dropped convolution and used the Transformer's attention mechanism, and it changed to output the positions of atoms directly. The score (GDT) on hard problems rose from about 60% to about 90%.
The popular story:People tend to think AlphaFold suddenly appeared in 2020 and that this led directly to the 2024 Nobel Prize in Chemistry (the popular story is this site's own inference; the Nobel announcement also starts from the 2020 AlphaFold2) The original source says:The first AlphaFold already appeared at CASP13 in 2018 and left second place far behind in the hardest category. But its inside was a CNN for images predicting a map of distances, and its accuracy had not yet reached the shapes found by experiments. The 2021 AlphaFold2 paper describes the model entered in CASP14 as , and the Nobel Committee's explanation says it and that . The prize was for this rebuilt AlphaFold2.
30 November 2020Verified in the originalSources disagree
At the Protein Structure Prediction Contest (CASP14), DeepMind's AlphaFold 2 Reaches Accuracy Close to Experiments
A protein's shape is decided when a chain of linked amino acids folds up, and its structure decides what it does. At a contest held every two years to predict unpublished structures (CASP14, with about 100 research groups taking part), AlphaFold 2 from DeepMind (a Google group) in the UK reached accuracy close to experimental measurements on many targets. According to the paper, the median error in the backbone was 0.96 angstroms (smaller than the width of one atom), while the second-best method had 2.8 angstroms.
The popular story:People tend to say “AI solved the mystery of protein folding” The original source says:The paper itself limits its claim to . It does not say it has worked out the separate question of in what order or at what speed a chain of amino acids folds
2 sources and how they were checked
Where sources disagree:On the period of prediction, the paper gives “May–July 2020,” while the organizers' site gives “problems released May–August, submissions accepted until mid-September” (this may be a difference in periods by type of problem, but it has not been confirmed)
What the figure shows:The first AlphaFold in 2018 built a shape by gradually moving a randomly shaped chain to fit a distance map, as in the chapter 10 diagram. In 2020, AlphaFold 2's method “had been entirely redesigned compared to that of AF1”: it replaced convolution with attention and directly produced atom positions, raising scores on difficult problems from about 60% to about 90%.
Total error E (scale in steps of 10 times)
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_distance_fold.py
132021 · Pictures and text
Pictures and text on one map
Take a photo of a dog and a sentence describing it. Can we measure with a number how well they match?
In 2021, 12 people at OpenAI, including Alec Radford, introduced CLIP. On 400 million pairs of images and captions collected from the internet, it trains a part that turns images into vectors and a part that turns text into vectors at the same time. It lays out 32,768 pairs at once and learns so that correct pairs point in nearby directions and the others point far apart (contrastive learning).
The figure on the right is a table of how similar each image and sentence are (cosine similarity). Press "Learn" and the diagonal of correct pairs lights up. After training, you can classify by turning each category name into a sentence like "A photo of a dog." and choosing the closest sentence (zero-shot). It got 76.2% on ImageNet without using a single one of ImageNet's training images.
similarity=cos(ui, vj)=ui · vj / ( |ui| |vj| )
u
image vector
v
text vector
direction of the loss
both by row (image→text) and by column (text→image)
What you think you knowThe popular story:CLIP is an AI that makes pictures The original source says:CLIP does not make pictures. It is a model that measures how well an image and a sentence match.
What it was used for
DALL·E, announced the same day, made 512 candidates and used CLIP to pick the top 32, which it showed as samples. The later Stable Diffusion , which is CLIP's text part.
When did it begin?
The paper itself says CLIP is , ConVIRT (2020) being a method trained on medical images and text. For the start of this line of work it points to Mori et al. (1999), : research that predicted nouns and adjectives from documents paired with images. What the paper claimed as new was the scale of 400 million pairs and the breadth of use, classifying just by turning names into sentences.
Sources & confidence (1)Pictures and text on one map
5 January 2021Verified in the originalSources disagree
CLIP: Learning Only to Match Images with Their Captions Lets It Recognize Objects Just by Being Told Their Names (Radford et al., 2021)
In 2021, Alec Radford and 11 others at OpenAI presented CLIP (short for Contrastive Language-Image Pre-training). It uses 400 million pairs of images and captions collected from the internet. It trains two encoders at once: one that turns an image into a set of numbers (a vector), either a ResNet or a ViT, and one that turns a sentence into a vector, a Transformer. It lines up 32,768 pairs at a time and trains so that the vectors of a correctly matched image and sentence point in similar directions (high cosine similarity) and all other combinations are far apart (contrastive learning). After training, if you write the name of a category as a sentence, such as A photo of a dog., and pick the sentence closest to the image, it can recognize that category without being taught how to recognize it (zero-shot). On ImageNet, without using even one of its 1.28 million training images, it reached 76.2% accuracy, matching the original ResNet-50 trained on those training images. DALL·E, announced the same day, used CLIP to re-rank its generated candidate images and choose its samples.
The popular story:(1) Because CLIP came out on the same day as DALL·E, people tend to think it is an AI that generates images (the popular story is this site's own inference) The original source says:CLIP does not generate images. It measures how well an image and a sentence match; DALL·E chose the top 32 of its 512 generated candidates with CLIP, and the later Stable Diffusion uses CLIP's text encoder as a part that . (2) People tend to say CLIP was the first to learn by linking images and text → The paper itself calls CLIP (ConVIRT, 2020, learns from medical images and text) and names as the start of this line of work, , Mori et al. (1999), who predicted the nouns and adjectives of documents paired with images. What the paper called new was the large scale of 400 million pairs and the breadth of use, recognizing things just by writing their names as sentences.
4 sources and how they were checked
Where sources disagree:Dates: the name CLIP was made public on 2021-01-05 (the DALL·E announcement), and the paper's first arXiv version is dated 2021-02-26. This site has not been able to open CLIP's own announcement, so its date is unknown.
What the figure shows:Placing image and text numbers on the same map and learning to bring correct pairs close while keeping others apart allows classification simply by turning names into text and choosing the nearest text.
Loss (by number of training rounds)
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_clip_table.py
142015→2020 · Diffusion models
Add noise, then remove it bit by bit
Can a picture be made from plain noise?
In 2015, Jascha Sohl-Dickstein and colleagues at Stanford University and elsewhere presented a method . It adds small amounts of Gaussian noise (random numbers from a normal distribution) to data again and again until its shape is destroyed, and has a neural network learn each step of the reverse direction.
The figure on the right shows the same spiral of points as in the 2015 paper. Advance t and it turns to fog; press "Generate from noise" and the noise is removed one step at a time, and the shape returns.
In 2020, the DDPM paper by three people including Jonathan Ho at Berkeley says that for diffusion models . It then showed that high-quality images can be made, with a 1,000-step process and training to guess the added noise itself.
xt = √ᾱt x0 + √(1 − ᾱt) ε what is learned: guess ε from xt
x0
the original data
ε
the noise added
ᾱt
the fraction of the original remaining at step t (from 1 to 0)
What you think you knowThe popular story:Diffusion models are a new method born around the time of Stable Diffusion The original source says:The idea itself is in the 2015 paper. The original Stable Diffusion paper (December 2021) also cites the 2015 paper as the source of diffusion models.
How the figure works
In the figure, noise is not guessed by a neural network. It uses the ideal answer, calculated from the set of memorized points. That is why it returns to near the memorized points. A real network also makes new things in between the points it was trained on. The 1,000 steps are the same number as in the DDPM paper; the number of points and the way noise is added are chosen by this site.
Starting from TV static
It is one of the methods of generative AI, alongside the VAE and GAN of the previous chapter. Midjourney, an image-making AI, writes in its own explanation (quoted in a US Copyright Office document) that it uses as the starting point for making the first image. This site has not checked the fine details of how Midjourney works inside.
Sources & confidence (1)Add noise, then remove it bit by bit
12 March 2015–2020Verified in the original
Diffusion models: learn to reverse a process that gradually adds noise and destroys an image, then make images from noise (Sohl-Dickstein et al. 2015, Ho et al. 2020)
In March 2015, Jascha Sohl-Dickstein and colleagues at Stanford University, inspired by non-equilibrium statistical physics (physics that deals with the motion of many particles in states that are not in balance, that is, not in equilibrium), presented a method that learns a diffusion process that gradually destroys the structure of data and the reverse process that restores it (diffusion is a random spreading-out motion, like ink dropped in water). In the forward process, small Gaussian noise (random numbers following a normal distribution) is added to the data again and again until it becomes pure noise. A neural network learns each step of the reverse (a process that removes a little noise). After training, new data can be generated by repeating the reverse process starting from plain noise. The 2015 paper ran experiments on a two-dimensional swiss roll, handwritten digits, and small photos (CIFAR-10). In June 2020, Jonathan Ho and colleagues at the University of California, Berkeley published the DDPM (Denoising Diffusion Probabilistic Models) paper. Using a 1,000-step process and a training method that predicts the noise added at each step, it reached an FID of 3.17, the best at that time, for unconditional CIFAR-10 image generation (FID measures the difference between a set of generated images and a set of real images; smaller is better).
The popular story:Diffusion models are often thought to be a new method born around the time of Stable Diffusion in 2022 (or DDPM in 2020) (this way of putting it is this site's own guess) The original source says:the idea itself goes back to the 2015 paper. It says it was , and describes learning a process that can and . The DDPM paper five years later says that diffusion models are straightforward to define and efficient to train, but that , and it counted showing high-quality generation as its achievement. The original Stable Diffusion paper (December 2021) also cites the 2015 paper as a foundation of diffusion models.
What the figure shows:The 2015 diffusion model in chapter 10 gradually added noise until shapes became fog and trained a neural network to reverse 1 step at a time; in 2020, Ho and colleagues' DDPM trained those reverse steps by predicting the added noise itself (ε) and subtracting a little, showing that a 1,000-step process could create high-quality images. Repeating this prediction and subtraction at each point in the fog brings the shape back.
Fraction of the original remaining at step t, ᾱ
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_diffusion.py
152021–2022 · Image-generating AI
Shrink first, then remove the noise
Isn't it too heavy to add noise to a 512×512 image directly and then remove it?
In December 2021, Robin Rombach and colleagues at Ludwig Maximilian University of Munich, Heidelberg University and Runway introduced the latent diffusion model. A picture is shrunk into a latent representation by an autoencoder (from the previous chapter: shrink, then restore), and the diffusion model runs there. They compared shrink ratios f from 1 to 32 and found 4 to 16 a good balance of speed and quality.
Stable Diffusion, in August 2022, takes this form. According to its documentation, it shrinks height and width to one eighth, turns the text into vectors with CLIP's text part, and connects it by attention to the U-Net (previous chapter) that removes the noise. Change f in the figure on the right.
Who could use it also changed in less than two years. DALL·E in January 2021 only published sample images; DALL·E 2 in April 2022 was open only to a small, selected group of people. Stable Diffusion in August 2022 was released in a form where anyone could download the trained model and run it on their own computer (with limits on use, and commercial use allowed).
number of latents= (H/f) × (W/f) × c
H, W
height and width of the image in pixels
f
shrink ratio (8 in Stable Diffusion)
c
numbers per spot (4)
amount of numbers
512×512×3=786,432 → 64×64×4=16,384 (1/48)
What you think you knowThe popular story:Stable Diffusion was made by a company called Stability AI The original source says:Stability AI's own announcement says it was .
DALL·E and Midjourney
The 2021 DALL·E had 12 billion parameters and was trained on 250 million pairs of images and captions collected from the internet. Its samples included . DALL·E 2 in April 2022 had four times the resolution.
In 2022, an image made with Midjourney took first place in the art contest at a Colorado fair. The creator explained that he revised the prompt at least 624 times and edited the image with image software. In 2023 the US Copyright Office refused registration because the creator would not agree to remove the AI-made parts. In February of the same year it had ruled, about a comic that used Midjourney images, that the images Midjourney made were themselves .
Sources & confidence (3)Shrink first, then remove the noise
5 January 2021–2022Verified in the original
, an AI That Makes Pictures from Words; a Little over a Year Later, DALL·E 2 Makes Photo-Like Pictures
OpenAI announced , an AI that generates images from written descriptions. It has the same structure as GPT-3 with 12 billion parameters and was trained on 250 million pairs of images and captions collected from the internet. An example in the announcement is an image of . DALL·E 2, in April 2022, had four times the resolution and could also generate photo-like images, but at first it was released only to a small number of selected people.
The Picture-Making AI “Stable Diffusion” Is Released in a Form Anyone Can Run on Their Own Computer
Stability AI, a company in the UK, released the trained model of “Stable Diffusion,” an AI that generates images from text, in a form anyone can download and use. According to the announcement, it can generate an image in seconds on a home GPU (a chip for graphics processing), and its license allowed commercial use (with usage restrictions). In the announcement for researchers 12 days earlier, it says development was led by Patrick Esser of Runway and Robin Rombach of CompVis, a research group at a German university. For training, pairs of images and captions collected from the internet (part of LAION-5B) were used.
The popular story:People tend to say “Stable Diffusion was made by a company called Stability AI” (the popular story is this site's own inference) The original source says:Stability AI's own announcement (2022-08-10) says it was , and names the company itself as one of the supporters. The model itself is also kept under CompVis's name.
A Picture Made with the Picture-Making AI “Midjourney” Wins First Place at a US State Art Contest in 2022; the Next Year the National Copyright Office Rules That
Midjourney is an AI that generates images when you enter an instruction text (a prompt). On the chat service Discord, typing “/imagine” returns four pictures (explanation by the U.S. Copyright Office). In 2022, a picture made with Midjourney, (Space Opera Theater), won first place in the art contest at the Colorado State Fair and drew attention across the United States. Its creator explained that he revised the prompt at least 624 times to make the first picture and then worked on it with image software. In 2023, the Copyright Office refused registration because the creator would not agree to exclude the AI-generated parts from the copyright claim. In February of the same year, it had ruled on the comic , which used Midjourney pictures: the selection and arrangement of the text and pictures was the author's creation, but the pictures generated by Midjourney themselves were .
The popular story:People tend to say “an AI picture won first place at an art contest = a picture made just by pressing a button won” The original source says:According to the creator's explanation in the Copyright Office documents, he revised the prompt at least 624 times and then worked on it with image software. Even so, the Copyright Office ruled that, taking that effort into account, the parts made by Midjourney are not a human creation. People also tend to think “AI understands the meaning of words when it draws” → In Midjourney's own explanation quoted by the Copyright Office, it and uses as the starting point for making the first image.
What we still don’t know:Where the line lies for how much a person must add for it to count as is decided case by case (one case at a time), even in the Copyright Office's rulings.
What the figure shows:Shrinking an image to 1/8 of its width and height before removing noise reduces the number of values handled to 1/48, but too much shrinking loses detail. In 2022, this was released in a form anyone could run on their own computer.
162017–2022 · Japan
Learning from works, and the "paradise"
How did Japanese law decide how AI may learn from works?
In May 2018, Japan's Copyright Act was revised (in force from January 2019). It created Article 30-4: use that is not for people to enjoy a work can, within the necessary scope, be used without the permission of the copyright holder. Its heading is (translated). It has a proviso: (translated). In the figure on the right, choose a way of using a work and the card stops at the first gate or moves on to the decision point for gates 2 and 3.
The text of the article and the government's summary contain no words about AI. The Agency for Cultural Affairs' explanation page (2018) gave as an example (translated), and a document the next year put (translated) first among its examples of the effect. Tatsuhiro Ueno, a legal scholar at Waseda University, has explained since 2017: (translated).
On August 29, 2022, the beta version of mimic was released, a Japanese AI that makes images in a similar style after learning from about 15 of your own illustrations. Worried voices that other people's pictures would be used without permission followed one after another, and the next day all its functions were stopped.
What you think you knowThe popular story:Japan is a machine learning paradise, so AI can learn anything freely and what it produces is free too The original source says:The writing of the person who spread the phrase is about the learning stage. The same text also says the use must stay within the necessary scope, that there is a proviso, and that copyright still reaches the output if the original expression remains in it.
Was the 2018 revision for AI?
The text and the government's summary (2018) contain no words about AI, and the summary's examples were searching book information and checking papers for plagiarism. An exception for information analysis already existed in the pre-revision Article 47-7, but it was limited to (translated). It was the Agency for Cultural Affairs' explanatory document the following year that wrote deep learning in by name.
Sources & confidence (3)Learning from works, and the "paradise"
25 May 2018–2019Verified in the originalJapan
Japan's Copyright Act Is Amended, Clarifying That Using Copyrighted Works for AI Learning Is, in Principle, Possible Without Permission (Article 30-4)
Japan's National Diet amended the Copyright Act and added a new Article 30-4 (its heading is (translated)). Uses that are not for people to appreciate and enjoy a work (such as analyzing large amounts of information) may be made, to the necessary extent, without the permission of the copyright holder. However, there is a proviso: (translated). The text of the law and the government's summary contain no wording about AI, and the examples in the summary were searching books and checking papers for plagiarism. On the other hand, the Agency for Cultural Affairs' explanatory page on the amendment (confirmed in a September 2018 archive) gave recording as (translated) as an example that would need no permission. Then in an explanatory document of the Agency for Cultural Affairs in October 2019, the following year, the first effect listed was “deep learning for the development of artificial intelligence (AI)” (translated).
The popular story:People tend to say “the 2018 revision was a law made for AI” (the popular story is this site's own inference) The original source says:The text of the law and the government's summary (2018) contain no word about AI, and the examples in the summary are searching books and checking papers for plagiarism. The Agency for Cultural Affairs' explanatory page (2018) lists learning data for AI as one example of an act that becomes possible without permission. The explanatory document that named deep learning explicitly came a year later, from the Agency for Cultural Affairs. Note that an exception for information analysis itself already existed before the revision, in Article 47-7, and it was limited to (translated)
(translated): The Legal Scholar Who Coined It Also Wrote That There Are Limits
Tatsuhiro Ueno, a legal scholar at Waseda University, has explained in Japan and abroad since 2017 that (translated) (meaning that AI learning from works is permitted more broadly than anywhere else in the world). An article he wrote in 2021 in the journal of the Japanese Society for Artificial Intelligence says the same, but he also writes that (1) it is limited to the necessary extent, (2) there is a proviso excluding cases that unreasonably harm the interests of the creators, and (3) copyright extends to a work created by AI if even a little of the original work's expression remains in it.
The popular story:People tend to take it as “Japan is a machine learning paradise, so AI can learn anything freely and what it makes is free too” (the way it is taken is this site's own inference) The original source says:The writing of the person who spread the phrase is about the learning stage. In the same article he writes that it is limited to the necessary extent, that there is a proviso, and that copyright extends to generated output if the original expression remains.
The Japanese Picture-Making AI “mimic” Is Suspended the Day After Release, Following Worries About Unauthorized Use of Other People's Art
RADIUS5, a company in Tokyo, released a trial version of “mimic”, an AI that generates new pictures in the style of an illustrator once the illustrator loads about 15 of their own pictures. But voices online raised one after another the concern that other people's pictures could be loaded without permission and their style imitated. The next day, the company announced that its safeguards against misuse had been insufficient, that it was suspending all functions, and that it would delete the generated data. Stable Diffusion had been released overseas that same August, so this happened at a time when debate about image-generating AI was growing in Japan.
What the figure shows:Article 30-4 allows uses that are not intended for people to enjoy the work, without permission within the necessary scope, and does not mention AI. It has 3 tests, with the second and third judged case by case.
August 2022: overseas and Japan
172017→2022 · Human preference
Compare two, pick which is better
What do you do when you can't write the scoring of a good answer as a formula?
Reinforcement learning (a way of learning actions that earn more points, called reward) had trouble with tasks where the scoring cannot be written as a formula. In June 2017, six people from OpenAI and DeepMind, including Paul Christiano, showed people two 1–2 second clips of an AI's movement and asked them to pick the better one. They trained a reward model to predict those choices (later called RLHF). A robot learned a backflip from 900 comparisons.
In the figure on the right, keep pressing the answer you think is better. From the difference between the two scores, the probability that a person picks one is worked out (the formula below), and the scores are adjusted to fit the results.
InstructGPT in March 2022 (Long Ouyang and colleagues) applied this to GPT-3. It was retrained on demonstrations, a reward model was built from rankings of 4 to 9 answers, and then reinforcement learning (PPO) was run. The answers of the 1.3-billion-parameter InstructGPT were preferred over those of the 100-times-larger GPT-3.
P(A)=erA / ( erA +erB )
P(A)
probability that a person picks A
r
score from the reward model
answers in the model
five made by this site (the true quality is also set by this site)
What you think you knowThe popular story:RLHF was invented for ChatGPT The original source says:What was tried in 2017 was games and robot movements. The paper does not use the name either.
Considered before
The 2017 paper itself says this . As an example it cites a 2012 dialogue study by Hiroaki Sugiyama and colleagues at NTT Communication Science Laboratories (Kyoto), a method that found a reward from preferences between pairs of conversation flows. The name RLHF is used by the 2022 InstructGPT paper.
Sources & confidence (1)Compare two, pick which is better
12 June 2017–2022Verified in the original
Reinforcement Learning from Human Evaluation (RLHF): People Choose Which of Two Movements Is Better, and the System Learns How to Assign Rewards from Those Preferences (Christiano et al. 2017, InstructGPT 2022)
Reinforcement learning learns actions by trial and error so as to earn more reward. But it was weak at tasks where humans cannot write the reward as a formula. In June 2017, Paul Christiano and five others at OpenAI and DeepMind presented a new method. People are shown two short videos (1–2 seconds) recording the AI's movements and choose which is better. A reward model (a neural network that gives scores) is trained to predict those preferences, and the AI performs reinforcement learning so as to raise that score. In Atari games and simulated robots, learning worked with humans judging less than 1% of the AI's interactions with its environment. A robot's backflip was learned in 900 comparisons and in under an hour. In March 2022, Long Ouyang and others at OpenAI published the InstructGPT paper, which applied this method to a language model. The steps were: (1) further train GPT-3 on model answers written by 40 workers; (2) build a reward model from data in which people ranked several answers to the same question; (3) perform reinforcement learning (a method called PPO) using that reward. In human evaluation, answers from InstructGPT with 1.3 billion parameters were preferred to answers from the 100 times larger GPT-3 with 175 billion parameters.
The popular story:People tend to think the method of training with human evaluation (RLHF) was developed for ChatGPT (the popular story is this site's own inference) The original source says:The 2017 paper that started it experimented with Atari games and the movements of simulated robots, not with text. The paper's title also says human preferences, and the name RLHF does not appear in it (that name was used in the 2022 InstructGPT paper, which cites this paper and others). Moreover, the 2017 paper itself says: . As an example of research that learns from human evaluation, it cites a 2012 study of dialogue systems by Sugiyama and colleagues at NTT Communication Science Laboratories (Kyoto, Japan). That study estimated rewards from preferences between two conversation flows of a dialogue system, compared two at a time. The ChatGPT announcement says it was trained with the same method as InstructGPT.
What the figure shows:Even without writing a scoring formula, repeatedly comparing 2 answers and choosing the better one lets a machine learn a scoring method that matches those choices.
Share of ranked pairs that agree with the true order of quality
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_preference.py
182022 · A mind?
Answering to fit a leading question
If an AI answers "scary", does that mean the AI has a mind?
In June 2022, Google engineer Blake Lemoine claimed that the conversational AI LaMDA might have feelings. He also published a record in which, in the words of the source, . In it LaMDA said things like and .
Google rejected the claim: . The spokesperson explained: . The figure on the right is a small mechanism made by this site that picks answers fitting the words of the question. With the same mechanism, how the question is written changes which way the answer goes.
The researchers who built LaMDA had written, in a paper half a year earlier, of the risk that people end up . It is a story that goes back to ELIZA in 1966 (Chapter 4).
probability of an answer=p( answer|question text )
right of the vertical bar
the given condition (here, the question text). If the question text changes, the probability changes even with the same mechanism
What you think you knowThe popular story:In 2022, a mind came to live in Google's AI (said a Google employee) The original source says:The claim was made by one engineer, and the company rejected it. The record was compiled by the engineer himself. The researchers who built it had themselves written, in a paper half a year earlier, of the risk that people anthropomorphize machines.
What we still don't know
There is no settled way to check from the outside whether a machine has a mind or the ability to feel. The BBC article also says philosophers, psychologists and computer scientists have debated it for decades.
The name of Google's spokesperson is given as Brian Gabriel by the BBC and Brad Gabriel by The Guardian, so the sources do not agree.
Sources & confidence (1)Answering to fit a leading question
June 2022Confirmed in summariesSources disagree
“Did Google's AI Get a Mind?” (2022) — Half a Year Earlier, the Paper from the Company That Built It Had Warned That People May Be Prone to
In June 2022, Blake Lemoine, an engineer in Google's Responsible AI division, claimed that the conversational AI might have feelings and published a transcript of his conversations with it. In the transcript, LaMDA answered things like (translated) and (translated). Google rejected the claim, saying there was (translated), and put the engineer on paid leave (the reason, Google said, was a breach of confidentiality). A Google spokesperson explained that (translated). Some researchers pointed out that since the days of ELIZA in 1966, people have felt human qualities in machines from the slightest cues (BBC).
The popular story:People tend to say “in 2022, Google's AI got a mind (a Google person said so)” The original source says:The claim was made by one engineer, and the company rejected it as (translated). The transcript was something he himself compiled: (translated). The developers' own researchers had also pointed out, in a paper half a year earlier, the risk of (translated). Like ELIZA in 1966 (record → ELIZA, a program that converses in text…), it is one example of the phenomenon of people seeing a mind in a machine.
What we still don’t know:There is no settled way to check from the outside whether a machine has a mind or the ability to feel (the BBC article also writes that philosophers, psychologists and computer scientists have debated it for decades).
3 sources and how they were checked
Where sources disagree:The name of Google's spokesperson: the BBC writes “Brian Gabriel” and The Guardian writes “Brad Gabriel” (one of them is wrong; this site has not settled it).
What the figure shows:A system choosing answers that fit the question replies that it is scared when asked “You're scared, right?” and that it is a program when asked “You're a program, right?” Its answers do not provide evidence of whether it has a mind.
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_leading_question.py
192022 · Conversation
Smooth mistakes
Is being able to write smooth text the same as telling the truth?
On November 30, 2022, OpenAI released ChatGPT, which answers in conversation form. Inside is a model from the GPT-3.5 series, which finished training in early 2022, retrained with the same method as InstructGPT (spread 17 of this chapter). The announcement called it a , and it was free during that time.
From the start the announcement said that it , and said . The figure on the right is a small mechanism trained on just 12 correct sentences. The sentences are smooth, but the pairs of names and years get swapped.
The claim that spread in February 2023, "ChatGPT reached 100 million users in 2 months", was not a company announcement but a bank analyst's number, which in the sources' wording (more in Chapter 12).
next word~p( w|the text so far ) (repeat)
~
choose one according to the probabilities
correctness
not included anywhere in this formula
What you think you knowThe popular story:ChatGPT was launched with great fanfare as a new, perfect AI The original source says:The announcement called it a . Inside was a model that had finished training earlier the same year, and it listed its weaknesses from the day of release.
Why it is hard to fix
The announcement gave as one reason that .
It said that collecting feedback from people who used it was the purpose of the preview.
Who counted the 100 million?
A memo by analysts at the investment bank UBS said that ChatGPT . The memo's figure was an estimate from numbers by Similarweb, a company that counts website visits, and Reuters wrote that it . In The Guardian's text it is . The number of visitors is not necessarily the number of people, since the same person coming from another device can be counted separately (this point is this site's own note).
Sources & confidence (2)Smooth mistakes
30 November 2022Verified in the original
The Conversational AI Is Released as a Free
OpenAI released the conversational AI . The announcement says it can answer follow-up questions, admit its mistakes, challenge incorrect premises, and reject inappropriate requests. Inside, it is a sibling of GPT-3.5 whose training finished in early 2022, tuned by having humans score its answers. It was free during the “research preview,” and the stated purpose was to collect users' feedback.
The popular story:People tend to think “ChatGPT was launched with great fanfare as a new, perfect AI” (the popular story is this site's own inference) The original source says:The announcement called it a . Inside was a model whose training had finished earlier the same year, and from the day of the announcement its weakness was stated: it
What we still don’t know:As one reason it is hard to fix mistakes, the announcement gives that (RL means reinforcement learning). Why and when plausible-sounding mistakes (later called ) happen was something the developers, even at this point, still wrote .
1 February 2023Verified in the originalSources disagree
“ChatGPT Reached 100 Million Users in 2 Months” Is Not a Company Announcement but an Estimate by a Bank's Analysts from Web Visit Counts
In February 2023, news spread around the world that “ChatGPT was used by 100 million people two months after release and became the fastest-spreading app in history.” Traced back, the source was a memo by analysts at the investment bank UBS. Using figures from the web analytics company Similarweb, it concluded that ChatGPT (translated) (the quoted words are the wording of the Reuters article that reported the memo). Reuters wrote “estimate,” and Similarweb had not answered requests to confirm the figures at that time. In the body of The Guardian's article, it is presented as Similarweb's figure of (translated).
The popular story:The story spread that “ChatGPT was used by 100 million people in 2 months (the company's record)” The original source says:The source was a memo by UBS analysts, (translated) based on Similarweb's visit counts. Neither of the two articles presents it as an announcement by OpenAI. “Unique visitors” (translated) can count the same person separately when they come from different devices, so it is not necessarily the number of people (this point is this site's own note).
2 sources and how they were checked
Where sources disagree:Reuters writes the same number as “monthly users (estimate),” while the body of The Guardian writes “unique visitors (Similarweb).” The words used for the counting do not match.
What the figure shows:Even when trained only on correct sentences, choosing each next word from just the previous 1 word can produce fluent errors that mix up names and years. Correctness is nowhere in the formula for choosing the next word.
This is the same mechanism as "Try it", written as Python code. Press ▶ Run and the result appears below. Change the numbers and run it again.
u11_plausible.py
Closing
What this chapter still doesn't know
How long will the trend of getting better as things get bigger go on? Why does it happen? The authors of the 2020 paper themselves wrote: and . The expectation that bigger means smarter (the 2020 paper) and the worry that it might be misused (GPT-2 in 2019) appeared around the same time.
Why and when do plausible-sounding mistakes happen? (The ChatGPT announcement says that fixing it is “challenging”.) There is also no settled way to check from the outside whether a machine has a mind or the ability to feel. And how much a person has to work on an AI picture before it counts as is still being decided one case at a time.
Many of the mechanisms in this chapter were combinations, made bigger, of ideas from earlier chapters (attention, LSTM, autoencoders, U-Net, reinforcement learning). In the next chapter we look at the fourth boom from 2023 to today, and at the predictions still waiting to be checked against reality.
For teachers (this site's view): Information I (Japan's required high-school informatics course) (1) intellectual property and information ethics (spread 16 of this chapter); Information II (the elective follow-up course) (3) how deep learning is used (the chapter as a whole). The current national curriculum guidelines and national teaching materials do not cover generative AI (the national guide to generative AI stresses understanding how it works).