Skip to main content
Section 3

Getting reliable results

Control the output, cut errors, and debug a prompt that is not working.

3 lessons25-question quiz
3.1

Controlling length, format, and randomness

7 min read

Two prompts can ask for the same thing and get wildly different results: one three sentences, the other three pages; one a tidy list, the other a wall of prose. The model is not being unpredictable for no reason. It is filling in gaps you left open. Say the length and format you want, and most of that variation disappears.

Specifying length

Vague length words like "briefly" or "in detail" leave a lot of room. A model reads "briefly" differently depending on the topic. Concrete units work better: a word count, a sentence count, a number of bullet points, or a comparison such as "about the length of a tweet."

VagueConcrete
Keep it shortIn 3 sentences or fewer
Give me detailAbout 300 words, with 2 examples
A quick list5 bullet points, one line each
Vague length cues versus concrete ones

Specifying format

Format is separate from length. Do you want prose or bullets? A table? A numbered list you can follow step by step? Plain text or a code block? Name the shape you want the answer to take, and say it before the model starts writing, not after.

  • Structure: bullets, numbered steps, a table, or plain paragraphs.
  • Tone: formal, casual, technical, for a beginner.
  • Output type: plain text, Markdown, JSON, or a code block in a specific language.
  • Sections: ask for headers if you want a longer answer organized.

What temperature does to variety

AI Foundations covered temperature: a setting that controls how willing a model is to pick a less likely next token. Length and format instructions control the shape of an answer. Temperature controls how much the wording and choices vary between separate runs of the same prompt.

0.0 (deterministic)nearly the same answer every time
0.3 (low)small wording changes
0.7 (moderate)noticeably different each run
1.0+ (high)wide variety, more risk of nonsense
Illustrative: output variety across runs, by temperature setting

Most chat apps do not expose a temperature slider, but you can still nudge it with words. Asking for "one straightforward answer" pushes toward a low-temperature feel. Asking for "a few different creative options" pushes toward a high-temperature feel, even without touching a setting.

Key idea
Say the length in concrete units, name the format up front, and remember temperature is about variety between runs, not about quality. Low temperature for consistency, higher temperature for range.
Key terms
Temperature
A setting that controls how much variety a model's output has between runs.
More

Low temperature favors the most likely tokens and gives consistent answers. High temperature allows less likely tokens, giving more varied and sometimes less reliable output. Covered in AI Foundations.

3.2

Cutting errors and verifying

7 min read

AI Foundations covered why models can be confidently wrong. This lesson is the practical follow-up: four habits that cut how often that happens, and a simple way to decide how hard to check.

Ground it in your source

When you ask a model about a document, a policy, or a piece of code, do not make it guess from memory. Paste the actual text into the prompt and ask it to answer using only that. This is called grounding. A grounded answer is built from what you gave it, not from a fuzzy recollection of something similar it saw during training.

Ask it to say when it is unsure

By default a model tends to produce a confident-sounding answer even when it is guessing. Asking directly for a signal changes that: "If you are not sure, say so" or "rate your confidence in this answer." It will not catch every mistake, but it surfaces some of the guesses instead of letting them read like settled facts.

Ask for sources

Asking "where does this come from" gives you something concrete to check: a source name, a document section, or a citation. AI Foundations already flagged that citations can be invented, so the point is not to trust the source blindly. The point is to have something specific enough to verify instead of a bare claim.

Check claims by stakes

You cannot verify everything, and you do not need to. Spend checking time in proportion to what happens if the answer is wrong. A brainstorm list costs little if it is off. A number that goes in a report, a medical or legal claim, or anything published under your name costs a lot. Sort by stakes first, then verify.

TechniqueWhat it does
Ground it in your sourceAnswers come from the text you gave it, not a guess from memory
Ask it to flag uncertaintySurfaces guesses instead of letting them read as settled facts
Ask for sourcesGives you a specific claim or citation you can check, not just a bare statement
Check claims by stakesPuts your limited verification time where a mistake would actually cost something
Four techniques for cutting errors
Key idea
Ground the model in real source text, ask it to flag uncertainty, ask for sources you can check, and match how hard you verify to how much a mistake would cost.
None of these techniques make errors impossible. They make errors easier to catch before you rely on the answer.
Key terms
Grounding
Giving a model the actual source text so it answers from what you provided instead of memory.
3.3

Debugging a prompt that is not working

6 min read

Every prompt eventually fails: the answer is off-topic, too generic, the wrong length, or just not what you meant. Before rewriting from scratch, run through a short diagnostic. Most bad results trace back to one of a handful of causes.

  1. 1Is the task clear?One specific ask, not three bundled into one sentence
  2. 2Is the context there?Background, source text, or constraints the model actually needs
  3. 3Is the format specified?Length, structure, and tone stated, not assumed
  4. 4Did you give an example?A sample of what "good" looks like, when the shape is hard to describe
  5. 5Did you change one thing at a time?So you know which change actually fixed it
The five-question debug checklist

Working through the checklist

Start at the top. If the task is bundled ("summarize this and also check it for errors and also suggest a title"), split it into one ask, or number the parts explicitly. If the answer is generic, look for missing context: does the model actually have the source text, the audience, the constraint you have in your head but never typed?

If the content is right but the shape is wrong, that is a format problem, covered in the first lesson of this section: state the length and structure you want. If the model keeps missing a style or pattern you cannot easily describe in words, give it an example instead of more instructions.

Change one thing at a time

When a prompt is not working, it is tempting to rewrite the whole thing at once. Resist that. Change one variable, run it, and check the result. If you change the context, the format, and the wording all together and the new answer is better, you do not know which change did the work, and you will not be able to repeat it on the next prompt.

SymptomLikely cause
Off-topic or generic answerMissing context
Right idea, wrong shapeFormat not specified
Ignores part of the requestTask not clear, or too many asks bundled together
Close, but not quite the style you wantNo example given
Symptom to likely cause
Key idea
When a prompt fails, check task clarity, context, format, and examples in order, and change one thing at a time so you learn what actually worked.

Section 3 quiz

25 questions. Pass at 75% to master this section. Retakes are unlimited, and the quiz is where the learning sticks.

Section 3 quiz · Getting reliable resultsQuestion 1 of 25

Why do two prompts asking for "the same thing" often produce very different length answers?