Block-Operations: Using Modular Routing to Improve Compositional Generalization

Florian Dietz, Dietrich KlakowarXiv 2024 · DOI

Introduction

Artificial Neural Networks (NNs) are notoriously bad at compositional generalization—the ability to take known concepts and recombine them to solve new, unseen tasks. While a human understands that the logic of addition remains constant regardless of the magnitude of the numbers, NNs often learn heuristic approximations tied to specific training distributions. This paper introduces block-operations, a new architectural framework that treats neural network activations as discrete, routable "blocks" rather than monolithic vectors. By using a novel Multiplexer module, the authors demonstrate that networks can learn to "grok" underlying logical rules and achieve near-perfect compositional generalization.

The Symbol Binding Problem

The authors argue that the failure of standard networks stems from the Symbol Binding Problem: NNs struggle to represent the world as symbol-like entities and dynamically "bind" information to them. In standard networks, routing is static; a neuron's influence is fixed at training time. To solve this, an inductive bias is needed that encourages the network to move data around without modification—analogous to how a computer program passes variables between functions.

Methodology: Blocks and Modular Routing

The proposed methodology is built on two pillars:

  1. Blocks: Activation tensors are split into uniformly sized chunks. Each block acts as a "placeholder variable" for a specific object or feature.
  2. Modular Representation-Preserving Mappings (MRPMs): These modules route blocks while preserving their exact representation across layers.

The primary implementation is the Multiplexer. Unlike the Self-Attention mechanism in Transformers, the Multiplexer evaluates the entire input state to generate a weight matrix that determines how input blocks are averaged or routed to output blocks. This is combined with a gated Feedforward Network (FNNR) to create the SMFR (Stack of Multiplexers and Feedforward Networks with gated Residuals).

Architecture of the Multiplexer and FNNR modules, illustrating how input blocks are routed and processed.

Experimental Evaluation

The researchers evaluated the SMFR architecture on four challenges:

  • Addition/Multiplication: Testing "negative interference" during multi-task learning.
  • Double-Addition: Testing subnetwork reuse by requiring the same logic on different input pairs.
  • ALGO (Algorithmic Logic): A synthetic task requiring conditional rules (e.g., "If C > D, then E = A + 1") over multiple iterations.
  • BPMNIST (Block-Permuted MNIST): A benchmark where MNIST images are sliced into blocks and permuted; the model must "undo" the permutation before recognition.

Key Results and Insights

The SMFR architecture demonstrated significant improvements in algorithmic reasoning and generalization:

  • Perfect Generalization: On the ALGO task, the SMFR achieved 100% accuracy on out-of-distribution (OOD) tests, whereas Transformers and FNNs often fell below 20% on complex logic.
  • Grokking on BPMNIST: The SMFR exhibited "grokking" behavior, where test accuracy continued to climb long after training accuracy reached 100%, eventually hitting 98.5%.
  • Subnetwork Reuse: In the Double-Addition task, the SMFR achieved 100% OOD accuracy, proving it could reuse the same "addition module" regardless of data location.
Comparison of OOD performance across different architectures, showing SMFR achieving perfect accuracy on both even and odd OOD tasks.

Discussion and Future Work

The paper suggests that the secret to algorithmic reasoning is better routing. By facilitating data copying via the Multiplexer, the network naturally converges on a common data "format" across layers. However, the Multiplexer is currently less computationally efficient than standard FNNs due to operations on small matrices. Future work involves scaling these principles to enhance Attention mechanisms in Large Language Models, potentially addressing their compositional weaknesses.

Summary updated

BibTeX
@misc{dietz2024block,
  author = {Florian Dietz and Dietrich Klakow},
  title = {{Block-Operations: Using Modular Routing to Improve Compositional Generalization}},
  year = {2024},
  eprint = {2408.00508},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.00508},
}
Figure