Skip to content

Instantly share code, notes, and snippets.

@erhangundogan
Created April 15, 2025 12:10
Show Gist options
  • Save erhangundogan/c671c25c91932da3b03edb5bc101064b to your computer and use it in GitHub Desktop.
Save erhangundogan/c671c25c91932da3b03edb5bc101064b to your computer and use it in GitHub Desktop.
LLM Fine Tuning

Fine-Tuning

Customize the model for a specific task, domain, or tone Narrow/specific tasks.

Adapts the model to specific needs, such as:

  • Your company’s support knowledge
  • Medical or financial language
  • Legal documents
  • Specific brand tone

Methods:

  • Full fine-tuning: Update all weights (expensive, rare now)
  • LoRA / QLoRA: Lightweight fine-tuning (adds small trainable layers)
  • Adapter / Prefix / Prompt Tuning: Modify only input prompts or small parts of the model

Examples:

  • Training GPT to answer only based on internal company docs
  • Making a chatbot talk like Shakespeare
  • Tuning a model for legal summarization or sentiment classification

Analogy

  • Pretraining = teaching a kid to read everything in the world.
  • Post-training = teaching them how to behave in conversations.
  • Fine-tuning = teaching them a specialized job (e.g., legal advisor, tech support agent).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment