Controlling Generation

Module 3, Lecture 3.3 | Working with LLMs in Practice

This lecture covers the parameters that control how an LLM generates its response — temperature, top-k, top-p, and max tokens. Temperature is the most important lever for agent development: low values produce reliable, deterministic behavior; high values introduce creative variation. The lecture explains how each parameter works, demonstrates their effects with concrete examples and runnable scripts, and provides practical defaults for agent work. The key takeaway is one of proportion: generation parameters are worth understanding and setting correctly, but the real work of agent engineering happens in the context.

Read the full lecture narrative

Additional Resources