Hidden-Fold Networks: Random Recurrent Residuals Using Sparse Supermasks

Ángel López García-Arias, Masanori Hashimoto, Masato Motomura, Jaehoon YuarXiv 2021

TL;DR

Hidden-Fold Networks (HFNs) combine two powerful neural network compression trends: structural "folding" (turning deep ResNets into shallow, recurrent networks via weight sharing) and "supermask" training (finding high-performing subnetworks within frozen, randomly initialized weights). By merging these orthogonal techniques, HFNs achieve accuracies competitive with standard ResNets while reducing memory footprints by up to 38.5x, opening the door for massive energy savings on edge hardware.

What Problem Does This Paper Address?

As deep neural networks (DNNs) have grown in accuracy, they have also ballooned in size, often containing tens of millions of parameters. In edge computing and specialized hardware deployment, the primary bottleneck isn't arithmetic computation—it's data transfer. Fetching weights from off-chip memory (DRAM) consumes orders of magnitude more energy and time than the actual math.

To tackle this, researchers have previously tried two distinct approaches:

  1. Hidden Networks (HNNs): Exploiting the fact that over-parametrized, randomly initialized networks already contain accurate subnetworks. Instead of training weights, you freeze them and learn a binary "supermask" to select the right connections.
  2. Network Folding: Exploiting the hypothesis that deep residual networks (ResNets) behave like unrolled, shallow recurrent neural networks (RNNs). By forcing layers to share weights, a deep network can be "folded" into a tiny recurrent one.

The authors of this paper ask: Can we combine these two paradigms to create an ultra-compressed network that never updates its weights, yet remains highly accurate?

Methods

The authors introduce Hidden-Fold Networks (HFNs), which seamlessly blend network folding and supermask training through four core components:

  • Folded ResNet Architecture: HFNs take a standard ResNet and fold identical bottleneck blocks within each stage into a single recurrent block. These blocks share the exact same weights and are iterated sequentially. The very first block of each stage (which handles downsampling) cannot be folded and is kept as-is.
  • Signed Kaiming Constant (SC) Initialization: Weights are completely frozen at initialization. Instead of a standard continuous distribution, weights are sampled uniformly from $\{-\sigma, \sigma\}$, where $\sigma$ is the standard deviation of the Kaiming normal distribution.
  • Supermask Training via edge_popup: Because weights are frozen, training focuses entirely on finding the optimal subnetwork. Every connection is assigned a score. During the forward pass, only the top-$k\%$ highest-scoring connections are kept (setting the supermask to 1, and the rest to 0). Backpropagation updates these scores rather than the weights.
  • Unshared Batch Normalization (UBN): While convolutional weights are shared across recurrent iterations, standard Batch Normalization fails due to exploding activations. To fix this, HFNs give each recurrent iteration its own unique, learnable affine BatchNorm parameters.
[Standard ResNet Stage] ---> Chained Blocks: B1 -> B2 -> B3 -> B4
                                 |
                                 V (Folding)
[HFN Recurrent Stage]   ---> B1 -> [ Shared Recurrent Block ] x3 iterations
                                      (Uses same Supermask & Weights)

Datasets

The method was evaluated on two standard image classification benchmarks:

  • CIFAR100: Used for hyperparameter tuning, density exploration, and depth trade-off analysis.
  • ImageNet: Used to validate the scalability of HFNs on a massive, real-world dataset.

Key Insights and Ideas

  • Orthogonality Breeds Synergy: Supermask training modifies how weights are treated, whereas folding changes the network architecture. Because these techniques operate on completely different axes, they don't interfere with each other; instead, they compound the compression gains.
  • Bio-Inspirations Hold Up: Primate visual systems are structurally shallow (4–6 layers) but highly recurrent. HFNs mimic this biology. The authors found that as they added more layers (which translates to more recurrent iterations in HFNs), accuracy grew monotonically, validating the theory that ResNets perform iterative feature refinement.
  • DRAM Avoidance: Because the weights are random and never change, hardware doesn't need to store them. It only needs to store a single random seed to regenerate the signs on the fly, alongside the highly compressible binary supermask.

Key Results

HFNs achieve massive memory reductions with minimal impact on accuracy:

  • CIFAR100: HFN-ResNet152 achieved a 78.02% top-1 accuracy (matching a vanilla ResNet50's 78.01%) while being 38.54x smaller in memory size (2.46 MB vs. 94.82 MB).
  • ImageNet: HFN-ResNet200 achieved a 72.06% top-1 accuracy (comparable to ResNet34's 73.30%) while being 26.83x smaller (3.25 MB vs. 87.19 MB).
  • Energy Efficiency: By compressing models down to just a few megabytes, the entire network can fit onto on-chip SRAM. This eliminates the need for DRAM access entirely, reducing model-loading energy consumption by two orders of magnitude on an ideal 45 nm CMOS accelerator.

Limitations and Future Work

  • Not for Standard CPUs/GPUs: HFNs are explicitly designed for specialized hardware accelerators. On standard hardware, the parameters must be uncompressed at runtime, and the recurrent unrolling actually increases computational latency (making HFN-ResNet152 roughly 3x slower to compute than ResNet50).
  • ImageNet Convergence Issues: While HFNs converged smoothly on CIFAR100, the loss on ImageNet dropped slowly and failed to fully converge within 100 epochs, indicating a need for better training schedules or optimizers (like RAdam).
  • Training Overhead: Tracking and updating a separate score tensor for the supermask increases training times significantly. For example, training ResNet50 on CIFAR100 took 44 seconds per epoch for a vanilla model, but jumped to 149 seconds for the HFN variant.

Summary updated

Abstract

Deep neural networks (DNNs) are so over-parametrized that recent research has found them to already contain a subnetwork with high accuracy at their randomly initialized state. Finding these subnetworks is a viable alternative training method to weight learning. In parallel, another line of work has hypothesized that deep residual networks (ResNets) are trying to approximate the behaviour of shallow recurrent neural networks (RNNs) and has proposed a way for compressing them into recurrent models. This paper proposes blending these lines of research into a highly compressed yet accurate model: Hidden-Fold Networks (HFNs). By first folding ResNet into a recurrent structure and then searching for an accurate subnetwork hidden within the randomly initialized model, a high-performing yet tiny HFN is obtained without ever updating the weights. As a result, HFN achieves equivalent performance to ResNet50 on CIFAR100 while occupying 38.5x less memory, and similar performance to ResNet34 on ImageNet with a memory size 26.8x smaller. The HFN will become even more attractive by minimizing data transfers while staying accurate when it runs on highly-quantized and randomly-weighted DNN inference accelerators. Code available at https://github.com/Lopez-Angel/hidden-fold-networks
BibTeX
@misc{garciaarias2021hidden,
  author = {Ángel López García-Arias and Masanori Hashimoto and Masato Motomura and Jaehoon Yu},
  title = {{Hidden-Fold Networks: Random Recurrent Residuals Using Sparse Supermasks}},
  year = {2021},
  eprint = {2111.12330},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.12330},
}
Figure