A small GRPO experiment targeted structured-output reliability

A public recipe measured whether light post-training could improve a compact model’s schema compliance.

Source artwork for Fine-tuning a 350M Model for Better Structured Outputs in 100 GRPO Steps
Source artwork · Hugging Face / credited contributors ↗
THE SHORT VERSION

Small, targeted post-training can improve a useful behavior without eliminating the need for deterministic validation.

The guide fine-tuned LFM2.5-350M with GRPO using TRL and evaluated it on IFStruct. Its reported experiment used about 500 samples and 100 training steps, improving the benchmark score from 22.6% to 29.7%. The source links the notebook and distinguishes this recipe from the benchmark’s own model-training pipeline.

The useful focus is narrow: output structure, not a sweeping claim about intelligence. A response can sound correct and still fail a downstream parser. Measuring format compliance separately makes that failure easier to diagnose and gives a small experiment a concrete objective.

Use the public notebook to understand rewards and evaluation, then test on held-out schemas from your own application. Keep parsing and validation outside the model as well; an improved compliance score is not a guarantee that every response is valid.

Valid output is not necessarily correct output

Structured generation is the point where an AI demo meets an ordinary software contract. A downstream application may require a date, a category and a list of items. The application does not benefit from an eloquent explanation if the returned object cannot be parsed. Yet parseability is only the first requirement: a syntactically valid object can contain the wrong date or omit an important item.

Suppose a support system extracts an order number and a requested action from an email. There are at least three independent checks: valid syntax, the expected fields and types, and agreement with the email. Keeping these separate makes it possible to see what training actually improves. Combining them into one success number can hide a model that has learned the shape of an answer without learning to extract the answer.

Design the reward around the real contract

A useful reward function should be simple enough to inspect. Begin with deterministic checks for requirements that are objectively testable. A parser can report malformed output; a schema validator can report missing fields. The rule should not quietly accept an empty object merely because it parses.

Then add examples where the correct behaviour is to represent missing information explicitly. Otherwise, a model may learn that inventing a value is the easiest way to satisfy a required-field check. The desired convention—null, an empty list, or a separate status—belongs in both the instructions and the evaluation.

Keep a strong baseline

Training is not the only way to improve structured responses. Clearer prompts, constrained decoding where supported, and an application-level validation-and-retry loop are meaningful baselines. Compare them before deciding that a new training run is necessary. A modest model with a reliable surrounding contract may be more useful than a larger model with an unreliable one.

For evaluation, hold out complete examples and, where possible, unfamiliar schema variations. Avoid letting nearly identical templates leak into both training and testing. Report format compliance separately from semantic correctness, and show failure examples rather than only the average.

Interpreting a small experiment

A short public training recipe is valuable because its moving parts can be studied and repeated. It is not a guarantee that every schema, language or document type will improve. Keep the initial model, reward implementation, data split and inference settings attached to any result you share.

The practical outcome to look for is fewer unusable responses under your actual workload, without increased fabrication or excessive retries. If a change improves a benchmark but makes the application less predictable, the benchmark has not answered the deployment question.

Source: Fine-tuning a 350M Model for Better Structured Outputs in 100 GRPO Steps · iamleonie, burtenshaw, sergiopaniego. How we write

← Back to all articles