Model LEGO: Creating Models Like Disassembling and Assembling Building Blocks

With the rapid development of deep learning, the increasing complexity and scale of parameters make training a new model increasingly resource-intensive. In this paper, we start from the classic convolutional neural network (CNN) and explore a paradigm that does not require training to obtain new models. Similar to the birth of CNN inspired by receptive fields in the biological visual system, we draw inspiration from the information subsystem pathways in the biological visual system and propose Model Disassembling and Assembling (MDA). During model disassembling, we introduce the concept of relative contribution and propose a component locating technique to extract task-aware components from trained CNN classifiers. For model assembling, we present the alignment padding strategy and parameter scaling strategy to construct a new model tailored for a specific task, utilizing the disassembled task-aware components. The entire process is akin to playing with LEGO bricks, enabling arbitrary assembly of new models, and providing a novel perspective for model creation and reuse. Extensive experiments showcase that task-aware components disassembled from CNN classifiers or new models assembled using these components closely match or even surpass the performance of the baseline, demonstrating its promising results for model reuse. Furthermore, MDA exhibits diverse potential applications, with comprehensive experiments exploring model decision route analysis, model compression, knowledge distillation, and more. The code is available at https://github.com/jiaconghu/Model-LEGO.

Paper

References (60)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer 17d97/10 · confidence 5/52024-07-02

Summary

This paper proposes a novel framework for model disassembling and assembling. A component locating technique is introduced to disassemble task-aware components from the models. And an alignment padding strategy and a parameter scaling strategy are also designed to assemble these useful components. This work is meaningful to the interpretability of deep neural network models, as it combines the theory of biology and brain science theory to design human-interpretable models, which can uncover the black box CNN.

Strengths

The paper is clearly written and easy to follow. The proposed task is very novel, and the whole pipeline is well presented and easy to understand, and makes sense. The locating-then-assembling paradigm is well supported by the informative components identification and alignment padding strategy. The authors tested their proposed method on various popular CNN models and obtained convincing results.

Weaknesses

In section 3.1.1, the insight and rationale of the proposed metric is not clear. Why can this metric measure the contribution of features? Also, in the 4.2, why the Parameter Scaling Strategy can balance the effects of different componens?

Questions

refer to the weakness part.

Rating

7

Confidence

5

Soundness

4

Presentation

3

Contribution

3

Limitations

This paper only design CNN-based method, ignoring the popular Vit model.

Reviewer gfoc7/10 · confidence 5/52024-07-03

Summary

This paper draws inspiration from the information subsystem pathways in biological vision systems and proposes a Model Disassembling and Assembling (MDA) approach. - For model disassembling, the authors introduce the concepts of contribution aggregation and contribution allocation within convolutional filters and their kernels. The relative contribution of features is calculated and linked to the corresponding parameters for subsequent structure pruning. - For model assembling, a new model is established by combining the disassembled, task-aware components derived from different source models without necessitating retraining. To validate the effectiveness of MDA, the authors conduct extensive experimental evaluations across diverse architectures, including CNNs and GCNs. The results show that MDA can work effectively on these architectures. In addition to model creation, the authors also explore potential applications of MDA, such as model decision route analysis and model compression.

Strengths

1. The concept of Model Disassembling and Assembling (MDA) is novel, offering a new perspective on model architecture. It suggests that each part of a model related to specific tasks or categories can be considered an independent functional component. These components can be flexibly reused and assembled to achieve various combinations for multi-classification tasks. 2. The concept of MDA, along with the proposed methods and formula definitions, is clearly presented. The experiments are well designed, and the comprehensive results validate that MDA can work effectively for model reuse or creation, and other task scenarios. Moreover, the extensive experiments provide deeper insights into MDA, enhancing the overall quality of the paper. 3. The paper is written in a clear and accessible manner. The illustrations, methods, and formulas are easy to understand, and the language used is straightforward. The provided source codes are also well-structured and easy to read. 4. The proposed method demonstrates significant performance benefits. Besides creating models by reusing model components, the basic idea of MDA has the potential to inspire future research directions, such as model interpretability and model architecture design.

Weaknesses

1. As the number of categories increases, the performance of disassembling decreases. This means that to achieve the best disassembling effect, it is necessary to decompose each category separately, which is time-consuming and may result in a heavier assembled model. 2. Manually setting thresholds (Eqns. 9 and 10) to obtain relative contributions may not guarantee consistently good results across tasks. 3. While the authors claim that model assembling does not necessitate retraining or incur performance loss (Line 204), the assembled models are often inferior to the baseline without retraining or fine-tuning (see Table 1). 4. In the assembled model, different categories fail to follow their own pathways extracted from the model disassembling. For example, a disassembled conv-filter of CIFAR-10-cat0 might generate a high response on CIFAR-100-cat0 because the conv-filter has never seen CIFAR-100-cat0, which can be regarded as inter-class interference. This is why the assembled model initially shows degraded performance. Ideally, model assembling should ensure that pathways between different categories are mutually exclusive.

Questions

1. The results in Table 3 have shown the effectiveness of MDA when applied to GCN models. However, could the authors provide more details on the design of MDA for GCN models? 2. Does model disassembling require additional training? If so, please present the details on how the numerical results in Tables 1 and 3 were obtained. 3. The fine-tuning of the assembled model will inevitably cause a shift in the internal pattern of the model. Do the pathways of the fine-tuned model remain the same as the original ones? 4. Have the authors considered the interference between categories when assembling the disassembled components? Are there any potential solutions to this issue?

Rating

7

Confidence

5

Soundness

4

Presentation

3

Contribution

4

Limitations

The limitations have been discussed in the paper. Additionally, there is no societal impact from the work performed.

Authorsrebuttal2024-08-06

Rebuttal by Authors [Q5-Q8]

> Q5: *The results in Table 3 have shown the effectiveness of MDA when applied to GCN models. However, could the authors provide more details on the design of MDA for GCN models?* > We apologize for any confusion. We are pleased that Table 3 demonstrates the effectiveness of MDA on GCN models. In fact, the core computation of GCN models is given by $\mathbb{H}^{l+1} = \delta(\tilde{\mathbb{A}}\mathbb{H}^{l}\mathbb{W}^{l})$, where $\tilde{\mathbb{A}}$ is the degree-normalized adjacency matrix, $\mathbb{H}^{l}$ and $\mathbb{W}^{l}$ represent the features and weights at layer $l$, respectively, and $\delta$ denotes an activation function. This process can be simplified to linear operations involving $\mathbb{H}^{l}\mathbb{W}^{l}$. The MDA method proposed in our paper, which is designed for convolutional operations (discussed in Sections 3 and 4 of the paper), is also applicable to linear operations (as detailed in Appendix C). Therefore, no special modifications are required to apply MDA to GCN models; the same MDA method used for CNNs can be directly employed. This underscores both the versatility and effectiveness of the MDA method. > Q6: *Does model disassembling require additional training? If so, please present the details on how the numerical results in Tables 1 and 3 were obtained.* > Thank you for your question. Model disassembling does not require any additional training. The performance results presented in Tables 1 and 3 are derived directly from the disassembled models. As observed, the performance of these disassembled models generally exceeds that of the original models. The detailed reasons for this performance improvement can be found in our response to your first comment. > Q7: *The fine-tuning of the assembled model will inevitably cause a shift in the internal pattern of the model. Do the pathways of the fine-tuned model remain the same as the original ones?* > This is an interesting question. We have disassembled both the pre-fine-tuned and fine-tuned assembled models to examine the internal decision pathways. Our analysis reveals that fine-tuning does indeed result in changes to the internal decision pathways of the model. These changes allow the fine-tuned model to better adapt to the new data distribution, thereby mitigating the interference between parameters from different categories during inference. > Q8: *Have the authors considered the interference between categories when assembling the disassembled components? Are there any potential solutions to this issue?* > Thank you for your question. We have indeed considered the issue of category interference when assembling disassembled components. Details regarding this concern are addressed in our responses to your third and fourth comments. In the paper, we propose two approaches to mitigate this interference: the "parameter scaling strategy" and "minimal fine-tuning mechanism." These methods can alleviate inter-category interference to some extent without incurring significant computational overhead. Furthermore, in our future work, we plan to explore adaptive parameter adjustment strategies from the perspective of the parameter space of submodels. For example, we are considering leveraging diffusion models to adjust parameter distributions. This approach would involve adapting the parameters of the submodels based on the characteristics of each category, enabling the assembled model to rapidly adapt to new data distributions and potentially eliminating the need for fine-tuning. However, it is important to note that the current methods for model disassembly and assembly still hold significant value.

Reviewer gfoc2024-08-12

Thank you for your detailed response, which effectively addressed my concerns. I have also reviewed the comments and responses provided to the other reviewers, and I find that they align with my understanding of this work. I believe that the model disassembly and assembly presented in this work are both insightful and significant for the deep learning community. I also look forward to seeing its potential application to a broader range of models and tasks. Based on the above considerations, I will maintain a positive recommendation for the acceptance of this work.

Reviewer UTXG2/10 · confidence 3/52024-07-08

