Discovering Decoupled Functional Modules in Large Language Models
Organizations: Thrust of AI, Hong Kong University of Science and Technology (Guangzhou) · Huawei Technologies Ltd.
Abstract
Understanding the internal functional organization of Large Language Models (LLMs) is crucial for improving their trustworthiness and performance. However, how LLMs organize different functions into modules remains highly unexplored. To bridge this gap, we formulate a functional module discovery problem and propose an Unsupervised LLM Cross-layer MOdule Discovery (ULCMOD) framework that simultaneously disentangles the large set of neurons in the entire LLM into modules while discovering the topics of input samples related to these modules. Our framework introduces a novel objective function and an efficient Iterative Decoupling (IterD) algorithm. Extensive experiments show that our method discovers high-quality, disentangled modules that capture more meaningful semantic information and achieve superior performance in various downstream tasks. Moreover, our qualitative analysis reveals that the discovered modules show semantic coherence, correspond to interpretable specializations, and a clear spatial and hierarchical organization within the LLM. Our work provides a novel tool for interpreting the functional modules of LLMs, filling a critical blank in LLM's interpretability research.
Figures & tables
| LLM | K-Means | Mini-Batch K-Means | Agglomerative | Spectral | Spectral Co-cluster | IterD ( Ours ) | |||||||||||||
| Qwen2.5 -1.5B -Instruct | 5 | 19.2 | 0.409 | 46.9 | 23.4 | 0.406 | 57.6 | 10.1 | 0.311 | 32.4 | 9.6 | 0.335 | 28.7 | 24.0 | 0.380 | 63.2 | 31.4 | 0.465 | 67.5 |
| 10 | 5.7 | 0.644 | 8.8 | 4.2 | 0.630 | 6.7 | 5.2 | 0.599 | 8.7 | 2.8 | 0.566 | 5.0 | 7.9 | 0.522 | 15.1 | 12.0 | 0.711 | 16.9 | |
| 15 | 0.9 | 0.829 | 1.1 | 1.9 | 0.752 | 2.6 | 1.9 | 0.655 | 2.9 | 0.7 | 0.750 | 0.9 | 3.8 | 0.583 | 6.4 | 6.6 | 0.892 | 7.5 | |
| 20 | 0.4 | 0.943 | 0.4 | 0.5 | 0.855 | 0.6 | 1.0 | 0.731 | 1.3 | 0.3 | 0.914 | 0.3 | 2.0 | 0.636 | 3.1 | 4.4 | 1.048 | 4.2 | |
| Qwen2.5 -3B -Instruct | 5 | 28.0 | 0.466 | 60.1 | 26.9 | 0.490 | 54.9 | 16.1 | 0.439 | 36.6 | 0.0 | 0.001 | 7.7 | 34.6 | 0.404 | 85.6 | 56.9 | 0.533 | 106.8 |
| LLM | Cls. | K-Means | Mini-Batch K-Means | Agglomerative | Spectral | Spectral Co-Clustering | IterD ( Ours ) | |||||||
| Acc | F1 | Acc | F1 | Acc | F1 | Acc | F1 | Acc | F1 | Acc | F1 | |||
| Qwen2.5 -1.5B -Instruct | LR | 5 | 0.4800 | 0.4758 | 0.5400 | 0.5404 | 0.5412 | 0.5409 | 0.5379 | 0.5300 | 0.4650 | 0.4602 | 0.5436 | 0.5428 |
| 10 | 0.7186 | 0.7173 | 0.6929 | 0.6927 | 0.7057 | 0.7039 | 0.7150 | 0.7150 | 0.6793 | 0.6764 | 0.7257 | 0.7259 | ||
| 15 | 0.7664 | 0.7662 | 0.7729 | 0.7724 | 0.7750 | 0.7750 | 0.7486 | 0.7474 | 0.7107 | 0.7089 | 0.8157 | 0.8158 | ||
| 20 | 0.7907 | 0.7908 | 0.7843 | 0.7839 | 0.7850 | 0.7849 | 0.7864 | 0.7862 | 0.7643 | 0.7637 | 0.8200 | 0.8200 | ||
| SVC | 5 | 0.5414 | 0.5417 | 0.5800 | 0.5829 | 0.5921 | 0.5933 | 0.5764 | 0.5695 | 0.5343 | 0.5339 | 0.5964 | 0.5987 | |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
LLM Interpretability
Large language model (LLM) interpretability studies how internal representations and computations produce outputs, and how they can be explained or controlled.
See all 778 papers