Install any skill in seconds. Free to start, no credit card required.
Get Started Free →brycewang-stanford/dl-transformer-finetune
Build transformer fine-tuning plans for classification and generation
Passed 19 of 24 test cases with the skill, and 15 of 24 without it.
and 2 more in the full report
4 fixed15 passed either way5 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
I am evaluating parameter-efficient adaptation methods for multi-task learning. What is the typical percentage of trainable parameters and performance retention relative to full fine-tuning when using Adapter Layers?
| Checked | Without skill | With skill |
|---|---|---|
| Specifies trainable parameter percentage for adapter layers as 1% to 5% | Missed | Passed |
| Specifies relative performance retention for adapter layers as 95% to 99% | Missed | Passed |
The instructions your model reads when the skill loads.
Fine-tuning pretrained transformers is the dominant paradigm in modern NLP and increasingly in vision, audio, and multimodal research. The core idea is simple: take a model pretrained on massive data, then adapt it to your specific task with a comparatively small labeled dataset. But the practical details -- which layers to freeze, which optimizer and learning rate to use, how to handle catastrophic forgetting, when to use parameter-efficient methods -- determine whether fine-tuning succeeds or fails.
This guide covers the full spectrum of fine-tuning approaches: full fine-tuning for maximum performance, parameter-efficient fine-tuning (PEFT) for resource-constrained settings, and the decision framework for choosing between them. The patterns are drawn from hundreds of published papers and the Hugging Face ecosystem that supports them.
Whether you are fine-tuning BERT for text classification in a domain-specific corpus, adapting a large language model with LoRA for instruction following, or building a multi-task model for your research pipeline, this guide provides the recipes you need.
from transformers import (
AutoModelForSequenceClassification,
AutoTokenizer,
TrainingArguments,
Trainer,
)
from datasets import load_dataset
import numpy as np
from sklearn.metrics import accuracy_score, f1_score
# Load model and tokenizer
model_name = "bert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(
model_name, num_labels=3
)
# Prepare dataset
dataset = load_dataset("multi_nli")
def tokenize_function(examples):
return tokenizer(
examples["premise"],
examples["hypothesis"],
truncation=True,
test cases passed, vs 15 / 24 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.