Tests whether the candidate constrains the format instead of hoping. Strong answers name the format, show one example, and validate.
Ask for named fields with one exact example line. Then parse strictly and reject anything else, since no technique works on every model.
def fake_assistant(prompt):
# FAKE scripted stand-in for a model, not real output
if "FORMAT: id, verdict" in prompt and "log line" in prompt:
return "id: 42, verdict: timeout"
return "it timed out maybe"
def parses_as_record(reply):
parts = [p.strip() for p in reply.split(",")]
if len(parts) != 2:
return False
return parts[0].startswith("id: ") and parts[1].startswith("verdict: ")
bad = []
structured = fake_assistant("FORMAT: id, verdict. log line 42 timed out")
plain = fake_assistant("what happened in the log")
if not parses_as_record(structured):
bad.append("structured prompt should parse")
if parses_as_record(plain):
bad.append("plain prompt should not parse")
if bad:
print("FAIL: " + "; ".join(bad))
raise SystemExit(1)
print("PASS: constrained prompt parses, unconstrained prompt does not")The stand-in above is fake and scripted, never real output. It proves the point that the constraint decides parseability, not the wording around it.
Tests measured judgment about few-shot prompting. Strong answers say it varies by model and propose a comparison.
Examples help when the format is unusual or the boundary cases matter. What works differs between models, so measure with and without on a fixed set.
schematic transcript (illustrative, not real model output)
Q: decide pass or fail from: id 42 ran 512 cycles, timeout at 500 cycles
A: id 42 fails: 512 > 500, over by 512 - 500 = 12 cycles
rule shown: quote the numbers, then the comparison, then the verdictThe transcript is schematic and invented for teaching. It shows the shape of a checkable answer: numbers first, verdict last.
Tests debugging discipline for flaky prompts. Strong answers isolate one change at a time and keep a log.
Temperature rescales the sampling distribution, and temperature 0 is approximately greedy. That is not a guarantee of identical output across runs or hardware, so log prompts and outputs to tell flakiness from drift.
Step | Do | Why |
|---|---|---|
Freeze one prompt | Rerun it unchanged three times | Separates prompt flakiness from prompt edits. |
Shrink the input | Halve the context and rerun | Long inputs wobble more than short ones. |
Tighten the format | Add the field list and one example | Vague formats invite varied readings. |
A field list with one exact example line, plus a strict parser that rejects the rest. The constraint carries the guarantee, not the politeness.
No. Temperature 0 is approximately greedy, not a guarantee of bit-identical output across runs or hardware.