Training Jun 2021

LoRA: Low-Rank Adaptation of Large Language Models

Edward J. Hu et al. · ICLR 2022

arXiv:2106.09685

In short

Instead of updating all of a large model’s weights, LoRA freezes them and learns a small low-rank correction for each layer. On GPT-3 it cut trainable parameters by about 10,000 times with quality on par with full fine-tuning.

Why it matters

It made adapting big models cheap enough for everyone, and is why fine-tunes are shared as small adapter files.

Read first

The 3 Field Guide ideas this paper leans on.

Starting from scratch? The full route 22 ideas · basics first
  1. Natural Language Processing ✓ understood

    The field of AI that lets computers read, interpret, translate and generate human language, from spam filters and search to chatbots.

  2. Token ✓ understood

    The unit of text a language model reads and writes: a word, part of a word, or a character, drawn from the model's fixed vocabulary.

  3. Tokenization ✓ understood

    Splitting text into tokens, usually subword pieces, and mapping each to an integer ID so a language model can process it.

  4. Language Modeling ✓ understood

    Assigning probabilities to sequences of text, in practice by predicting each next token from the ones before it; the objective behind large language models.

  5. Dataset ✓ understood

    A collection of data examples used for training, validating, or testing machine learning models.

  6. Training ✓ understood

    The process of fitting a model to data by repeatedly measuring how wrong its outputs are and adjusting its parameters to reduce that error.

  7. Machine Learning ✓ understood

    Building systems that learn patterns from data instead of following hand-written rules, getting better at a task as they see more examples.

  8. Unsupervised Learning ✓ understood

    Learning from unlabeled data to discover hidden patterns, structures, or relationships without explicit target outputs.

  9. Self-Supervised Learning ✓ understood

    Training on unlabeled data by making the data supply its own answers: hide or alter part of an input and have the model predict or match it.

  10. Pre-training ✓ understood

    Training a model on a large dataset (often self-supervised) before fine-tuning on specific tasks, enabling transfer learning.

  11. Feature ✓ understood

    A single measurable property of an example, such as a house's floor area or how many links an email contains, used as an input to a model.

  12. Neural Network ✓ understood

    A model built from layers of simple units, each taking a weighted sum of its inputs and applying a nonlinearity; training adjusts the weights so the whole stack maps inputs to useful outputs.

  13. Deep Learning ✓ understood

    A subset of machine learning that uses neural networks with multiple layers (deep neural networks) to learn hierarchical representations of data.

  14. Representation Learning ✓ understood

    Letting a model learn its own internal description of the data, such as embeddings or layered visual features, instead of relying on features designed by hand.

  15. Embedding ✓ understood

    A list of numbers (a vector) that represents a word, sentence, image or other item, learned so that similar items end up close together.

  16. Attention Mechanism ✓ understood

    A technique that lets a neural network weigh every part of its input when producing each output, focusing on the parts most relevant at that step.

  17. Transformer ✓ understood

    A neural network architecture, introduced in 2017, built from stacked self-attention and feed-forward layers; the basis of nearly every modern large language model.

  18. Large Language Model · read first ✓ understood

    A neural network, almost always a transformer, trained on vast amounts of text to predict the next token, which lets it write, answer, summarize and follow instructions.

  19. Fine-Tuning · read first ✓ understood

    The process of further training a pre-trained model on a specific dataset to adapt it for a particular task or domain.

  20. Parameter ✓ understood

    A number inside a model, a weight or a bias, that training adjusts to reduce the loss. Together, a model's parameters are everything it has learned.

  21. Parameter-Efficient Fine-Tuning (PEFT) ✓ understood

    A family of methods that adapt a large pretrained model by training a small number of new or selected parameters while leaving the original weights frozen.

  22. LoRA · read first ✓ understood

    Low-Rank Adaptation - a parameter-efficient fine-tuning method that updates only small low-rank matrices instead of full weights.

Nearby papers

Summary in our own words; read the paper for the details. ← All papers