Skip to content
Learn Motion
ExploreHow it worksMembership
Log in
Learn Motion

How Generative AI Creates Text, Images, and Videos from a Prompt

1The Shared Idea Behind All Generative AI2How a Prompt Becomes an Instruction3Generating Text: One Token at a Time4Generating Images: From Noise to Picture5Generating Video: Adding Time6Comparing the Three Modalities and Judging Outputs
Generating Text: One Token at a Time

The Loop That Writes

1 / 4
Watch the cycle rather than the words. The context box on the left holds everything written so far. From it, the model produces a row of candidate tokens with different likelihoods, and one is selected and appended to the right. The important move is what happens next: that appended token slides back into the context box, so the following round is scored against a slightly longer history. Nothing in this loop knows where the sentence is going. The ending emerges because each round narrows what fits, and the loop stops only when a stop condition fires.
0:00 / 0:00

A language model does not draft a whole answer and then hand it over. It runs a short cycle over and over. In each round it looks at everything written so far, assigns a probability to every token that could come next, picks one, and appends it. The appended token then becomes part of the input for the next round.

This is why generation feels like watching text appear rather than receiving a finished document. The model has no plan for the sentence's end when it writes the first word; the ending is decided later, one choice at a time, each choice made in the light of the choices already made. A stop condition, such as a special end-of-sequence token or a length limit, is what finally breaks the loop.

Previous1 / 4Next

Learn Motion

Generate a course. Learn it properly.

Operated by Wuhan Daoyin Technology Co., Ltd.

Contact: [email protected]
Privacy PolicyTerms of Service

© 2026 Learn Motion