Training: learning from examples

Generative AI models are trained by exposing them to large datasets and optimizing them to predict or reconstruct their training data. For language models, training typically involves next-token prediction: given a sequence of text, learn to predict the next token. Doing this across billions of examples causes the model to learn the statistical structure of language — grammar, factual associations, reasoning patterns, and stylistic conventions — as a byproduct of becoming good at prediction. For image generation models using diffusion, training involves learning to reverse a process that progressively adds noise to images, so the trained model can start from noise and iteratively refine it into a realistic image. The model does not explicitly learn rules; it learns a compressed representation of patterns in data.

Inference: generating from learned patterns

At inference time, a generative model takes a prompt or conditioning input and uses its learned patterns to produce output. For a language model, the process is autoregressive: the model generates one token at a time, with each token conditioned on the prompt and all previously generated tokens. Sampling temperature controls the randomness of token selection — lower temperature produces more predictable, focused output; higher temperature produces more varied, sometimes creative output. For image generation models, inference typically involves iterative denoising steps, starting from random noise and applying the learned denoising function repeatedly until an image emerges that matches the conditioning prompt. The number of steps, the guidance strength, and other parameters affect the quality and character of the output.

Alignment: shaping behavior through additional training

Base models trained purely on next-token prediction produce outputs that follow the statistical patterns of their training data, which may not be safe, helpful, or appropriately formatted for use as an assistant. Alignment techniques — particularly reinforcement learning from human feedback (RLHF) and related approaches — add a second training stage that teaches the model to produce outputs that humans rate as preferable: helpful, honest, and avoiding harmful content. This alignment training is what turns a base language model into a usable assistant that follows instructions, refuses harmful requests, and produces structured responses rather than raw statistical continuations. The alignment process introduces its own limitations and failure modes, but it is what makes deployed language models substantially different from the raw models that emerge from pretraining.