ChatPaper.aiChatPaper

TextGenSHAP:具有長文檔的可擴展後設解釋在文本生成中

TextGenSHAP: Scalable Post-hoc Explanations in Text Generation with Long Documents

December 3, 2023
作者: James Enouen, Hootan Nakhost, Sayna Ebrahimi, Sercan O Arik, Yan Liu, Tomas Pfister
cs.AI

摘要

大型語言模型(LLMs)由於其日益準確的回應和連貫的推理能力,在實際應用中引起了巨大興趣。由於它們作為黑盒子,使用複雜的推理過程處理輸入,對於為LLMs生成的內容提供可擴展且忠實的解釋的需求將不可避免地增長。過去十年在神經網絡模型的可解釋性方面已經取得了重大進展。其中,事後可解釋性方法,特別是Shapley值,已被證明對解釋深度學習模型非常有效。然而,在將Shapley值擴展至LLMs時存在著重大挑戰,特別是當處理包含數千個標記和自回歸生成的輸出序列的長輸入內容時。此外,如何有效利用生成的解釋來提高LLMs的性能通常是不清楚的。在本文中,我們介紹了TextGenSHAP,一種高效的事後解釋方法,結合了LM特定技術。我們展示了這對於與傳統Shapley值計算相比,速度顯著提高,將用於標記級別解釋的處理時間從幾小時減少到幾分鐘,用於文檔級別解釋的時間僅為幾秒。此外,我們展示了實時Shapley值如何應用於兩個重要場景,通過定位重要詞語和句子來提供更好的理解長文檔問答;並通過增強所選段落的準確性,從而改進現有文檔檢索系統,最終提高最終回應的準確性。
English
Large language models (LLMs) have attracted huge interest in practical applications given their increasingly accurate responses and coherent reasoning abilities. Given their nature as black-boxes using complex reasoning processes on their inputs, it is inevitable that the demand for scalable and faithful explanations for LLMs' generated content will continue to grow. There have been major developments in the explainability of neural network models over the past decade. Among them, post-hoc explainability methods, especially Shapley values, have proven effective for interpreting deep learning models. However, there are major challenges in scaling up Shapley values for LLMs, particularly when dealing with long input contexts containing thousands of tokens and autoregressively generated output sequences. Furthermore, it is often unclear how to effectively utilize generated explanations to improve the performance of LLMs. In this paper, we introduce TextGenSHAP, an efficient post-hoc explanation method incorporating LM-specific techniques. We demonstrate that this leads to significant increases in speed compared to conventional Shapley value computations, reducing processing times from hours to minutes for token-level explanations, and to just seconds for document-level explanations. In addition, we demonstrate how real-time Shapley values can be utilized in two important scenarios, providing better understanding of long-document question answering by localizing important words and sentences; and improving existing document retrieval systems through enhancing the accuracy of selected passages and ultimately the final responses.
PDF61December 15, 2024