All models

fla_gsa_causallm

A linear-time sequence model that pairs bounded memory slots with gating for adaptive forgetting.

Language · 226 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (23 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
GSA
Parameters
97.2K
Operations
226
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2024
Cited by
5 (as of 29 October 2026)
Authors
Yu Zhang, Songlin Yang, Ruijie Zhu and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m4937
Graph hash
414b42d922ea48833d88642ce0be94380ccfc7cf1a9750ed32657c8557690456
Skeleton hash
3c70f39139e933f80c6b07169808421f4109cb5fa238e80d0b2cb1a29f6e1eba
Architecture hash
c1e0caa3ec51809cd244d3200fdb47c76507c0158285b187b4fa094855a8bc67
Diagram SHA-256
35be2a0843088da9c4e7f0388bb44e6c3e30bf9659fe6451ce99b9d5a1053c78
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

menagerie.classics.fla_reimpl:build_fla: build({})

What it is

This model is the causal language model built from GSA layers in the flash-linear-attention library, whose model implementations are compatible with the Transformers library.

About this model's family

Gated Slot Attention (GSA) is a linear-time sequence model that reads from and writes to a bounded memory, which keeps its recurrent state compact. It enhances Attention with Bounded-memory-Control (ABC) by adding a gating mechanism inspired by Gated Linear Attention (GLA).

The paper's motivation is that linear attention Transformers and their gated variants fall short of traditional Transformers in recall-intensive tasks and demand significant resources for training from scratch. The authors first reformulate ABC as two-pass linear attention linked via softmax. They then point to limitations of ABC's memory update rule, the first being that it lacks a forgetting mechanism, so items stay in memory slots indefinitely once written. GSA is described as essentially a gated version of ABC.

Because GSA retains the softmax operation, the paper also studies finetuning pretrained Transformers to RNNs (T2R), and reports that finetuning Mistral-7B to GSA surpasses large recurrent language models such as RWKV6-7B and Mamba-7B. Its language modeling experiments use models with 1.3B and 2.7B parameters trained on the Slimpajama corpus for 100B tokens each.

Key idea. GSA adds gating to Attention with Bounded-memory-Control, forming a two-layer Gated Linear Attention linked via softmax that forgets adaptively and keeps a compact recurrent state.

  • gsa
  • gated slot attention
  • linear attention
  • linear-time sequence modeling
  • bounded memory attention
  • flash linear attention
  • finetuning transformers to rnns
  • t2r
  • efficient language model

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{zhang2024gatedslotattentionefficient,
      title={Gated Slot Attention for Efficient Linear-Time Sequence Modeling}, 
      author={Yu Zhang and Songlin Yang and Ruijie Zhu and Yue Zhang and Leyang Cui and Yiqiao Wang and Bolun Wang and Freda Shi and Bailin Wang and Wei Bi and Peng Zhou and Guohong Fu},
      year={2024},
      eprint={2409.07146},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2409.07146}, 
}