DOCS: Quantifying Weight Similarity for Deeper Insights into Large Language Models
–arXiv.org Artificial Intelligence
We introduce a novel index, the Distribution of Cosine Similarity (DOCS), for quantitatively assessing the similarity between weight matrices in Large Language Models (LLMs), aiming to facilitate the analysis of their complex architectures. Leveraging DOCS, our analysis uncovers intriguing patterns in the latest opensource LLMs: adjacent layers frequently exhibit high weight similarity and tend to form clusters, suggesting depth-wise functional specialization. Additionally, we prove that DOCS is theoretically effective in quantifying similarity for orthogonal matrices, a crucial aspect given the prevalence of orthogonal initializations in LLMs. This research contributes to a deeper understanding of LLM architecture and behavior, offering tools with potential implications for developing more efficient and interpretable models. Large Language Models (LLMs), built on transformer architectures (Vaswani et al., 2017), have ushered in a new era in natural language processing (Brown et al., 2020). These complex models have demonstrated remarkable capabilities, but understanding their underlying mechanisms remains a challenge. Similarity analysis techniques (Raghu et al., 2017; Morcos et al., 2018; Kornblith et al., 2019) offer a promising approach for gaining insights into the learned representations and computational processes within these models. By analyzing the weights themselves, we aim to uncover deeper insights into the model's structure and functionality that are not apparent from representations alone. For further discussion, see Appendix E. 1. Focus on Representation, Not Weights: Similar representations across layers do not necessarily imply similar weight matrices. This discrepancy arises from the use of residual connections in transformer architectures (He et al., 2016), which create shortcuts that allow information to bypass layer transformations. Mathematically, a residual connection is represented as y = F(x, W) + x, (1) where x is the layer's input, W represents the weight matrices, F is the transformation function (including the feedforward network and attention), and y is the layer's output.
arXiv.org Artificial Intelligence
Jan-27-2025
- Country:
- Europe > Romania
- Asia > Middle East
- Jordan (0.04)
- Genre:
- Research Report > New Finding (1.00)
- Technology: