Summary
The authors study Approximate Attention Loss Gradient Computation (AALGC) (e.g. complexity of training LLMs with backprop):
- they show that the magnitude of entries of certain matrices (layer inputs times QKV matrices) affect whether LLM backprop is "almost-linear" or not. This connects techniques like quantization to complexity.
- if the max entry of the products is bounded by B and B is o(root(logn)) it's almost-linear time, and when it's more than that, it's impossible under some assumptions (SETH)
- for the almost-linear case, they construct a novel algorithm for AALGC
- SETH: the assumptions are the Strong Exponential Time Hypothesis: for any eps>0 exists k>=3 for which solving k-sat with n variables in O(2^{(1-eps)n}) is impossible (even with randomized algorithms)
- part of the construction involves a polynomial approximation to softmax that works well for non-large entries.
- the authors use some nice techniques (like the tensor trick) that not everyone between theory + ML is familiar with, so the techniques in the paper are useful in their own right
- more generally, the style of the paper is nice in that the results are clear + it's very pedagogical
Strengths
- the results, as mentioned in the introduction: extending results in complexity of forward computation to complexity of backprop
- discussion of how complexity changes when certain assumptions are made (magnitude of entries) or approximations are made (polynomial softmax)
- connection to practice: discussion of e.g. quantization practices in the context of theory
Weaknesses
- the softmax approximation passes by a little too quickly in the paper, I had to scroll up and down throughout the paper several times to piece the definitions together. If you control+F (search) for "softmax" or "polynomial" in the paper, only a few results come up and it's mostly references. It would be really great to add a committed subsection that says "This is the precise softmax approximation we use" and later in the algorithm section point out where exactly it's used in a clear way.
- could use a little more discussion on whether such bounds on B hold in practice (e.g. in some open source models)
Questions
- I can't tell if it's just notation or not, but at some points like Definition 1.4 it seems like "n" refers to (1) the sequence length (2) the number of bits in the B bound B = o(root(log(n)) , and also (3) d = O(log n) where d is the embedding dimension ? Could you elaborate on which of these are tied together?
- You allude to the near-linear time algorithms possibly being tough and needing more algorithms/hardware innovations to make practical. Could you elaborate on whether there are any particular things that come to mind?
- AALGC seems to switch between an epsilon parameter and B parameter around Definition 1.4