DataMUX: Data Multiplexing for Neural Networks

Vishvak Murahari, Carlos E. Jimenez, Runzhe Yang, Karthik Narasimhan

Introduction

Modern neural networks are vastly overparameterized, often utilizing only a fraction of their parameters to model a given function. This paper introduces Data Multiplexing (DataMUX), a technique that exploits this excess capacity by combining multiple inputs into a single "mixed" representation. By allowing the network to process multiple inputs simultaneously, DataMUX yields massive inference speedups (up to 18x for Transformers) with minimal memory overhead and only slight drops in accuracy.

The Challenge of Scaling Inference

Deep neural networks require significant computational and memory resources, which traditionally scale linearly with the number of inputs processed (batch size). However, if networks have excess processing capacity, it stands to reason they might be able to model functions over multiple inputs simultaneously.

Just as radio channels share bandwidth to carry multiple audio streams at once, the authors propose multiplexing data streams through a neural network. If successful, this drastically increases inference throughput without the memory and compute bloat associated with simply increasing batch sizes.

Methods: How DataMUX Works

Overview of DataMUX compared to standard batch processing.

The authors propose a three-component architecture to achieve data multiplexing:

  1. Multiplexing Layer: Before entering the base network, $N$ inputs (e.g., token embeddings for sentences) are each passed through a fixed linear transformation, such as a random orthogonal matrix. These transformed inputs are then averaged together to create a single, superposed representation of the exact same size as a single input.
  2. Base Network: The neural network backbone (e.g., a Transformer) processes this single mixed representation normally. Architecturally, the base network remains completely unchanged.
  3. Demultiplexing Layer: The network's output is disentangled back into $N$ individual representations. For Transformers, the authors use an "Index Embeddings" strategy, where special prefix tokens are prepended to the sequences to help the model route information, and a shared multi-layer network extracts the individual outputs.

Retrieval Warm-up: Naively training a multiplexed Transformer fails because gradients for individual instances become entangled during the backward pass. To resolve this, the authors introduce a novel self-supervised pre-training task where the model must simply retrieve the original tokens and their correct order from the mixed representation.

Key Insights

  • Overparameterization as Bandwidth: The paper practically demonstrates that the massive parameter counts in Transformers act like bandwidth. A single forward pass can carry and process up to 40 independent signal streams simultaneously without catastrophic interference.
  • Attention Heads Aren't the Secret: One might assume the Transformer achieves this by dedicating specific attention heads to specific inputs. Surprisingly, reducing the number of attention heads from 12 to 2 had minimal impact on multiplexing performance, suggesting the mechanism relies on deeper subspace routing rather than head-splitting.
  • Robustness of Mixed Representations: t-SNE visualizations reveal that the demultiplexed representation of a specific input remains highly stable, regardless of which other random inputs it was multiplexed with. The network genuinely learns to isolate the signals.

Key Results

Performance of DataMUX across various NLP tasks as the number of multiplexed instances (N) increases.

DataMUX was evaluated across several text classification tasks (GLUE benchmark, CoNLL-2003 NER) and image classification (MNIST).

  • Massive Throughput Gains: On the MNLI dataset, a multiplexed Transformer (T-MUX) handling 20 inputs simultaneously achieved an 11x inference speedup with less than a 2% absolute drop in accuracy compared to a standard Transformer. Multiplexing 40 inputs yielded an 18x speedup with less than a 4% drop.
  • Perfect Retrieval: On the retrieval warm-up task, T-MUX models achieved nearly 100% accuracy in disentangling and retrieving original words for up to 20 multiplexed instances, proving the architecture's raw capacity for signal separation.
  • Smaller Models Work Too: Even smaller Transformers (e.g., 4 layers, 768 hidden dimension) successfully multiplexed up to 20 instances, yielding an even higher relative throughput boost of 25x.
  • Struggles with Vision Models: Multiplexing MLPs and CNNs on MNIST was much less successful. MLPs could handle up to 8 instances before accuracy dropped significantly. CNNs struggled past 4 instances, likely because the multiplexing transformation destroys the spatial locality that convolutions rely on.

Limitations and Future Work

While inference is incredibly fast, training time increases almost linearly with the number of multiplexed instances because the task becomes significantly harder for the model to learn. Furthermore, performance degrades more noticeably on complex token-level tasks (like NER) as the number of multiplexed inputs approaches 40.

Future work will focus on designing better multiplexing and demultiplexing transformations—especially to preserve spatial locality for vision tasks—exploring large-scale pre-training, and applying DataMUX to multi-modal and multi-lingual models.

Summary updated

BibTeX
@inproceedings{murahari2022datamux,
  author = {Vishvak Murahari and Carlos E. Jimenez and Runzhe Yang and Karthik Narasimhan},
  title = {{DataMUX: Data Multiplexing for Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=HtwfGtdY6W},
}
Figure