English
Related papers

Related papers: The Two-Pass Softmax Algorithm

200 papers

While transformer models exhibit strong in-context learning (ICL) abilities, they often fail to generalize under simple distribution shifts. We analyze these failures and identify Softmax, the scoring function in the attention mechanism, as…

Computation and Language · Computer Science 2026-05-12 Omar Naim , Swarnadeep Bhar , Jérôme Bolte , Nicholas Asher

Softmax function is widely used in artificial neural networks for multiclass classification, multilabel classification, attention mechanisms, etc. However, its efficacy is often questioned in literature. The log-softmax loss has been shown…

Machine Learning · Computer Science 2020-11-24 Kunal Banerjee , Vishak Prasad C , Rishi Raj Gupta , Karthik Vyas , Anushree H , Biswajit Mishra

A softmax operator applied to a set of values acts somewhat like the maximization function and somewhat like an average. In sequential decision making, softmax is often used in settings where it is necessary to maximize utility but also to…

Artificial Intelligence · Computer Science 2017-06-15 Kavosh Asadi , Michael L. Littman

Learning distributed representations, or embeddings, that encode the relational similarity patterns among objects is a relevant task in machine learning. A popular method to learn the embedding matrices $X, Y$ is optimizing a loss function…

Machine Learning · Computer Science 2025-06-03 Lorenzo Dall'Amico , Enrico Maria Belliardo

The softmax function is a cornerstone of multi-class classification, integral to a wide range of machine learning applications, from large-scale retrieval and ranking models to advanced large language models. However, its computational cost…

Machine Learning · Computer Science 2025-01-16 Jin Chen , Jin Zhang , Xu huang , Yi Yang , Defu Lian , Enhong Chen

Softmax is widely used in neural networks for multiclass classification, gate structure and attention mechanisms. The statistical assumption that the input is normal distributed supports the gradient stability of Softmax. However, when used…

Computer Vision and Pattern Recognition · Computer Science 2021-08-17 Shulun Wang , Bin Liu , Feng Liu

Computations for the softmax function are significantly expensive when the number of output classes is large. In this paper, we present a novel softmax inference speedup method, Doubly Sparse Softmax (DS-Softmax), that leverages sparse…

Machine Learning · Computer Science 2019-07-04 Shun Liao , Ting Chen , Tian Lin , Denny Zhou , Chong Wang

Recent neural network and language models rely on softmax distributions with an extremely large number of categories. Since calculating the softmax normalizing constant in this context is prohibitively expensive, there is a growing…

Machine Learning · Statistics 2018-03-26 Francois Fagan , Garud Iyengar

The widespread adoption of machine learning algorithms necessitates hardware acceleration to ensure efficient performance. This acceleration relies on custom matrix engines that operate on full or reduced-precision floating-point…

Hardware Architecture · Computer Science 2024-08-23 Kosmas Alexandridis , Christodoulos Peltekis , Dionysios Filippas , Giorgos Dimitrakopoulos

With the explosion of the size of digital dataset, the limiting factor for decomposition algorithms is the \emph{number of passes} over the input, as the input is often stored out-of-core or even off-site. Moreover, we're only interested in…

Numerical Analysis · Computer Science 2016-08-14 Radim Řeh{ů}řek

Differentiable image sampling in the form of backward warping has seen broad adoption in tasks like depth estimation and optical flow prediction. In contrast, how to perform forward warping has seen less attention, partly due to additional…

Computer Vision and Pattern Recognition · Computer Science 2020-03-13 Simon Niklaus , Feng Liu

The problem of finding a maximum size matching in a graph (known as the maximum matching problem) is one of the most classical problems in computer science. Despite a significant body of work dedicated to the study of this problem in the…

Data Structures and Algorithms · Computer Science 2021-09-14 Moran Feldman , Ariel Szarf

Softmax can become a computational bottleneck in the Transformer model's Multi-Head Attention (MHA) block, particularly in small models under low-precision inference, where exponentiation and normalization incur significant overhead. As…

Machine Learning · Computer Science 2026-04-03 Dimitrios Danopoulos , Enrico Lupi , Michael Kagan , Maurizio Pierini

Despite achieving state-of-the-art results in nearly all Natural Language Processing applications, fine-tuning Transformer-based language models still requires a significant amount of labeled data to work. A well known technique to reduce…

Machine Learning · Computer Science 2025-03-13 Julius Gonsior , Christian Falkenberg , Silvio Magino , Anja Reusch , Maik Thiele , Wolfgang Lehner

In classification tasks, softmax functions are ubiquitously used as output activations to produce predictive probabilities. Such outputs only capture aleatoric uncertainty. To capture epistemic uncertainty, approximate Gaussian inference…

Machine Learning · Computer Science 2026-02-12 Bálint Mucsányi , Nathaël Da Costa , Philipp Hennig

We propose DropMax, a stochastic version of softmax classifier which at each iteration drops non-target classes according to dropout probabilities adaptively decided for each instance. Specifically, we overlay binary masking variables over…

Machine Learning · Computer Science 2018-11-05 Hae Beom Lee , Juho Lee , Saehoon Kim , Eunho Yang , Sung Ju Hwang

While Transformers are dominated by Floating-Point (FP) Matrix-Multiplications, their aggressive acceleration through dedicated hardware or many-core programmable systems has shifted the performance bottleneck to non-linear functions like…

Hardware Architecture · Computer Science 2025-04-16 Run Wang , Gamze Islamoglu , Andrea Belano , Viviane Potocnik , Francesco Conti , Angelo Garofalo , Luca Benini

The softmax activation function plays a crucial role in the success of large language models (LLMs), particularly in the self-attention mechanism of the widely adopted Transformer architecture. However, the underlying learning dynamics that…

Machine Learning · Computer Science 2026-01-27 Yang Cao , Yingyu Liang , Zhenmei Shi , Zhao Song

Regular expression matching is the core function of various network security applications such as network intrusion detection systems. With the network bandwidth increases, it is a great challenge to implement regular expression matching…

Networking and Internet Architecture · Computer Science 2024-03-26 Jincheng Zhong , Shuhui Chen , Chuan Yu

Debugging accumulation of floating-point errors is hard; ideally, computer should track it automatically. Here we consider twofold approximation of an exact real with value + error pair of floating-point numbers. Normally, value + error sum…

Numerical Analysis · Computer Science 2014-01-06 Evgeny Latkin