Recursive Sketches for Modular Deep Learning

Badih Ghazi, Rina Panigrahy, Joshua R. Wang

Modern deep learning models excel at immediate inference tasks, such as identifying objects in a single image. However, they often lack a structured, efficient mechanism to "reminisce" or answer memory-based questions over extended periods without storing prohibitively large amounts of raw input data or activation vectors.

This paper introduces a mathematical framework for creating "sketches"—highly compressed, recursive summaries of the computations performed by modular deep networks. These sketches enable a system to efficiently store long-term memories of past inputs, allowing it to answer complex retrospective questions (e.g., "How often did I see a cat this month?"). Furthermore, this framework allows a student network to learn the structure of a teacher network through a novel dictionary learning process.

The core challenge addressed is efficient information storage and retrieval within neural architectures. The authors seek a representation that is succinct, structured (preserving hierarchical relationships between objects), and robust to deletion or corruption.

Methodology: Recursive Sketching

The authors propose a Recursive Sketching Mechanism specifically designed for "modular deep networks"—architectures where independent neural modules communicate via attribute vectors.

Modular Deep Network Architecture
  • The Sketching Function: To create a sketch, the system applies specific random matrices to the attribute vectors produced by these modules. These transformed vectors are combined using a "tuple sketch" formula: $s_{tuple} = \sum w_i (\frac{I+R_i}{2}) s_i$, where $I$ is the identity matrix, $R_i$ is a random matrix, and $w_i$ represents the importance weight of the input.
  • Recursion: The sketches are inherently recursive. A high-level sketch (like a "room") contains the sketches of its components (like a "cat" or "chair"), which in turn contain sketches of their sub-components ("ears," "legs").
  • Block-Sparse Random Matrices: The foundation of this method relies on a custom distribution of block-random matrices. These are designed to satisfy an approximate version of isometry, ensuring information is preserved as it propagates through layers of recursion.
  • Recursable Dictionary Learning: The authors introduce an algorithm to reverse-engineer the network. By observing triples of inputs, outputs, and sketches, a student model can utilize dictionary learning to identify the underlying modules and their connectivity.

Key Insights

  • Graceful Erasure: A striking feature of these sketches is the absence of a single point of failure. Randomly erasing 20% of a sketch does not result in the loss of 20% of the objects; instead, the recovery accuracy for all objects degrades slightly, mimicking the gradual fading of biological memory.
  • Sketch-to-Sketch Similarity: The mathematical formulation ensures that completely different scenes yield sketches with near-zero dot products. Conversely, scenes sharing common modules or objects remain mathematically "close" in sketch space, facilitating efficient clustering and knowledge graph formation.
  • Frequency Recovery: Sketches implicitly store summary statistics. It is possible to estimate how frequently a specific module (e.g., a "cat detector") was triggered across numerous sketches without needing to access the original images.
  • Learning via Sketches: Augmenting standard input/output pairs with these sketches theoretically simplifies the process of learning the "ground truth" network, offering a potential pathway for more efficient model distillation.

Theoretical Results

This paper is primarily theoretical and foundational, relying on rigorous mathematical proofs rather than empirical benchmarks like ImageNet. It provides several key theoretical guarantees:

  • Attribute Recovery: An object's original attribute vector can be approximately recovered from the overall sketch with an error bound of $O(\delta/w_\theta)$, where $w_\theta$ is the effective weight or importance of that object.
  • Frequency Estimation: The number of objects produced by a specific module can be estimated with an additive error that decreases as the sketch size increases.
  • Network Learnability: The authors prove that a teacher network's modules can be learned from sketches in polynomial time, provided the modules meet specific criteria for "robust learnability" and "sufficient weight."

Limitations and Future Directions

  • The Modular Assumption: The framework heavily relies on the "modular" abstraction. While architectures like Capsules or PathNet fit this paradigm, applying it to standard, monolithic CNNs or Transformers would require casting them into a modular form first.
  • Computational Overhead: Although sketches are memory-efficient to store, computing them requires repeated matrix multiplications. The proposed block-sparse matrices aim to mitigate this, but real-world performance on hardware accelerators remains to be evaluated.
  • Empirical Validation: As a theoretical work, the paper lacks large-scale experimental validation. Future research should focus on implementing this framework within production-grade vision or NLP models to assess attribute recovery performance with real-world, noisy data.

Summary updated

BibTeX
@inproceedings{ghazi2019recursive,
  author = {Badih Ghazi and Rina Panigrahy and Joshua R. Wang},
  title = {{Recursive Sketches for Modular Deep Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
  url = {https://openreview.net/forum?id=rkEmH2WdbB},
}
Figure