← Back to LLMs Mind Map
⚡ LLMsID: lora

LoRA / QLoRA Low-Rank Adaptation

LoRA/QLoRA 低秩适配
🎯Core Definition
LoRA (Low-Rank Adaptation) is a parameter-efficient fine-tuning method: freeze the pretrained weights WW and train only a low-rank delta ΔW=BA\Delta W = BA with A∈Rd×rA \in \mathbb{R}^{d \times r}, B∈Rr×dB \in \mathbb{R}^{r \times d}, rank r≪dr \ll d. Forward pass computes h=Wx+BAxh = Wx + BAx; at inference the matrices merge into W′=W+BAW' = W + BA with zero overhead.
💡Use Cases
fine-tuning large models (7B-70B) on consumer GPUs, multi-adapter deployment (shared base + hot-swappable LoRAs), rapid iteration; QLoRA quantizes the base to 4-bit, enabling 65B fine-tuning on a single GPU.
⚡Key Problems Solved
full fine-tuning of 70B needs ~4×80GB A100s; LoRA trains ~0.1% of params, cutting gradient/optimizer memory by an order of magnitude, and multiple adapters hot-swap on one base, slashing serving cost.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of LoRA / QLoRA Low-Rank Adaptation.
Use Cases
In production engineering, what are the primary use cases for LoRA / QLoRA Low-Rank Adaptation and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Why does LoRA work? What justifies the low-rank assumption?
2
How do you pick the rank r? Effects of r too large or small?
3
How are LoRA weights merged at inference? Deploying multiple LoRAs?
4
QLoRA's mechanism: 4-bit quant, paged optimizer, double quantization — what does each solve?
5
LoRA vs full fine-tuning: quality gaps and when full FT is required?
Updated 2026-08-11
🎯
Verify Mastery: Practice Exam Questions for "LoRA / QLoRA Low-Rank Adaptation"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardSupervised Fine-Tuning (SFT)Next Card →Soft Prompts / Adapters

🔗 More LLMs Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/LLM/card/lora
中文速览与面试要点

LoRA/QLoRA 低秩适配 (LoRA / QLoRA Low-Rank Adaptation)

定义: LoRA (Low-Rank Adaptation, 低秩适配) 是一种参数高效微调方法:冻结预训练权重 W,只训练低秩增量 W = BA,其中 A R^d r、B R^r d,秩 r d。训练时前向计算 h = Wx + BAx,推理时可合并回 W' = W + BA 零额外开销。 使用场景: 在消费级显存上微调大模型(7B-70B)、多任务多适配器部署(共享底座 + 热插拔 LoRA)、快速迭代实验;QLoRA 进一步把底座量化到 4-bit,单卡即可微调 65B。 解决的问题: 全量微调 70B 需要约 4×80GB A100;LoRA 只训练约 0.1% 参数,优化器状态与梯度显存降一个数量级,且多个适配器可在同一底座上热插拔,部署成本大幅下降。

核心要点

  • LoRA 为什么有效?低秩假设的依据是什么?
  • LoRA 的秩 r 如何选择?r 太大/太小的影响?
  • LoRA 在推理时如何合并权重?多个 LoRA 如何部署?
  • QLoRA 的原理:4-bit 量化 + 分页优化器 + 双重量化分别解决什么?
  • LoRA 和全量微调 (Full FT) 的效果差异?什么时候必须全量?