Skip to content
DnsLister Forum

Where domain hunters compare notes

Prajit Ramachandran and the Search for Better Building Blocks of Deep Learning: From Swish to Self-Attentional Vision

Introduction

Some researchers in artificial intelligence become associated with a single enormous system; others make their mark by questioning the apparently minor design choices from which such systems are constructed. Prajit Ramachandran belongs especially to the latter tradition. His research has repeatedly examined components of neural networks that practitioners had begun to take for granted: activation functions, convolution, receptive fields, pretraining strategies, and experience replay. Instead of assuming that these established components represented the best possible solution, his work asked whether they could be redesigned, automatically discovered, or replaced altogether.

The most famous result of this approach is Swish, the activation function discovered by Ramachandran, Barret Zoph, and Quoc V. Le through automated search. The function

Swish(x) = x · σ(βx)

where

σ(z) = 1 / (1 + e^(−z))

became one of the important modern alternatives to the Rectified Linear Unit (ReLU). Their work was significant not merely because another activation function was proposed, but because the function emerged from a systematic search over possible mathematical operations rather than solely from human intuition. The research therefore represented an early example of a broader idea that became increasingly important in machine learning: using computation itself to discover components of machine-learning architectures.

Ramachandran subsequently worked on another fundamental question: whether self-attention could replace convolution as the basic computational primitive of computer vision. The resulting research demonstrated that self-attention could operate as a stand-alone mechanism for image recognition and object detection, helping establish the intellectual path toward increasingly attention-dominated computer-vision architectures.

Taken together, these contributions reveal a consistent theme. Ramachandran's work is less about creating one isolated algorithm than about reconsidering the fundamental building blocks of deep neural networks.

1. The Activation-Function Problem

Every artificial neuron performs a weighted combination of its inputs and then normally passes the result through an activation function. Without nonlinear activation functions, stacking many neural-network layers would still ultimately produce a linear transformation, greatly restricting what the network could represent.

During the early development of deep learning, sigmoid and hyperbolic tangent functions were widely used. They were differentiable and biologically suggestive, but deep networks using them could suffer from vanishing gradients.

The Rectified Linear Unit, or ReLU,

ReLU(x) = max(0, x)

became enormously influential because of its simplicity and favorable optimization properties.

For positive values,

ReLU(x) = x

whereas for negative values,

ReLU(x) = 0

By the middle of the 2010s, ReLU had become so successful that it could easily have been regarded as a largely solved component of neural-network design.

Ramachandran and his collaborators questioned that assumption.

Instead of asking, "What activation function can we invent?", they effectively asked a more radical question:

Can an algorithm search for a better activation function than the functions humans have designed?

This change in perspective was crucial.

2. Searching for Activation Functions

In the work Searching for Activation Functions, Prajit Ramachandran, Barret Zoph, and Quoc V. Le constructed a search space containing mathematical building blocks from which candidate activation functions could be assembled.

They then explored this space using both exhaustive search and reinforcement-learning-based search.

This transformed activation-function design into a machine-search problem.

Instead of researchers proposing a few equations based on intuition and experimentally comparing them, a computational procedure could examine many possible mathematical combinations and identify promising candidates.

The most successful function discovered by this process was:

f(x) = x · sigmoid(βx)

The researchers named it Swish.

For the commonly used case in which β = 1,

Swish(x) = x·σ(x)

or explicitly,

x / (1 + e^(−x))

This equation is remarkably simple considering that it emerged from a search procedure.

That simplicity contributed significantly to its usefulness.

3. Why Swish Was Interesting

ReLU possesses a sharp boundary at zero:

x < 0 ⇒ f(x) = 0

Swish behaves differently. Negative inputs can produce small negative outputs rather than being immediately truncated to zero.

Furthermore, Swish is smooth.

Its derivative for β = 1 can be expressed as

σ(x) + xσ(x)(1 − σ(x))

This smooth transition gives Swish different optimization behavior from the piecewise-linear ReLU.

Another unusual characteristic is that Swish is non-monotonic over part of its domain. Neural-network activation functions had often been designed under an intuitive assumption that increasing the input should increase the output. Swish demonstrated that strict monotonicity was not necessarily required for an effective activation function.

For large positive x,

σ(x) → 1

and consequently

Swish(x) ≈ x

For sufficiently negative x,

σ(x) → 0

