The Extender: A Log-Structured Transformer
Organizations: UIC · University of Illinois Chicago
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 , a superposition channel. The Extender adds a concatenation channel : each layer emits both a residual update which is added to , and a much smaller extension which is appended to . While both the FFN and see , the attention projections take only as input. As a result, the fully extended contains the complete input for the projections of all layers, reducing the persistent attention memory footprint from to . We find that with , 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 smaller than MHA. The memory savings grow with model width.
Figures & tables
| Step | Explanation and Motivation |
|---|---|
| Both and start out as a token embedding, size . weights tied to below. | |
| Size sliding window of . . | |
| The ATTN projections see only , but the projection also sees . | |
| is the input to the FFN | |
| The FFN outputs both the residual update , and the extension . | |
| allows ATTN to write directly to the residual stream, and provides ATTN a clean gradient. |
| Size | Width | Depth | Q/K/V | Head |
|---|---|---|---|---|
| class | heads | dim | ||
| 198M | 1024 | 13 | 8 | 128 |
| 436M | 1280 | 20 | 10 | 128 |
| 920M | 1664 | 26 | 13 | 128 |
| Model | Stage | SCORE | 1k | 2k | 4k | 8k | 16k | 32k | 64k | T-mono | CORE |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Extender | ClimbMix 18B | NIAH-6 | 91.4 | 82.8 | 57.6 | 37.2 | 13.3 | 4.0 | 0.7 | 32.7 | 23.7 |
| REST | 31.2 | 22.5 | 11.6 | 5.0 | 4.1 | 3.7 | 2.9 | ||||
| RULER | 59.0 | 50.3 | 32.9 | 19.9 | 8.4 | 3.8 | 1.9 | ||||
| Transformer | ClimbMix 18B | NIAH-6 | 90.0 | 84.4 | 17.5 | 0.0 | – | – | – | 32.3 | 22.5 |
| REST | 33.1 | 24.1 | 5.9 | 0.0 | – | – | – | ||||
| RULER | 59.4 | 51.9 | 11.2 | 0.0 | – | – | – |
| Configuration | Val. | T-mono | CORE | RULER | |||
|---|---|---|---|---|---|---|---|
| 1k | 2k | 4k | 8k | ||||
| default Extender | 2.7547 | 20.1 | 14.6 | 50.1 | 39.3 | 25.7 | 13.5 |
| from | 2.7555 | 20.4 | 15.7 | 47.0 | 41.8 | 12.6 | 1.2 |
| from | 2.7617 | 19.5 | 15.1 | 44.7 | 41.5 | 22.1 | 12.4 |
| from | 2.7695 | 19.2 | 15.4 | 44.9 | 38.5 | 18.1 | 8.0 |
| from | 2.7500 | 20.2 | 15.6 | 48.0 | 37.0 | 25.9 | 13.9 |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Configuration | Val. | T-mono | CORE | RULER | |||
|---|---|---|---|---|---|---|---|
| 1k | 2k | 4k | 8k | ||||
| wide0, | 2.4983 | 30.5 | 23.0 | 60.3 | 48.1 | 33.8 | 14.0 |
| , | 2.4984 | 30.5 | 22.9 | 57.3 | 44.3 | 36.9 | 14.3 |
| 2.4781 | 30.0 | 22.9 | 61.9 | 47.7 | 33.6 | 15.1 | |
| , | 2.4934 | 30.8 | 22.9 | 63.0 | 53.9 | 34.6 | 15.3 |
| , | 2.4773 | 30.4 | 23.4 | 58.6 | 47.7 | 33.8 | 13.3 |
| Model | Tokens | T-mono | CORE | RULER | |||
| 1k | 2k | 4k | 8k | ||||
| 199M Extender, from scratch | 4B | 19.9 | 15.9 | 46.8 | 38.5 | 24.4 | 12.0 |
| 199M Extender student, Extender teacher | 4B | 24.1 | 19.1 | 51.7 | 44.0 | 29.6 | 14.8 |
| 199M Extender student, Transformer teacher | 4B | 23.8 | 17.2 | 51.9 | 44.0 | 27.8 | 16.0 |
| 924M Extender (teacher) | 14.5B | 33.2 | 25.1 | 70.7 | 64.1 | 62.5 | 53.5 |
| 920M Transformer (teacher) | 14.5B | 32.1 | 23.9 | 68.3 | 58.1 | 54.7 | 50.1 |
| Model | T-mono | CORE | RULER | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 1k | 2k | 4k | 8k | 16k | 32k | 64k | |||
| Extender 924M (MHA) | 32.7 | 23.7 | 59.0 | 50.3 | 32.9 | 19.9 | 8.4 | 3.8 | 1.9 |
| Extender 813M (GQA4/5) | 33.1 | 22.9 | 61.2 | 52.4 | 36.3 | 18.4 | 6.6 | 2.1 | 1.2 |
| Transformer 920M (MHA) | 32.3 | 22.5 | 59.4 | 51.9 | 11.2 | 0.0 | – | – | – |
| Extender 924M B (MHA) | 30.8 | 23.5 | 70.5 | 63.7 | 56.1 | 48.5 | 46.6 | 38.0 | 22.6 |
| Extender 813M B (GQA4/5) | 31.2 | 23.3 | 63.9 | 57.9 | 56.3 | 49.7 | 45.8 | 33.8 | 20.2 |
| Model | T-mono | CORE | RULER | |||
|---|---|---|---|---|---|---|
| 1k | 2k | 4k | 8k | |||
| 199M | 20.4 | 15.7 | 49.3 | 41.0 | 28.0 | 16.9 |
| 438M | 26.0 | 19.5 | 57.3 | 45.1 | 33.4 | 15.6 |
| 924M | 32.7 | 23.7 | 59.0 | 50.3 | 32.9 | 19.9 |
Transformer
Transformers are neural architectures that use attention to model relationships among sequence elements in language, vision, and scientific data.
See all 540 papers