Computational Complexity

Computational complexity describes how memory, compute, or communication cost changes as input size and model width grow.

For an architecture :

is a size variable such as sequence length, number of pixels, or number of graph edges, is hidden dimension, and is the dominant scaling term.

Common Patterns

Dense linear layer from to :

Self-attention with sequence length and hidden dimension :

The attention matrix costs and stores attention weights before implementation details.

2D convolution over height , width , kernel size , input channels , and output channels :

Graph message passing with edge set :

for a simple per-edge message of hidden size .

Why It Matters

Architecture choice is also a systems decision. A model can be statistically reasonable but impossible to train, too slow to serve, or too memory-heavy for long inputs.

Complexity is not the whole story. Constants, kernels, hardware layout, batching, parallelism, and memory bandwidth can dominate in practice.

For paper claims, complexity should be separated from the actual scaling evidence. A lower asymptotic term does not prove better quality per compute unless the budget, implementation, and metric are comparable.

Checks

  • What variable grows at deployment: sequence length, graph size, image resolution, batch size, or number of candidates?
  • Is the bottleneck arithmetic, activation memory, KV cache, communication, or IO?
  • Does the benchmark hide the real deployment size?
  • Is the asymptotic cost compatible with the intended inference workflow?
  • Is a scaling claim backed by matched data, model size, compute, hardware, and metric?