How Large Language Models Generate Text
Part of the Prompt Engineering course
You now know what a prompt and a completion are, and that the same prompt can come back differently worded each time. This lesson shows you what happens on the other side of that prompt: how the model actually turns your words into a reply. Understanding the mechanism now will make the five principles of prompting, coming up next, feel less like rules to memorize and more like consequences of how the machine works.
Before a model sees your prompt, the text is chopped into small chunks called tokens, which are subword pieces such as a short word, part of a longer word, or a single punctuation mark. The process of cutting text into these chunks is called tokenization. ...
Want to learn Prompt Engineering How Large Language Models Generate Text in a real environment?
Click below, get a fresh Linux box with Prompt Engineering ready to go, and work through How Large Language Models Generate Text hands-on with an AI tutor that knows your code.
Start this lessonHow Large Language Models Generate TextWhat you'll learn
- Tokens and tokenization
- Next-token prediction
- Temperature and top-p sampling
- Context window
- Why models hallucinate
Read this lesson in your language
All lessons in this course
11 lessons- 1What a Prompt Is20 min
- 2How Large Language Models Generate Text30 min
- 3The Five Principles of Prompting30 min
- 4Standard Practices for Text Generation35 min
- 5Prompt Templates and Function Calling35 min
- 6Vector Databases and Retrieval-Augmented Generation40 min
- 7Autonomous Agents: Memory and Tools40 min
- 8How Diffusion Models Generate Images30 min
- 9Standard Practices for Image Generation35 min
- 10Advanced Image Techniques: Inpainting, Outpainting, and ControlNet35 min
- 11Building AI-Powered Applications40 min
