READ IN CLOUD READER →
CHAPTER 5 OF 6

Image Generation in the Generative AI Family

From the monograph How AI Creates Images by Leo Odåsnac · ~8 min read (1,453 words)
auto_stories Open this chapter in the interactive reading room
CLOUD READER →

Next-Token Prediction and Iterative Denoising

A sign on the café may look almost right while spelling its name incorrectly. That oddity points to a useful distinction: a model’s training can teach it patterns in language and images, but the way it generates them depends on the kind of system it is.

A common language model works like a writer adding one small piece at a time. Given “The red bicycle leaned against,” it estimates which next token is likely, selects one, then uses the growing sentence to estimate the next. The process repeats until the answer is finished. The model’s learned parameters—adjusted during training on vast amounts of text—shape each prediction. It does not usually draft the whole answer in one simultaneous leap.

A diffusion image model follows a different route. It starts from a noisy representation and iteratively adjusts it, guided by the prompt. For our example, those updates steer the representation toward a rainy street, a blue café, and a red bicycle. The system is not normally choosing a sequence of words or painting one finished pixel after another. Many calculations refine a shared image representation; a decoder can then turn that representation into pixels. The prompt guides the process; it does not blueprint every pixel.

The difference is like the difference between writing a sentence from left to right and revising a blurry sketch in rounds. The comparison is helpful, but not exact: diffusion steps do not necessarily correspond to visible stages in which the bicycle becomes clearer to a person watching. They are calculations that move the representation toward one the model has learned is more image-like and more consistent with the prompt.

Both methods nevertheless share important foundations. Each has learned parameters shaped by training data and an objective that rewards useful predictions. Their generation procedures differ: one extends a sequence, while the other iteratively transforms an image representation.

This also clarifies why “AI predicts” can describe both systems without meaning they do the same thing. The language model predicts the next token in an ordered stream. A diffusion model predicts updates to a representation over iterative steps. One extends a sequence; the other transforms a whole representation. Those updates follow the model and sampling procedure; they are not a general-purpose image-quality judgment.

There are exceptions to the broad contrast. Some image systems do generate image tokens in an autoregressive sequence, and some combine different approaches. But the familiar text model’s next-token method is not the same mechanism as diffusion. For the bicycle scene, the prompt can guide either kind of system toward similar subject matter; the route from instruction to finished picture is what differs.

Flow Matching and Other Routes to an Image

The contrast between extending a word sequence and repeatedly refining a noisy image is useful, but it is not the whole map. Researchers have developed several ways to move from a simple starting point—often random noise—to the complicated patterns found in images.

One family is called flow matching. Picture a cloud of random starting points and, elsewhere, the much more structured distribution of real images. A flow-matching model learns a vector field—a set of directions for movement—that connects starting points to image-like outcomes. During generation, it begins with a random sample and repeatedly follows those learned directions, gradually carrying that sample toward a plausible image representation.

The word flow is apt: the model learns a direction and speed of travel for each stage. The boundary with diffusion is not absolute. Flow matching can train vector fields along diffusion paths as well as other paths, and diffusion models can also be sampled through deterministic flows. The useful distinction concerns the training target and chosen path, rather than two entirely separate kinds of machine. [6] The bicycle outside the blue café might emerge through either route. Neither method retrieves a matching photograph; each uses learned patterns to steer a new sample toward an image that fits the prompt.

There are also systems that generate images autoregressively. They first represent an image as a sequence of discrete or continuous image tokens, then predict those tokens in an order, much as a language model predicts words. Other systems are hybrid: they may use autoregressive steps for one part of the task and diffusion-like refinement for another. “Image generation” names the destination, not a single road. An early text-to-image transformer, for example, generated discrete image tokens autoregressively. [7]

A different distinction matters here: the model’s architecture is not the same as its generation method. Some diffusion systems use a transformer as the neural-network architecture that processes the noisy image representation and prompt. These are often called diffusion transformers. The transformer supplies the machinery for combining information; diffusion supplies the denoising-based generative process. A transformer does not automatically mean next-token generation, any more than a bicycle frame tells you which road it will take. [8]

