Skip to content

Training, adaptation, compression, and systems techniques · Training, fine-tuning, adaptation, compression, and systems techniques · TRN024 · Training method

BitFit bias-only fine-tuning

Updates bias terms while freezing most pretrained weights.

Runs in CodeSplash Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

A CodeSplash method runs this entry in Python and R. Set it up from the method's page.

Do it in CodeSplash Run it on your own data, in Python or R.

Availability
Runs in CodeSplash
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
Verified in Python and R through learn.cnn, learn.ft_transformer, learn.tabm, learn.torch_mlp. The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Updates bias terms while freezing most pretrained weights.

Question / hypotheses

Does this intervention improve the intended quality, adaptation, resource, or reliability objective under a controlled comparison? It defines a method, not an intrinsic null-hypothesis test.

Architecture / computational structure

The computational graph remains largely unchanged; a trainable-parameter mask selects bias tensors and, depending on the task, an output head.

Assumptions

The architecture must contain useful bias terms; bias-free models offer little or no BitFit capacity. Results from masked language models do not automatically transfer to all modern decoders.

Formula / computational definition

W=W0,b←b−η∇bL.W=W_0,\qquad b\leftarrow b-\eta\nabla_bL.

Parameters and notation

Learned: selected biases and optionally head parameters. Frozen: weight matrices. Hyperparameters: bias subset, learning rate, head policy, regularization, epochs.

Fitting, fine-tuning, and adaptation

Inspect trainable names and parameter counts, initialize the task head, then fit on training data with early stopping. Compare to a frozen-feature linear probe and richer PEFT alternatives.

How to use and calibrate

Measure task accuracy and retained pretrained behavior. Example: low-data classification with a compatible pretrained encoder.

Example application

low-data classification with a compatible pretrained encoder.

Interpretation / pitfalls

Watch out

A small parameter count does not prove low activation memory or sufficient adaptation capacity. Updating normalization gains as well is a different trainable subset.

Python and R code examples

Scope: numerical mechanism demonstration. Validation: Python executed successfully on the supplied synthetic inputs; R reviewed but not executed (Rscript unavailable).

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — numerical mechanism demonstration. · needs numpy

import numpy as np
W=np.array([[1.,2.]]); x=np.array([.5,1.]); b=np.array([.1]); grad_b=np.array([.3])
b=b-.01*grad_b; print(W@x+b)
R

Component demo, not a trained model — numerical mechanism demonstration.

W <- matrix(c(1,2),1); x <- c(.5,1); b <- .1; grad.b <- .3
b <- b-.01*grad.b; print(W%*%x+b)

Sources

From the CodeSplash reference, entry TRN024.