Exercises — Computational complexity of LLMs
Self-check questions, exercises, and worked answers
← Back to the lesson: Computational complexity of LLMs
Check your understanding
- Dense attention is quadratic: why can it still be computed in parallel? Interactions between positions are parallelizable matrix operations; total work and sequential depth are different.
- Why is standard generation still sequential? The next token depends on the token just selected.
- Does FlashAttention make attention linear? No: it retains quadratic work while reducing memory movement and intermediates.
- Is a recurrent model with linear work in \(T\) fully parallel? No: a naïve recurrence depends on the previous state, although some structures enable parallel scans.
- Does an MoE with few active experts store only those experts? No: all expert weights must be hosted or accessible.