Saved in:
Bibliographic Details
Main Authors: You, Chong, Wu, Kan, Jia, Zhipeng, Chen, Lin, Bhojanapalli, Srinadh, Guo, Jiaxian, Evci, Utku, Wassenberg, Jan, Netrapalli, Praneeth, Willcock, Jeremiah J., Subramanian, Suvinay, Chern, Felix, Andreev, Alek, Pathak, Shreya, Yu, Felix, Jain, Prateek, Culler, David E., Levy, Henry M., Kumar, Sanjiv
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2506.06644
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914108596551680
author You, Chong
Wu, Kan
Jia, Zhipeng
Chen, Lin
Bhojanapalli, Srinadh
Guo, Jiaxian
Evci, Utku
Wassenberg, Jan
Netrapalli, Praneeth
Willcock, Jeremiah J.
Subramanian, Suvinay
Chern, Felix
Andreev, Alek
Pathak, Shreya
Yu, Felix
Jain, Prateek
Culler, David E.
Levy, Henry M.
Kumar, Sanjiv
author_facet You, Chong
Wu, Kan
Jia, Zhipeng
Chen, Lin
Bhojanapalli, Srinadh
Guo, Jiaxian
Evci, Utku
Wassenberg, Jan
Netrapalli, Praneeth
Willcock, Jeremiah J.
Subramanian, Suvinay
Chern, Felix
Andreev, Alek
Pathak, Shreya
Yu, Felix
Jain, Prateek
Culler, David E.
Levy, Henry M.
Kumar, Sanjiv
contents The discovery of the lazy neuron phenomenon in trained Transformers, where the vast majority of neurons in their feed-forward networks (FFN) are inactive for each token, has spurred tremendous interests in activation sparsity for enhancing large model efficiency. While notable progress has been made in translating such sparsity to wall-time benefits, modern Transformers have moved away from the ReLU activation function crucial to this phenomenon. Existing efforts on re-introducing activation sparsity often degrade model quality, increase parameter count, complicate or slow down training. Sparse attention, the application of sparse activation to the attention mechanism, often faces similar challenges. This paper introduces the Spark Transformer, a novel architecture that achieves a high level of activation sparsity in both FFN and the attention mechanism while maintaining model quality, parameter count, and standard training procedures. Our method realizes sparsity via top-k masking for explicit control over sparsity level. Crucially, we introduce statistical top-k, a hardware-accelerator-friendly, linear-time approximate algorithm that avoids costly sorting and mitigates significant training slowdown from standard top-$k$ operators. Furthermore, Spark Transformer reallocates existing FFN parameters and attention key embeddings to form a low-cost predictor for identifying activated entries. This design not only mitigates quality loss from enforced sparsity, but also enhances wall-time benefit. Pretrained with the Gemma-2 recipe, Spark Transformer demonstrates competitive performance on standard benchmarks while exhibiting significant sparsity: only 8% of FFN neurons are activated, and each token attends to a maximum of 256 tokens. This sparsity translates to a 2.5x reduction in FLOPs, leading to decoding wall-time speedups of up to 1.79x on CPU and 1.40x on GPU.
format Preprint
id arxiv_https___arxiv_org_abs_2506_06644
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Spark Transformer: Reactivating Sparsity in FFN and Attention
You, Chong
Wu, Kan
Jia, Zhipeng
Chen, Lin
Bhojanapalli, Srinadh
Guo, Jiaxian
Evci, Utku
Wassenberg, Jan
Netrapalli, Praneeth
Willcock, Jeremiah J.
Subramanian, Suvinay
Chern, Felix
Andreev, Alek
Pathak, Shreya
Yu, Felix
Jain, Prateek
Culler, David E.
Levy, Henry M.
Kumar, Sanjiv
Machine Learning
The discovery of the lazy neuron phenomenon in trained Transformers, where the vast majority of neurons in their feed-forward networks (FFN) are inactive for each token, has spurred tremendous interests in activation sparsity for enhancing large model efficiency. While notable progress has been made in translating such sparsity to wall-time benefits, modern Transformers have moved away from the ReLU activation function crucial to this phenomenon. Existing efforts on re-introducing activation sparsity often degrade model quality, increase parameter count, complicate or slow down training. Sparse attention, the application of sparse activation to the attention mechanism, often faces similar challenges. This paper introduces the Spark Transformer, a novel architecture that achieves a high level of activation sparsity in both FFN and the attention mechanism while maintaining model quality, parameter count, and standard training procedures. Our method realizes sparsity via top-k masking for explicit control over sparsity level. Crucially, we introduce statistical top-k, a hardware-accelerator-friendly, linear-time approximate algorithm that avoids costly sorting and mitigates significant training slowdown from standard top-$k$ operators. Furthermore, Spark Transformer reallocates existing FFN parameters and attention key embeddings to form a low-cost predictor for identifying activated entries. This design not only mitigates quality loss from enforced sparsity, but also enhances wall-time benefit. Pretrained with the Gemma-2 recipe, Spark Transformer demonstrates competitive performance on standard benchmarks while exhibiting significant sparsity: only 8% of FFN neurons are activated, and each token attends to a maximum of 256 tokens. This sparsity translates to a 2.5x reduction in FLOPs, leading to decoding wall-time speedups of up to 1.79x on CPU and 1.40x on GPU.
title Spark Transformer: Reactivating Sparsity in FFN and Attention
topic Machine Learning
url https://arxiv.org/abs/2506.06644