arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.04444cs.CLcs.AIcs.LGcs.NE

什么是魔法词?LLM提示的控制理论

What's the Magic Word? A Control Theory of LLM Prompting

California Institute of Technology(加州理工学院);University of Toronto(多伦多大学)

Aman Bhargava, Cameron Witkowski, Shi-Zhuo Looi, Matt Thomson

AI总结:

本文用控制理论将LLM建模为离散随机动力系统,分析自注意力可控性与参数矩阵奇异值的关系,并通过Falcon-7b等模型实验表明短提示可显著改变输出概率,为提示工程提供数学基础。

摘要:

提示工程对于部署大语言模型(LLM)至关重要,但在数学上对其理解甚少。我们将LLM系统形式化为一类离散随机动力系统,以通过控制理论的视角探索提示工程。我们对自注意力可控性的局限性进行了数学分析,该可控性作为参数矩阵奇异值的函数。我们提供了关于一组LLM可控性的补充实证结果,包括Falcon-7b、Llama-7b和Falcon-40b。给定来自Wikitext的初始状态 $\mathbf x_0$ 和长度 $k \leq 10$ 个token的提示,我们发现“正确”的下一个token至少在97%的情况下可达,并且前75个最可能的下一个token至少在85%的情况下可达。有趣的是,短提示序列可以显著改变特定输出的可能性,甚至使最不可能的token变成最可能的token。这种对LLM的控制论分析展示了输入序列在引导输出概率方面的重要但理解不足的作用,为增强语言模型系统能力提供了一个基础性视角。

英文摘要:

Prompt engineering is crucial for deploying LLMs but is poorly understood mathematically. We formalize LLM systems as a class of discrete stochastic dynamical systems to explore prompt engineering through the lens of control theory. We offer a mathematical analysis of the limitations on the controllability of self-attention as a function of the singular values of the parameter matrices. We present complementary empirical results on the controllability of a panel of LLMs, including Falcon-7b, Llama-7b, and Falcon-40b. Given initial state $\mathbf x_0$ from Wikitext and prompts of length $k \leq 10$ tokens, we find that the "correct" next token is reachable at least 97% of the time, and that the top 75 most likely next tokens are reachable at least 85% of the time. Intriguingly, short prompt sequences can dramatically alter the likelihood of specific outputs, even making the least likely tokens become the most likely ones. This control-theoretic analysis of LLMs demonstrates the significant and poorly understood role of input sequences in steering output probabilities, offering a foundational perspective for enhancing language model system capabilities.

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

↑