rank⁡\operatorname{rank}

Rank of a matrix

Read "rank of W". It is the number of truly independent directions a matrix can produce, which equals its number of nonzero singular values.

A 4096×40964096 \times 4096 matrix stores about 16.8 million numbers, but its rank can be as low as 8: every output it produces is then a mix of just 8 directions. Low rank means the matrix can be stored much more compactly, as two thin matrices.

LoRA assumes that the change a fine-tune makes to the weights has low rank, even though the weights themselves do not. So the change can be learned as two thin matrices.

Example

rank⁡[1224]=1\operatorname{rank}\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} = 1

The second row is twice the first, so there is only one independent direction.

Where the course uses it

Related terms