Fully Fine-Tune a Small Language Model (Gemma 3 270M)
Supervised Fine-Tuning (SFT) of Google's Gemma 3 270M model for a specific task: extracting food and drink items from text. The fine-tuned model processes text inputs and returns structured data about food/drink content.
Problem Statement
General-purpose language models lack the precision needed for domain-specific extraction tasks. Fine-tuning a small language model offers a cost-effective alternative to prompting large models, with faster inference and better accuracy for targeted use cases.
Methodology
Performed Supervised Fine-Tuning (SFT) on Google's Gemma 3 270M using the Hugging Face Transformers and TRL libraries. Curated a custom dataset of text passages with labeled food and drink items. Trained with optimized hyperparameters on NVIDIA DGX Spark hardware. Deployed the fine-tuned model as a Gradio app on Hugging Face Spaces.
Results
The fine-tuned model accurately extracts food and drink items from unstructured text, outperforming zero-shot prompting on the same base model. Deployed as a live Hugging Face Space for interactive testing and demonstration.