6/31
Part 1 of 6 · What LoRA trainsLearn and do
Multiply x by A first, and the big matrix is never built
The order of the two matmuls decides what the update costs.
# GPT-3 175B's query projection, at rank 8
d, r = 12_288, 8
# x @ A.T @ B.T, for one input row
print(f"{r * (d + d):,}")
# the frozen layer, for one input row
print(f"{d * d:,}")
# building B @ A
print(f"{d * r * d:,}")
GPT-3's query projection is 12,288 by 12,288. At rank 8, how does the branch's work for one input row compare with the frozen layer's?
Pick one to see what it prints.
Pick an answer above to see the rest