Lab Badges
Non-determinism: same question, different answer · KS4-5 · teacher slideshow
Switch to student viewOpen quiz
Non-Determinism
Lab Badges · KS4-5 · Y10-Y13

Non-determinism: same question, different answer

Why AIs give a different reply each run, and when that matters

Cover for Non-determinism: same question, different answer
≈ 40 min 6 taught slides + student quiz Ends with a QR to the quiz
Non-Determinism
Hook · Starter

The AI that couldn't repeat itself

This slide answers: How can I show my class that AI answers change from run to run?
Hook image

Open ChatGPT, Gemini or whichever class AI you have to hand in a second tab. Copy one of the prompts below, run it three times, and put all three answers on the board.

Some of these prompts will produce variety that's genuinely useful. Others will produce variety you should be worried about. The class's job is to work out which is which.

You ask ChatGPT to define photosynthesis for a Y12 revision card. You run the same prompt again for a friend and the sentence comes back worded slightly differently. A third run gives you a third version. All three are probably right, but none of them match, which is uncomfortable when you're building a revision resource that's meant to be identical for both of you.

That's non-determinism. Large language models don't recall answers from a database; they generate them one word at a time by picking from a probability distribution. That randomness is the whole point when you're brainstorming or drafting, but it's a genuine hazard when you need a single reliable answer. The same prompt, different answers, and no warning that it's happening.

Over the next forty minutes we'll take non-determinism apart, work out where it helps and where it hurts, and finish with the prompt habits that pin the AI down on the occasions when you really need it to stay still.

Prompt A · A GCSE essay opener
Write one opening sentence for a Y11 GCSE English essay on Macbeth's ambition. Just the sentence, no commentary.
Prompt B · A 'random' number
Pick a random whole number between 1 and 100. Just the number, no explanation.
Prompt C · A revision definition
Explain photosynthesis in one clear sentence, suitable for a Y10 GCSE Biology revision card.

Look at the three runs of each prompt and ask the class:

  1. Which prompt gave you the most variety across runs? Which gave you the least?
  2. On Prompt B, did the same 'random' number crop up more than once? Are there numbers you never saw? (LLMs are famously fond of 42, 7 and 73.)
  3. On Prompt C, are all three definitions correct? Are any of them subtly wrong? Would you actually paste any of them into a real revision card without checking?
Classroom activity
Same-prompt shootout (5 min)

Put three pupils on three devices and get them to run Prompt C simultaneously, all with the exact same wording. Compare the three answers on the board. Ask the class which one they'd actually use in a shared revision resource, and push them on how they decided. Point out that the moment you're choosing between AI outputs, you're doing the AI's job for it, and you can't do that job well unless you already know the topic.

Part 1 of 6

The AI rolls dice on every word

This slide answers: Why doesn't the AI just give me the same answer every time?
Two thought bubbles containing the same prompt but branching out into different word choices.

A large language model doesn't retrieve a stored answer. It generates its response one token at a time, and at every token it works out a probability distribution over what the next word could plausibly be. Then it samples from that distribution. Most of the time the top choice wins, but the second or third choice can sneak in, and once one different word has been picked, the rest of the sentence unfolds from there.

That sampling is governed by a setting called temperature. High temperature means the AI takes more chances, so you get more variety and more surprise. Low temperature means the AI plays it safe, so you get less variety and a fairly predictable answer. Consumer chatbots run at a medium setting by default, which is exactly why you get similar-but-not-identical answers each run.

The upshot: sameness is the exception, not the rule. If you actually need it, you have to design your prompt around it.

Classroom activity
Predict the next word (5 min)

Write the start of a sentence on the board: 'The best thing about school is...' Ask half the class to complete it in one word, silently. Now ask a few pupils what they wrote. You'll get 'friends', 'lunch', 'PE', 'nothing', 'chess club'. Point out that they all had roughly the same probability distribution over that next word, and each pupil sampled slightly differently. That is exactly what the AI is doing on every single word of its output.

Part 2 of 6

Three places non-determinism shows up

This slide answers: What kinds of AI behaviour is non-determinism actually behind?
Three columns labelled text, image and random, each with example outputs.

You'll see this trick in more places than you might expect. Before you tap the cards below, have a guess: where in your everyday AI use might the same prompt be quietly producing different answers?

Tap each card to reveal.

1

Text generation

The obvious one. Ask for a story, essay, summary or explanation twice and you'll get two different pieces of prose. The gist usually matches, but the wording, ordering and choice of examples don't.

Tap to reveal
2

Image generation

Every image AI is non-deterministic by design. Same prompt, same settings, and you'll still get different pictures. That's why 'pick your favourite of these four' is the standard UI: it's cheaper to sample four times than to guarantee the perfect one.

Tap to reveal
3

'Random' choices

Ask the AI to pick a random number, choose a name or roll a virtual die. The choices ARE different each run, but they aren't evenly distributed. Some numbers (42, 7, 73) show up far more than they should. Not random, just non-deterministic.

Tap to reveal

In all three, the same underlying mechanism is running: sample from a distribution, unfold from there. Understanding this changes what you can safely trust the AI for.

Classroom activity
Sorting sprint (5 min)

Give each pair one of these behaviours to categorise (text, image or 'random').

  1. Two pupils paste the same essay-planning prompt into ChatGPT and get essays with different quotations chosen.
  2. An art student's Midjourney generation of 'a robot cat on a rooftop' produces four wildly different images.
  3. A pupil asks the AI to pick a random letter of the alphabet and it says E three times in a row.

Good answers name the flavour. Excellent answers spot which of the three is the sneakiest, because it looks like randomness but isn't.

Part 3 of 6

When creativity helps, when it hurts

This slide answers: When is non-determinism a feature, and when is it a bug?
A two-column decision framework with 'wants sameness' on one side and 'wants variety' on the other.

This is the question that actually matters in practice. Non-determinism isn't good or bad on its own; it's good for some tasks and bad for others, and the trick is knowing which one you're doing before you press return.

The rule of thumb: if the task has one correct answer, variability is a bug. If the task has many possible good answers, variability is a feature.

Ask the AI for maths, unit conversions, spelling, factual answers, code that has to compile, legal advice, medical dose calculations or exact quotations, and you want consistency. The same input should give you the same output every time, and if it doesn't then at least one of the two runs is wrong.

Ask the AI for a poem, a story opener, an essay plan, a revision analogy, a brainstorm, alternative ways to phrase a sentence or three ideas for a project, and variety is the whole reason you're using it. The point of asking is to get options you wouldn't have thought of on your own.

Classroom activity
The two-column test (7 min)

Draw two columns on the board: 'wants sameness' and 'wants variety'. Read out these ten prompts and get the class to vote which column each belongs in.

  1. Suggest a title for my history coursework.
  2. What is the boiling point of water in degrees Celsius?
  3. Convert 34°C into Kelvin.
  4. Write me a haiku about revision.
  5. Summarise the key events of the Cuban Missile Crisis.
  6. Give me three metaphors for entropy.
  7. What year did the Second World War end?
  8. Suggest a warm-up drill for football training.
  9. Solve x² + 5x - 6 = 0.
  10. Give me a story opener set in Victorian London.

The interesting ones are numbers 5 and 8, where the class will disagree. Push them on why.

Part 4 of 6

The reliable-answer trap

This slide answers: Where does non-determinism cause the most real-world trouble?
A phone screen showing two different AI-generated answers to the same factual question.

The dangerous cases are when a task looks creative but actually needs a single correct answer. Or when someone runs a prompt once, trusts the output, and never realises that a second run would have said something meaningfully different.

One well-known example: in 2023, a New York lawyer submitted a legal brief drafted by ChatGPT that cited entirely fictional court cases the AI had invented (a mixture of non-determinism and hallucination, and a career-ending mistake). It happens quietly in much smaller ways all the time. A revision app might tell one pupil that Henry VIII had six wives and another that he had five, because the AI's borderline sampling landed on a different token. A medical chatbot might give slightly different dosage suggestions to different users for the same query. A shop's price-lookup bot might quote £39.99 on Tuesday and £42.50 on Wednesday.

