Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Searching for Activation Functions

Automated search yields Swish, an activation that tends to beat ReLU

  • Problem ReLU remains the default activation because hand-designed replacements give gains that vary across models and datasets. Researchers had no reliable way to find a better one.
  • Method Swish comes from automatic search over small formulas, and swaps in for ReLU directly.
  • Results Swish beat ReLU on ImageNet classification for several models, with a 0.9% gain for Mobile NASNet-A and 0.6% for Inception-ResNet-v2.

Why ReLU is hard to replace

ReLU is the default activation in deep learning, defined as the maximum of x and 0. Many alternatives have been proposed, but none has gained the adoption that ReLU enjoys.

The alternatives fail for a practical reason: their gains are inconsistent across models and datasets. Each one was hand-designed around properties its designers judged important. Search methods have recently automated human-designed parts of networks, such as convolutional cells found by reinforcement learning. The authors ask whether the same kind of search can find the activation function itself.

A search space of scalar functions

The key idea is a search over small formulas built from unary and binary functions. The formulas map one scalar to one scalar, so they can replace ReLU without changing the architecture.

The design has to balance two failure modes. An overly constrained space leaves out novel functions, and an overly large one is hard to search. The authors therefore build the space around a repeated core unit, inspired by the optimizer search of Bello et al. (2017). A core unit takes two scalar inputs, passes each through a unary function, and merges the two outputs with a binary function.

Example unary functions include x² and σ(x), and example binary functions include x1·x2 and exp(−(x1−x2)²). The unary inputs are limited to the preactivation x and the outputs of binary functions.

How candidates are generated and scored

When the core unit appears only once, the authors enumerate the whole space exhaustively. For these larger spaces, an RNN controller predicts one component of the function per step and feeds each choice back as its next input.

Each candidate is scored by training a child network on CIFAR-10. The searches used ResNet-20 as the child network, trained for 10K steps. The score is that child network's validation accuracy. In exhaustive search, the top candidates are kept in a ranked list ordered by validation accuracy. For the RNN controller, validation accuracy is the reward, so reinforcement learning pushes the controller toward functions with high validation accuracy.

Because each candidate needs a full training run, the authors trained candidates in parallel. Worker machines pull candidates from a queue and report back validation accuracy, which then updates the search.

What the search found

The authors plotted the top novel functions and reported several trends. Simpler functions beat complicated ones, and the best could be written with one or two core units. Most top functions take the raw preactivation x into their final binary function, as ReLU does with max(x1, x2) and g(x)=0.

Periodic functions such as sin and cos appear often, mostly added to or subtracted from x. Earlier work only briefly explored periodic activations, so the authors see these results as a route for further research. Division performed poorly when the denominator approached 0, unless the denominator stayed bounded away from 0 or vanished together with the numerator.

Do the discovered functions transfer to larger models?

The authors checked the discovered functions on preactivation ResNet-164, Wide ResNet 28-10 and DenseNet 100-12. Each ReLU was replaced by one of the top functions, and each score is the median of 5 runs. Six of the eight functions still held up, and all six matched or beat ReLU on ResNet-164.

The function x·σ(βx) scored 94.5 on ResNet-164 with CIFAR-10, compared to 93.8 for ReLU. max(x, σ(x)) and x·σ(βx) matched or beat ReLU on all three models. The authors chose Swish, x·σ(βx), for the full study because early experiments generalized better than max(x, σ(x)). Two functions fell well below ReLU on ResNet-164: sinc(x)+x scored 91.5, and x·(sinh⁻¹(x))² scored 85.1.

What Swish computes and how β changes it

Swish scales x by a gate that depends on x itself, namely σ(βx). Here σ(z) equals 1 over 1 plus exp(−z), and β is either a fixed constant or a trainable parameter. With β = 1 the function is the Sigmoid-weighted Linear Unit that Elfwing et al. (2017) proposed for reinforcement learning.

As β grows large, the sigmoid approaches a 0-1 step, so Swish approaches ReLU. At β = 0 the function becomes a scaled linear function. The authors therefore describe Swish as a smooth curve that moves between a linear function and ReLU, with β setting the position.

Swish is unbounded above and bounded below, but unlike ReLU it is smooth and non-monotonic. Its derivative at β = 1 has magnitude below 1 for inputs under about 1.25.