so the output approaches zero.

It therefore retains some ReLU-like behavior while providing a smooth transition and allowing limited negative activation.

The original experiments reported that replacing ReLU with Swish improved ImageNet top-1 classification accuracy by 0.9 percentage points for Mobile NASNet-A and 0.6 points for Inception-ResNet-v2, among the reported experiments. The authors found that Swish tended to perform particularly well in deeper networks.

These improvements may appear numerically modest, but in mature image-classification systems, gains obtained simply by changing a scalar activation function can be meaningful because the modification requires almost no redesign of the surrounding architecture.

4. Swish as an Example of Machine-Discovered Architecture

The conceptual significance of Swish arguably extends beyond the equation itself.

Traditionally, neural-network architectures were designed almost completely by researchers. Humans chose the layers, connections, activation functions, normalization procedures and optimization strategies.

Ramachandran, Zoph and Le demonstrated that even something as mathematically elementary as the activation function could instead become a searchable object.

The process can be summarized as:

Define mathematical primitives ↓ Generate candidate functions ↓ Train neural networks ↓ Measure performance ↓ Use performance to guide search ↓ → Discover useful neural components 

This philosophy connects activation-function search to the wider field of AutoML and neural architecture search.

The important idea is that the designer does not necessarily need to know beforehand what the optimal mathematical form should look like.

Instead, the researcher defines the space and evaluation procedure; computation helps discover the solution.

5. Early Work on Unsupervised Pretraining

An important but less frequently mentioned part of Ramachandran's research predates Swish.

With Peter J. Liu and Quoc V. Le, he worked on unsupervised pretraining for sequence-to-sequence learning.

Sequence-to-sequence systems were becoming powerful tools for tasks such as machine translation and summarization. However, supervised seq2seq systems required large quantities of labeled parallel data.

The researchers investigated whether large quantities of unlabeled text could be exploited first.

Their method pretrained the encoder and decoder using language models and subsequently fine-tuned the entire sequence-to-sequence system using labeled examples. An auxiliary language-modeling objective could additionally regularize fine-tuning.

Conceptually:

unlabeled text → language-model pretraining → encoder/decoder initialization → supervised fine-tuning

The experiments showed improvements particularly when labeled data were scarce. The Google Research record reports a 1.3 BLEU improvement over previous best models on the examined WMT 2014 and WMT 2015 English-to-German tasks.

In hindsight, this line of research is particularly interesting because pretrain-then-fine-tune subsequently became one of the central paradigms of modern AI.

One should not retrospectively equate this particular seq2seq system with today's large language models—the architectures, scales and objectives differ enormously. Nevertheless, the underlying methodological principle is recognizable: learn broadly useful representations from abundant unlabeled data and adapt them to a supervised downstream task.

6. Moving From Language to Vision

Ramachandran's next major line of research concerned another foundational assumption.

Computer vision had been dominated by convolutional neural networks.

A convolution learns filters that are applied across spatial locations. This produces powerful properties such as locality, parameter sharing and translation-related inductive biases.

By the late 2010s, however, Transformers had demonstrated the extraordinary effectiveness of self-attention for sequence processing.

The question naturally arose:

Could attention perform the role traditionally assigned to convolution in images?

At first, attention was commonly added to convolutional architectures as an auxiliary mechanism. Ramachandran and collaborators pursued the stronger hypothesis.

Perhaps convolution was not required at all for the spatial transformations.

7. Stand-Alone Self-Attention in Vision Models

In the 2019 NeurIPS paper Stand-Alone Self-Attention in Vision Models, Ramachandran worked with Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya and Jonathon Shlens.

Their central question was straightforward but fundamental:

Can self-attention serve as a stand-alone primitive for computer vision rather than merely augmenting convolution?

The researchers replaced spatial convolutions in a ResNet-style architecture with a form of local self-attention.

Ordinary convolution computes an output using fixed learned filters applied according to spatial position. Self-attention instead makes interactions content dependent.

In simplified form, attention is represented by

softmax(QK^T / √(d_k)) · V

Here Q, K, and V represent queries, keys and values.

The essential difference is profound.

A convolutional filter applies learned weights largely according to relative spatial arrangement. Attention can dynamically determine how strongly one feature should interact with another according to their content.

8. The Experimental Result

The results demonstrated that self-attention could indeed operate as a principal vision primitive.

