How do large language models like GPT-4 actually generate text?

Large language models like GPT-4 are like super-smart text detectives who can guess what comes next in a story.

Imagine you're reading a book, and someone covers the last few pages with a blanket, all you see is the end of a sentence. You have to figure out what happens next based on what you've read so far. That's kind of how GPT-4 works! It looks at the words it already knows and tries to guess what comes next, just like you would.

How It Thinks

Inside GPT-4 is a big brain made up of lots of little helpers. These helpers look at every word, letter by letter, and remember patterns they've seen before, like how "The cat sat on the mat" usually goes together.

When it wants to write something new, it starts with one word, then adds another, and keeps going until it makes a whole sentence or even a paragraph. It’s like playing a game of “What comes next?” over and over again, but with hundreds of billions of examples to help it out!

Take the quiz →

Examples

  1. A child asks how a robot can write a story without knowing what it's saying.
  2. A simple example: the robot guesses the next word in a sentence, like a game of telephone.
  3. The robot learns from many books and uses that knowledge to make up new sentences.

Ask a question

See also

Discussion

Recent activity