How does a large language model generate coherent text?

A large language model is like a super-smart writer who knows how sentences and stories work, and it can make up new ones by following patterns it has learned.

Imagine you're playing with building blocks, and each block has letters on it. A language model is like someone who has seen so many different buildings made from these blocks that they know all the rules of how to stack them together in a way that makes sense, even if they've never seen that exact building before.

How It Knows What Comes Next

The model looks at what’s already been written and guesses what might come next, like you guessing the next word in a story. It uses patterns it has learned from reading millions of sentences, just like how you learn to speak by listening to people around you talk every day.

How It Makes Whole Sentences

Once it knows what comes next, it keeps going, adding one piece at a time, just like building a tower block by block. It doesn’t stop until the sentence or story feels complete, and that’s how it can write whole paragraphs, even if it has never seen them before!

Take the quiz →

Examples

  1. A storybook reads aloud in a simple, consistent way.
  2. A robot guesses the next word in a sentence based on what it has heard before.

Ask a question

See also

Discussion

Recent activity