So the durable picture is a family of methods. Some generate by iterative denoising, some by learned flows, some by predicting image tokens in sequence, and some mix approaches. Their shared challenge is to turn a compact description and a starting sample into a structured picture. The route differs; the red bicycle still has to look like a bicycle, and the rain still has to land somewhere believable.

Why the Breakthroughs Arrived Together

The early-2020s breakthroughs were a convergence, not a simultaneous invention of every ingredient. The 2020 denoising diffusion work, the 2021 autoregressive text-to-image work, and latent diffusion presented at CVPR 2022 illustrate distinct routes advancing within a short period. Many influential diffusion systems used U-Net networks with attention; diffusion transformers expanded the architectural options. Images did not become possible merely because someone applied an LLM unchanged to pixels. [2] [7] [3] [8]

Making these systems useful required more than choosing a clever generation method. Several ingredients matured together, each making the others more useful.

Start with examples. A model trained on many images and their associated text can encounter bicycles in different positions, lighting, weather, and settings. The variety matters: a red bicycle outside a blue café is not one fixed picture to memorize, but a combination of visual patterns that may recur across many scenes. Large datasets give models more chances to learn those patterns and the relationships between words and visual features. They also bring limitations: data can be uneven, noisy, or biased, and sheer quantity does not guarantee quality.

Then there is computing power. Training a large neural network over enormous collections of data requires substantial computation. More capable hardware and more efficient ways to distribute work made it practical to train larger systems for longer. That gave researchers room to test models with more parameters and more examples. In many settings, increasing scale improved performance—but not by magic, and not without limits. A bigger model cannot reliably learn what its data or training objective fails to teach it.

Architecture helped organize the learning. Transformers, already familiar from language models, provide flexible ways to relate information across a sequence or representation. In an image system, a transformer may help connect prompt words to relevant visual features or process patches of an image. But the architecture is not the whole recipe. A transformer can be used within different generation methods; it does not dictate whether the system predicts image pieces one at a time, denoises a representation, or follows a learned flow.

A further ingredient was the ability to build useful internal representations. Instead of treating every pixel as an isolated fact, models can learn compact patterns that capture recurring structures: edges, textures, objects, and arrangements. In language, representations connect words through their uses and relationships. In image generation, learned visual representations make it possible to work with complex scenes without planning every pixel independently. Text representations can then condition visual representations through learned connections, so “rainy street” can guide more than a literal search for the word rain.

Finally, researchers developed training objectives that gave models a workable learning task. Predicting missing or future information, learning to denoise, and learning a flow each provide different ways to shape a model’s behavior. These objectives turn a vague ambition—“make a convincing image”—into repeated training signals the system can improve against. The objective, data, architecture, and scale must fit together: a powerful model with a poor learning task is a very expensive way to be confused.

The same broad convergence helped language and image generation, though their data and generation procedures differ. More data, compute, scalable architectures, useful representations, and effective objectives reinforced one another. No single invention suddenly created the whole field. Progress came when enough parts of the system could advance together—and when researchers learned how to make those parts cooperate. That is why the red bicycle can now emerge from noise, while a sentence can unfold one token at a time: related advances, distinct mechanisms, shared enabling conditions.

FOUNDATIONS & DOCUMENTATION

Sources Cited in This Chapter

  1. Jonathan Ho, Ajay Jain, Pieter Abbeel. Denoising Diffusion Probabilistic Models. 2020. arXiv:2006.11239. ↩
  2. Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Björn Ommer. High-Resolution Image Synthesis with Latent Diffusion Models. CVPR 2022. arXiv:2112.10752. ↩
  3. Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, Matt Le. Flow Matching for Generative Modeling. 2022; revised 2023. arXiv:2210.02747. ↩
  4. Aditya Ramesh et al. Zero-Shot Text-to-Image Generation. 2021. arXiv:2102.12092. ↩
  5. William Peebles, Saining Xie. Scalable Diffusion Models with Transformers. 2022; revised 2023. arXiv:2212.09748. ↩
READING ROOM ACCESS

Continue in the Knowelia Cloud Reader

Enjoy personalized typography, distraction-free reading, shelf syncing, and offline library access for How AI Creates Images.