{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "w2TnJ6ta-2zj" }, "source": [ "# GRPO Fine-tuning for verifiable tasks\n", "\n", "Fine-tuning requires a GPU. If you don't have one locally, you can run this notebook for free on [Google Colab](https://colab.research.google.com/github/Liquid4All/cookbook/blob/main/finetuning/notebooks/grpo_for_verifiable_tasks.ipynb) using a free NVIDIA T4 GPU instance.\n", "\n", "[](https://colab.research.google.com/github/Liquid4All/cookbook/blob/main/finetuning/notebooks/grpo_for_verifiable_tasks.ipynb)\n", "\n", "### What's in this notebook?\n", "\n", "In this notebook you will learn how to fine-tune a Small Text-to-text Language Model for verifiable tasks using Group Relative Policy Optimization (GRPO).\n", "\n", "GRPO is a Reinforcement Learning algorithm widely used by AI labs and practitioners to fine-tune models for easily verifiables tasks like\n", "\n", "- Mathematical problem solving with numeric verification\n", "- Code generation with unit test validation\n", "- Structured output tasks (JSON, SQL) with schema validation\n", "- Question answering with ground truth answers\n", "\n", "\n", "We will cover\n", "- Environment setup\n", "- Data preparation\n", "- Model training\n", "- Local inference with your new model\n", "- Model saving and exporting it into the format you need for **deployment**.\n", "\n", "### Deployment options\n", "\n", "LFM2.5 models are small and efficient, enabling deployment across a wide range of platforms:\n", "\n", "
| Deployment Target | \n", "Use Case | \n", "
|---|---|
| 📱 Android | \n", "Mobile apps on Android devices | \n", "
| 📱 iOS | \n", "Mobile apps on iPhone/iPad | \n", "
| 🍎 Apple Silicon Mac | \n", "Local inference on Mac with MLX | \n", "
| 🦙 llama.cpp | \n", "Local deployments on any hardware | \n", "
| 🦙 Ollama | \n", "Local inference with easy setup | \n", "
| 🖥️ LM Studio | \n", "Desktop app for local inference | \n", "
| ⚡ vLLM | \n", "Cloud deployments with high throughput | \n", "
| ☁️ Modal | \n", "Serverless cloud deployment | \n", "
| 🏗️ Baseten | \n", "Production ML infrastructure | \n", "
| 🚀 Fal | \n", "Fast inference API | \n", "