arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.11891cs.CLcs.AI
收藏

揭示与操控大型语言模型中的提示影响

Unveiling and Manipulating Prompt Influence in Large Language Models

Nanyang Technological University(南洋理工大学);School of Electrical and Electronic Engineering, Nanyang Technological University(南洋理工大学电气与电子工程学院);Singapore-ETH Centre(新加坡-ETH中心)

Zijian Feng, Hanzhang Zhou, Zixiao Zhu, Junlang Qian, Kezhi Mao

AI总结:

本文提出 Token Distribution Dynamics(TDD),通过 LM head 与词表分布动态衡量提示 token 显著性,并支持零样本毒性抑制和情感引导。

摘要:

提示在引导大型语言模型(LLM)的响应方面发挥着关键作用。然而,提示中各个 token 在塑造响应时所承担的复杂作用(即输入显著性)仍基本未得到充分研究。现有显著性方法要么与 LLM 的生成目标不一致,要么严重依赖线性假设,从而可能导致不准确。为解决这一问题,我们提出 Token Distribution Dynamics(TDD,token 分布动态),这是一种简单而有效的方法,用于揭示并操控提示在生成 LLM 输出中的作用。TDD 利用语言模型头(LM head)强大的解释能力来评估输入显著性。它将输入 token 投影到嵌入空间,然后基于整个词表上的分布动态估计其重要性。我们介绍了 TDD 的三种变体:前向、后向和双向,每一种都能对 token 相关性提供独特见解。大量实验表明,在阐明提示与 LLM 输出之间的因果关系方面,TDD 以显著优势超越最先进的基线方法。除单纯解释外,我们还将 TDD 应用于两个用于受控文本生成的提示操控任务:零样本有毒语言抑制和情感引导。实证结果突显了 TDD 在识别提示中的有毒线索和情感线索方面的能力,随后可减轻生成内容中的毒性或调节其情感。

英文摘要:

Prompts play a crucial role in guiding the responses of Large Language Models (LLMs). However, the intricate role of individual tokens in prompts, known as input saliency, in shaping the responses remains largely underexplored. Existing saliency methods either misalign with LLM generation objectives or rely heavily on linearity assumptions, leading to potential inaccuracies. To address this, we propose Token Distribution Dynamics (TDD), a \textcolor{black}{simple yet effective} approach to unveil and manipulate the role of prompts in generating LLM outputs. TDD leverages the robust interpreting capabilities of the language model head (LM head) to assess input saliency. It projects input tokens into the embedding space and then estimates their significance based on distribution dynamics over the vocabulary. We introduce three TDD variants: forward, backward, and bidirectional, each offering unique insights into token relevance. Extensive experiments reveal that the TDD surpasses state-of-the-art baselines with a big margin in elucidating the causal relationships between prompts and LLM outputs. Beyond mere interpretation, we apply TDD to two prompt manipulation tasks for controlled text generation: zero-shot toxic language suppression and sentiment steering. Empirical results underscore TDD's proficiency in identifying both toxic and sentimental cues in prompts, subsequently mitigating toxicity or modulating sentiment in the generated content.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