Scaling Frontiers › Architectural Innovations for Scale

Michael BrenndoerferMarch 15, 202611 min read
Language AI HandbookAll chapters
Part 67 of 67Frontier Outlook from 2025
Chapter 508Scaling Frontiers › Architectural Innovations for Scale
Reading section 5 of 10 · Architectural Innovations for Scale · 11 minSection 5 of 10 · 11 min

Book contents

Section 5 of 10 · 11 min read

Scaling Frontiers › Architectural Innovations for ScaleOne section · Sections in this chapter5 / 10 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

When the standard approach reaches its limits, the response is often to change what you are scaling. The history of deep learning includes several architectural transitions that improved efficiency and opened qualitatively new scaling regimes. Understanding what drove those transitions helps identify where the next ones might come from.

Mixture of Experts: Sparse Scaling

The Mixture of Experts (MoE) architecture offers a way to increase model capacity without proportionally increasing the compute required per forward pass. We covered this in detail in Part K, but it is worth revisiting in the context of scaling limits, because MoE represents a fundamentally different scaling axis.

In a dense transformer, every parameter participates in processing every token. In an MoE model, parameters are divided into groups called experts, and a learned routing function determines which small subset of experts handles each token. A model might have 100 billion total parameters but route each token through only 10 billion, maintaining the computational cost of the smaller model while having the capacity of the larger one.

This creates what researchers sometimes call conditional compute: the model's effective capacity grows with total parameters, but its computational cost per token does not. The relationship between parameters and FLOPs becomes decoupled.

The scaling law under MoE therefore changes. Instead of the standard:

C≈6NDC \approx 6ND

where CC is total compute, NN is parameters, and DD is training tokens, MoE allows:

C≈6⋅k⋅Nactive⋅DC \approx 6 \cdot k \cdot N_{\text{active}} \cdot D

where kk is the fraction of parameters activated per token and NactiveN_{\text{active}} is total parameters. For k=0.1k = 0.1, you can train a model ten times larger at the same compute cost, at least in terms of FLOPs.

In practice, MoE introduces new engineering challenges. Expert load balancing, where all experts are utilized roughly equally, requires auxiliary loss terms that add complexity to training. Communication costs increase in distributed training because tokens may need to be routed to experts on different devices, creating network bandwidth pressure. And the relationship between parameters and downstream task performance is less straightforward than for dense models, because different experts develop different specializations.

Despite these challenges, leading frontier models including GPT-4 (reportedly), Gemini 1.5, and Mixtral use MoE architectures. The performance-per-FLOP benefits are large enough that the engineering complexity is considered worthwhile.

Inference-Time Compute: A New Scaling Axis

One of the most significant recent shifts in the scaling conversation has been the recognition that inference-time compute is its own scalable resource. Training-time scaling dominates much of the literature because it is where the upfront cost is paid, but inference-time computation, the compute used when the model generates each response, can be traded for quality in ways that are only beginning to be understood.

The clearest demonstration came from chain-of-thought reasoning, which we explored in Part P on alignment. By prompting models to generate explicit intermediate reasoning steps before answering, performance on complex reasoning tasks improved dramatically, without any change to model weights. This extra generated text represents additional inference-time compute. The reasoning chain is a form of additional computation the model performs at test time.

More recent work has formalized this into explicit reasoning models. OpenAI's o1 and o3 series and DeepSeek-R1 are trained to perform extended internal reasoning before producing answers. These models allocate variable amounts of inference compute depending on the difficulty of the problem. Easy questions receive short reasoning chains; hard mathematical or coding problems receive much longer ones.

This introduces a qualitatively new scaling law. Performance scales with training compute and with the amount of compute spent at inference:

L(Ctrain,Cinfer)=f(Ctrain)−g(Cinfer)L(C_{\text{train}}, C_{\text{infer}}) = f(C_{\text{train}}) - g(C_{\text{infer}})

where ff captures the training-time scaling and gg captures the inference-time boost. The exact functional forms of ff and gg are active research topics, but empirically, inference scaling shows power law returns analogous to training scaling, at least for reasoning-intensive tasks.

The practical implication is significant: compute-limited organizations that cannot afford frontier training runs can compensate at inference time. A smaller model that reasons for longer can sometimes match or exceed the performance of a larger model on specific tasks.

Test-Time Compute

Test-time compute refers to the computational resources expended during inference, when a model generates a response. Unlike training compute, which is a one-time cost, test-time compute scales with the number of queries and the length of reasoning chains. Extended thinking or chain-of-thought reasoning trades increased latency and cost per query for improved accuracy on difficult tasks.

State Space Models and Linear Attention

Transformers scale well, but they have a quadratic attention problem. The standard self-attention mechanism we covered in Part J has complexity O(n2)O(n^2) in sequence length nn, which means that doubling the context window quadruples the attention compute. This puts fundamental pressure on the ability to scale context length, which is increasingly important for tasks that require reasoning over long documents.

Several architectural alternatives have emerged that offer linear or near-linear attention complexity. State Space Models (SSMs), particularly the S4 and Mamba architectures, reformulate sequence modeling as a learned linear dynamical system. Instead of attending to all previous tokens, SSMs maintain a compact state vector that is updated as new tokens arrive. This is analogous to RNNs, which we studied in Part H, but with structured state transition matrices that can be computed efficiently in parallel during training.

The key mathematical idea is that a linear SSM can be written as:

ht=Aht−1+Bxth_t = A h_{t-1} + B x_t yt=Chty_t = C h_t

where:

  • hth_t: the hidden state at time step tt, a compact summary of processed history
  • xtx_t: the input at step tt
  • yty_t: the output at step tt
  • AA: the state transition matrix, which determines how history is preserved or forgotten
  • BB: the input projection matrix
  • CC: the output projection matrix

The critical property is that AA, BB, and CC are fixed (or slowly varying) matrices, making the recurrence parallelizable via convolutions during training while remaining sequential (and therefore memory-efficient) during inference. Mamba extends this with selective state spaces where BB, CC, and a selection mechanism depend on the input, allowing the model to selectively ignore irrelevant context.

These architectures scale differently from transformers. They do not have the same attention bottleneck, so they can handle much longer sequences at lower cost. However, they also do not have the same in-context retrieval ability as full attention: transformers can precisely recall information from anywhere in a long context, while SSMs must compress history into a fixed-size state, which can cause information loss.

Hybrid architectures that combine attention layers with SSM layers represent an active area of research. The intuition is that attention handles precise retrieval when needed, while SSM layers handle bulk sequential processing more efficiently.

Scaling Depth Versus Width

Traditional neural network scaling increases both depth (number of layers) and width (hidden dimension) together. But these two dimensions of scale have different properties, and optimizing their ratio for specific objectives is an ongoing area of research.

Wider networks have more capacity per layer but transmit information across many independent channels in parallel. This makes them better at storing many independent patterns and at distributed computation where different parts of the network handle different subtasks simultaneously.

Deeper networks have more sequential computation, which allows them to build up more complex representations step by step. Each layer refines the representation from the previous one, enabling the hierarchical composition of features that makes deep learning powerful.

For language modeling at scale, the optimal depth-to-width ratio is not constant. Early scaling laws research suggested that depth and width should scale roughly proportionally. But more recent work has found that at very large scales, the marginal value of additional depth may exceed that of additional width, because reasoning tasks benefit from more sequential computation steps. This insight influences architecture choices in modern models, which tend to be relatively deeper and narrower than architectures from the early scaling era.

In[6]:
Code
import numpy as np

# Illustrate depth vs width tradeoffs in scaling
# We model a simplified performance function based on parameter count
# and how they are distributed across depth and width


def model_params(depth, width):
    """Approximate parameter count for a transformer with given depth and width."""
    # Each transformer layer has roughly 12 * width^2 parameters
    return depth * 12 * width**2


def reasoning_score(depth, width, total_params_target=1e10):
    """
    Simplified reasoning performance model.
    Deeper models get a bonus for sequential computation.
    Wider models are better at pattern storage.
    We normalize by total parameters to compare same-cost models.
    """
    params = model_params(depth, width)
    # Penalize for being far from target compute
    param_penalty = abs(np.log10(params) - np.log10(total_params_target)) * 0.1
    depth_bonus = 0.3 * np.log(depth + 1)
    width_bonus = 0.2 * np.log(width + 1)
    return depth_bonus + width_bonus - param_penalty


# Explore depth-width tradeoffs at fixed parameter budget
target_params = 1e10  # 10B parameters

# Find width for each depth to approximately hit target params
depths = np.arange(12, 200, 4)
widths = []
for d in depths:
    # width = sqrt(target_params / (d * 12))
    w = np.sqrt(target_params / (d * 12))
    widths.append(w)

widths = np.array(widths)
params_actual = np.array([model_params(d, w) for d, w in zip(depths, widths)])
reasoning_scores = np.array(
    [reasoning_score(d, w) for d, w in zip(depths, widths)]
)
Out[7]:
Visualization
Scatter plot showing hidden width falling from about 8,300 to 2,100 as depth rises from 12 to 196 layers at a fixed 10B-parameter budget.
Depth-width tradeoff at fixed parameter budget (~10B parameters). Each point represents a model with the same total parameters but different depth and width. Width decreases as depth increases to maintain the parameter budget.
Line chart showing a synthetic reasoning score increasing gradually from 2.58 to 3.11 as model depth rises from 12 to 196 layers.
Synthetic reasoning score from the chapter's explicit depth-width formula at a fixed 10B-parameter budget. The assumed score rises from 2.58 at 12 layers to 3.11 at 196 layers; it illustrates the model's built-in depth preference rather than an empirical architecture benchmark.

Long-Context and Efficient Attention

Scaling context length is one of the most practically valuable dimensions for language AI applications. Many real-world tasks, including document analysis, code understanding, multi-turn conversation, and reasoning over databases, require processing far more tokens than early transformer models could handle. GPT-2 had a 1,024-token context window. Modern models like Gemini 1.5 Pro handle 1 million tokens.

This scaling has been achieved through several advances. Position encoding improvements, particularly Rotary Positional Embeddings (RoPE) and its extensions, allow models to generalize to longer sequences than seen during training. Attention approximations like Flash Attention rewrite the attention computation to be more memory-efficient without changing the results, enabling longer sequences at the same hardware budget.

Flash Attention deserves particular attention here because it illustrates an important principle: algorithmic improvement can enable scaling that hardware improvement alone cannot. The standard attention implementation requires materializing the full n×nn \times n attention matrix in GPU memory, which scales quadratically. Flash Attention computes attention in tiles that fit in the faster on-chip SRAM, avoiding the quadratic memory footprint while producing exactly the same output. This makes long-context training feasible on hardware that would otherwise be memory-limited.

The impact of efficient attention on scaling is not merely quantitative. Long context changes what models can do qualitatively. A model that can hold an entire codebase in context can reason about global code structure in ways that a short-context model cannot. A model that can process entire book-length documents can synthesize information across hundreds of pages. These qualitative shifts represent a different kind of scaling than simply adding more parameters.