What is PEFT?
PEFT methods add trainable adapter modules to a frozen pre-trained model. Instead of fine-tuning all billions of parameters, you train only millions of adapter parameters:- Full Fine-tuning: Update all 7B parameters
- LoRA (rank=64): Update only ~100M adapter parameters (1.4% of total)
- Result: Similar performance with much less compute and memory
Installation
Install LeRobot with PEFT support:Quick Start
Fine-tune SmolVLA with LoRA:--policy.path: Load pre-trained model--peft.method_type=LORA: Use LoRA adapters--peft.r=64: LoRA rank (higher = more parameters)- Higher learning rate (1e-3 vs 1e-4 for full fine-tuning)
Supported Methods
LoRA (Low-Rank Adaptation)
LoRA is the most popular PEFT method. It adds low-rank matrices to attention layers:r: Rank of adapter matrices (higher = more capacity)r=8: Very lightweight (~25M params)r=32: Balanced (~50M params)r=64: High capacity (~100M params)
lora_alpha: Scaling factor (typicallyr/2orr/4)lora_dropout: Dropout rate for adapters
IA³ (Infused Adapter by Inhibiting and Amplifying Inner Activations)
IA³ uses even fewer parameters by learning scaling factors:AdaLoRA (Adaptive LoRA)
Adaptively allocates rank across different layers:Targeting Modules
Default Targets
By default, LoRA targets attention projection layers and task-specific heads:Custom Targets
Specify custom modules to adapt:Using Regex
Target modules with regex patterns:- All MLP layers in the language model expert
- State and action projection layers
Finding Module Names
Print model architecture to find module names:Full Fine-tuning Specific Modules
For some modules, you may want full fine-tuning instead of adapters:- Adds LoRA adapters to attention layers
- Fully fine-tunes state and action projections
Fine-tuning SmolVLA
Complete example for fine-tuning SmolVLA on a manipulation task:output_features=null,input_features=null: Auto-infer from dataset- Learning rate 10x higher than full fine-tuning
- Batch size 32 (adjust based on GPU memory)
- Evaluate every 10k steps
Fine-tuning π₀
Fine-tune Physical Intelligence’s π₀ policy:Memory and Speed Benefits
Memory Usage
PEFT drastically reduces memory requirements:| Method | Trainable Params | Memory (fp16) | Speedup |
|---|---|---|---|
| Full Fine-tuning | 7B | ~28 GB | 1.0x |
| LoRA (r=64) | 100M | ~16 GB | 1.8x |
| LoRA (r=32) | 50M | ~14 GB | 2.0x |
| LoRA (r=8) | 25M | ~12 GB | 2.2x |
Training Speed
PEFT training is faster because:- Fewer gradients to compute
- Less memory movement
- Faster optimizer updates
Hyperparameter Tuning
Learning Rate
PEFT typically uses higher learning rates:LoRA Rank
Balance between capacity and efficiency:LoRA Alpha
Scaling factor for adapter outputs:lora_alpha = r/2 or r/4.
Loading PEFT Models
Load fine-tuned PEFT models:Merging Adapters
Merge adapters into base model for deployment:- Load faster (no adapter overhead)
- Use slightly less memory
- Cannot be “un-merged”
Multi-GPU PEFT Training
Scale PEFT training across GPUs:Best Practices
lerobot-train \
--policy.path=lerobot/smolvla_base \
--peft.method_type=LORA \
--peft.r=64 \
--peft.lora_alpha=32 \
--policy.optimizer_lr=1e-3
Troubleshooting
Model not learning
Increase learning rate or rank:Out of memory
Reduce rank or batch size:Overfitting
Reduce rank or add dropout:Next Steps
- Multi-GPU Training - Scale PEFT across GPUs
- Evaluate Policies - Test your fine-tuned model
- SmolVLA Guide - Learn about SmolVLA architecture
- PEFT Documentation - Deep dive into PEFT methods