arXiv:2610.22256cs.LGOct 2026

Manuscript Offprint

arXiv:2610.22256

BitSparse: Compact Activation Storage for ReLU Feed-Forward Networks

Max Zhu, Bohang Sun, Pietro Lio, Jialin Yu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Reducing memory use in large language model (LLM) training is an ongoing challenge. Activation checkpointing saves memory by recomputation, while lossy compression changes the stored activations. The reemergence of sparse ReLU and ReLU 2^{2} activations creates a third opportunity: losslessly compressing the activation cache itself. We present BitSparse, a GPU-resident lossless compression format for sparse activations. Compression and reconstruction run in custom Triton kernels fused into an autograd function, shrinking the activation cache while recovering it exactly for the backward pass. Bfloat16 (BF16) and FP8 activations are supported. Optional sign-bit packing further increases compression up to close to the theoretical limit. We analyze its compression ratio and compare it to the theoretical optimum. BitSparse lowers per-token VRAM by 31% and 30% Modded-NanoGPT and Nemotron-H respectively, with overheads of no more than 1% at practical sequence lengths. Additionally, a new preallocated buffer system avoids host synchronization during training when variable size tensors are allocated.

1 Introduction

The memory required to train large language models limits the batch sizes and sequence lengths that fit on an accelerator. Alongside weights, gradients, and optimizer states, backpropagation requires activations retained from the forward pass. Parameter-related storage is largely independent of input size, whereas saved activations and some temporary buffers grow with the number of tokens processed simultaneously. Reducing this input-dependent memory cost is therefore important even when the model weights already fit on the device.

Feed-forward layers are a natural target. They expand each token’s hidden representation, typically by a factor of 3–5, and retain intermediate values for computing weight gradients. While the original Transformer Vaswani et al. (2017) used quadratic memory, more recent memory-efficient attention (Rabe and Staats, 2022; Dao et al., 2022) and state-space architectures such as Mamba (Gu and Dao, 2024) are both linear in the number of tokens, so the feedforward layers make up a significant portion of the memory cost.

Certain activations produce sparse outputs that can be exploited to reduce memory usage. The ReLU activation (ReLU) maps nonpositive inputs to exact zeros (Nair and Hinton, 2010). Large language models (LLMs) have used alternative activations such as GELU Hendrycks and Gimpel (2016) and gated activations such as SwiGLU. However, recently squared ReLU (ReLU 2^{2}) activations have demonstrated competitive efficiency in LLMs (So et al., 2021) and are used in the Nemotron family and Modded-NanoGPT (Blakeman et al., 2025; Basant et al., 2025; Adler et al., 2024; Jordan et al., 2024a). Sparsity naturally emerges in training without any sparsity-inducing objective (Li et al., 2023; Mirzadeh et al., 2024). In our measurements, the pretrained Nemotron-H model has approximately 92% feed-forward activation sparsity.

Exploiting this redundancy requires an inexpensive enough representation to use during backpropagation with minimal latency. Alternatives such as activation checkpointing reduce storage by recomputing forward intermediates (Chen et al., 2016), while lossy activation compression trades accuracy for memory (Chen et al., 2021; Shamshoum et al., 2025). This raises a simple question: can the exact zeros already produced by ReLU-family LLMs be converted into activation-memory savings without recomputation or approximation?

*Preprint. Corresponding author: Max Zhu, mz406@cam.ac.uk. Code: https://github.com/Maxzhu123/Bitmask_Sparsity.

Figure

Figure 1: Overview of BitSparse. Caching ReLU activations for backpropagation is expensive: most entries are exact zeros, and every stored value carries a redundant sign bit. BitSparse caches only the nonzero values and reconstructs them with optimized Triton kernels.

We present BitSparse, a GPU-native format for lossless compression of sparse activations using a bitmask and compact nonzero values. Custom Triton kernels compress activations during the forward pass and reconstruct them as needed during backward. A shared value buffer avoids host synchronization. BitSparse supports the ReLU and ReLU 2^{2} activations with optimized kernels for minimum overhead. Figure 1 illustrates the approach. Our contributions are:

• A GPU activation-storage scheme for ReLU and squared ReLU, with tile-parallel reconstruction, integration into feed-forward backpropagation and a preallocated buffer to avoid host synchronization.

• An information-theoretic analysis of sparse activation storage, together with compression ratios and break-even sparsity thresholds for the implemented representation.

• Evaluations spanning activation sparsity, codec throughput, MLP comparisons, and language-model forward/backward workloads. BitSparse reduces peak allocated memory by up to 48% in an MLP, and reduces the memory per token by approximately 31% for Modded-NanoGPT and 30% for Nemotron-H, with minimal runtime overhead.

References (65)