DataMUX: Data Multiplexing for Neural Networks

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

TL;DR

DataMUX is a novel technique that allows neural networks to process up to 40 different inputs simultaneously within a single "mixed" representation. By leveraging the inherent overparameterization of modern models, it achieves up to an 18x increase in inference throughput with minimal loss in accuracy.

What Problem Does This Paper Address?

Modern deep neural networks are notoriously resource-hungry, yet research into "lottery tickets" and pruning suggests they are vastly overparameterized—containing far more processing capacity than is strictly necessary for a single task.

Standard batching handles multiple inputs by adding a batch dimension, which increases memory and computational requirements linearly. The authors of DataMUX ask a provocative question: If these networks have excess capacity, can they share their internal "bandwidth" to process multiple independent streams of information at once, much like how radio channels carry multiple signals simultaneously?

Methods

The DataMUX framework introduces three primary components to a standard neural network architecture:

  1. Multiplexing Layer (MUX): This layer takes $N$ independent inputs (e.g., sentences or images) and applies a fixed linear transformation ($\phi^i$) to each. These transformed inputs are then averaged into a single "mixed" representation of the same dimensions as a single input.
  2. Base Network: A standard, architecturally unchanged backbone (like a Transformer) processes this mixed representation.
  3. Demultiplexing Layer (DEMUX): This layer disentangles the base network's output back into $N$ individual representations ($h^i$), which are then fed into a shared task head to produce final predictions for each original input.
Figure 1: Schematic illustrating our proposed DataMUX technique in comparison to traditional minibatch processing in neural networks. Here, DataMUX uses a multiplexing layer (MUX), to multiplex 40 instances into a single representation, passing only 32 inputs to the neural network. The demultiplexing layer (DEMUX) uses the output to generate predictions for all 1280 instances.

A critical innovation is the Retrieval Warm-up. The authors found that training a multiplexed model from scratch is difficult because gradients get "mixed up." To solve this, they use a self-supervised pre-training task where the model must simply identify which original token belongs to which input index in the mixture. This "teaches" the model how to disentangle the signals before it tackles the actual downstream task.

Datasets

The authors evaluated DataMUX across six diverse tasks:

  • Natural Language Processing (NLP): Sentence classification tasks from the GLUE benchmark (MNLI, SST-2, QQP, QNLI) and Named Entity Recognition (NER) using CoNLL-2003.
  • Computer Vision: Image classification on MNIST.
  • Pre-training: The retrieval warm-up was conducted on the Wikitext-103 dataset.

Key Insights and Ideas

  • Subspace Independence: The authors provide a theoretical construction showing that self-attention networks can process inputs in independent subspaces. Essentially, the model learns to "park" different inputs in different parts of its high-dimensional internal space to avoid interference.
  • Transformer Superiority: Transformers proved much more amenable to multiplexing than MLPs or CNNs. The authors hypothesize that the global connectivity of self-attention is better at managing mixed signals than the local connectivity of CNNs, which rely heavily on spatial locality.
  • Implicit Regularization: Interestingly, for small values of $N$ (2 or 5), performance sometimes improved slightly. This suggests that multiplexing might act as a form of implicit regularization, similar to the "mixup" data augmentation technique.
  • Robustness of Representations: Using t-SNE visualizations, the researchers showed that the demultiplexed representation of a specific input remains remarkably consistent regardless of which other inputs it was mixed with.
Figure 2: DataMUX for Transformers: (Left) Given a tuple of N sentences (x1, x2, . . . , xN), each of length L, we first apply a multiplexing operation which performs a transformation φi on the embeddings of each sequence xi, such that the same transformation is applied to every token in a sequence xi. The multiplexing operation then aggregates the sequences by averaging over each position, generating a single combined sequence x1:N ∈RL×d, for embedding size d, which will be passed on to the central Transformer model. (Right) After processing, we perform a demultiplexing operation to the Transformer model’s output h1:N ∈RL×d, to generate hidden representations h1, h2, . . . , hN, corresponding to inputs x1, x2, xN respectively. We finally use these hidden representations to generate predictions for a particular task (e.g. named entity recognition (NER)) using a shared task prediction head.

Key Results

  • Massive Throughput Gains: For Transformers (T-MUX), the technique achieved an 11x speedup for 20x multiplexing and an 18x speedup for 40x multiplexing.
  • Minimal Accuracy Trade-off: On the MNLI task, T-MUX maintained high performance with absolute drops of only <2% for 20x multiplexing and <4% for 40x multiplexing compared to a vanilla Transformer.
  • Memory Efficiency: While memory usage does increase with $N$ (due to the demultiplexing layer), the growth is gentle. Multiplexing 40 instances only required about 4x the memory of a single-instance baseline, rather than the 40x required by standard batching.
  • Retrieval Accuracy: Models achieved nearly 100% accuracy on the retrieval warm-up task for up to 20 instances, proving the model's surprising ability to perfectly disentangle mixed data.

Limitations and Future Work

  • Training Overhead: While inference is much faster, training takes longer to converge because the optimization problem is significantly more complex.
  • Architecture Sensitivity: The current methods for CNNs and MLPs are less effective, with performance dropping sharply beyond $N=4$ or $N=8$. The authors suggest that specialized multiplexing strategies for vision architectures are a key area for future work.
  • Security and Privacy: The authors highlight potential risks, such as "data leakage" between different users' inputs in a multiplexed batch or new vectors for black-box attacks.
  • Scaling: Future research could explore how DataMUX performs during large-scale pre-training (e.g., training a BERT-style model with multiplexing from day one).

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