---
title: "BitFit Explained: Fine-Tuning Only the Bias Terms"
description: "BitFit fine-tunes a Transformer by training only its bias terms, about 0.08% of BERT-large. How it works, the 2021 results, its limits, and PyTorch code."
url: https://launchkudos.com/news/llm-fine-tuning-bitfit
section: AI
author: "Arnab Gupta"
published: 2026-12-05T02:19:43.615Z
updated: 2026-12-05T02:19:43.615Z
tags: [llm-fine-tuning, bitfit, peft, bias-tuning, bert]
---

# BitFit Explained: Fine-Tuning Only the Bias Terms

*BitFit fine-tunes a Transformer by training only its bias terms, about 0.08% of BERT-large. How it works, the 2021 results, its limits, and PyTorch code.*

*Part 4 of 15 in [LLM fine-tuning techniques](https://launchkudos.com/news/llm-fine-tuning-techniques)*

BitFit (BIas-Term FIne-Tuning) adapts a pretrained Transformer by freezing every weight matrix and training only the bias vectors plus a task classifier. Researchers at Bar-Ilan University and the Allen Institute for AI introduced it in June 2021 and reported that on BERT-large, training 0.08% of the parameters matched full fine-tuning on the GLUE validation set, 84.2 versus 84.1 ([Ben Zaken et al., 2021](https://arxiv.org/abs/2106.10199)).

- 0.08% · Share of BERT-large's parameters that BitFit trains · BitFit paper, Sec. 3
- 84.2 vs 84.1 · GLUE dev average: BitFit vs full fine-tuning, BERT-large · BitFit paper, Table 1
- 0.04% · Only the query and MLP-intermediate biases: 81.1 vs 82.3 full FT · BitFit paper, Sec. 1, Table 3
## What is BitFit?

BitFit is "a sparse-finetuning method where only the bias-terms of the model (or a subset of them) are being modified", according to its paper. With small to medium training data it was "competitive with (and sometimes better than) fine-tuning the entire model" on BERT; with larger data it was competitive with other sparse methods ([Ben Zaken et al., abstract](https://arxiv.org/abs/2106.10199)).

The authors list four goals for it: change very few parameters per task, change the *same* parameters for every task, keep those changes isolated in one part of the network, and match full fine-tuning on small to medium datasets (Sec. 1). Changing the same set every time is what they argue makes it suited to hardware where most weights are fixed (Sec. 1, Sec. 6).

## How does BitFit work?

Almost every linear layer in BERT computes **Wx + b**: a weight matrix W times the input, plus a bias vector b. BitFit freezes all W matrices and layer-norm scale vectors g, and trains only the additive bias terms b and the final classification layer ([BitFit paper, Sec. 3](https://arxiv.org/abs/2106.10199)).

![Diagram of BitFit inside a BERT layer: the query, key, value, attention output, MLP-in and MLP-out weight matrices are shown frozen in grey while their bias vectors are shown trained in orange; a bar chart compares the share of BERT-large parameters trained: 100% for full fine-tuning, 3.6% for adapters, 0.08% for BitFit](https://launchkudos.com/media/e966be4122fe29df0c37.webp)

The bias terms per BERT layer, using the paper's names and the Hugging Face parameter names it maps them to (Appendix A.1):

| Paper name | Hugging Face parameter | What it shifts |
|---|---|---|
| b_q, b_k, b_v | `attention.self.query.bias`, `key.bias`, `value.bias` | Query, key and value projections |
| b_m1 | `attention.output.dense.bias` | Attention output projection |
| b_LN1 | `attention.output.LayerNorm.bias` | First layer norm |
| b_m2 | `intermediate.dense.bias` | MLP up-projection (768 → 3072 in BERT-base) |
| b_m3 | `output.dense.bias` | MLP down-projection |
| b_LN2 | `output.LayerNorm.bias` | Second layer norm |

### Which biases matter most?

Not all biases move equally. Measuring how far each bias vector changed during fine-tuning on RTE, the authors found the key bias b_k had "zero change", while the query bias b_q and the MLP-intermediate bias b_m2 changed the most (Sec. 4, Figure 1). Training only those two, half the bias parameters and 0.04% of the model, scored 81.1 on BERT-base GLUE dev, versus 82.4 for all biases and 82.3 for full fine-tuning (Table 3).

### Worked example: counting BERT-base's biases

Using the layer list above and BERT-base's sizes (hidden 768, MLP 3072, 12 layers):

| Bias | Size per layer |
|---|---|
| b_q, b_k, b_v | 3 × 768 = 2,304 |
| b_m1 | 768 |
| b_LN1 | 768 |
| b_m2 | 3,072 |
| b_m3 | 768 |
| b_LN2 | 768 |
| **Per layer** | **8,448** |
| **12 layers** | **101,376** |

So BitFit updates roughly 101K numbers in the encoder, plus the embedding layer norm's bias and the task classifier. This is our arithmetic; the paper states biases make up 0.09% of BERT-base's parameters and 0.08% of BERT-large's (Sec. 3).

## When was BitFit introduced, and by whom?

BitFit was introduced in "BitFit: Simple Parameter-efficient Fine-tuning for Transformer-based Masked Language-models" by Elad Ben Zaken, Shauli Ravfogel and Yoav Goldberg of Bar-Ilan University (Ravfogel and Goldberg also with the Allen Institute for AI). It was posted to arXiv on June 18, 2021, and accepted at the ACL 2022 main conference ([arXiv 2106.10199](https://arxiv.org/abs/2106.10199)).

The authors released code at [github.com/benzakenelad/BitFit](https://github.com/benzakenelad/BitFit) (paper, Sec. 3, footnote 1). The arXiv listing spells the first author "Elad Ben-Zaken".

## What results did the BitFit paper report?

On BERT-large, BitFit averaged 84.2 on the GLUE validation sets against 84.1 for the authors' own full fine-tuning runs, while training 0.08% of the parameters. On the GLUE test sets it averaged 80.9, against 81.1 for adapters (3.6% of parameters) and 81.5 to 81.8 for full fine-tuning as reported in earlier papers ([BitFit paper, Table 1](https://arxiv.org/abs/2106.10199)).

| Model (GLUE dev average) | Full fine-tuning | BitFit | BitFit params | Source |
|---|---|---|---|---|
| BERT-base | 82.3 | 82.4 | 0.09% | Table 2 |
| BERT-large | 84.1 | 84.2 | 0.08% | Table 2 |
| RoBERTa-base | 85.3 | 84.6 | 0.09% | Table 2 |

Other findings:

- **Biases are special, not just "few parameters".** Training the same number of randomly chosen parameters scored 78.5 (uniform) or 79.5 (whole rows/columns), against 82.4 for BitFit on BERT-base (Table 3).
- **A frozen model is far worse:** 62.1 average with no parameters trained (Table 3).
- **Fewer parameters than competitors:** on BERT-large, 6 times fewer trainable parameters than Diff-Pruning and 45 times fewer than adapters (Sec. 4).
- **Token-level tasks:** on Penn Treebank POS tagging, BitFit scored 97.2, 97.4 and 97.1 for BERT-base, BERT-large and RoBERTa-base, against 97.2, 97.4 and 97.2 for full fine-tuning (Sec. 4).
- **Data size matters.** On growing subsets of SQuAD, "BitFit dominates over Full-FT in the smaller-data regime, while the trend is reversed when more training data is available" (Sec. 4, Figure 2).
- **Smaller generalization gap** between training and test error than full fine-tuning (Sec. 4).

### Results on a large decoder model

BitFit's paper tested only BERT-family masked language models. The [LoRA](https://launchkudos.com/news/llm-fine-tuning-lora) paper later ran BitFit on GPT-3 175B: with 14.2M trainable parameters it scored 71.3 on WikiSQL, 91.0 on MNLI-m and 51.3/27.4/43.5 ROUGE on SAMSum, versus 73.8, 89.5 and 52.0/28.0/44.5 for full fine-tuning and 73.4, 91.7 and 53.8/29.8/45.9 for LoRA with 4.7M ([Hu et al., 2021, Table 4](https://arxiv.org/abs/2106.09685)).

## How is BitFit different from LoRA, QLoRA and adapters?

BitFit adds nothing to the model: it re-trains a subset of parameters that already exist. [Adapter Tuning](https://launchkudos.com/news/llm-fine-tuning-adapter-tuning) inserts new layers, and [LoRA](https://launchkudos.com/news/llm-fine-tuning-lora) and [QLoRA](https://launchkudos.com/news/llm-fine-tuning-qlora) add new low-rank matrices beside existing weights. Because only biases change, the trained set is the same for every task, which the authors list as a design goal ([BitFit paper, Sec. 1](https://arxiv.org/abs/2106.10199)).

| | BitFit | [Adapter Tuning](https://launchkudos.com/news/llm-fine-tuning-adapter-tuning) | [LoRA](https://launchkudos.com/news/llm-fine-tuning-lora) | [QLoRA](https://launchkudos.com/news/llm-fine-tuning-qlora) |
|---|---|---|---|---|
| New parameters added | None | Bottleneck layers | Low-rank A, B | Low-rank A, B |
| What is trained | Existing biases + classifier | Adapters + layer norms + classifier | A, B | A, B on 4-bit base |
| Share trained in its paper | 0.08–0.09% (BERT) | 3.6% (BERT-large, GLUE) | 4.7M of 175B (GPT-3) | r = 64 on all linear layers |
| Models in original paper | BERT, RoBERTa (encoders) | BERT | RoBERTa, DeBERTa, GPT-2, GPT-3 | LLaMA, T5, RoBERTa and others |

One practical limit: BitFit can only train bias terms a model actually has. The BitFit paper itself notes that the original Transformer equations "do not include bias terms at all" (Sec. 5, footnote 5). Check your model's `named_parameters()` before choosing it.

## Which libraries support BitFit?

We found no dedicated BitFit method in the major PEFT libraries. Hugging Face PEFT's methods overview lists prompt-based, layer-tuning (such as LayerNorm Tuning) and adapter methods, but not BitFit, and AdapterHub's methods page does not mention it either ([PEFT methods overview](https://huggingface.co/docs/peft/methods/overview); [AdapterHub methods](https://docs.adapterhub.ml/methods.html), both checked Dec. 4, 2026).

- **Plain PyTorch** is enough: set `requires_grad` on bias parameters only. PyTorch's `nn.Module` docs describe `requires_grad_()` as "helpful for freezing part of the module for finetuning" ([PyTorch nn.Module](https://docs.pytorch.org/docs/2.15/generated/torch.nn.Module.html)).
- **The authors' code:** [benzakenelad/BitFit](https://github.com/benzakenelad/BitFit) on GitHub.
- **Not the same thing:** PEFT's `LoraConfig(bias="all")` trains biases *in addition to* LoRA matrices ([PEFT LoRA reference](https://huggingface.co/docs/peft/package_reference/lora)); that is LoRA plus biases, not BitFit.

## How do you use BitFit in code?

Since no official library implements it, this is plain PyTorch on a Hugging Face Transformers model: freeze every parameter except those whose name ends in `.bias` and the task classifier. `named_parameters()` yields (name, parameter) pairs, per the PyTorch docs.

```python
import torch
from transformers import AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained(
    "bert-base-uncased", num_labels=2
)

# BitFit: train only bias terms and the new classification head
for name, param in model.named_parameters():
    param.requires_grad = name.endswith(".bias") or name.startswith("classifier.")

trainable = sum(p.numel() for p in model.parameters() if p.requires_grad)
total = sum(p.numel() for p in model.parameters())
print(f"trainable: {trainable:,} of {total:,} ({100 * trainable / total:.3f}%)")

optimizer = torch.optim.AdamW(
    [p for p in model.parameters() if p.requires_grad], lr=1e-4
)
# ... standard training loop or transformers.Trainer ...
```

The learning rate follows the paper, which searched bias-only runs over 1e-4 to 1e-3, higher than the 1e-5 to 5e-5 used for full fine-tuning, and used AdamW with batch size 16 (Appendix A.2). The printed share includes the classifier, so it will be slightly above the paper's bias-only 0.09%.

## Common pitfalls

- **Using full fine-tuning learning rates.** The authors used larger rates for bias-only training "as the smaller rates took a very long time to converge" (Appendix A.2).
- **Expecting it to hold on large datasets.** The paper's own SQuAD experiment shows full fine-tuning overtaking BitFit as training data grows (Sec. 4, Figure 2).
- **Applying it to models without biases.** BitFit can only train biases that exist; inspect `named_parameters()` first. The paper's results are for BERT-family encoders (title, Sec. 4).
- **Training only one bias type.** On BERT-base, only b_q gave 76.6 and only b_m2 gave 80.0, against 81.1 for both together (Table 3).
- **Confusing it with `bias="all"` in PEFT.** That option trains biases alongside LoRA, and PEFT warns that disabling the adapter then "will not reproduce the base model's output" ([PEFT LoRA reference](https://huggingface.co/docs/peft/package_reference/lora)).

> **> We read the BitFit paper (arXiv 2106.10199v5, the ACL 2022 version) in full: Sections 1 to 6, Tables 1 to 3, Figures 1 and 2, and Appendices A.1 and A.2. The GPT-3 comparison comes from the LoRA paper (2106.09685, Table 4). We checked the Hugging Face PEFT methods overview and LoRA reference, the AdapterHub methods page, and the PyTorch 2.15 nn.Module reference on Dec. 4, 2026; none of the PEFT libraries lists BitFit, so the code uses plain PyTorch. The bias count is our own arithmetic from BERT-base's layer sizes.**

## FAQ

### What does BitFit stand for?

BIas-Term FIne-Tuning. The method freezes the network and trains "only the bias-terms and the task-specific classification layer" (BitFit paper, Sec. 3).

### Is BitFit as good as full fine-tuning?

On BERT-base and BERT-large GLUE dev sets it matched it (82.4 vs 82.3, 84.2 vs 84.1); on RoBERTa-base it was 0.7 points lower, 84.6 vs 85.3 (Table 2). With more training data, full fine-tuning pulled ahead on SQuAD (Figure 2).

### How many parameters does BitFit train?

Less than 0.1%: 0.09% of BERT-base and 0.08% of BERT-large (Sec. 3), plus the task classifier. Training only the query and MLP-intermediate biases cuts it to 0.04% (Sec. 1).

### Does BitFit work on GPT-style models?

The original paper only tested masked language models. The LoRA paper ran it on GPT-3 175B with 14.2M trainable parameters: 71.3 on WikiSQL versus 73.8 for full fine-tuning, and 91.0 on MNLI-m versus 89.5 ([Hu et al., Table 4](https://arxiv.org/abs/2106.09685)).

### Is BitFit in Hugging Face PEFT?

Not as a named method in the PEFT docs we checked on Dec. 4, 2026. It takes a few lines of PyTorch: set `requires_grad=True` only on bias parameters and the classifier.

### Why do bias terms work so well?

The authors argue the results support the hypothesis that fine-tuning "is mainly about exposing knowledge induced by language-modeling training, rather than learning new task-specific linguistic knowledge" (abstract). Randomly chosen parameters of the same count did worse (Table 3).

### Can BitFit be combined with other methods?

The paper does not test combinations. PEFT's `LoraConfig(bias="all")` trains biases together with LoRA, which is a different method ([PEFT docs](https://huggingface.co/docs/peft/package_reference/lora)).

## Related techniques

- [LoRA](https://launchkudos.com/news/llm-fine-tuning-lora): trainable low-rank matrices beside frozen weights
- [QLoRA](https://launchkudos.com/news/llm-fine-tuning-qlora): LoRA on a 4-bit quantized base model
- [Adapter Tuning](https://launchkudos.com/news/llm-fine-tuning-adapter-tuning): bottleneck layers inserted in each block
- [All 15 LLM fine-tuning techniques](https://launchkudos.com/news/llm-fine-tuning-techniques)

## Sources

- Ben Zaken, E., Ravfogel, S., Goldberg, Y. "BitFit: Simple Parameter-efficient Fine-tuning for Transformer-based Masked Language-models." arXiv, June 18, 2021 (v5 Sept. 5, 2022); ACL 2022. [arXiv 2106.10199](https://arxiv.org/abs/2106.10199). Read Dec. 4, 2026.
- PyTorch docs, 2.15: [torch.nn.Module](https://docs.pytorch.org/docs/2.15/generated/torch.nn.Module.html). Checked Dec. 4, 2026.
- Hugging Face PEFT docs, v0.22.0: [Methods overview](https://huggingface.co/docs/peft/methods/overview), [LoRA reference](https://huggingface.co/docs/peft/package_reference/lora). Checked Dec. 4, 2026.
- AdapterHub docs: [Methods](https://docs.adapterhub.ml/methods.html). Checked Dec. 4, 2026.
- Hu, E. J., et al. "LoRA: Low-Rank Adaptation of Large Language Models." arXiv, June 17, 2021. [arXiv 2106.09685](https://arxiv.org/abs/2106.09685). Read Dec. 4, 2026.
- Houlsby, N., et al. "Parameter-Efficient Transfer Learning for NLP." arXiv, Feb. 2, 2019; ICML 2019. [arXiv 1902.00751](https://arxiv.org/abs/1902.00751). Read Dec. 4, 2026.

**Series:** [← Prev: Adapter Tuning](https://launchkudos.com/news/llm-fine-tuning-adapter-tuning) · [All 15 techniques](https://launchkudos.com/news/llm-fine-tuning-techniques) · [Next: Prefix Tuning →](https://launchkudos.com/news/llm-fine-tuning-prefix-tuning)
