Merge LoRA Adapters into Base Weights

easy
Unit 4 · Fine-Tuning & Evaluation0/2 to milestone

A LoRA adapter stores a low-rank update ΔW=αrBA\Delta W = \frac{\alpha}{r} B A next to a frozen weight WW (shape (d_out, d_in)), with AA of shape (r, d_in) and BB of shape (d_out, r). For deployment you can merge it into the weight, so inference costs nothing extra:

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Merge LoRA Adapters into Base Weights · TechGradify