From pretraining to prediction / 1 of 9
How generative models work
What you’ll learn
- Explain the main idea of “How generative models work” in your own words.
- Trace a concrete example and identify the assumptions behind it.
- Apply the principle in a practice problem and recognize a common failure.
The idea, intuitively
Generative models learn structure in data so they can produce new samples. Autoregressive, diffusion, and latent-variable models make different assumptions and generate through different procedures. Their outputs reflect both training patterns and generation settings.
Separate what a model learned during training from what an application supplies at runtime. Generation settings change how outputs are selected, while architecture and precision affect resource needs. The labs use small transparent calculations so you can understand mechanisms without downloading a model or calling an API.
Under the hood
Autoregressive generation samples one conditional token at a time. Diffusion iteratively denoises a sample. A variational autoencoder decodes a latent variable. Each approach trades off sampling cost, representation, and objective.
A plausible sample is not evidence of factual correctness or permission to reuse training content.
A worked example
Text completion and image denoising both generate data, but their intermediate states and stopping rules differ.
How to use this way of thinking
Compare one setting at a time using fixed inputs and a written quality rubric. Record the checkpoint, tokenizer, decoding options, and hardware. Report failures and resource costs alongside successful examples. Do not infer factual reliability from confidence, fluency, or parameter count alone.
Try it yourself
Contrast a diffusion step with a text-generation step.
Key takeaways
- Repeated conditional next-token selection
- A plausible sample is not evidence of factual correctness or permission to reuse training content.
- Check the assumptions with a small example before applying this idea to a larger system.
Check your understanding
Use feedback to learn. Quiz scores and lesson completion are tracked separately.
Go to lesson completionFurther reading
Original papers and reference material for this school. External resources may be in English and require internet access.
Hugging Face: generation configuration (opens a new tab)llama.cpp project (opens a new tab)Finish this lesson
Mark this lesson complete when you’re ready to continue.