Generative AI · Beginner level

Beginner level · Module 3: Introduction to Large Language Models · Lesson 2 of 3

Context Windows and Temperature

Learners see how much text a model can consider at once, what happens when it is exceeded, and how temperature changes creativity and consistency.

In this lesson you will

  • Explain context windows
  • Explain temperature and its effects

Key concepts

context windowtruncationtemperaturecreativity vs consistencyrepeatability

The lesson

The context window is the amount of text (in tokens) the model can consider at once: your instructions, documents and the conversation so far. If it is exceeded, older content is dropped or the request fails.

Temperature controls randomness. Low temperature gives more predictable, consistent text (good for summaries and facts); higher temperature gives more varied text (good for brainstorming slogans).

Because of randomness, the same prompt can give different answers. For important work, keep the prompt and output, and check the final version.

Step by step

  1. Ask for five slogan ideas twice and compare.
  2. If the tool allows, compare a low and a high temperature setting (or use the offline pack).
  3. Paste a very long document and observe what is missed.
  4. Write when to prefer low temperature.

Practice activity

Run a consistency experiment and write guidance on temperature for different tasks.

Expected result: Observed differences and sensible guidance.

Check your understanding

  1. What is the context window?

    Show answer

    The amount of text the model can consider at once.

  2. Which temperature suits a factual summary?

    Show answer

    A low temperature.

Further learning

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.