The fully self-attentional ImageNet model reported in the paper outperformed its ResNet baseline while using:

12% fewer FLOPs, and
29% fewer parameters.

For COCO object detection, a fully self-attentional model matched the mean average precision of the RetinaNet baseline while requiring:

39% fewer FLOPs, and
34% fewer parameters.

The researchers' ablation experiments also found that self-attention was particularly effective in the later layers of the vision network.

This mattered because it demonstrated experimentally that convolution was not the only viable primitive around which high-performance image-recognition networks could be constructed.

9. Connection to the Transformer Revolution in Computer Vision

The historical timing of the work is notable.

The stand-alone self-attention paper appeared in 2019, during the period in which attention architectures were rapidly transforming natural-language processing but before Vision Transformers became established as a dominant approach to large-scale computer vision.

It would therefore be inaccurate to say that Ramachandran and colleagues single-handedly invented attention-based computer vision; numerous research groups were exploring related ideas.

Their particular contribution was more precise and important: they provided strong evidence that self-attention could replace spatial convolution rather than merely supplement it.

That helped undermine the assumption that computer vision inherently required convolution.

Later vision architectures increasingly adopted attention and Transformer-like mechanisms as central computational primitives.

Seen from that perspective, Stand-Alone Self-Attention in Vision Models forms part of the bridge between the CNN-dominated computer-vision era and the subsequent rise of attention-based vision architectures.

10. HaloNets and Scaling Local Self-Attention

Ramachandran's research did not stop at proving that attention could work for images.

A new problem immediately emerged.

Self-attention can be computationally expensive, particularly when the number of image locations becomes large.

For N positions, global self-attention involves interactions that can scale approximately as

O(N²)

For high-resolution images, this becomes expensive.

The next challenge was therefore:

How can self-attention be made efficient enough to compete practically with highly optimized convolutional networks?

Ramachandran, Ashish Vaswani, Aravind Srinivas, Niki Parmar, Blake Hechtman and Jonathon Shlens addressed this problem in Scaling Local Self-Attention for Parameter Efficient Visual Backbones, presented at CVPR 2021.

The resulting model family was called HaloNet.

11. The Halo Idea

Instead of allowing every location to attend globally to every other image location, HaloNet employs structured local self-attention.

The image is conceptually partitioned into blocks. Attention is performed over local regions while extending each block's accessible context into a surrounding area—a "halo."

This creates a compromise.

Purely local processing is computationally manageable but may lose useful contextual information. Global attention provides extensive context but can be prohibitively expensive.

Halo attention provides:

local computation + expanded contextual neighborhood

The research introduced improvements that made local self-attention faster, more memory efficient and more accurate. The resulting HaloNet family achieved state-of-the-art accuracy in the parameter-limited setting examined on ImageNet. Transfer-learning experiments also showed that HaloNet models could outperform substantially larger models while providing favorable inference characteristics.

The work additionally examined object detection and instance segmentation, where combinations of local self-attention and convolution improved on strong baselines.

This illustrates another recurring feature of Ramachandran's research.

First comes a conceptual question:

Can we replace the conventional component?

Then comes the engineering question:

Can the replacement be made computationally competitive?

12. Research on Experience Replay

Ramachandran has also contributed to reinforcement learning.

He was among the authors of Revisiting Fundamentals of Experience Replay, published at ICML 2020.

Experience replay is a central mechanism in many deep reinforcement-learning algorithms. An agent stores previously observed transitions in a replay buffer and subsequently samples experiences from that memory while learning.

Despite its widespread use, basic questions remained about how replay-buffer design affected learning.

The researchers systematically investigated factors including replay capacity and the replay ratio, meaning the amount of learning performed relative to the amount of new experience collected.

Their experiments challenged some conventional assumptions. Larger replay capacities could substantially improve certain algorithms while having relatively little effect on others. They also examined the behavior of multi-step returns and experimentally analyzed why replay could improve learning.

This work differs from Swish and visual self-attention, but the methodological similarity is noticeable.

Again, the research took something regarded as a standard ingredient of deep learning and asked whether the community properly understood it.

13. A Common Philosophy Across His Research

Ramachandran's contributions can therefore be viewed through several recurring questions:

Activation functions:
Why assume ReLU is optimal?

Neural component design:
Why must humans manually invent every mathematical component?