The clearest difference from ReLU is a non-monotonic bump for x < 0. A large share of preactivations fall in the range −5 ≤ x ≤ 0, so the authors treat the bump as an important part of Swish. On Mobile NASNet-A the trained β values spread between 0 and 1.5, with a peak near 1.

In most deep learning libraries, Swish takes a one-line code change. With BatchNorm the scale parameter should be enabled, and the authors lowered the learning rate slightly relative to ReLU networks.

Baselines and aggregate comparison

The authors compared Swish with Leaky ReLU, PReLU, Softplus, ELU, SELU and GELU. LReLU used α = 0.01, and PReLU learned α with an initial value of 0.25 per channel. GELU was given a shape similar to Swish with β = 1.4, and Swish-1 denotes Swish with β fixed at 1.

Across these comparisons, Swish outperformed ReLU on 9 models, tied on none, and lost on none. The paper reports this improvement as statistically significant under a one-sided paired sign test. The authors note that their training setup differs from the original works, so their numbers aren't directly comparable with those papers.

CIFAR-10 and CIFAR-100 results

On CIFAR-100 with ResNet-164, Swish scored 75.1, compared to 74.2 for ReLU. The same comparison put Softplus at 76.0, above both. On CIFAR-10 and CIFAR-100, Swish and Swish-1 matched or beat ReLU on every model.

The best baseline changed from model to model, and Swish stayed close to the top on each. So the CIFAR evidence supports Swish as a stable replacement, not as the winner on every model.

ImageNet results

ImageNet 2012 has 1,000 classes and 1.28 million training images, and the authors evaluated on its 50,000 validation images. The architectures were designed with ReLU, and each was retrained with each activation, trying three RMSProp learning rates and keeping the best.

On MobileNet, Swish scored 74.2 top-1, compared to 72.0 for ReLU.

Softplus matched Swish on the larger models but performed worse on both mobile models. On Inception-v4, Swish slightly underperformed Softplus and ELU. The authors conclude that switching to Swish improved performance with little additional tuning.

Machine translation results

Each model was trained for 300K steps at two learning rates, with the original hyperparameters, including Adam. Swish itself scored 27.6 on newstest2014, compared to 27.8 for ReLU.

Swish-1 beat the next best baseline on newstest2016 by 0.6 BLEU points. Softplus was the weakest baseline in translation, which the authors read as inconsistency across domains. The authors say Swish performed well consistently across these domains.

Limitations

The search itself used a small ResNet-20 child network trained for 10K steps on CIFAR-10. The authors acknowledge this could skew the results toward small networks, since the top functions might only perform well there. The ImageNet and translation experiments use only the architectures listed in the paper, and the translation runs use two learning rates.

All the architectures were designed for ReLU, and their hyperparameters were not retuned for Swish. The authors expect further gains when models and hyperparameters are designed with Swish in mind. Two GELU runs on Mobile NASNet-A were still training when the paper was submitted. Swish also trails Softplus and ELU on Inception-v4.

Why the result matters

The authors read the results as challenging the belief that ReLU's gradient-preserving property is essential. They argue that residual connections let very deep networks train, which weakens the need for each activation to keep gradients. A similar insight appears in the Transformer, where constant-length attention connections make the LSTM cell unnecessary, as the authors note.

Searching over scalar functions also surfaced periodic functions, an area the authors see as under-explored. The authors chose Swish partly for its simplicity and its similarity to ReLU, which makes swapping it in easy.

Paper info

Authors
Prajit Ramachandran, Barret Zoph, Quoc V. Le
Venue
arXiv · Preprint
First published
2017-10-16
Added
2026-11-6
Updated
2017-10-27
Version
v2
arXiv
1710.05941
Category
cs.NE · cs.CV · cs.LG
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Prajit Ramachandran, Barret Zoph, Quoc V. Le (2017). Searching for Activation Functions. arXiv:1710.05941v2. https://arxiv.org/abs/1710.05941v2

BibTeX
@misc{ramachandran2017searching,
  title = {{Searching for Activation Functions}},
  author = {Prajit Ramachandran and Barret Zoph and Quoc V. Le},
  year = {2017},
  eprint = {1710.05941},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1710.05941v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up