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

要約

プロンプトエンジニアリングはLLMを展開する上で極めて重要であるが、数学的にはあまり理解されていない。我々はLLMシステムを離散確率力学系の一種として定式化し、制御理論のレンズを通してプロンプト工学を探求する。R_y(Γmathbf x_0)$の各$mathbf yΓに対して、初期状態列$mathbf x_0$から$mathbf y$を出力する制御入力列$mathbf u$が存在する出力トークン列$R_y(Γmathbf x_0)$の到達可能集合を調べる。我々は、到達可能集合の観点から自己注意の制御可能性の制限に関する解析的分析を提供し、パラメータ行列の特異値の関数として出力の到達可能集合$R_y( \mathbf x_0)$の上限を証明する。また、ファルコン-7b、ラマ-7b、ファルコン-40bを含むLLMの制御可能性に関する補足的な実証解析を行う。その結果、Wikitextデータセットからサンプリングした初期状態列$mathbf x_0$に対して、到達可能な出力集合$R_y( \mathbf x_0)$の下界を示した。その結果、$kleq 10$トークンのプロンプトで、$mathbf x_0$シーケンスに続く正しい次のWikitextトークンに97%以上の確率で到達できることがわかった。また、LLM自身によって推定された、次に来る可能性の高い上位75個のトークンは、$kleq 10$トークンのプロンプトで少なくとも85%の確率で到達可能である。興味深いことに、短いプロンプトシーケンスは特定の出力の可能性を劇的に変化させ、最も可能性の低いトークンを最も可能性の高いものにすることさえできる。この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 investigate the reachable set of output token sequences $R_y(\mathbf x_0)$ for which there exists a control input sequence $\mathbf u$ for each $\mathbf y \in R_y(\mathbf x_0)$ that steers the LLM to output $\mathbf y$ from initial state sequence $\mathbf x_0$. We offer analytic analysis on the limitations on the controllability of self-attention in terms of reachable set, where we prove an upper bound on the reachable set of outputs $R_y(\mathbf x_0)$ as a function of the singular values of the parameter matrices. We present complementary empirical analysis on the controllability of a panel of LLMs, including Falcon-7b, Llama-7b, and Falcon-40b. Our results demonstrate a lower bound on the reachable set of outputs $R_y(\mathbf x_0)$ w.r.t. initial state sequences $\mathbf x_0$ sampled from the Wikitext dataset. We find that the correct next Wikitext token following sequence $\mathbf x_0$ is reachable over 97% of the time with prompts of $k\leq 10$ tokens. We also establish that the top 75 most likely next tokens, as estimated by the LLM itself, are reachable at least 85% of the time with prompts of $k\leq 10$ tokens. 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-centric 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.

arxiv情報

著者 Aman Bhargava,Cameron Witkowski,Manav Shah,Matt Thomson
発行日 2024-01-03 06:38:36+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

カテゴリー: cs.AI, cs.CL, cs.LG, cs.NE パーマリンク