tinyllama-math-demo / README.md
lil-sumedhk
Add training and evaluation notebooks
06ab972

A newer version of the Gradio SDK is available: 6.9.0

Upgrade
metadata
title: TinyLlama Math Fine-tuning Demo
emoji: 🧮
colorFrom: blue
colorTo: purple
sdk: gradio
app_file: app.py
pinned: false

TinyLlama Math Fine-tuning Demo

Compare base TinyLlama vs fine-tuned TinyLlama on math word problems from GSM8K.

Models

Training Details

  • Dataset: GSM8K (7,473 training examples)
  • Method: LoRA (r=8, alpha=16)
  • Epochs: 5
  • Quantization: 4-bit (NF4)

Usage

  1. Load an example using the slider, or enter your own math question
  2. Click "Compare Models" to see responses from both models
  3. Compare with the reference answer

Observations

The fine-tuned model learns:

  • Step-by-step reasoning format
  • Mathematical notation (using <<calc>> markers)
  • Structured problem-solving approach

However, as a 1.1B parameter model, complex multi-step calculations may still contain errors.

Code

This repository includes the full training and evaluation code: