Representation Similarity: A Better Guidance of DNN Layer Sharing for Edge Computing without Training

Bryan Bo Cao, Abhinav Sharma, Manavjeet Singh, Anshul Gandhi, Samir Das, Shubham Jain · DOI

Introduction

Edge computing devices, such as the NVIDIA Jetson Nano, are increasingly deployed for real-time video analytics. However, these devices often encounter a "memory wall," where limited GPU memory prevents the simultaneous execution of multiple Deep Neural Networks (DNNs). Traditional model merging techniques attempt to alleviate this by sharing weights between architecturally identical layers. These methods are restrictive: they require identical layer structures, computationally expensive retraining, and access to labeled ground-truth data for validation.

The Proposed Approach: Representation Sharing

Researchers from Stony Brook University propose a novel paradigm called Representation Sharing. Unlike weight merging, which focuses on internal parameters, representation sharing focuses on the outputs (representations) of layers. If two layers from different models produce similar feature maps, one layer can be removed from memory, and the output of the remaining layer can be shared to feed the subsequent stages of both models.

Comparison of existing merging approaches vs. the proposed representation sharing.

This approach utilizes Centered Kernel Alignment (CKA) to quantify similarity ($S$) between layer outputs. CKA is particularly effective because it is invariant to certain transformations, allowing for comparisons between layers with different internal structures. To handle architectural mismatches, the authors employ uniform sampling for channel differences and up/downsampling for resolution variances. For non-sequential models with skip connections, "None tensors" are used as placeholders to maintain structural integrity.

Key Results and Insights

The core finding of this research is that representation similarity ($S$) serves as a highly accurate proxy for post-merging performance. The researchers observed a strong linear relationship between similarity and accuracy when $S > 0.4$, below which accuracy drops precipitously.

Experimental evaluation using EfficientNet-B0 (classification) and EfficientDet-D0 (detection) on the ImageNet validation set demonstrated that representation similarity significantly outperforms traditional metrics in predicting merged model accuracy.

Correlation coefficients (|r|) of various metrics with merged model accuracy.

As shown in the figure above, the Pearson Correlation Coefficient ($|r|$) for the proposed similarity metric ($S$) reaches 0.94, far exceeding metrics like FLOPs (0.0021) or the number of parameters (0.89). Furthermore, the method proves robust for "Cross-Stage" sharing—where representations are shared between different stages of different models—maintaining a correlation of $|r| = 0.99$.

Conclusion

By shifting the focus from weight identity to representation similarity, this work enables the "on-the-fly" merging of diverse DNNs at the edge. This eliminates the need for cloud-based retraining or labeled datasets, effectively allowing multiple models to coexist on memory-constrained hardware. Future work will focus on automating the search for optimal sharing points and extending the framework to a wider variety of computer vision tasks such as pose estimation or license plate recognition.

Summary updated

BibTeX
@inproceedings{cao2024representation,
  author = {Bryan Bo Cao and Abhinav Sharma and Manavjeet Singh and Anshul Gandhi and Samir Das and Shubham Jain},
  title = {{Representation Similarity: A Better Guidance of DNN Layer Sharing for Edge Computing without Training}},
  booktitle = {ACM MobiCom '24: Proceedings of the 30th Annual International Conference on Mobile Computing and Networking S3 Workshop},
  year = {2024},
  doi = {10.1145/3636534.3695903},
}
Figure