AI · Article or course

Unsloth Fine-tuning LLMs Guide

Practical guide to fine-tuning LLMs with LoRA, QLoRA, and RL.

Visit unsloth.ai ↗

An official documentation guide by Unsloth that covers the entire pipeline of fine-tuning large language models. It walks through selecting base models, choosing between LoRA and QLoRA, curating datasets, tuning training hyperparameters, and deploying the resulting models. It is tailored to help developers train models efficiently on consumer hardware with minimal VRAM.

What it's for

  • Fine-tune instruct models like Llama 3 on custom datasets using QLoRA
  • Select appropriate training hyperparameters like learning rate, rank, and sequence length
  • Prepare and format question-answer datasets for domain-specific fine-tuning
  • Diagnose training metrics to identify underfitting or overfitting
  • Export trained models for local deployment with tools like Ollama or vLLM

Features

  • Step-by-step walkthrough covering model choice, dataset preparation, and parameter selection
  • Memory-efficient guidance for 4-bit and 16-bit LoRA and QLoRA workflows
  • Hyperparameter tuning advice including batch sizes, learning rates, and target modules
  • Explanation of advanced training techniques including GRPO, DPO, and continued pretraining
  • Ready-to-use Colab and Kaggle notebooks for immediate hands-on practice
  • Instructions for local setup via Docker or pip on Windows and Linux

Pricing

Free online documentation and open-source notebooks

Details

Type
Article or course
Category
AI
Topic
LLM Fine-Tuning
Open source
Yes
Platforms
Web
For
Developers, AI researchers, and hobbyists looking to fine-tune open-source LLMs efficiently.
Alternative to
Hugging Face TRL Documentation, Axolotl Documentation
Tags
unsloth, finetuning, llm, qlora, lora, machine learning, documentation

Why it was saved

  • @UnslothAI, 10 March 2025: Covers the full workflow: understanding fine-tuning and example usecases (headline sentiment, legal contract analysis), choosing the right model and method (QLoRA vs LoRA, max_seq_length, load_in_4bit for 16GB GPUs), model parameters (r, target_modules, lora_alpha, learning rate ranges 1e-4 to 5e-5, counteracting overfitting), plus RL/GRPO/DPO/CPT, data prep, evaluation, and deployment via vLLM, Ollama, Open WebUI.

Related

  • Ultimate Guide to Fine-Tuning LLMs

    A 114-page technical report covering the full LLM fine-tuning lifecycle.

  • ChatGPT

    Conversational AI assistant for writing, research, reasoning, and coding

  • Pinokio

    Browser that installs and runs open-source AI apps with one click

  • Prompt Engineering (Google Whitepaper)

    A comprehensive guide to prompt engineering techniques and LLM parameters by Google.

  • Claude

    Anthropic's conversational AI assistant for analysis, writing, and coding

  • Hermes 3

    Open-weights fine-tune of Llama 3.1 built for agentic function calling.

Updated