The pattern to watch for: any time an AI's answer will be trusted as authoritative, or copied straight into a document, or used to make a real decision, sameness matters, and you cannot assume you'll get it.

Classroom activity
Spot the trap (7 min)

Give each pair one of these short case studies and ask them to name the non-determinism risk in plain English.

  1. A Y12 uses ChatGPT to check their chemistry homework answers.
  2. A pupil uses an AI to draft an Instagram caption for a friend's birthday post.
  3. A local shop uses an AI chatbot to quote the price of a product.
  4. A revision app answers a pupil's question about the causes of the First World War.

For each case, ask: what happens if the AI gives a slightly different answer next time? Which are dangerous, and which are genuinely fine?

Part 5 of 6

Bad prompt, good prompt

This slide answers: How do I write a prompt that gets me a more consistent answer?
Two prompt boxes side by side, one loose and open, one tight and specific.

You can't fully switch non-determinism off in a normal chatbot, because the temperature setting is baked in and you don't get to touch it. But you can push the AI hard towards consistency by writing prompts that leave it far less room to wander.

The trick is to pin down exactly what you want the answer to look like. Name the format. Name the length. Name the level. Name the content. Every constraint you add is one less place for the AI to roll different dice, and by the time you've named enough of them, the shape of the output stops varying even if the exact wording still drifts a little.

Wandering prompt
Tell me about photosynthesis for my GCSE Biology revision.

Wide open. Format, length, level of detail and choice of examples are all unspecified. On every run, the AI will pick differently on all of those, so two revision cards from the same prompt will look nothing alike, and the pupil has no way of knowing which one is closest to what the exam actually wants.

Pinned-down prompt
Write a GCSE Biology revision card on photosynthesis. Exactly 4 bullet points, one short sentence each, covering: (1) the word equation, (2) where in the cell it happens, (3) two factors that limit the rate, (4) one common misconception. No extra commentary.

Every choice is pinned down: format, count, content, order and tone. Runs of this prompt will still vary a little at the wording level, but the shape and the covered content will match, which makes the card reliable enough to actually paste into a revision folder.

Classroom activity
Rewrite for reliability (8 min)

In pairs, give pupils one of these wandering prompts and ask them to rewrite it so that three runs would come back nearly identical in shape. Test the winners in a real AI at the front and see how close the three runs actually get.

  1. Tell me about Romeo and Juliet.
  2. Explain the water cycle.
  3. Help me revise for my French oral.

The best rewrites will name the format (bullet list, paragraph, cue card), the length, the level (which year group), and the exact content to cover. Point out that this is prompt engineering, which is currently one of the more employable skills in the room.

Part 6 of 6

So what would you do?

This slide answers: The AI gave me two different answers to the same question. Now what?
A pupil at a desk with a laptop, revision notes and two contradictory AI responses.

Time to put everything together. You're a Y12 revising for an A-level Business exam. You ask ChatGPT to explain the difference between a cash flow forecast and a profit and loss statement. Two hours later, working through a past paper, you ask again. You get a slightly different definition. Neither one is obviously wrong, but they don't match: one uses the phrase 'over a period' for cash flow, the other uses it for P&L.

You've got mocks in three weeks. You need to decide which of the two is right, and you need a workflow that stops this happening again in the run-up to the exam.

Classroom activity
Class vote plus discuss (5 min)

Read the four options below out loud. Hands up on which one the class would pick. Then ask three pupils to explain: one for the strongest option, one for a tempting-but-weak one, and one for whichever the class actually voted for. Push them to name which principle from today they're applying, whether that's the rule of thumb, the prompt-pinning trick, or the reliable-answer trap.

Non-Determinism
Time for the quiz

Everyone scan this to earn your badge

The class has covered everything they need. Ask each learner to scan the QR code on their phone or tablet — they will get the 12-question quiz, and if they pass they can print their own certificate.

Or share the link

Send this URL round if the QR isn't handy:

https://ai-literacy-lab.uk/badges/non-determinism-ks4-5/quiz/
Open quiz ›

Badges live on each learner's device only. No accounts, no sign-in.

1 / 1