让大模型提示词解释更清晰,支持细粒度分析
PromptExp: Multi-granularity Prompt Explanation of Large Language Models
- 通过聚合词元级解释,实现多粒度提示词分析
- 基于扰动的解释方法在情感分析中表现最佳
- 适合需要理解大模型决策过程的研究者和开发者
大语言模型在自然语言理解与文本生成任务中表现出色,提示工程对其有效应用至关重要。然而,大模型的黑箱特性限制了其可解释性与高效提示设计。现有深度学习模型解释方法主要针对单输出任务(如分类、回归),难以直接应用于生成序列的大型语言模型。近期研究尝试用自然语言进行解释,但易产生幻觉和错误。为此,我们提出 PromptExp:一种通过聚合词元级洞察实现多粒度提示解释的框架。PromptExp 引入两种词元级解释方法:1)结合局部解释技术的聚合方法;2)创新的扰动方法,用于评估词元屏蔽的影响。该框架支持白盒与黑盒解释,可扩展至更高粒度,实现灵活分析。我们在情感分析等案例研究中验证,扰动方法在语义相似度评估下表现最优。此外,用户研究表明 PromptExp 具备高准确性和实际价值,显著提升大模型可解释性。
原文摘要 · Abstract (English)
Large Language Models excel in tasks like natural language understanding and text generation. Prompt engineering plays a critical role in leveraging LLM effectively. However, LLMs black-box nature hinders its interpretability and effective prompting engineering. A wide range of model explanation approaches have been developed for deep learning models, However, these local explanations are designed for single-output tasks like classification and regression,and cannot be directly applied to LLMs, which generate sequences of tokens. Recent efforts in LLM explanation focus on natural language explanations, but they are prone to hallucinations and inaccuracies. To address this, we introduce PromptExp , a framework for multi-granularity prompt explanations by aggregating token-level insights. PromptExp introduces two token-level explanation approaches: 1. an aggregation-based approach combining local explanation techniques, and 2. a perturbation-based approach with novel techniques to evaluate token masking impact. PromptExp supports both white-box and black-box explanations and extends explanations to higher granularity levels, enabling flexible analysis. We evaluate PromptExp in case studies such as sentiment analysis, showing the perturbation-based approach performs best using semantic similarity to assess perturbation impact. Furthermore, we conducted a user study to confirm PromptExp's accuracy and practical value, and demonstrate its potential to enhance LLM interpretability.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。