Case Study 04

RAG-Based QA System

Fine-tuned FLAN-T5 at 4,000× data scale

PythonHugging FaceFLAN-T5Gradio
View on GitHub (opens in new tab)

The Problem

Small, custom FAQ datasets aren't enough to fine-tune a generative model that generalizes well. The goal was to see how far a QA system could be pushed by scaling training data aggressively, then package the result as something people could actually query.

Approach

  1. 01Started from a 20-example custom FAQ dataset and scaled it to 87K+ examples using SQuAD v1.1 — a 4,000× increase in training data.
  2. 02Fine-tuned FLAN-T5 (80M to 250M parameter variants) using Hugging Face Transformers, with custom prompt formatting and batched tokenization.
  3. 03Used mixed-precision (FP16) training and validation monitoring via Seq2SeqTrainer to keep experimentation fast and reproducible.
  4. 04Built and deployed an interactive Gradio inference UI, and architected the system with future LoRA-based parameter-efficient fine-tuning in mind.

Results

Scaled training data 4,000× — from 20 examples to 87K+.

Fine-tuned and compared FLAN-T5 variants from 80M to 250M parameters.

Shipped a working, interactive Gradio QA interface.

Reflection

The scale jump from 20 to 87K examples was the real experiment here — it's easy to assume more data always helps, but tracking validation performance across that scale-up taught me where the returns started diminishing for a model this size.