Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Intel Ipex llm LoRA Adapter Injection QLoRA

From Leeroopedia


Knowledge Sources
Domains NLP, Parameter_Efficient_Finetuning
Last Updated 2026-02-09 00:00 GMT

Overview

Technique for injecting trainable low-rank adapter matrices into a 4-bit quantized model for parameter-efficient fine-tuning.

Description

LoRA (Low-Rank Adaptation) injects pairs of low-rank decomposition matrices (A and B) into selected transformer layers. For QLoRA specifically, the base model is frozen at 4-bit precision while the LoRA adapters are trained in bfloat16. The process involves: (1) preparing the quantized model for k-bit training by freezing base parameters and enabling gradient computation on adapters, (2) configuring LoRA hyperparameters (rank, alpha, target modules), and (3) wrapping the model with PEFT to isolate trainable parameters.

Usage

Use this principle after loading a 4-bit quantized model (QLoRA) to add trainable LoRA adapters. The training_mode must be set to "qlora" to ensure IPEX-LLM applies the correct quantization-aware gradient computation.

Theoretical Basis

LoRA decomposes weight updates as low-rank matrices:

W=W+ΔW=W+BA

Where:

  • Wd×k is the frozen pretrained weight (4-bit quantized)
  • Bd×r and Ar×k are trainable (bf16)
  • rmin(d,k) is the rank (typically 8 or 16)
  • Scaling factor: α/r

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment