← All 96 breakdowns
SPREAD

Your prompt's formatting can swing your AI's accuracy: the breakdown

What's happening

A model doesn't read your intent; it reads tokens. Changing a colon, a capital letter or a space changes the tokens, and inside the model each format ends up in its own place, so the same words in a different layout can get different answers.

  • University of Washington (Sclar, Choi, Tsvetkov, Suhr, ICLR 2024): keeping every word and changing only the formatting (separators, casing, spacing), one open model (LLaMA-2-7B) went from 4 % to 80 % right on the same task. Across 50+ tasks the swing averaged about 10 points; up to 56 with GPT-3.5 and 76 with LLaMA-2-13B. More examples, bigger models (up to 70B) and instruction tuning didn't remove it.
  • Microsoft (He et al., 2024): the same prompt written as Markdown or as JSON, at temperature zero, got the same answer from GPT-3.5 only 16 % of the time. GPT-4 was steadier, but no single format was best across models.
  • The catch: the best format for one model isn't the best for another, and in Sclar et al.'s tests just changing the format reversed which of two models looked better about one time in seven.

Why it matters

If you compare models, pick a prompt, or ship an eval with one format, part of what you measured is the format.

What to do (save this)

  1. Test several formats: the same words in 5-10 layouts (separators, casing, spacing, Markdown / JSON / plain).
  2. Report the range: lowest to highest, not just the best run.
  3. Retest every time you switch models: the best format moves.

Set it up yourself

  1. Write your prompt as a template with the content in placeholders (instructions, examples, input).
  2. Make 5-10 formatting variants that keep every word: Answer: / ANSWER: / Answer - / answer:; one or two line breaks between fields; plain text, Markdown headings, JSON keys.
  3. Run your eval set (even 100 examples) through each variant, same model, same settings.
  4. Keep the table: format, accuracy. Report min, median and max; ship the format that's best and stable.
  5. When you change models (or versions), rerun step 3 before trusting the old winner.
  6. For a smarter search on API models, FormatSpread (github.com/msclar/formatspread, MIT) samples formats with Bayesian optimisation; the authors report under 10 USD per task on GPT-3.5.

Sources

FREE ONE-TIME UNLOCK

Unlock the full SPREAD breakdown

Drop your email once to read the complete step-by-step guide, grab the files, and unlock all 96 Reel breakdowns on this device forever.

✓ Instant reveal right here✓ No spam, unsubscribe any time