---
title: "Improving Prompt Consistency with Structured Generations"
description: "LLM benchmark scores swing by roughly 10 points, and model rankings flip, under superficial prompt-format changes on MMLU."
url: "https://swe.quest/articles/improving-prompt-consistency-with-structured-generations-d4c5d5bd00fee00a"
canonical: "https://huggingface.co/blog/evaluation-structured-outputs"
source: "Hugging Face"
published: "2024-04-30"
difficulty: "medium"
kind: "Research"
reading_minutes: 10
tags: ["evals","llms"]
---

# Improving Prompt Consistency with Structured Generations

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-04-30, 10 min read, Research. Original: [https://huggingface.co/blog/evaluation-structured-outputs](https://huggingface.co/blog/evaluation-structured-outputs)

## Summary

LLM benchmark scores swing by roughly 10 points, and model rankings flip, under superficial prompt-format changes on MMLU. Reordering the same few-shot examples alone moves scores by up to 3 points. Constraining outputs with structured generation (regex-guided decoding in Outlines) makes results far more consistent across n-shot count and shot order. On GSM8K it cut variance and kept Mistral-7B ahead of Zephyr-7B in every setup, with 1-shot structured matching 5-shot unstructured. On GPQA diamond it raised mean accuracy (about 0.24 to 0.29–0.30), lowered standard deviation and made winner calls much more stable.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- LLM few-shot prompting ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- multiple-choice benchmark evaluation ([easy posts on Evaluation](https://swe.quest/tags/evals.md?difficulty=easy))
- regular expressions

## Keywords

Outlines, MMLU, GSM8K, GPQA, Mistral-7B, Zephyr-7B-beta, FormatSpread, structured generation

## Related posts

- [What's going on with the Open LLM Leaderboard?](https://swe.quest/articles/what-s-going-on-with-the-open-llm-leaderboard-93a0bc3d63292861.md): Hugging Face · 2023-06-23 · Medium · 12 min read · Evaluation, LLMs
  MMLU scores for the same model vary widely depending on which implementation runs the benchmark.
- [Introducing the Open Chain of Thought Leaderboard](https://swe.quest/articles/introducing-the-open-chain-of-thought-leaderboard-6b7ce484cba7687f.md): Hugging Face · 2024-04-23 · Medium · 10 min read · Evaluation, LLMs
  The Open CoT Leaderboard ranks LLMs by the accuracy gain from chain-of-thought prompting (accuracy with CoT minus loglikelihood accuracy without it) rather than by absolute accuracy, which makes it more robust to training-data contamination.
- [Arabic Leaderboards: Introducing Arabic Instruction Following, Updating AraGen, and More](https://swe.quest/articles/arabic-leaderboards-introducing-arabic-instruction-following-updating-aragen-736604e37db5e184.md): Hugging Face · 2025-04-08 · Medium · 15 min read · Evaluation, LLMs
  Inception and MBZUAI launched an Arabic-Leaderboards Space hosting an updated AraGen generative benchmark (AraGen-03-25) and a new instruction-following leaderboard built on Arabic IFEval, the first public Arabic instruction-following benchmark.
- [Aligning LLM-as-a-Judge with Human Preferences](https://swe.quest/articles/aligning-llm-as-a-judge-with-human-preferences-ffa838b947416549.md): LangChain · 2026-08-26 · Easy · 6 min read · Evaluation, LLMs
  LangSmith evaluators now store human corrections to LLM-as-a-Judge scores as few-shot examples, optionally with explanations, and inject them into the judge prompt on later runs so the evaluator aligns with team preferences without manual prompt engineering.
- [📚 3LM: A Benchmark for Arabic LLMs in STEM and Code](https://swe.quest/articles/3lm-a-benchmark-for-arabic-llms-in-stem-and-code-45eb24e056a94df9.md): Hugging Face · 2025-08-01 · Medium · 5 min read · Evaluation, LLMs
  3LM is a benchmark for evaluating Arabic LLMs on STEM reasoning and code generation, built from three datasets: 865 native MCQs extracted from Arabic grade 8–12 educational materials via OCR (with Pix2Tex for math) and LLM-assisted extraction, 1,744 synthetic mid-to-high difficulty MCQs generated with the YourBench pipeline, and Arabic translations of HumanEval+ and MBPP+ validated by backtranslation with a ROUGE-L F1 cutoff of 0.8.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
