Unsloth tutorial: fine-tune Llama 3.1 8B locally

Learn to prepare Q&A data and fine-tune Llama 3.1 8B with Unsloth. The speaker reports a run under 15 minutes on an RTX 5090.

Player not loading? Watch on YouTube

This tutorial uses Unsloth to fine-tune Llama 3.1 8B on questions about Doctor Who series 10. The speaker first tests the base model on specific facts, then compares its answers with the adapted model. The example shows a local LLM training workflow and the limits of a dataset built around short answers.

Data preparation takes much of the walkthrough. Unsloth's PDF document Q&A recipe uses a locally running model, identified as Qwen 3.8 27B, to generate examples from merged Wikipedia PDFs. The speaker explains how to map instruction and output fields to user and assistant messages, remove evidence fields, and discard irrelevant questions about article references. For the final dataset, he says he used an online model instead.

Training uses LoRA adapters and about 1,000 Q&A examples. The speaker increases the run to 10 epochs after finding three insufficient in his tests, and reports completion in under 15 minutes on an RTX 5090. That timing describes his hardware and run, rather than a general requirement or benchmark.

The adapted model answers the demonstrated factual questions more accurately, but returns a short response when asked for a blog post. The speaker attributes this to the concise training examples and suggests mixing in carefully checked long-form examples. He also briefly contrasts fine-tuning with retrieval augmented generation.