Skip to content

Improving structured outputs in 350 million-parameter models: GRPO algorithm efficiency in narrowing the architectural accuracy gap

Share
Improving structured outputs in 350 million-parameter models: GRPO algorithm efficiency in narrowing the architectural accuracy gap

Listen to this article

Read by Anchor

Recent technical experiments published by the "Hugging Face" platform demonstrated the possibility of noticeably increasing the accuracy of small language models' compliance with structured outputs by using the Group Relative Policy Optimization algorithm, known as "GRPO", relying on the open-source "TRL" library and without requiring costly computing hardware.

The experiment targeted the "LFM 2.5" model with 350 million parameters, developed by "LeCode AI", which uses a hybrid architecture that combines attention mechanisms with mathematical looping. The model underwent light fine-tuning with the "LoRA" technique affecting about 6 million parameters, representing 1.66 % of its total parameters, and was trained on roughly 500 extracted and edited samples from Nvidia's "Nimotron" dataset over just 100 training steps, requirements that can be run on a free GPU in environments such as "Colab" or "Kaggle".

The experiment shows that adjusting structural behavior does not necessarily require extensive retraining or costly billion-parameter inference models; it suffices to guide the model with precisely defined mathematical reward signals.

The training pathway combined three reward functions with differing weights: the first rewarded correct JSON formatting with a weight of 1.0, the second rewarded matching the number of extracted fields with a weight of 0.5, and the structural schema validation function received the highest weight of 2.0 to ensure mandatory fields are satisfied and to prevent outputs from drifting beyond the specified programmatic constraints.

When the fine-tuned model was evaluated on the "IFStruct" benchmark designed to test programmatic output correctness, its overall success rate rose from 22.6 % for the base version to 29.7 % after training with the "Llama.cpp" inference system. The improvement was concentrated in JSON outputs, whose success rate jumped from 18 % to 31.9 %, approaching the performance of larger models such as "Quine 3.5" with 2 billion parameters, which achieves 33.15 % on the same benchmark, while YAML output remained roughly stable at 27.5 %.

This shift in fine-tuning mechanisms carries a direct practical implication for developers and technical teams in the Gulf, Egypt, and the Arab region, where inference costs and cloud infrastructure present barriers to automating data-processing pipelines and extracting tables and reports. The ability to convert a tiny 350-million-parameter model into a reliable extraction engine with just 100 training steps enables entity extraction and parameter sorting tasks to run locally on modest internal servers or edge devices, without leaking sensitive data or repeatedly relying on calls to massive cloud-based model APIs.

Don't miss the next story

Subscribe for updates