Summary

This paper proposes the Model Disassembling and Assembling (MDA) task for CNN classifiers, introducing techniques for extracting and reassembling task-aware components. Experiments show reassembled models perform comparably or better than original models. The approach offers new applications in decision route analysis, model compression, and knowledge distillation, with future extensions planned for Transformers and multi-modal models.

Strengths

- The idea presented by this paper is novel and the technique adopted for solving the problem is new.

Weaknesses

1. The definition of sub-task is strongly tied to category, severely limiting it to classification tasks. Additionally, the entire method seems complicated, appearing to be overfitted to classification tasks and the CNN architecture. Its inability to handle other types of tasks, especially self-supervised learning, which is widely recognized as the future, raises concerns about the value of this work. 2. There is a lack of systematic comparisons with other works, such as deep model reassembly[1], and the study only includes self-constructed specific tasks, making it hard to evaluate the technical soundness. 3. Given the widespread adoption of transformers in the field, the absence of experiments involving transformers is unfortunate. [1] Yang, Xingyi, et al. "Deep model reassembly." Advances in neural information processing systems 35 (2022): 25739-25753.

Questions

Could you provide an intuitive explanation for why your method sometimes outperforms the baseline, given that the baseline is end-to-end trained for the classification task?

Rating

2

Confidence

3

Soundness

2

Presentation

2

Contribution

2

Limitations

As stated in the weakness part, the absence of the results on widely-adopted transformer architectures and its inapplicability to models trained with tasks other than classification (e.g., masked image modeling) may limit the value of this work.

Authorsrebuttal2024-08-06

Rebuttal by Authors [Q2]

> Q2: *There is a lack of systematic comparisons with other works, such as deep model reassembly[1], and the study only includes self-constructed specific tasks, making it hard to evaluate the technical soundness.* > Thank you for your valuable feedback. Here is our response: **Systematic Comparisons with Other Methods**: We apologize for any confusion regarding this matter. In lines 44 to 47 of the main text and lines 503 to 504 of Appendix B, we highlight the key differences between our work and other related studies. To provide a systematic comparison, we have specifically compared our method, MDA, with the Deep Model Reassembly (DeRy) [1], as you pointed out. This comparison covers aspects such as problem definition, methodology, and effectiveness. It is evident that MDA differs significantly from DeRy and offers clear advantages. For instance, MDA disassembles models into task-aware components that handle different subtasks vertically. These disassembled submodels can be directly used for inference, are interpretable, and can be assembled to perform various tasks. Moreover, compared to other related work, MDA has several distinctive features. For example, there is no need for predefined subcomponents during the training of the original model, and no additional learning modules are required during disassembly and reassembly. In summary, this work represents the first approach to model disassembly and reassembly related to subtasks, allowing for the flexible creation of new models in a manner akin to assembling with building blocks. | | DeRy [1] | MDA [This Paper] | | --- | --- | --- | | Problem Definition | DeRy aims to partition different layers of models into equivalent sets and then reassemble layers from these sets. | MDA is the first to aim at disassembling a model into different task-aware components, with each component corresponding to one or more specific sub-tasks, which can be assembled to solve a larger task comprising these sub-tasks. | | Model Disassembly Method | DeRy uses covering set optimization to partition different layers of models into equivalent sets. To maintain these sets, each time a new model is partitioned, it requires calculating the "functional similarity" for relevant layers across all models, increasing unnecessary computational overhead. | MDA disassembles the model based on proposed contribution aggregation and allocation, independent of other models and solely related to the sub-tasks themselves. This direct approach significantly enhances disassembly efficiency and practicality. | | Effectiveness of Disassembled Models | The parameters generated by DeRy's method, which partitions models by layers, lack practical meaning, resembling a black box that cannot be understood or used directly for inference. | MDA disassembles the model according to the inference paths of different sub-tasks, making the model more transparent and interpretable. More importantly, the task-aware components disassembled can be used directly for inference without any training. | | Model Reassembly Method | DeRy reassembles models by solving integer programming to stack layers from different models horizontally. If the dimensions of two consecutive layers do not match, additional parameters for concatenation layers are introduced, necessitating retraining. | MDA reassembles models by vertically assembling different decision paths and uses a parameter scaling strategy that requires no training to mitigate sub-task interference. This approach usually yields excellent results and maintains interpretability during the assembly phase. | | Effectiveness of Reassembled Models | DeRy can only partition and reassemble models for the same task. For example, different models for ImageNet classification can be partitioned by layers and reassembled, but the new model can still only be used for ImageNet classification. | MDA can assemble models used for different sub-tasks. The reassembled model can solve new, previously unseen larger tasks comprising these sub-tasks. | | | | | **Self-constructed Specific Tasks**: Here is our response to your concern: 1. This work is the first to propose sub-task-based deep model disassembly and assembly (Section 2). Therefore, there are currently no standard datasets or tasks, nor comparable settings from previous works. 2. The datasets used to evaluate the final model performance are publicly recognized, and the evaluation process is standard. In addition to the commonly used model accuracy, we provide more detailed experimental results, such as parameter counts and FLOPs of disassembled models (Appendix G) and more granular baseline effects before model assembly (Appendix H). We understand your concerns and hope that the above response addresses your questions. Designing a comprehensive benchmark for model disassembly and reassembly will be one of our priorities in future work.

Authorsrebuttal2024-08-06

Rebuttal by Authors [Q3&Q4]

> Q3: *Given the widespread adoption of transformers in the field, the absence of experiments involving transformers is unfortunate.* > We understand your concern. In fact, the proposed MDA, such as contribution aggregation and allocation, can be applied to transformers, as discussed in our response to your first comment (Q1). We conducted a preliminary model disassembly experiment using ViT-Tiny on ImageNet-10, and the results are shown in Table 1. Table 1: Disassembly Performance of ViT-Tiny on ImageNet-10 | Disassembled Task | Base(%) | Disa(%) | | --- | --- | --- | | 0-1 | 87.70 | 89.25 (+1.55) | | 1-3 | 75.10 | 78.10 (+3.00) | | 3-9 | 77.51 | 79.29 (+1.78) | As shown in Table 1, the disassembled model can still be used for inference, and its accuracy is higher than that of the original model. Furthermore, we tested the model assembly performance of ViT-Tiny on CIFAR-10 and CIFAR-100. However, we must acknowledge that the results were not satisfactory. For example, when assembling the disassembled CIFAR-10 (0-3) and CIFAR-100 (11-17) models, the accuracy without fine-tuning was only 13.27%. As Reviewer gfoc mentioned in their final comment, task interference occurs when sub-models from different source models are assembled together, and this issue is particularly severe due to the self-attention mechanism unique to transformers. We believe that adjusting parameter distribution from different sub-model parameter spaces before assembly is a potential solution to this problem, which will be a focus of our future research. > Q4: *Could you provide an intuitive explanation for why your method sometimes outperforms the baseline, given that the baseline is end-to-end trained for the classification task?* > That's an excellent question. The superior performance of the proposed MDA method over the base model can be attributed to two main factors: 1. The source model, from which the disassembled components are derived, can be considered as trained on additional data relative to the target task. This means it has learned more features and possesses better feature extraction capabilities. 2. More critically, during model disassembly, our proposed method extracts only the parameters relevant to the subtasks, discarding those unrelated. This means that during inference, there is no interference from parameters associated with other subtasks, leading to higher inference accuracy. The performance improvement demonstrates that disassembling and identifying subtask-related model parameters is both feasible and effective. Besides the accuracy improvement, the experiments in our paper also show that our method accurately identifies subtask-related parameters and effectively removes irrelevant ones (as detailed in Table 5 of Appendix G).

Authorsrebuttal2024-08-11

Willing to Provide Further Clarifications

Dear Reviewer, Thank you for your valuable comments and feedback. We have thoroughly addressed the questions you raised in our detailed responses. If you have any further questions or concerns, we would be more than happy to provide additional clarifications. We believe this would be greatly beneficial in refining and improving our work. Sincerely, The Authors of Model Lego

Reviewer UTXG2024-08-11

Thank you for your detailed response. Although NeurIPS rules state that "Reviewers are not required to take comments into consideration," I reviewed all your comments. However, I found them not satisfactory. Specifically, the main issues with your response are as follows: The response was *overwhelmingly long*, exceeding the NeurIPS rebuttal limit of 6000 characters. This length made it difficult for me to grasp the key points and conclusions in your response. The overall content seemed somewhat vague, with extensive explanations of what your method *might* achieve. However, an experiment result is worth more than a thousand words. For instance, you spent considerable effort discussing whether your method could be applied to other tasks like generation or self-supervised learning, but the explanations remained highly theoretical and philosophical without supporting results. Moreover, I was hoping for more system level with other methods. I expected to see how your method outperforms others in a fair setting, demonstrating clear advantages or unique capabilities, but such results were absent. Additionally, your experiments applying the method to transformers further demonstrated that the generalizability of the approach is quite limited (even in a very toy setting, from my perspective). This reinforces the idea that philosophical explanations is far from insufficient in validating your claims. Practical experiments reveal that applying this method to other tasks or models is not as straightforward as suggested. So I would also expect similar difficulties in applying your method to other tasks (for example, masked image modeling or next-token-prediction in self-supervised learning). Given the above points, my concerns are not addressed with the author's response, and I will be maintaining my original rating.

Authorsrebuttal2024-08-13

Dear Reviewer, Thank you for your constructive suggestions. We apologize for exceeding the word limit in our previous response. Here, we summarize our replies to your four comments on weaknesses and questions (denoted as Q1 to Q4) in the most concise manner: - **Limitation of Subtask Definitions (Q1)**: This work introduces model disassembly and reassembly related to subtasks (Section 2). Besides classification, it is evident that subtasks can be defined in image detection, segmentation, generation, and subtasks related to factual knowledge in natural language. - **Complexity and Generalization of the Method (Q1)**: The proposed approach is not coupled with the CNN architecture. This paradigm can be applied to a broader range of deep neural networks, such as graph neural networks (Section 5.3 in the paper). - **Applicability of Self-Supervised Learning (Q1)**: Regarding self-supervised learning, such as masked image modeling, the pre-trained model obtained is used for feature learning and is not tied to a specific task. Thus, only subtasks related to feature learning can be defined and utilized for model compression (as discussed in Appendix J.2). However, for downstream task models based on self-supervised learning, our method is equally applicable as it is to standard models. - **Systematic Comparison with Other Methods (Q2)**: This work is the first to propose model disassembly and assembly related to subtasks, significantly differing from existing work. For example, previous work does not even decompose a sub-model that can be directly inferred from. Therefore, fair quantitative comparisons are not feasible. Nevertheless, we provide detailed comparisons across problem definition, methods, and effects, highlighting the advantages of our approach. - **Specific Tasks of Self-Constructed Models (Q2)**: As the first work on model disassembly and assembly, there are no established experimental settings to follow. However, our experimental environment is fair, using publicly available datasets, with detailed experimental setups provided. In addition to model accuracy, we have also provided experimental data on model parameters and FLOPs (Appendix G), as well as more fine-grained baselines (Appendix H). - **Experimental Results on Transformers (Q3)**: We have supplemented experimental results on Transformers, demonstrating that disassembled sub-models perform well on different subtasks. However, due to the unique nature of self-attention mechanisms, there can be interference between subtasks when assembling these sub-models, leading to unsatisfactory performance without further fine-tuning. We have provided explanations and potential solutions for this issue. Along with model disassembly and reassembly on large language models, this will be a direction for our future work. - **Reasons for Performance Exceeding Baselines (Q4)**: The primary reason is that the original model, from which the components are disassembled, has been trained on more extensive data compared to the baseline models for the target tasks. Furthermore, only parameters relevant to subtasks are included in the disassembled model, reducing interference from other task parameters and thus leading to more accurate predictions. The detailed responses to these points can be found in the rebuttal above. Once again, we appreciate your thorough review and valuable suggestions. Best regards, The Model LEGO Authors

Reviewer FhUd7/10 · confidence 4/52024-07-14

Summary

The paper introduces Model Disassembling and Assembling (MDA), a novel method inspired by the biological visual system to create new deep learning models without retraining. By disassembling pretrained CNNs into task-aware components and reassembling them, the approach maintains performance while enabling efficient model reuse. Experiments show that the reassembled models match or exceed the original models' performance, highlighting MDA's potential for applications like model compression and knowledge distillation.

Strengths

1. The proposed method allows for arbitrary assembly of new models from task-aware components, similar to building with LEGO blocks, which is novel and interesting. 2. MDA creates new models without requiring extensive retraining, saving significant computational resources. 3. The experimental results are impressive. The reassembled models can match or even surpass the performance of the original models.

Weaknesses

1. The computation of contributions and component locating may introduce additional time and computational cost, especially when the number of classes or tasks are large. It is recommended to add a analysis of the complexity of this method. 2. Is this method applicable to transformer models and large models? 3. In some cases, the performance of MDA can even outperforms the base model, why? 4. Some typos in writing should be corrected. For example, in Section 5.2.1, the quotes `’sth’` are all right quotes.

Questions

See Weaknesses.

Rating

7

Confidence

4

Soundness

4

Presentation

3

Contribution

4

Limitations

The authors have adequately discussed the limitations.

Area Chair XtJa2024-08-11

Discussion Period

Dear Reviewers, Please read the authors' rebuttal and post your response to the rebuttal. Thank you. Best, AC

Reviewer 17d92024-08-11

Good response

This response successfully addressed my concerns. I maintain the accept score

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC