Skip to content

The Extender: A Log-Structured Transformer

Jakob Eriksson

cs.LG

Abstract

We introduce the Extender, a log-structured variant of the standard Transformer architecture. In a standard Transformer, each layer communicates with subsequent layers exclusively via the residual h\mathbf{h}, a superposition channel. The Extender adds a concatenation channel x\mathbf{x}: each layer ℓ\ell emits both a residual update δℓδ_\ell which is added to h\mathbf{h}, and a much smaller extension εℓε_\ell which is appended to x\mathbf{x}. While both the FFN and q\mathbf{q} see h\mathbf{h}, the attention kv\mathbf{kv} projections take only x\mathbf{x} as input. As a result, the fully extended x\mathbf{x} contains the complete input for the kv\mathbf{kv} projections of all layers, reducing the persistent attention memory footprint from 2Ldmodel2Ld_{model} to ∑∣εℓ∣\sum|ε_\ell|. We find that with ∣εℓ∣=32|ε_\ell|=32, the Extender matches Transformer accuracy on short-context (CORE) tasks at 199M-924M parameters, and exceeds Transformer accuracy on long-context (RULER) workloads, again at 924M parameters. For our 1664-wide, 924M model, the Extender's persistent attention memory footprint is 104×104\times smaller than MHA. The memory savings grow with model width.

Create a lesson

Metadata

Categories
cs.LG, cs.AI