TL;DR
This paper introduces a novel iterative algorithm, the Block Code Factorizer (BCF), for efficiently disentangling complex data representations encoded as Generalized Sparse Block Codes (GSBCs). This BCF is then ingeniously applied to replace the computationally expensive final fully connected layers (FCLs) in deep neural networks, significantly reducing model size and computational cost while maintaining high accuracy.
What Problem Does This Paper Address?
Modern deep learning models often rely on Vector Symbolic Architectures (VSAs) to represent complex data structures using fixed-width vectors. A key challenge in VSAs is "factorization" – disentangling these distributed representations into their constituent elements. This becomes particularly difficult when the representations are noisy, as is common with outputs from neural networks. Furthermore, the final fully connected layers (FCLs) in Convolutional Neural Networks (CNNs) are notorious for their large parameter count and computational burden, especially in applications with many classes or evolving class sets. This paper tackles both the VSA factorization problem for sparse block codes and the FCL bottleneck in CNNs.
Methods
The core of this work is the Block Code Factorizer (BCF), an iterative algorithm designed to efficiently factorize Generalized Sparse Block Codes (GSBCs). GSBCs are a more flexible extension of binary sparse block codes, allowing for more general representations. The BCF employs several novel techniques:
- $l_\infty$-based Similarity Metric: A new similarity measure that focuses on the element-wise difference between vectors, proving more effective than traditional dot-product similarity for GSBCs.
- Sparse Activation and Conditional Random Sampling: A thresholding mechanism is used to focus on promising factor candidates, and a conditional random sampling strategy is introduced to prevent decoding failure when the thresholding results in an all-zero similarity vector. This mechanism allows for analytical determination of expected decoding iterations.
- Weighted Bundling: The final factor estimate is generated by a normalized weighted bundling of codevectors.
For the CNN application, the authors propose integrating the BCF to replace the FCL. This involves:
- Casting Classification as Factorization: Classes are represented as product vectors in a GSBC space, where each factor can correspond to an attribute (e.g., shape, color).
- Novel Blockwise Cross-Entropy Loss: A new loss function is introduced to train CNNs to generate these GSBC product vectors, overcoming limitations of standard binary cross-entropy loss.
- BCF-based Inference: The CNN's output is fed into the BCF to decode the class representation, effectively performing classification.
Datasets
The paper evaluates its methods on several standard image classification benchmarks:
- ImageNet-1K: A large-scale dataset with 1000 classes.
- CIFAR-100: A dataset with 100 classes.
- RAVEN: A dataset for relational and analogical reasoning, used here for object recognition based on attributes.
Key Insights and Ideas
- GSBCs are more flexible and effective: The generalization of sparse block codes to GSBCs allows for richer representations and better performance in factorization tasks.
- $l_\infty$-similarity is crucial for sparse codes: Traditional similarity metrics struggle with sparse representations; the $l_\infty$-based metric offers a significant improvement.
- Conditional random sampling prevents dead ends: The BCF's ability to intelligently "restart" or explore alternatives when stuck is key to its robustness and efficiency.
- BCF as an FCL replacement is highly effective: Replacing large FCLs with BCF drastically reduces model size and computation without sacrificing accuracy, making deep learning models more efficient, especially for edge devices or continual learning scenarios.
- Factorization can directly map to classification: The insight that classification can be framed as a factorization problem, where class attributes are factors, is a powerful conceptual bridge.
Key Results
- Factorization Efficiency: The BCF significantly outperforms previous methods in factorizing synthetic and noisy product vectors, achieving higher operational capacity and requiring fewer iterations. For instance, it can solve problems with a search space of $10^6$ with high accuracy.
- CNN FCL Replacement:
- On ImageNet-1K, BCF reduces FCL parameters by up to 44.5% and computational cost by up to 68.0%, while maintaining accuracy within 4.46% of the baseline.
- On CIFAR-100, BCF reduces parameters by 0.5% and computational cost by 60.0%, with accuracy within 0.91% of the baseline.
- On RAVEN, BCF reduces parameters by 16.2% and computational cost by 86.7%, with accuracy within 0.07% of the baseline.
- The BCF-based approach can achieve high accuracy even with very sparse representations (e.g., 99.98% zero elements in the FCL).
Limitations and Future Work
- Decoding Superpositions: The current BCF primarily decodes single product vectors. The authors suggest future work on efficiently decoding superpositions of vector products, which would enable handling multiple objects in an image or replacing more complex FCLs.
- Learned Product Spaces: While codebooks are currently defined or chosen arbitrarily, the paper suggests exploring learned product spaces via gradient descent to reveal inherent class structures.
- Transformer Models: The authors propose applying BCF to reduce the memory footprint of embedding tables in Transformer models and to replace feedforward layers, noting that sparse activations would be beneficial.
- Hyperparameter Tuning: While Bayesian optimization is used, further hyperparameter tuning for different block configurations (B) could potentially yield even better results.
Summary updated