Sequence learning:
Why train a supervised model entirely from scratch when unlabeled text is abundant?

Computer vision:
Why assume convolution must be the fundamental spatial operator?

Attention efficiency:
Why assume attention must be globally quadratic or computationally impractical?

Reinforcement learning:
Why accept conventional experience-replay settings without systematically examining them?

The common intellectual strategy is the re-examination of defaults.

This is an important form of scientific contribution.

Progress in machine learning does not come exclusively from producing ever larger models. Sometimes a field advances because researchers reconsider one seemingly mundane component and discover that the conventional choice was never inevitable.

14. Why Swish Remains His Signature Contribution

Among these works, Swish remains especially identifiable with Ramachandran.

Its appeal comes partly from the extraordinary compactness of the result:

f(x) = xσ(βx)

A complicated automated search ultimately produced an equation that can be written on one line.

That is scientifically attractive because the discovered object is interpretable. One does not need an enormous model merely to understand the contribution.

The function combines several useful properties:

smoothness + negative-value tolerance + approximately linear positive regime + non-monotonicity

More importantly, its discovery provided empirical evidence that activation functions themselves could profitably be treated as objects of automated optimization rather than fixed assumptions.

In that sense, Swish belongs simultaneously to two histories:

the history of activation functions in neural networks, and
the history of automated machine-learning design.

15. From Individual Components to Modern AI

Ramachandran's work is particularly interesting when viewed against the development of modern deep learning.

Modern neural networks are constructed from numerous interacting components:

representation + activation + attention + normalization + optimization + pretraining + scaling

Improving any one of these can propagate through enormous numbers of models.

A new activation function may appear less spectacular than a complete AI system. A more efficient attention primitive may appear less visible than a commercial application. But improvements to foundational primitives can have unusually broad influence because those primitives are reusable.

This is the appropriate context in which to understand Ramachandran's contributions.

His research has repeatedly operated close to the architectural foundations of neural networks.

16. A Broader Scientific Significance

There is also a broader lesson in this body of work concerning the relationship between human intuition and computational search.

Traditional scientific reasoning might suggest designing a function according to desirable mathematical properties and then testing it.

The Swish work reversed part of this process.

First, computational search identified functions that performed well.

Then researchers could examine the mathematical characteristics of what had been discovered.

Thus:

human-designed search space + machine exploration + empirical evaluation → new human knowledge

This does not eliminate human scientific reasoning. Humans still determine the problem, representation, search space, experiments and interpretation.

Instead, computation becomes a collaborator in mathematical design.

That idea has subsequently become increasingly important throughout machine learning.

Conclusion

Prajit Ramachandran's contributions to artificial intelligence are best understood as a sustained investigation of the fundamental primitives from which deep-learning systems are constructed.

His best-known work, with Barret Zoph and Quoc V. Le, used automated search to discover Swish:

Swish(x) = xσ(βx)

The result challenged the dominance of manually designed activation functions and demonstrated that automated search could discover simple, reusable mathematical components that improve neural networks.

His earlier work on unsupervised pretraining for sequence-to-sequence models explored the principle of learning from unlabeled data before supervised fine-tuning—a principle that would become central to later machine learning.

His work on stand-alone self-attention for computer vision demonstrated that self-attention could replace spatial convolutions and still achieve competitive or superior image-recognition and object-detection performance with fewer parameters and operations in the reported comparisons.

The subsequent development of HaloNets addressed the practical scaling problem, showing how local self-attention could become a parameter-efficient visual backbone competitive with sophisticated convolutional systems.

And his research on experience replay helped clarify the behavior of another widely used but incompletely understood component of deep reinforcement learning.

There is consequently a striking continuity across his research career:

Question the standard component → experiment systematically → find a better or deeper formulation

Swish asks whether ReLU should be taken for granted. Stand-alone self-attention asks whether convolution should be taken for granted. HaloNet asks whether the computational cost of attention should be taken for granted. His experience-replay research asks whether conventional replay configurations should be taken for granted.

That makes Prajit Ramachandran's work significant beyond any single equation or architecture. His contributions illustrate one of the most productive strategies in modern machine-learning research: when a technology becomes standard, return to its foundations and ask whether the supposedly settled design decisions are actually optimal.

Source: r/IndicKnowledgeSystems · by /u/RossbihariGhost1900

Leave a Reply

Your email address will not be published. Required fields are marked *