Large Language Models (LLMs) with billions of parameters have drastically transformed AI applications. However, their demanding computation during inference has raised significant challenges for deployment on resource-constrained devices. Despite recent trends favoring alternative activation functions such as GELU or SiLU, known for increased computation, this study strongly advocates for reinstating ReLU activation in LLMs. We demonstrate that using the ReLU activation function has a negligible impact on convergence and performance while significantly reducing computation and weight transfer. This reduction is particularly valuable during the memory-bound inference step, where efficiency is paramount. Exploring sparsity patterns in ReLU-based LLMs, we unveil the reutilization of activated neurons for generating new tokens and leveraging these insights, we propose practical strategies to substantially reduce LLM inference computation up to three times, using ReLU activations with minimal performance trade-offs.
ReLU$^2$ Wins: Discovering Efficient Activation Functions for Sparse LLMs
Tsinghua University(清华大学);Shanghai Jiao Tong University(上海交通大学);Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所);Renmin University of China(中国人民大学)
UCLA(加州大学洛杉矶分校);Courant Institute of Mathematical Sciences, New York University(纽约大学柯朗数学科学研究所);Center for Data Science, New York University(纽约大学数据科学中心);Institute for Advanced Study(普林斯顿高等研究院)
The analysis of neural network training beyond their linearization regime remains an outstanding open question, even in the simplest setup of a single hidden-layer. The limit of infinitely wide networks provides an appealing route forward through the mean-field perspective, but a key challenge is to bring learning guarantees back to the finite-neuron setting, where practical algorithms operate. Towards closing this gap, and focusing on shallow neural networks, in this work we study the ability of different regularisation strategies to capture solutions requiring only a finite amount of neurons…
Institute of Robotics and Cognitive Systems, University of Lübeck(吕贝克大学机器人与认知系统研究所);Mercedes-Benz AG(梅赛德斯-奔驰公司);Software Competence Center Hagenberg (SCCH)(哈根贝格软件能力中心);Institute of Signal Processing, Johannes Kepler University of Linz (JKU)(林茨约瑟夫·凯斯勒大学信号处理研究所);Institute of Neuro- and Bioinformatics, University of Lübeck(吕贝克大学神经与生物信息学研究所)
Overwhelming theoretical and empirical evidence shows that mildly overparametrized neural networks -- those with more connections than the size of the training data -- are often able to memorize the training data with $100\%$ accuracy. This was rigorously proved for networks with sigmoid activation functions and, very recently, for ReLU activations. Addressing a 1988 open question of Baum, we prove that this phenomenon holds for general multilayered perceptrons, i.e. neural networks with threshold activation functions, or with any mix of threshold and ReLU activations. Our construction is prob…
Recent approaches in the theoretical analysis of model-based deep learning architectures have studied the convergence of gradient descent in shallow ReLU networks that arise from generative models whose hidden layers are sparse. Motivated by the success of architectures that impose structured forms of sparsity, we introduce and study a group-sparse autoencoder that accounts for a variety of generative models, and utilizes a group-sparse ReLU activation function to force the non-zero units at a given layer to occur in blocks. For clustering models, inputs that result in the same group of active…
Towards the Connection between Activation Sparsity and Flat Minima
State Key Laboratory for Novel Software Technology, Nanjing University(南京大学新型软件技术国家重点实验室);Institute of Brain-Machine Interface, Nanjing University(南京大学脑机接口研究院);School of Computer Science and Engineering, Southeast University(东南大学计算机科学与工程学院)
École Polytechnique Fédérale de Lausanne (EPFL)(洛桑联邦理工学院)
We propose to optimize the activation functions of a deep neural network by adding a corresponding functional regularization to the cost function. We justify the use of a second-order total-variation criterion. This allows us to derive a general representer theorem for deep neural networks that makes a direct connection with splines and sparsity. Specifically, we show that the optimal network configuration can be achieved with activation functions that are nonuniform linear splines with adaptive knots. The bottom line is that the action of each neuron is encoded by a spline whose parameters (i…
Consider the multivariate nonparametric regression model. It is shown that estimators based on sparsely connected deep neural networks with ReLU activation function and properly chosen network architecture achieve the minimax rates of convergence (up to $\log n$-factors) under a general composition assumption on the regression function. The framework includes many well-studied structural constraints such as (generalized) additive models. While there is a lot of flexibility in the network architecture, the tuning parameter is the sparsity of the network. Specifically, we consider large networks…
University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Intel(英特尔)
Our community has greatly improved the efficiency of deep learning applications, including by exploiting sparsity in inputs. Most of that work, though, is for inference, where weight sparsity is known statically, and/or for specialized hardware. We propose a scheme to leverage dynamic sparsity during training. In particular, we exploit zeros introduced by the ReLU activation function to both feature maps and their gradients. This is challenging because the sparsity degree is moderate and the locations of zeros change over time. We also rely purely on software. We identify zeros in a dense data…
An Accelerated Alternating Partial Bregman Algorithm for ReLU-based Matrix Decomposition
School of Mathematics and Computational Science, Xiangtan University(湘潭大学数学与计算科学学院);School of Mathematical Sciences, Beihang University(北京航空航天大学数学科学学院)
University of Alberta(阿尔伯塔大学);Hong Kong University of Science and Technology(香港科技大学);University of Washington(华盛顿大学);Carnegie Mellon University(卡内基梅隆大学)
In this paper we investigate the performance of different types of rectified activation functions in convolutional neural network: standard rectified linear unit (ReLU), leaky rectified linear unit (Leaky ReLU), parametric rectified linear unit (PReLU) and a new randomized leaky rectified linear units (RReLU). We evaluate these activation function on standard image classification task. Our experiments suggest that incorporating a non-zero slope for negative part in rectified activation units could consistently improve the results. Thus our findings are negative on the common belief that sparsi…
SenseTime Research(商汤科技研究院);The University of Hong Kong(香港大学)
Improving sparsity of deep neural networks (DNNs) is essential for network compression and has drawn much attention. In this work, we disclose a harmful sparsifying process called filter collapse, which is common in DNNs with batch normalization (BN) and rectified linear activation functions (e.g. ReLU, Leaky ReLU). It occurs even without explicit sparsity-inducing regularizations such as $L_1$. This phenomenon is caused by the normalization effect of BN, which induces a non-trainable region in the parameter space and reduces the network capacity as a result. This phenomenon becomes more promi…
The leaky ReLU network with a group sparse regularization term has been widely used in the recent years. However, training such a network yields a nonsmooth nonconvex optimization problem and there exists a lack of approaches to compute a stationary point deterministically. In this paper, we first resolve the multi-layer composite term in the original optimization problem by introducing auxiliary variables and additional constraints. We show the new model has a nonempty and bounded solution set and its feasible set satisfies the Mangasarian-Fromovitz constraint qualification. Moreover, we show…
School of Informatics, University of Edinburgh(爱丁堡大学信息学院);ILLC, University of Amsterdam(阿姆斯特丹大学语言、逻辑与计算研究所);Department of Computational Linguistics, University of Zurich(苏黎世大学计算语言学系)
Recently, it has been argued that encoder-decoder models can be made more interpretable by replacing the softmax function in the attention with its sparse variants. In this work, we introduce a novel, simple method for achieving sparsity in attention: we replace the softmax activation with a ReLU, and show that sparsity naturally emerges from such a formulation. Training stability is achieved with layer normalization with either a specialized initialization or an additional gating function. Our model, which we call Rectified Linear Attention (ReLA), is easy to implement and more efficient than…
Turbo Sparse: Achieving LLM SOTA Performance with Minimal Activated Parameters
Institute of Parallel and Distributed Systems (IPADS), Shanghai Jiao Tong University(上海交通大学并行与分布式系统研究所(IPADS));Department of Computer Science and Technology, Tsinghua University(清华大学计算机科学与技术系);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)
The rectified linear unit (ReLU) is a highly successful activation function in neural networks as it allows networks to easily obtain sparse representations, which reduces overfitting in overparameterized networks. However, in network pruning, we find that the sparsity introduced by ReLU, which we quantify by a term called dynamic dead neuron rate (DNR), is not beneficial for the pruned network. Interestingly, the more the network is pruned, the smaller the dynamic DNR becomes during optimization. This motivates us to propose a method to explicitly reduce the dynamic DNR for the pruned network…
California Institute of Technology(加州理工学院);Claremont Graduate University(克莱蒙特研究生大学);Massachusetts Institute of Technology(麻省理工学院)
The paper briefy reviews several recent results on hierarchical architectures for learning from examples, that may formally explain the conditions under which Deep Convolutional Neural Networks perform much better in function approximation problems than shallow, one-hidden layer architectures. The paper announces new results for a non-smooth activation function - the ReLU function - used in present-day neural networks, as well as for the Gaussian networks. We propose a new definition of relative dimension to encapsulate different notions of sparsity of a function class that can possibly be exp…
We explore the concept of co-design in the context of neural network verification. Specifically, we aim to train deep neural networks that not only are robust to adversarial perturbations but also whose robustness can be verified more easily. To this end, we identify two properties of network models - weight sparsity and so-called ReLU stability - that turn out to significantly impact the complexity of the corresponding verification task. We demonstrate that improving weight sparsity alone already enables us to turn computationally intractable verification problems into tractable ones. Then, i…
Yale University(耶鲁大学);Max-Planck-Institut für Informatik(马克斯·普朗克信息学研究所);Google Research(谷歌研究院)
Infinite width limit has shed light on generalization and optimization aspects of deep learning by establishing connections between neural networks and kernel methods. Despite their importance, the utility of these kernel methods was limited in large-scale learning settings due to their (super-)quadratic runtime and memory complexities. Moreover, most prior works on neural kernels have focused on the ReLU activation, mainly due to its popularity but also due to the difficulty of computing such kernels for general activations. In this work, we overcome such difficulties by providing methods to …
There has been a growing interest in expressivity of deep neural networks. However, most of the existing work about this topic focuses only on the specific activation function such as ReLU or sigmoid. In this paper, we investigate the approximation ability of deep neural networks with a broad class of activation functions. This class of activation functions includes most of frequently used activation functions. We derive the required depth, width and sparsity of a deep neural network to approximate any Hölder smooth function upto a given approximation error for the large class of activation fu…
University of Oxford(牛津大学);The Alan Turing Institute(阿兰·图灵研究所)
Deep Convolutional Sparse Coding (D-CSC) is a framework reminiscent of deep convolutional neural networks (DCNNs), but by omitting the learning of the dictionaries one can more transparently analyse the role of the activation function and its ability to recover activation paths through the layers. Papyan, Romano, and Elad conducted an analysis of such an architecture, demonstrated the relationship with DCNNs and proved conditions under which the D-CSC is guaranteed to recover specific activation paths. A technical innovation of their work highlights that one can view the efficacy of the ReLU n…
Middle Tennessee State University(中田纳西州立大学);The University of Hong Kong(香港大学);University of Wisconsin-Madison(威斯康星大学麦迪逊分校);Tsinghua University(清华大学);The Simons Institute for the Theory of Computing at the UC, Berkeley(加州大学伯克利分校西蒙斯理论计算研究所)
HATA: Trainable and Hardware-Efficient Hash-Aware Top-k Attention for Scalable Large Model Inference
University of Science and Technology of China(中国科学技术大学);Institute of Artificial Intelligence(人工智能研究院);Hefei Comprehensive National Science Center(合肥综合性国家科学中心);Huawei Technologies(华为技术有限公司);Peking University(北京大学)
Smoothness Adaptivity in Constant-Depth Neural Networks: Optimal Rates via Smooth Activations
Department of Mathematical Sciences, Tsinghua University(清华大学数学科学系);School of Mathematical Sciences, Peking University(北京大学数学科学学院);Center for Machine Learning Research, Peking University(北京大学机器学习研究中心);AI for Science Institute, Beijing(北京人工智能科学研究院)