A Controlled Study of Attention-Only Transformers

· Source: Artificial Intelligence · Field: Technology & Digital — Artificial Intelligence & Machine Learning · Depth: Expert, quick

Summary

A controlled study investigates the necessity of feed-forward networks (FFNs) in Transformer architectures, which account for two-thirds of non-embedding parameters. Researchers developed Simple Attention Networks (SANs), attention-only decoder transformers, and compared them against standard transformers. Initial findings showed that directly removing FFNs was detrimental, with standard transformers outperforming SANs by 0.47 nats at matched depth and 0.26 nats at matched FLOPs. However, reallocating the freed parameter budget into increased attention depth largely closed this performance gap. At matched parameter counts, the difference was a mere 0.006 nats (0.27 percent of loss), a difference that shrank with larger training budgets (5B, 30B, 105B tokens) and remained near 0.02 nats across a 29x size range. The residual gap was attributed to parametric recall, where SANs struggled with knowledge-dense tasks requiring information from weights. QK-normalization was identified as critical for training deep attention-only stacks.

Key takeaway

For Machine Learning Engineers optimizing large language models, this study suggests rethinking the necessity of feed-forward layers. If your goal is to reduce model parameter count without sacrificing performance, consider reallocating the budget from FFNs to increased attention depth. This approach can achieve comparable performance, especially when paired with robust QK-normalization, potentially enabling more efficient model deployment on constrained hardware. Evaluate your model's parametric recall for knowledge-intensive applications.

Key insights

Attention-only Transformers can match standard Transformer performance by reallocating feed-forward network parameters to increased attention depth.

Principles

Method

Pretrain attention-only decoder transformers (SANs) against standard transformers, matching parameter count, training FLOPs, and depth (2-48 layers) across 6M-87M parameters and up to 105B tokens.

In practice

Topics

Best for: Research Scientist, AI Scientist, Machine Learning Engineer, NLP Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Artificial Intelligence.