← Latest papers
💬 NLP

When Correct Isn't Usable: Improving Structured Output Reliability in Small Language Models

This paper identifies a critical reliability gap where small language models fail to produce both mathematically correct and format-compliant outputs under standard prompting, and proposes AloLab, an iterative meta-agent system that optimizes system prompts to achieve high output accuracy with near-native latency without requiring model fine-tuning or constrained decoding.

Original authors: Cosimo Galeone, Minsu Park, Giuseppe Ettorre, Daniele Ligorio

Published 2026-05-05
📖 4 min read☕ Coffee break read

Original authors: Cosimo Galeone, Minsu Park, Giuseppe Ettorre, Daniele Ligorio

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a brilliant but slightly chaotic assistant (a "Small Language Model") who is incredibly good at solving complex math puzzles. If you ask them, "What is 2 plus 2?", they will happily tell you, "Well, I added them up, and the answer is 4."

But in the real world of computers, that's not enough. The system waiting for the answer doesn't want a sentence; it wants a specific, rigid format, like a digital envelope with two labeled windows: one for "Reasoning" and one for "Answer." If the assistant writes the answer in a paragraph, or wraps it in a fancy box, or forgets to put it in the envelope at all, the computer rejects it. To the computer, a perfect answer in the wrong format is the same as a wrong answer.

This paper, titled "When Correct Isn't Usable," investigates why these smart assistants keep failing to follow these simple formatting rules and how the authors fixed it.

The Problem: The "Perfect Answer, Wrong Envelope" Gap

The researchers tested three popular, smaller AI models on math problems. They found a strange phenomenon:

  • The Math: The models were great at solving the problems (getting 77–85% of the math right).
  • The Format: They were terrible at following the rules (getting 0% of the answers in the correct JSON format).

It's like a chef who can cook a perfect steak but keeps serving it on a plate made of paper that falls apart. The steak is delicious, but you can't eat it.

They tried two common fixes, and both failed:

  1. Just asking nicely (Naive/Reference): Telling the model, "Please give me the answer in a box," didn't work. The models kept ignoring the instruction or wrapping the box in extra decorations (like markdown fences) that broke the computer's parser.
  2. Force-feeding the rules (Constrained Decoding): This is like putting the model in a straitjacket where it physically cannot type anything that isn't valid JSON. It worked for the format, but it made the model slow (3 to 8 times slower) and sometimes confused, causing the math quality to drop.

The Solution: AloLab (The "Prompt Coach")

The authors built a system called AloLab. Think of AloLab as a specialized coach who watches the model try to solve problems, sees where it fails, and rewrites the instructions (the "system prompt") to fix those specific mistakes.

Here is how the coach works:

  1. Watch: The coach (using a very smart AI called Claude Sonnet 4.5) watches the model try to answer questions.
  2. Spot the Error: If the model keeps wrapping the answer in a "markdown fence" (a weird symbol that breaks the format), the coach notices this pattern.
  3. Rewrite the Rules: The coach updates the instruction manual to say, "Do not use markdown fences," or "Put the answer in the 'answer' field, not the 'reasoning' field."
  4. Repeat: This happens over a few rounds until the model gets it right.

The Result:

  • Speed: Unlike the "straitjacket" method, AloLab doesn't slow the model down. In fact, because the instructions become clearer, the model sometimes answers faster.
  • Success: On the math tests, AloLab boosted the "usable" answer rate from 0% to 84–87% for the smaller models.
  • Even for the Big Guys: They tested this on a massive, expensive model (GPT-4o). Even that model was failing to follow the format (0% success) until AloLab coached it, at which point it jumped to 95% success.

Key Takeaways from the Paper

  • The "Meta-Agent" Matters: The coach needs to be smart. When they swapped the smart coach (Sonnet 4.5) for a cheaper, dumber one (Haiku), the results became a coin flip. Sometimes it worked, sometimes it failed completely. You need a capable coach to get consistent results.
  • No "Inside Access" Needed: AloLab works like a black box. It doesn't need to see the model's internal code or weights; it just watches what comes out and adjusts the instructions.
  • The "Reasoning vs. Answer" Glitch: Even with AloLab, there's a small remaining problem. Sometimes the model does the math correctly in its "reasoning" section but accidentally writes the wrong number in the final "answer" box. It's like the model knows the answer but has a typo when writing it down. This happens in about 1.5% to 1.8% of cases.

Summary

The paper argues that for small AI models, the biggest hurdle isn't intelligence; it's communication. They know the answer, but they can't format it correctly for computers. The authors found that instead of forcing the model to move slowly (constrained decoding), it's better to have a smart coach (AloLab) rewrite the instructions until the model learns to speak the computer's language perfectly. This makes the AI both faster and much more reliable.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →