Gating is Weighting: Understanding Gated Linear Attention through In-context Learning

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Li, Yingcong, Tarzanagh, Davoud Ataee, Rawat, Ankit Singh, Fazel, Maryam, Oymak, Samet
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866916675259990016
author Li, Yingcong
Tarzanagh, Davoud Ataee
Rawat, Ankit Singh
Fazel, Maryam
Oymak, Samet
author_facet Li, Yingcong
Tarzanagh, Davoud Ataee
Rawat, Ankit Singh
Fazel, Maryam
Oymak, Samet
contents Linear attention methods offer a compelling alternative to softmax attention due to their efficiency in recurrent decoding. Recent research has focused on enhancing standard linear attention by incorporating gating while retaining its computational benefits. Such Gated Linear Attention (GLA) architectures include competitive models such as Mamba and RWKV. In this work, we investigate the in-context learning capabilities of the GLA model and make the following contributions. We show that a multilayer GLA can implement a general class of Weighted Preconditioned Gradient Descent (WPGD) algorithms with data-dependent weights. These weights are induced by the gating mechanism and the input, enabling the model to control the contribution of individual tokens to prediction. To further understand the mechanics of this weighting, we introduce a novel data model with multitask prompts and characterize the optimization landscape of learning a WPGD algorithm. Under mild conditions, we establish the existence and uniqueness (up to scaling) of a global minimum, corresponding to a unique WPGD solution. Finally, we translate these findings to explore the optimization landscape of GLA and shed light on how gating facilitates context-aware learning and when it is provably better than vanilla linear attention.
format Preprint
id arxiv_https___arxiv_org_abs_2504_04308
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Gating is Weighting: Understanding Gated Linear Attention through In-context Learning
Li, Yingcong
Tarzanagh, Davoud Ataee
Rawat, Ankit Singh
Fazel, Maryam
Oymak, Samet
Machine Learning
Artificial Intelligence
Computation and Language
Optimization and Control
Linear attention methods offer a compelling alternative to softmax attention due to their efficiency in recurrent decoding. Recent research has focused on enhancing standard linear attention by incorporating gating while retaining its computational benefits. Such Gated Linear Attention (GLA) architectures include competitive models such as Mamba and RWKV. In this work, we investigate the in-context learning capabilities of the GLA model and make the following contributions. We show that a multilayer GLA can implement a general class of Weighted Preconditioned Gradient Descent (WPGD) algorithms with data-dependent weights. These weights are induced by the gating mechanism and the input, enabling the model to control the contribution of individual tokens to prediction. To further understand the mechanics of this weighting, we introduce a novel data model with multitask prompts and characterize the optimization landscape of learning a WPGD algorithm. Under mild conditions, we establish the existence and uniqueness (up to scaling) of a global minimum, corresponding to a unique WPGD solution. Finally, we translate these findings to explore the optimization landscape of GLA and shed light on how gating facilitates context-aware learning and when it is provably better than vanilla linear attention.
title Gating is Weighting: Understanding Gated Linear Attention through In-context Learning
topic Machine Learning
Artificial Intelligence
Computation and Language
Optimization and Control
url https://arxiv.org/abs/2504.04308