Composable Sparse Subnetworks via Maximum-Entropy Principle

Francesco Caso, Samuele Fonio, Simone Monaco, Nicola Saccomanno, Fabrizio Silvestri

Introduction

Neural networks usually entangle knowledge, making it hard to extract specific capabilities. This paper introduces a method to train sparse, class-specific subnetworks that are highly confident on their target classes and maximally uncertain on everything else. These isolated modules can then be easily merged—either by summing weights or averaging logits—to build a fully functional, interpretable generalist model.

The Problem: Entangled Representations

Modern neural networks are notorious for "superposition"—a phenomenon where representations for different concepts or classes are entangled across shared neurons. This lack of modularity makes it incredibly difficult to isolate a specific function (like recognizing a specific class), reuse it, or understand how the network works under the hood.

If we want to edit models, unlearn specific data, or achieve true mechanistic interpretability, we need a way to extract clean, functional modules that specialize in one task without interfering with others. The authors ask: Can we train sparse, class-specialized subnetworks that remain deliberately ignorant outside their domain, yet compose smoothly into an accurate generalist model without requiring fine-tuning?

Methods: Creating Composable Modules

The authors propose a two-pronged approach to create composable "subnetwork modules":

  1. Maximum-Entropy (MaxEnt) Loss: Instead of standard cross-entropy, they use a custom KL-divergence loss. For a designated "rewarded" class (or subset of classes), the network is trained to output a highly confident prediction. For all other classes, it is forced to output a perfectly uniform distribution (maximum entropy).
  2. Iterative Magnitude Pruning (IMP): To physically isolate the functional circuit, the authors apply IMP. They repeatedly train the network, prune the smallest weights, and reset the remaining weights. This strips away irrelevant capacity and reinforces specialization.
  3. Model Merging: To build a generalist model, the isolated modules are combined in two ways:
  4. Weight Summation: Literally adding the sparse weight matrices together.
  5. Logit Averaging: Averaging the output logits, which acts probabilistically as a "product of experts."
Overview of the subnetwork training and merging process

Key Insights and Ideas

  • Ignorance is a feature, not a bug: By forcing the network to output uniform predictions on non-target classes, the MaxEnt loss ensures that modules don't step on each other's toes. In standard one-vs-all training, a neuron might learn to fire for "not class A," which semantically collides with a module trying to learn "class B". MaxEnt prevents this collision.
  • Sparsity enables physical composability: Pruning isn't just for compression here; it's for functional isolation. Removing irrelevant weights reduces the chance of destructive interference when you literally add two networks' weights together.
  • Mode connectivity by design: The authors show that modules trained this way are often "mode-connected." This means there is a low-loss path in the weight space connecting them, which mathematically justifies why simple weight summation works without requiring complex weight-alignment techniques.
  • Logit averaging acts as an automatic filter: Because non-target modules output uniform distributions, they effectively cancel out during softmax normalization. This allows logit averaging to seamlessly combine experts without them drowning each other out.

Key Results

The method was evaluated across a mix of image (MNIST, FMNIST, CIFAR-10) and tabular datasets (Human Activity Recognition, Yeast) to prove it works beyond simple toy vision tasks.

  • Perfect Isolation: Individual submodules achieved near 100% accuracy on their target classes while hitting the theoretical maximum entropy limit (e.g., ~2.3 for 10 classes) on excluded classes.
  • Successful Weight Merging: For simpler architectures (Shallow/Deep MLPs) on MNIST and FMNIST, merging modules via direct weight summation retained over 90% accuracy, even when incrementally combining all 10 class modules into a single network.
  • Pruning Matters: Using IMP significantly improved weight-space merging performance. This was particularly true for Deep MLPs, where unpruned networks suffered severe accuracy degradation upon merging.
Impact of Iterative Magnitude Pruning (IMP) on merged model accuracy
  • Logit Merging is Highly Robust: While weight summation struggled on complex setups (like ResNet18 on CIFAR-10), logit averaging recovered generalist performance almost perfectly across all tested architectures and datasets.

Limitations and Future Work

Direct weight summation degrades as architectures get deeper (like CNNs or ResNets) or datasets get harder (CIFAR-10). While the authors found that freezing and re-estimating BatchNorm statistics helps, simple summation isn't a silver bullet for complex models yet. Additionally, the physical overlap between pruned subnetworks needs to be carefully studied to optimize the best pruning strategy for isolation.

Future directions include exploring more sophisticated merging techniques (like Git-Rebasin or task arithmetic) to improve weight-space merging for complex architectures. The authors also highlight massive potential downstream applications for this modular approach, including machine unlearning (simply deleting or retraining a single class module), federated learning, and mechanistic interpretability by design.

Summary updated

BibTeX
@inproceedings{caso2026composable,
  author = {Francesco Caso and Samuele Fonio and Simone Monaco and Nicola Saccomanno and Fabrizio Silvestri},
  title = {{Composable Sparse Subnetworks via Maximum-Entropy Principle}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=IHwx5ioIP2},
}
Figure