NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Routing Networks and the Challenges of Modular and Compositional Computation

Clemens Rosenbaum, Ignacio Cases, Matthew Riemer, Tim Klinger

Abstract

Compositionality is a key strategy for addressing combinatorial complexity and the curse of dimensionality. Recent work has shown that compositional solutions can be learned and offer substantial gains across a variety of domains, including multi-task learning, language modeling, visual question answering, machine comprehension, and others. However, such models present unique challenges during training when both the module parameters and their composition must be learned jointly. In this paper, we identify several of these issues and analyze their underlying causes. Our discussion focuses on routing networks, a general approach to this problem, and examines empirically the interplay of these challenges and a variety of design decisions. In particular, we consider the effect of how the algorithm decides on module composition, how the algorithm updates the modules, and if the algorithm uses regularization.

Introduction

Standard deep learning models are typically monolithic, where every input follows a fixed sequence of transformations. In contrast, compositionality allows a model to select and combine specialized sub-components (modules) dynamically. This approach is theoretically powerful for handling combinatorial complexity, yet training these "routing networks" remains notoriously difficult.

The core difficulty lies in a "chicken-and-egg" problem: a router cannot learn which module is optimal until those modules have specialized, but modules cannot specialize until the router consistently provides them with relevant data. This paper investigates why these models often fail to stabilize, why they suffer from "module collapse," and why they are prone to "hyperlocal" overfitting.

The Routing Network Framework

A routing network consists of a library of neural modules and a router that determines the path of an input through these modules. As shown in Figure 1, the router $\pi(h)$ receives an activation and selects the next module $t_i$ to apply from a set of candidates.

A routing network architecture where a router $\pi(h)$ selects modules $t_i$ to process input $x$.

The authors evaluate several strategies for training the router, including value-based Reinforcement Learning (Q-Learning, Advantage Learning), policy gradient methods (REINFORCE), and stochastic reparameterization (Gumbel-Softmax).

The Flexibility Dilemma

The research identifies a fundamental "flexibility dilemma" in modular learning. If the router is too rigid, it settles on a single path for all inputs, a phenomenon known as module collapse. Conversely, if the router is too flexible, it can create hyperlocal approximations, essentially memorizing specific paths for training samples, which leads to severe overfitting.

Illustration of the routing challenge: (a) a dataset with two linear modes, (b) the desired specialized routing solution, and (c) the state of routing modules at initialization.

As illustrated in Figure 4, the goal is to have modules specialize in different modes of the data. However, at initialization, modules are undifferentiated, making it hard for the router to make meaningful choices that lead to specialization.

Empirical Analysis and Results

The study conducted experiments on CIFAR-100 and the Stanford Corpus of Implicatives (SCI). Several key insights emerged:

Value-Based RL vs. Policy Gradients

Surprisingly, simple value-based RL methods consistently outperformed more complex policy gradient methods and reparameterization tricks. Policy gradients appear to struggle with the high variance and non-stationarity of the environment as modules evolve.

The "Adam" Problem

While Adam is standard in deep learning, it often fails in routing networks. Adam's moving averages of gradients become "stale" when the router changes the path, as the parameters of a module are suddenly being updated based on different data distributions. Plain Stochastic Gradient Descent (SGD) proved to be much more robust in these dynamic settings.

The Role of Meta-information

Without external signals (like task labels), routing networks often fail to exceed random baselines. Meta-information helps by reducing the dimensionality of the router's decision space, providing a "life-raft" to navigate the early stages of training.

Conclusion

Routing networks offer a promising path toward modular AI, but they introduce unique optimization challenges. The non-stationarity of the "environment" (the modules) makes standard RL and optimization techniques like Adam less effective. Future work should focus on adaptive rewards to prevent early collapse and new regularization techniques to mitigate hyperlocal overfitting.

Summary updated

BibTeX
@misc{rosenbaum2019routing,
  author = {Clemens Rosenbaum and Ignacio Cases and Matthew Riemer and Tim Klinger},
  title = {{Routing Networks and the Challenges of Modular and Compositional Computation}},
  year = {2019},
  eprint = {1904.12774},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.12774},
}
Figure