Skip to main content
QUICK REVIEW

[論文レビュー] What's the Magic Word? A Control Theory of LLM Prompting

Aman Bhargava, Cameron Witkowski|arXiv (Cornell University)|Oct 2, 2023
Topic Modeling被引用数 7
ひとこと要約

要旨:この論文はLLMプロンプトを離散的確率制御問題として形式化し、自己注意から到達可能な出力に対する上界を証明し、Falcon-7b、Falcon-40b、Llama-7bに渡るプロンプト長依存の controllability を経験的に大幅に示しています。短いプロンプトで出力を劇的に操作でき、 unlikely tokens を most likely にすることもあります。

ABSTRACT

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.

研究の動機と目的

  • LLMにおけるプロンプト設計を controllability の問題として動機づける。
  • LLMs を入力(プロンプト)と状態(トークン列)を持つ制御系として正式に定義する。
  • 自己注意の到達可能出力集合の解析的境界を導出する。
  • 短いプロンプトと WikiText 起源の状態を用いて Falcon-7b、Falcon-40b、Llama-7b の各モデルで controllability を経験的に評価する。

提案手法

  • Definition 1–3 に従い、入力付き自己回帰系として LLMs を定義する(制御入力とリードアウト写像)。
  • Theorem 1 および式 5–7 に基づき、Wq と Wk の特異値に関する自己注意の到達可能出力集合の境界を導出する。
  • Section 5.1 にて k-短プロンプト最適化(貪欲なバックジェネレーションと貪欲座標勾配法)を用いて出力を操作するプロンプトを見つける。
  • Section 5.2 にて、Wikitext 由来の x0 とモデル出力の y を用い、Falcon-7b、Falcon-40b、Llama-7b に対して k-ε controllability をデータセット上で経験的に測定する。
  • Figure 1 にて ground-truth 次トークンおよび top-75 Likely 出力の到達可能性を評価する。
Figure 1: Main experimental results on $k-\epsilon$ controllability of Falcon-7b. Top left : $k-\epsilon$ values for Falcon-7b on ground truth target token $y^{*}$ . 97.16% of the instances were solved with a prompt of length $k\leq 10$ . Top right : $k-\epsilon$ values for reaching the top 75 most
Figure 1: Main experimental results on $k-\epsilon$ controllability of Falcon-7b. Top left : $k-\epsilon$ values for Falcon-7b on ground truth target token $y^{*}$ . 97.16% of the instances were solved with a prompt of length $k\leq 10$ . Top right : $k-\epsilon$ values for reaching the top 75 most

実験結果

リサーチクエスチョン

  • RQ1与えられた状態から短いプロンプト下で k-トークン入力制約のもとに次トークン出力は到達可能か?
  • RQ2自己注意は到達可能出力集合をどのように境界づけ、重み行列の特異値は controllability にどう影響するか?
  • RQ3ground-truth および高確率出力に対して、異なる LLM 間での経験的 controllability の程度はどれくらいか?
  • RQ4短めのプロンプトで低確率トークンから高確率トークンへ操作可能か?
  • RQ5プロンプト長さとモデル規模に応じた controllability の変化は?

主な発見

  • x0 に続く正しい次の WikiText トークンは k ≤ 10 トークンのプロンプトで 97% 以上到達可能。
  • トップ75 の最も可能性の高い次トークンは k ≤ 10 トークンのプロンプトで少なくとも 85% の頻度で到達可能。
  • 短いプロンプトは、k ≤ 4 のプロンプト内で最も可能性の低いトークンを最も可能性の高いものへ変えることができる。
  • ground-truth の WikiText targets に対して、Falcon-7b、Falcon-40b、Llama-7b の各モデルで到達可能性が実証された。
  • 入力系列が出力確率を prior の可能性を超えて操縦する上で非自明な役割を果たすことを示唆。
  • プロンプト長さ k と controllability の比 ε の間に対数線形の関係性が、研究された領域で見られる。
Figure 2: Log spaced main results of $k-\log(\epsilon)$ controllability. Interestingly, the relationship between $k$ and $\log(\epsilon)$ appears roughly linear for each question length in the regime studied. Top left : $k-\log(\epsilon)$ values for Falcon-7b. With $k=10$ control tokens, 97.16% of t
Figure 2: Log spaced main results of $k-\log(\epsilon)$ controllability. Interestingly, the relationship between $k$ and $\log(\epsilon)$ appears roughly linear for each question length in the regime studied. Top left : $k-\log(\epsilon)$ values for Falcon-7b. With $k=10$ control tokens, 97.16% of t

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。