🤖 AI Summary
Existing layer importance evaluation methods based on cosine similarity fail to accurately capture the actual performance degradation incurred by removing a specific layer, often leading to misinterpretations of the internal mechanisms of large language models. Through theoretical analysis and extensive empirical validation across multiple models, this work systematically demonstrates the weak correlation between cosine similarity and true performance drop. It proposes instead to directly measure layer importance by the actual decline in accuracy following layer removal—a more reliable and intuitive metric that dispenses with conventional proxies. Evaluated on several mainstream large language models, this approach consistently identifies critical layers with significantly higher precision than cosine similarity, offering a robust new paradigm for model pruning, compression, and interpretability research.
📝 Abstract
Large language models (LLMs) have revolutionized natural language processing. Understanding their internal mechanisms is crucial for developing more interpretable and optimized architectures. Mechanistic interpretability has led to the development of various methods for assessing layer relevance, with cosine similarity being a widely used tool in the field. On this work, we demonstrate that cosine similarity is a poor proxy for the actual performance degradation caused by layer removal. Our theoretical analysis shows that a layer can exhibit an arbitrarily low cosine similarity score while still being crucial to the model's performance. On the other hand, empirical evidence from a range of LLMs confirms that the correlation between cosine similarity and actual performance degradation is often weak or moderate, leading to misleading interpretations of a transformer's internal mechanisms. We propose a more robust metric for assessing layer relevance: the actual drop in model accuracy resulting from the removal of a layer. Even though it is a computationally costly metric, this approach offers a more accurate picture of layer importance, allowing for more informed pruning strategies and lightweight models. Our findings have significant implications for the development of interpretable LLMs and highlight the need to move beyond cosine similarity in assessing layer relevance.