Mingyu Jin,Qinkai Yu,Jingyuan Huang,Qingcheng Zeng,Zhenting Wang,Wenyue Hua,Haiyan Zhao,Kai Mei,Yanda Meng,Kaize Ding,Fan Yang,Mengnan Du,Yongfeng Zhang
Abstract:Large language models (LLMs) have shown remarkable performances across a wide range of tasks. However, the mechanisms by which these models encode tasks of varying complexities remain poorly understood. In this paper, we explore the hypothesis that LLMs process concepts of varying complexities in different layers, introducing the idea of ``Concept Depth'' to suggest that more complex concepts are typically acquired in deeper layers. Specifically, we categorize concepts based on their level of abstraction, defining them in the order of increasing complexity within factual, emotional, and inferential tasks. We conduct extensive probing experiments using layer-wise representations across various LLM families (Gemma, LLaMA, Qwen) on various datasets spanning the three domains of tasks. Our findings reveal that models could efficiently conduct probing for simpler tasks in shallow layers, and more complex tasks typically necessitate deeper layers for accurate understanding. Additionally, we examine how external factors, such as adding noise to the input and quantizing the model weights, might affect layer-wise representations. Our findings suggest that these factors can impede the development of a conceptual understanding of LLMs until deeper layers are explored. We hope that our proposed concept and experimental insights will enhance the understanding of the mechanisms underlying LLMs. Our codes are available at \url{<a class="link-external link-https" href="https://github.com/Luckfort/CD" rel="external noopener nofollow">this https URL</a>}.
What problem does this paper attempt to address?
The problem that this paper attempts to solve is to understand how large - scale language models (LLMs) encode concepts of different complexity in different neural network layers. Specifically, the author proposes a hypothesis that when LLMs handle tasks of different complexity, they process concepts in different network layers, and introduces the concept of "Concept Depth" to describe that more complex concepts are usually acquired in deeper network layers. The paper verifies this hypothesis through a series of experiments, aiming to explore the connection between the depth of the neural network of the language model and its concept - understanding ability.
### Main research questions:
- **RQ1**: Do different LLMs show consistency in concept depth within the same dataset?
- **RQ2**: Do LLMs of different sizes in the same model family (such as the LLaMA series) have the same concept depth?
- **RQ3**: Do LLMs of the same size show consistency in concept depth?
### Experimental design:
- **Dataset**: The paper uses nine datasets, covering fact - understanding, sentiment - understanding and reasoning tasks.
- **Model**: Three open - source model families are used: Gemma, LLaMA and Qwen.
- **Method**: By training independent linear probes for each model layer to predict binary classification labels, the maximum performance of each layer is determined.
### Key findings:
- **Different trends in the accuracy of different concepts**: For example, the "Cities" dataset can quickly reach high accuracy at lower layers, while the "StrategyQA" dataset, which requires advanced reasoning, is difficult to reach an accuracy of more than 0.7 at any layer.
- **Consistent performance of different models for the same concept**: When processing the same concept, different LLMs tend to have a consistent accuracy pattern at each layer.
- **Layered processing of concept depth**: When processing complex concepts, LLMs show the characteristics of layered processing, that is, more complex tasks require deeper layers for accurate understanding.
### Conclusion:
By introducing the concept of "Concept Depth", the paper provides a new perspective for understanding the internal working mechanism of LLMs. The experimental results show that simple concepts are usually captured in shallower layers, while complex concepts require deeper layers for effective understanding. These findings are of great significance for further research and optimization of LLMs.