Downloads · 30 days
0
Neha12210/project1-math-reasoning-llm
project1-math-reasoning-llm is a machine learning model from Neha12210. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Taught a small LLM to reason step-by-step using Reinforcement Learning (GRPO)
Downloads · 30 days
0
Access
Public
Updated Apr 24, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py45.5 KB · 55%
From the Hugging Face model README
Taught a small LLM to reason step-by-step using Reinforcement Learning (GRPO)
Fine-tunes Qwen2.5-1.5B-Instruct (1.5B parameters) to solve math problems with chain-of-thought reasoning using a two-phase training approach:
| Benchmark | Base Model | After SFT | After GRPO | Improvement |
|---|---|---|---|---|
| MATH-500 | ~XX% | ~XX% | ~XX% | +XXpp |
(Fill in after running evaluation)
┌─────────────────────────────────────────────────────────┐
│ Training Pipeline │
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ │
│ │ NuminaMath │───▶│ SFT Phase │───▶│ SFT Model │ │
│ │ CoT (50K) │ │ (QLoRA) │ │ Adapter │ │
│ └─────────────┘ └──────────────┘ └──────┬──────┘ │
│ │ │
│ ┌─────────────┐ ┌──────────────┐ ┌──────▼──────┐ │
│ │ DeepMath │───▶│ GRPO Phase │───▶│ GRPO Model │ │
│ │ 103K │ │ (RL + QLoRA)│ │ Adapter │ │
│ └─────────────┘ └──────────────┘ └──────┬──────┘ │
│ │ │
│ ┌─────────────┐ ┌──────────────┐ ┌──────▼──────┐ │
│ │ MATH-500 │───▶│ Evaluation │───▶│ Benchmark │ │
│ │ Benchmark │ │ Script │ │ Results │ │
│ └─────────────┘ └──────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────┘
| Component | Tool |
|---|---|
| Base Model | Qwen/Qwen2.5-1.5B-Instruct |
| SFT Training | TRL SFTTrainer + PEFT QLoRA |
| RL Training | TRL GRPOTrainer + custom rewards |
| Speed Optimization | Unsloth (2x faster, 80% less VRAM) |
| SFT Dataset | AI-MO/NuminaMath-CoT (859K math problems) |
| GRPO Dataset | trl-lib/DeepMath-103K (103K prompts) |
| Evaluation | MATH-500 benchmark |
| Hardware | Kaggle T4 GPU (16GB VRAM, free tier) |
project1_math_reasoning_llm/
├── README.md # This file
├── 01_sft_training.py # Phase 1: Supervised Fine-Tuning
├── 02_grpo_training.py # Phase 2: GRPO Reinforcement Learning
├── 03_evaluation.py # Evaluate on MATH-500 benchmark
├── kaggle_notebook_sft.py # Ready-to-paste Kaggle notebook code
├── kaggle_notebook_grpo.py # Ready-to-paste Kaggle notebook code
└── requirements.txt # Dependencies
kaggle_notebook_sft.py into the notebook/kaggle/working/sft_adapter/kaggle_notebook_grpo.py03_evaluation.py to get MATH-500 scores<think>...</think> structured reasoning