Table of Contents
Fetching ...

Unveiling and Consulting Core Experts in Retrieval-Augmented MoE-based LLMs

Xin Zhou, Ping Nie, Yiwen Guo, Haojie Wei, Zhanqiu Zhang, Pasquale Minervini, Ruotian Ma, Tao Gui, Qi Zhang, Xuanjing Huang

TL;DR

This paper identifies core experts that can signify the sufficiency of the model’s internal knowledge, assess the quality of retrieved documents, and enhance the model’s ability to utilize context and proposes several strategies to enhance RAG’s efficiency and effectiveness through expert activation.

Abstract

Retrieval-Augmented Generation (RAG) significantly improved the ability of Large Language Models (LLMs) to solve knowledge-intensive tasks. While existing research seeks to enhance RAG performance by retrieving higher-quality documents or designing RAG-specific LLMs, the internal mechanisms within LLMs that contribute to the effectiveness of RAG systems remain underexplored. In this paper, we aim to investigate these internal mechanisms within the popular Mixture-of-Expert (MoE)-based LLMs and demonstrate how to improve RAG by examining expert activations in these LLMs. Our controlled experiments reveal that several core groups of experts are primarily responsible for RAG-related behaviors. The activation of these core experts can signify the model's inclination towards external/internal knowledge and adjust its behavior. For instance, we identify core experts that can (1) indicate the sufficiency of the model's internal knowledge, (2) assess the quality of retrieved documents, and (3) enhance the model's ability to utilize context. Based on these findings, we propose several strategies to enhance RAG's efficiency and effectiveness through expert activation. Experimental results across various datasets and MoE-based LLMs show the effectiveness of our method.

Unveiling and Consulting Core Experts in Retrieval-Augmented MoE-based LLMs

TL;DR

This paper identifies core experts that can signify the sufficiency of the model’s internal knowledge, assess the quality of retrieved documents, and enhance the model’s ability to utilize context and proposes several strategies to enhance RAG’s efficiency and effectiveness through expert activation.

Abstract

Retrieval-Augmented Generation (RAG) significantly improved the ability of Large Language Models (LLMs) to solve knowledge-intensive tasks. While existing research seeks to enhance RAG performance by retrieving higher-quality documents or designing RAG-specific LLMs, the internal mechanisms within LLMs that contribute to the effectiveness of RAG systems remain underexplored. In this paper, we aim to investigate these internal mechanisms within the popular Mixture-of-Expert (MoE)-based LLMs and demonstrate how to improve RAG by examining expert activations in these LLMs. Our controlled experiments reveal that several core groups of experts are primarily responsible for RAG-related behaviors. The activation of these core experts can signify the model's inclination towards external/internal knowledge and adjust its behavior. For instance, we identify core experts that can (1) indicate the sufficiency of the model's internal knowledge, (2) assess the quality of retrieved documents, and (3) enhance the model's ability to utilize context. Based on these findings, we propose several strategies to enhance RAG's efficiency and effectiveness through expert activation. Experimental results across various datasets and MoE-based LLMs show the effectiveness of our method.

Paper Structure

This paper contains 41 sections, 4 equations, 11 figures, 9 tables.

Figures (11)

  • Figure 1: Three types of core experts identified in our experiments and their applications in RAG scenarios. Blue colors represent core experts, while solid lines and $\checkmark$ indicate activated experts. Cognizant experts indicate whether knowledge is sufficient; Quality experts evaluate the quality of retrieval documents; In-context experts enhance the LLM's ability.
  • Figure 2: An overview of our methods. To detect core experts, we use data from Pos and Neg scenarios to inspect MoE-based LLMs, collecting experts that are frequently activated only in corresponding scenarios. By comparing expert activation in contrastive scenarios, we identified core experts that are highly activated in specific scenarios. The activation of these core experts can be used as classifiers to predict the scenario for new input.
  • Figure 3: The visualization results of the cognizant expert. Each value represents the contrastive activation probability of the expert, with deeper colors indicating the higher absolute value of activation probability.
  • Figure 4: The visualization of the quality expert. Each value represents the contrastive activation probability of the expert, with deeper colors indicating the higher absolute value of activation probability.
  • Figure 5: The visualization results of the in-context expert. Each value represents the contrastive activation probability of the expert, with deeper colors indicating the higher absolute value of activation probability.
  • ...and 6 more figures