Skip to content
nonconvexcard

Derive the attention crossover length

ProofBeginner⏱ 15 minLLM Opscrossoverflopsscaling

Problem

Show that the attention term of the forward-pass cost overtakes the weight term at S⋆=N/(2Ld)S_\star = N/(2Ld). Then show that for a transformer whose parameters are dominated by the standard per-layer blocks, S⋆S_\star is proportional to dd, and say what that implies about wide versus deep models at long context.

Write a complete argument. Every inequality you use should be one you could state precisely.

Hints

Hints — 0 of 2 revealed

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
Count the FLOPs of a forward passLLM OpsNumericalFoundation15 min
Ridge point and the batch size needed to saturateLLM OpsNumericalBeginner15 min
The 6ND FLOP estimateLLMsNumericalBeginner15 min
When does attention dominate the MLP?Deep LearningNumericalBeginner30 min
Locating the Bernstein crossoverHigh-Dim ProbabilityNumericalIntermediate30 min