Recurrent Neural Networks with flexible Gates using Kernel activation Functions

Simone Scardapane, Steven Van Vaerenbergh, Danilo Comminiello, Simone Totaro, Aurelio Uncini

Introduction

In sequential data processing, gated Recurrent Neural Networks (RNNs), such as Long Short-Term Memory (LSTM) and Gated Recurrent Units (GRU), have become the standard architecture. These networks utilize "gates"—multiplicative layers that regulate the flow of information—to maintain long-term dependencies. Traditionally, these gates are implemented using a linear projection followed by a fixed sigmoid activation function.

While architectural variations often focus on the number or connectivity of gates, the functional form of the gate itself has remained largely static. This paper proposes that the rigid, "one-size-fits-all" nature of the sigmoid function limits the expressiveness of RNNs. By introducing learnable, non-parametric "Flexible Gates," the authors demonstrate significant improvements in both accuracy and convergence speed, particularly for tasks requiring long-term memory.

Methodology: Flexible Gates via Kernel Activation Functions

The core innovation is the replacement of the standard sigmoid activation in a GRU with a Flexible Gate based on Kernel Activation Functions (KAFs).

The KAF Framework

A KAF is a non-parametric function defined as a weighted sum of 1D Gaussian kernels centered around a fixed "dictionary" of points. By learning the mixing coefficients for these kernels during training, the network can effectively "sculpt" the gate's response function into nearly any shape.

Ensuring Stability with Residual Sigmoids

Simply replacing a sigmoid with a KAF is insufficient because gates must produce values between 0 and 1 to function as effective "valves." To address this, the authors propose a "Flexible Sigmoid" formulation: $$\sigma_{KAF}(s) = \sigma\left(\frac{1}{2}KAF(s) + \frac{1}{2}s\right)$$ The inclusion of the residual term ($s$) acts as a safety net. It ensures that for very large or very small inputs, the gate maintains the asymptotic behavior of a standard sigmoid, preventing the "breakage" of information flow that can occur if a pure KAF reverts to zero at its boundaries.

Initialization Strategy

To facilitate stable training, the authors use kernel ridge regression to initialize the KAF mixing coefficients such that the flexible gate perfectly mimics a standard sigmoid at the start of the optimization process.

Experimental Evaluation

The proposed architecture was evaluated on three sequential variants of the MNIST dataset, designed to test memory capacity:

  • Row-wise MNIST (R-MNIST): 28 time steps.
  • Pixel-wise MNIST (P-MNIST): 784 time steps, requiring significantly longer memory.
  • Permuted P-MNIST (PP-MNIST): 784 time steps with shuffled pixel order, increasing the difficulty of pattern recognition.

Key Results

The flexible GRU outperformed the standard GRU across all benchmarks, with the most dramatic gains observed in the pixel-wise tasks:

  • Accuracy: On P-MNIST, the flexible GRU achieved 97.34% accuracy (vs. 89.50% for standard). On PP-MNIST, it reached 96.10% (vs. 86.41%).
  • Convergence: The flexible model converged significantly faster, particularly in the early stages of training. This suggests that the additional degrees of freedom in the gate shape assist optimization algorithms like Adam in navigating the loss landscape more effectively.
  • Stability: The flexible variant exhibited much lower variance across different training runs, indicating a more robust optimization process compared to the standard GRU, which frequently converged to poor local minima.

Discussion and Future Work

The primary insight of this work is that increasing the power of individual gates with a small number of additional parameters (the KAF mixing coefficients) yields substantial performance benefits. The residual connection proved essential for maintaining the structural integrity of the RNN's memory.

While this study focused on the GRU, the methodology is inherently extensible to other gated architectures like LSTMs. Future research will explore the interpretability of the learned gate shapes to better understand the specific functional requirements of long-term memory in deep networks.

Summary updated

BibTeX
@inproceedings{scardapane2018recurrent,
  author = {Simone Scardapane and Steven Van Vaerenbergh and Danilo Comminiello and Simone Totaro and Aurelio Uncini},
  title = {{Recurrent Neural Networks with flexible Gates using Kernel activation Functions}},
  booktitle = {MLSP},
  year = {2018},
  doi = {10.1109/mlsp.2018.8516994},
}
Figure