179 questions
No questions match those filters.
← All questions
Training & Fine-tuningMedium· FlashAttention· Memory Efficiency· Backpropagation
Why does FlashAttention save memory during training, no...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansStandard attention requires storing the full N x N probability matrix P to compute gradients during the backward pass, which consumes massive amounts of memory at long context lengths. FlashAttention avoids this by storing only the log-sum-exp (Li) values per head. During the backward pass, it recomputes the necessary tiles of P. This reduces the activation memory footprint from O(N^2) to O(N), which is often the difference between being able to run a training job or encountering an out-of-memory error.