Adaptive Rank Allocation: Speeding Up Modern Transformers with RaNA Adapters
Roberto Garcia, Jerry Liu, Daniel Sorvisto, Sabri Eyuboglu
TL;DR
The paper tackles the rising inference cost of modern Transformers by moving beyond neuron-based adapters and introducing Adaptive Rank Allocation, with RaNA as a concrete adapter. RaNA replaces linear layers with input-dependent low-rank decompositions, enabling computation to be allocated via rank-aware routers without relying on activation sparsity, and extends to both MLP and QKV components of Transformers. Empirically, RaNA achieves lower reconstruction error and better perplexity/accuracy trade-offs than prior adapters across Llama2-7b, Gemma-2b, and Pythia models at around 40–46% FLOP reductions, including practical latency gains. The approach demonstrates robust applicability to non-sparse activations like SwiGLU and GeLU, highlights the sparsity of rank contributions, and suggests that input-driven rank adaptation can be a powerful generalization of neuron adapters with meaningful real-world speedups.
Abstract
Large Language Models (LLMs) are computationally intensive, particularly during inference. Neuron-adaptive techniques, which selectively activate neurons in Multi-Layer Perceptron (MLP) layers, offer some speedups but suffer from limitations in modern Transformers. These include reliance on sparse activations, incompatibility with attention layers, and the use of costly neuron masking techniques. To address these issues, we propose the Adaptive Rank Allocation framework and introduce the Rank and Neuron Allocator (RaNA) adapter. RaNA adapters leverage rank adapters, which operate on linear layers by applying both low-rank matrix decompositions and adaptive masking to efficiently allocate compute without depending on activation sparsity. This enables RaNA to be generally applied to MLPs and linear components of attention modules, while eliminating the need for expensive maskers found in neuron-adaptive methods. Notably, when compared to neuron adapters, RaNA improves perplexity by up to 7 points and increases accuracy by up to 8 percentage-points when reducing FLOPs by $\sim$44% in state-of-the-art Transformer architectures. These results position RaNA as a robust solution for improving inference efficiency in modern Transformer architectures.
