liveBook · Manning

Low-rank adaptation

As explained in Build a Large Language Model (From Scratch)

A parameter-efficient fine-tuning method that adapts a model by training low-rank updates instead of all weights.

Low-rank adaptation (LoRA) is a parameter-efficient fine-tuning method that adapts a language model by training low-rank updates instead of all model weights. section 7.8

Use LoRA to make instruction fine-tuning more efficient, then compare the modified run with the original:

  • Modify an existing instruction-fine-tuning implementation to use LoRA. section 7.8
  • Compare training runtime before and after applying the method. section 7.8
  • Compare model performance using the evaluation procedure and scored responses. section 7.8

Parameter-efficient fine-tuning exercise

Apply LoRA to the instruction-fine-tuning code, run the resulting training workflow, and compare its runtime and model performance with the original full fine-tuning run. section 7.8

Figure 7.19 The three-stage process for instruction fine-tuning the LLM. In this last step of the instruction-fine-tuning pipeline, we implement a method to quantify the performance of the fine-tuned model by scoring the responses it generated for the test.
figure

Use the instruction-fine-tuning evaluation pipeline to score generated responses and quantify performance differences between runs. section 7.8

How Build a Large Language Model (From Scratch) covers it

How deep it goes
Defines low-rank updates and assigns a runtime-versus-performance experiment, but does not detail the underlying implementation.
Examples
Uses a code-modification exercise comparing training runtime and model performance before and after LoRA.
What it assumes
Assumes an existing instruction-fine-tuning implementation and the ability to compare training runs and evaluation results.
What you can do after
Apply it via an existing fine-tuning implementation and evaluate its runtime and model-performance effects.
How it connects
Connects parameter-efficient fine-tuning with instruction fine-tuning and model evaluation.

Also explained in

Compare how 9 books explain low-rank adaptation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Large Language Model (From Scratch). The section links point to the parts of the book it draws on.