LearnQuestion bank

What are the main weaknesses of the standard transformer, and which modifications or alternatives address each (compute, memory, context length, reasoning)?

ResearchTechnicalMedium

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • Quadratic attention: FlashAttention is exact and IO-aware; sparse/linear attention and state-space or hybrid models trade exactness or recall for lower asymptotic cost.
  • KV memory: GQA and latent/low-rank KV compression reduce cache size and bandwidth, with some risk to fine-grained token-level fidelity.
  • Fixed context: retrieval and external memory extend effective context, but add pipeline complexity and retrieval or memory-access errors.
  • Length generalisation and reasoning: positional schemes, chain-of-thought, tools, and test-time compute help, but do not guarantee robust long-range reasoning.
  • MoE: increases capacity per FLOP by activating a subset of experts, at the cost of routing, load balancing, memory, and latency.
  • Every fix trades quality for efficiency: exactness, recall, reliability, or simplicity is usually given up to gain speed, memory, or context.

In full

The core weakness is that standard attention scales quadratically with sequence length, so compute and memory grow steeply as context expands. FlashAttention is the safest fix because it computes exact attention while being IO-aware, improving wall-clock speed and memory traffic without changing the math, but it does not remove the quadratic asymptotic cost; sparse or linear attention and state-space or hybrid models reduce that cost, yet they approximate or restrict interactions and can lose precise long-range recall. The KV cache is the other memory bottleneck, and GQA or latent/low-rank KV compression cut cache size and bandwidth, usually with a small quality cost but a real risk of losing fine-grained token-level detail. Fixed context length is addressed by retrieval and external memory mechanisms, which can reach beyond the training window, but they add retrieval errors, extra infrastructure, and no guarantee that the model will use the right evidence. Length generalisation and reasoning are only partly solved by positional schemes, chain-of-thought, tools, and test-time compute: these improve practical performance, but they do not prove robust reasoning over very long inputs and can be unreliable or expensive. MoE adds capacity per FLOP by activating only some experts, improving quality per unit of compute, but it introduces routing overhead, load-balancing pressure, extra memory for inactive experts, and latency or communication costs. Overall, each modification buys efficiency by giving up some combination of exactness, recall, reliability, or simplicity, so the right choice depends on whether the priority is exactness, long-context recall, or throughput.

Checked against sources by an independent AI reviewer.

What a strong answer covers

  • Quadratic attention: FlashAttention (exact and IO-aware), sparse or linear attention, state-space or hybrid models.
  • KV memory: GQA or latent attention.
  • Fixed context: retrieval or memory mechanisms.
  • Length generalisation and reasoning limits.
  • MoE adds capacity per FLOP.
  • States the quality/efficiency trade-off for each fix.

Common mistakes

  • Listing alternatives with no trade-offs.
  • Calling FlashAttention approximate.