---
title: "Fine-tuning a 350M Model for Better Structured Outputs in 100 GRPO Steps"
description: "GRPO fine-tuning of LFM2.5-350M with TRL on about 500 Nemotron structured-output samples for 100 steps raises its IFStruct pass rate from 22.6% to 29.7%."
url: "https://swe.quest/articles/fine-tuning-a-350m-model-for-better-structured-outputs-in-100-grpo-steps-e2ff9bff03d56a9c"
canonical: "https://huggingface.co/blog/grpo-with-trl-ifstruct"
source: "Hugging Face"
published: "2026-09-03"
difficulty: "hard"
kind: "How-to"
reading_minutes: 8
tags: ["model-training","llms","evals"]
---

# Fine-tuning a 350M Model for Better Structured Outputs in 100 GRPO Steps

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2026-09-03, 8 min read, How-to. Original: [https://huggingface.co/blog/grpo-with-trl-ifstruct](https://huggingface.co/blog/grpo-with-trl-ifstruct)

## Summary

GRPO fine-tuning of LFM2.5-350M with TRL on about 500 Nemotron structured-output samples for 100 steps raises its IFStruct pass rate from 22.6% to 29.7%. The run fits on a free-tier Colab or Kaggle GPU. The recipe uses a LoRA adapter (~1.66% of parameters) on the hybrid attention/convolution modules and prompt augmentation for fenced code blocks and bare lists. Three weighted reward functions score format parseability, field count and JSON Schema validation. Gains concentrate where training aimed: JSON rises from 18.0% to 31.9% and bare lists from 16.6% to 29.7%, while YAML is flat, bringing the 350M model close to Qwen3.5-2B's 33.15%. Evaluation runs locally via llama.cpp serving BF16 GGUFs.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

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

## Prerequisites

- LLM fine-tuning basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- LoRA adapters
- reinforcement learning for LLMs ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- JSON Schema

## Keywords

GRPO, TRL, LFM2.5-350M, IFStruct, llama.cpp, LoRA, GGUF, Nemotron

## Related posts

- [We Got Claude to Fine-Tune an Open Source LLM](https://swe.quest/articles/we-got-claude-to-fine-tune-an-open-source-llm-b2f9fccf5ad1d82f.md): Hugging Face · 2025-12-04 · Medium · 12 min read · Model training, AI agents, AI for coding, LLMs
  Hugging Face Skills, specifically the hf-llm-trainer skill, lets coding agents like Claude Code, Codex and Gemini CLI run a full LLM fine-tuning lifecycle.
- [Together AI expands fine-tuning service with more models, live metrics, and finer controls](https://swe.quest/articles/together-ai-expands-fine-tuning-service-with-more-models-live-metrics-and-finer-30dc413ddac46c8c.md): Together AI · 2026-09-11 · Medium · 10 min read · Model training, LLMs, ML platforms
  Together Fine-Tuning adds support for new open-weight models (GLM-5.3, Kimi K2.7, Qwen 3.5/3.6/3.8, Gemma 4, DeepSeek-V4-Flash), live per-step metrics via API, CLI and dashboard, and new training controls.
- [🐯 Liger GRPO meets TRL](https://swe.quest/articles/liger-grpo-meets-trl-4a551ec5e4d7e307.md): Hugging Face · 2025-05-25 · Hard · 13 min read · Model training, LLMs, Performance engineering
  Liger's chunked loss, extended to GRPO and integrated into TRL's GRPOTrainer, cuts peak training memory by up to 40% with no change in reward curves.
- [CodeAgents + Structure: A Better Way to Execute Actions](https://swe.quest/articles/codeagents-structure-a-better-way-to-execute-actions-5f9ad7c5f62e107c.md): Hugging Face · 2025-05-28 · Medium · 8 min read · AI agents, LLMs, Evaluation, Python
  Forcing code-writing agents to emit their reasoning and Python code as a structured JSON blob (thoughts + code) beats both markdown-parsed CodeAgents and JSON tool-calling agents by 2-7 percentage points on GAIA, MATH, SimpleQA and Frames for capable models.
- [GLM-5.2: Built for Long-Horizon Tasks](https://swe.quest/articles/glm-5-2-built-for-long-horizon-tasks-22484eb2dd0aab06.md): Hugging Face · 2026-06-17 · Hard · 13 min read · LLMs, Inference & serving, Model training, AI for coding, Evaluation
  GLM-5.2 is Z.ai's MIT-licensed flagship model for long-horizon coding-agent work, with a 1M-token context and selectable thinking effort levels.

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)
