Pith. sign in

REVIEW 4 cited by

A Study on ReLU and Softmax in Transformer

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2302.06461 v1 pith:JMZQR3UA submitted 2023-02-13 cs.CL cs.AIcs.LG

classification cs.CLcs.AIcs.LG
keywords relusoftmaxkey-valuememorytransformerdifferentequivalentself-attention
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

The Transformer architecture consists of self-attention and feed-forward networks (FFNs) which can be viewed as key-value memories according to previous works. However, FFN and traditional memory utilize different activation functions (i.e., ReLU and Softmax respectively), which makes them not equivalent. In this paper, we first rebuild the connections between FFN and key-value memory by conducting extensive studies on ReLU and Softmax, and find they are equivalent when adding an additional layer normalization module on Softmax. In addition, ReLU outperforms Softmax on both FFN and key-value memory when the number of value slots is large. We analyze the reasons and then explore this good property of ReLU on the self-attention network where the original Softmax activation performs poorly on long input sequences. We then propose a full ReLU architecture named ReLUFormer which performs better than the baseline Transformer on long sequence tasks such as document translation. This paper sheds light on the following points: 1) Softmax and ReLU use different normalization methods over elements which lead to different variances of results, and ReLU is good at dealing with a large number of key-value slots; 2) FFN and key-value memory are equivalent, and thus the Transformer can be viewed as a memory network where FFNs and self-attention networks are both key-value memories.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 4 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Unpacking Softmax: How Temperature Drives Representation Collapse, Compression, and Generalization

    cs.LG 2025-06 conditional novelty 6.0 of 10

    Softmax temperature controls the rank of learned representations: high temperature induces rank-deficit bias, compresses features, hurts OOD generalization, and improves OOD detection.

  2. On Space Folds of ReLU Neural Networks

    cs.LG 2025-02 reject novelty 6.0 of 10

    A new Hamming-space ratio measures how far a straight input path is from staying convex in a ReLU network's activation space.

  3. Transformers and Their Roles as Time Series Foundation Models

    cs.LG 2025-02 conditional novelty 5.0 of 10

    Transformers can implement autoregressive least-squares regression in-context on time series, and pretraining on weakly dependent data gives test error decaying as 1 divided by the square root of the number of pretrai...

  4. Dual Attention Residual U-Net for Accurate Brain Ultrasound Segmentation in IVH Detection

    eess.IV 2025-05 conditional novelty 4.0 of 10

    A residual U-Net with CBAM and a dual-branch sparse/dense attention layer reports Dice 89.04 and IoU 81.84 on brain ultrasound ventricle segmentation.

Pith tools