generate() extends an input prompt or model state with generated output. For causal language models, it repeatedly produces text according to a configured sampling strategy; related generative models can use it to produce images. section 16.3.1 section 17.2.6
Prompting for useful continuations
A short, vague prompt can produce plausible but unhelpful text. Structuring the prompt as the beginning of a brownie recipe makes the intended continuation clearer, producing instructions such as melting butter and sugar before adding eggs and vanilla. section 16.3.1
Common uses include:
- Generate text from a prompt with a causal language model. section 16.3.1
- Generate images at the end of each training epoch and inspect them in a grid. section 17.2.6

