Persistent Contextual Neural Networks for learning symbolic data sequences

Yann OllivierarXiv 2013

Introduction

Recurrent Neural Networks (RNNs) are theoretically capable of representing complex sequential dependencies that exceed the capacity of simpler models like Hidden Markov Models (HMMs). However, practical training remains difficult due to two primary hurdles: the vanishing gradient problem, which prevents the propagation of error signals across long sequences, and parameter sensitivity, where performance is dictated by arbitrary design choices like activation function scaling. This paper introduces Gated Leaky Neural Networks (GLNNs) and a training procedure based on Riemannian metrics to address these challenges, creating a framework that is invariant to design choices and highly effective at capturing long-distance symbolic dependencies.

Methods

Gated Leaky Neural Networks (GLNNs)

The GLNN architecture integrates two core concepts to handle symbolic sequences:

  • Gated Units: Inspired by finite automata, network weights are dynamically adjusted based on the last produced symbol. This allows the network to explicitly switch between internal "modes" or "states."
  • Leaky Dynamics: Drawing from continuous-time networks, weights control the derivative (variation) of activation levels rather than setting them directly. This creates an integrating effect, enabling units to maintain state over long periods and act as natural accumulators.

Riemannian Metric Training

Rather than standard Euclidean gradient descent, the author proposes gradient ascent within a Riemannian metric. Standard gradients assume a flat parameter space, whereas Riemannian metrics acknowledge that parameter shifts have non-uniform effects on output distributions. The paper derives two efficient metrics: the Recurrent Backpropagated Metric (RBPM) and the Recurrent Unitwise Outer Product (RUOP). These methods ensure "invariance," meaning the training trajectory remains identical even if the network is mathematically reformulated (e.g., swapping sigmoid for tanh).

Experimental Results

The models were evaluated on four synthetic symbolic tasks designed to challenge standard RNN architectures:

  1. Alphabet with Insertions: A context-free grammar task requiring the network to resume the Latin alphabet after interruptions by sub-sequences. GLNNs came 10 times closer to true model entropy than standard RNNs.
  2. Distant XOR: A task requiring the memory of two distant bits to compute an XOR output. GLNNs achieved error rates below 1% significantly faster than previous "Hessian-free" methods.
  3. Synthetic Music: Modeling LilyPond format notation involving complex harmonic and rhythmic constraints.
  4. $a^n b^n$ Task: A classic non-regular language task where the network must count the number of 'a's to produce an equal number of 'b's.
Example sequences from the $a^n b^n$ task, requiring the model to count and match symbol frequencies.

In the $a^n b^n$ task, GLNNs learned to solve for block lengths in the thousands within minutes using as few as 10 training examples. The best GLNN reached a log-likelihood of -129.7 bits, vastly outperforming the best standard RNN at -222.4 bits.

Discussion

The results demonstrate that invariant training algorithms consistently outperform non-invariant ones, regardless of the specific architecture. The "leaky" integration mechanism allows GLNNs to function as counters without explicit programming. While the computational complexity of the Riemannian metrics is quadratic relative to connections per unit, the use of sparse networks (as few as 3 connections per unit) keeps the approach manageable. Future work will focus on scaling the gating mechanism for larger alphabets and developing fully online learning versions of the algorithm.

Summary updated

Abstract

Recurrent neural networks are powerful models for sequential data, able to represent complex dependencies in the sequence that simpler models such as hidden Markov models cannot handle. Yet they are notoriously hard to train. Here we introduce a training procedure using a gradient ascent in a Riemannian metric: this produces an algorithm independent from design choices such as the encoding of parameters and unit activities. This metric gradient ascent is designed to have an algorithmic cost close to backpropagation through time for sparsely connected networks. We use this procedure on gated leaky neural networks (GLNNs), a variant of recurrent neural networks with an architecture inspired by finite automata and an evolution equation inspired by continuous-time networks. GLNNs trained with a Riemannian gradient are demonstrated to effectively capture a variety of structures in synthetic problems: basic block nesting as in context-free grammars (an important feature of natural languages, but difficult to learn), intersections of multiple independent Markov-type relations, or long-distance relationships such as the distant-XOR problem. This method does not require adjusting the network structure or initial parameters: the network used is a sparse random graph and the initialization is identical for all problems considered.
BibTeX
@misc{ollivier2013persistent,
  author = {Yann Ollivier},
  title = {{Persistent Contextual Neural Networks for learning symbolic data sequences}},
  year = {2013},
  eprint = {1306.0514},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1306.0514},
}
Figure