The Paper That Put the “T” in ChatGPT
A crane lands by the marsh. A crane lifts a piano through a third-floor window. If you’re translating those sentences, you’d better figure out which crane has feathers before you get to the piano.
You did it by noticing a few words around crane. In 2017, eight researchers gave a computer a way to look for clues like that anywhere in a sentence. They built a model, a program that learns patterns from examples, and came up with a new way to organize its calculations. They called the design the Transformer. Years later, its name would supply the T in ChatGPT, the program that writes back when you ask it a question.
The job that first put the Transformer to the test was translation. The team gave its paper a title with a little swagger, Attention Is All You Need.
The trouble with waiting your turn
Picture a translator working on a long sentence. The subject appears near the start. Then come a name, a place, a date and a bit about the weather. By the time the translator reaches the verb, it still matters who did what.
One popular kind of model worked through a sentence in order. Each step passed along a bundle of numbers that stood for what it had read so far. The calculation for word ten had to wait for word nine, which had to wait for word eight. Give the job to a room full of fast chips and some of those chips still had to wait.
Translation programs already used a trick called attention. While choosing the next word of a translation, a program could give helpful words in the original sentence more say. The Transformer also looked for clues by comparing words within the original sentence. It could make many of those comparisons at once.
During practice, the time those chips spent waiting could add up. The team gave it pairs of sentences that said the same thing in two languages. With each round of practice, the software adjusted numbers in the model to improve its guesses. That process is called training. With the Transformer, several chips could work on different parts of the same training sentence at once.
Which crane gets the piano?
Start with the word crane. The Transformer represents the words, or smaller pieces of words, with numbers. The math happens in stages called layers. Within a layer, the model uses the numbers for crane to score how closely each piece relates to it. A piece with a high score has more influence on how the model represents crane at the next stage. The clues come from inside the same sentence. That’s the “self” in self-attention.
In our piano sentence, lifts is the kind of clue that could help. In the marsh sentence, lands points the other way. Word order matters, too. “The crane lifted the piano” would make a different news story if the piano lifted the crane. The researchers gave the model a signal for each piece’s position so it could use that difference.
How Attention Tells Two Meanings of a Word Apart
The team trained its larger model on eight graphics chips for three and a half days. On an English-to-German translation test, it beat the best scores reported up to then, including those from groups of models working together.
How the T got into GPT
In 2018, researchers at OpenAI, the company that would later make ChatGPT, used the part of the design that predicts the next piece of text. They gave their model a large collection of writing to practice on. Then they gave it extra practice on jobs such as answering questions.
The name GPT stands for generative pre-trained transformer. It generates new text, it gets an initial round of practice before learning a particular job, and it uses a design that grew out of that translation work.
- Sebastian Raschka walks Python programmers through building a small language model.
- You can train it on text and then watch it generate new text, one piece at a time.
Try asking a chatbot to translate “The crane at the end of the road was washing its feathers.” Like the original translation program, it writes an answer one piece at a time. But it can use a clue at the very end of your sentence to help pick the first word of its reply. By the time it has to choose which crane you meant, it’s already read about the feathers.
AI Translation Can Sound Right and Get the Meaning Wrong
An Engineer Quit Google. A $2.7 Billion Deal Brought Him Back.
QUOTE:
"Amateurs hack systems, professionals hack people."
