Recursive Routing Networks: Learning to Compose Modules for Language Understanding

Ignacio Cases, Clemens Rosenbaum, Matthew Riemer, Atticus Geiger, Tim Klinger, Alex Tamkin, Olivia Li, Sandhini Agarwal, Joshua D. Greene, Dan Jurafsky, Christopher Potts, Lauri Karttunen

Abstract

Recursive Routing Networks (RRNs) introduce a modular architecture designed to dynamically compose neural "function blocks" for complex language understanding tasks. By utilizing a meta-learner, known as the router, to select specific paths through a grid of modules, the model effectively manages the fundamental trade-off between knowledge transfer and catastrophic interference. Evaluated on Natural Language Inference (NLI) benchmarks and a novel implicatives dataset (SCI), RRNs demonstrate superior performance and enhanced compositional generalization compared to traditional monolithic architectures.

Introduction: The Transfer-Interference Trade-off

Standard deep learning models typically follow a monolithic design, applying a fixed sequence of transformations to every input regardless of its unique characteristics. This approach contrasts with human cognition, which excels at decomposing complex problems into smaller sub-tasks and re-composing existing skills to solve novel challenges.

A central challenge in multi-task or multi-genre learning is the "transfer-interference trade-off":

  1. Transfer: Sharing weights across examples allows a model to learn general patterns and commonalities.
  2. Interference: Sharing weights across unrelated or conflicting examples can lead to "catastrophic interference," where learning a new pattern degrades the model's performance on previously acquired knowledge.
Conceptual illustration of the transfer-interference trade-off. RRNs aim for "Orthogonalized Knowledge" to minimize interference while maintaining high transfer where appropriate.

While Mixture of Experts (MoE) models attempt to address this, they often lack the recursive depth and fine-grained specialization required for nuanced linguistic tasks.

Methodology: Recursive Routing Networks

The Recursive Routing Network (RRN) architecture consists of two primary components: a set of Function Blocks and a Router.

  • Function Blocks: These are trainable neural modules (typically fully connected layers) organized in a grid.
  • The Router: A meta-learner that implements a policy $\pi$ to determine the sequence of function blocks to apply. This decision is based on the current input state and available meta-information, such as the text genre.

The routing process is inherently recursive. The router selects an initial module, applies it to the input, and then uses the resulting activation to inform the selection of the subsequent module. This continues for a predefined depth $d$, effectively building a custom neural path for each input.

The Recursive Routing Network architecture. The router (2) selects a module from a grid (3) based on input (1) and meta-information, recursively building a computational path (4-6).

The authors explored several RRN integrations, including routing within classifiers, RNN encoders (LSTM transformations), and CBOW models. To handle missing metadata at test time, a "Dispatcher" component was introduced to predict the necessary meta-information.

Experimental Setup and Results

The RRN framework was evaluated on two key benchmarks: MultiNLI, a large-scale corpus spanning multiple genres, and the Stanford Corpus of Implicatives (SCI), a new dataset focusing on verbs like manage or fail that possess specific inferential signatures.

Key Findings

  • Genre-Aware Specialization: Qualitative analysis revealed that the router naturally clusters similar genres. For instance, government reports and Slate articles often share routing paths, whereas fiction and spoken language are routed through distinct modules.
  • Performance Gains: RRNs consistently outperformed non-routed baselines. In a CBOW configuration on MultiNLI, routing increased accuracy from 61.94% to 65.84%. On the SCI "joint" set, the improvement was even more dramatic, rising from 57.26% to 75.56%.
  • Compositional Generalization: RRNs showed greater resilience when moving from training sets to "disjoint" sets (unseen verbs), suggesting they learn a more robust, modular library of semantic operations.

Conclusion

Recursive Routing Networks provide a scalable way to introduce modularity into deep learning. While they offer significant performance boosts and better generalization, they are more parameter-heavy and can be prone to overfitting on smaller datasets. Future research directions include stabilizing the joint training of the Dispatcher and pretraining RRNs on massive datasets to develop a "universal" library of composable linguistic modules.

Summary updated

BibTeX
@inproceedings{cases2019recursive,
  author = {Ignacio Cases and Clemens Rosenbaum and Matthew Riemer and Atticus Geiger and Tim Klinger and Alex Tamkin and Olivia Li and Sandhini Agarwal and Joshua D. Greene and Dan Jurafsky and Christopher Potts and Lauri Karttunen},
  title = {{Recursive Routing Networks: Learning to Compose Modules for Language Understanding}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/n19-1365},
}
Figure