LLMチャットボットに欠けているもの:目的意識
The Gradient の記事は、現在の LLM チャットボットのベンチマーク評価が不十分であるとし、目的志向の対話(Purposeful Dialogue)による人間と AI の協働モデルへの転換を提唱している。
キーポイント
現状の評価指標の限界
MMLU や HumanEval などのベンチマークは非対話的な単発評価に偏っており、ユーザー体験がスコア向上と比例していないという指摘がある。
目的志向対話の定義と価値
特定のゴール(旅行計画、カウンセリングなど)に向かって複数回やり取りを行う「目的志向対話」こそが、真の人間-AI 協働の実現に不可欠である。
コード生成への応用可能性
SWE-bench のような複雑なタスクでは、AI が単発で解決するのではなく、エンジニアと対話して要件を確認・修正するペアプログラミング的なアプローチが必要となる。
長期的記憶と適応の進化
ターン制の導入により、チャットボットはユーザーのプロファイルや好みを学習し、長期にわたってパーソナライズされたアシスタントへと進化する可能性がある。
対話システムにおけるターン取りと長期記憶の可能性
ターン取りの導入により、チャットボットはユーザーのプロファイルや好みを学習し、長期的な関係性を築くことでパーソナライズされたアシスタントとして機能できるようになる。
LLM の次トークン予測と人間らしい対話の矛盾
現代の LLM は次トークンを予測するよう訓練されているが、人間は単発のやり取りではなく多段階の対話を通じて相互に適応し合っており、この点に根本的な違いがある。
1970 年代から現在までの対話システムの変遷
初期のシステムはレストランや心理療法などの特定のシナリオをスクリプト化して設計されていたが、現在はインターネット上の膨大なテキストデータで次トークンを予測するモデルへと進化している。
影響分析・編集コメントを表示
影響分析
この記事は、LLM の進化を単なる性能スコアの向上から「人間との協働能力」へと評価軸を転換させる重要な示唆を与えています。特にコード生成やカスタマーサポートなどの実務領域において、AI が受動的なツールから能動的なパートナーとして機能するための設計思想の転換を促すものであり、今後の AI エージェント開発の方向性を決定づける可能性があります。
編集コメント
ベンチマークスコアに囚われず、実社会での「目的達成」を重視する視点の重要性が説かれています。開発者は今すぐ対話設計を見直す必要があります。
タイトル: LLMチャットボットに欠けているもの: 目的意識
LLMベースのチャットボットの能力は毎月進歩している。これらの改善は、主にMMLU、HumanEval、MATHなどのベンチマーク(例:sonnet 3.5、gpt-4o)によって測定される。しかし、これらの指標がますます飽和していくにつれて、ユーザー体験はこれらのスコアに比例して向上しているだろうか?AIが人間に取って代わるのではなく、人間とAIの協働の未来を思い描くならば、現在の対話システムの測定方法は、非対話的な方法で測定するため、不十分かもしれない。
なぜ目的志向の対話が重要なのか?
目的志向の対話とは、目標や意図を中心とした、複数ラウンドにわたるユーザーとチャットボットの会話を指す。その目標は、「無害で役立つ」といった一般的なものから、「旅行計画エージェント」、「心理セラピスト」、「カスタマーサービスボット」といったより具体的な役割まで多岐にわたる。
旅行計画は、単純でわかりやすい例だ。私たちの好み、同行者の好み、そして現実世界の状況の複雑さのすべてを考えると、すべての情報を一発で伝えるのはコストが高すぎる。しかし、情報のやり取りを複数回行うことが許されれば、重要な情報だけが選択的に交換される。交渉理論はこのことの類推を提供している——一か八かの提案よりも、反復的な交渉の方がより良い結果をもたらす。
実際、情報の共有は対話の一側面に過ぎない。テリー・ウィノグラードの言葉を借りれば:「言語使用はすべて、聞き手の内部で手続きを活性化する方法と考えることができる」。私たちはそれぞれの発話を、一方の当事者が他方の世界モデルを変えるために行う意図的な行動と考えることができる。もし両当事者がより複雑な、あるいは隠された目標を持っていたらどうだろう?このように、目的志向の対話は、人間とAIの相互作用を協調ゲームとして定式化する方法を提供してくれる。ここでのチャットボットの目標は、人間が特定の目標を達成するのを助けることだ。
これは、学者だけが関心を持つ不必要な複雑さのように思えるかもしれない。しかし、目的志向の対話は、コード生成のような最も現実的で製品志向の研究分野にとっても有益でありうる。既存のコーディングベンチマークは、ほとんどがワンパス生成設定での性能を測定している。しかし、AIが普通のGithubイシュー(SWE-benchのような)を自動的に解決するためには、単一のアクションでは達成されない可能性が高い——AIは、正しい要件を理解しているか確認し、不足しているドキュメントやデータを要求し、必要なら人間に手を貸すよう依頼するために、人間のソフトウェアエンジニアと双方向にコミュニケーションを取る必要がある。ペアプログラミングと同様に、これはコードの欠陥を減らすことができるが、工数を増やす負担はない。
さらに、ターン制(話者交替)の導入により、多くの新しい可能性が解き放たれる。相互作用が長期的になり、記憶が構築されるにつれて、チャットボットはユーザープロファイルを徐々に更新できる。また、ユーザーの好みに適応することもできる。日常の対話を通じて、あなたの好みや意図を学習する個人アシスタント(例:IVA、Siri)を想像してみてほしい。それは新しい情報源(例:Twitter、arXiv、Slack、NYT)を自動的に読み取り、あなたの好みに合わせて朝のニュース要約を提供できる。あなたのためにメールを下書きし、あなたの編集から学び続けて改善していくことができる。
要するに、人々の間の意味のある相互作用は、完全な見知らぬ人から始まり、たった一度のやり取りで終わることはほとんどない。人間は自然に、複数ラウンドの対話を通じて互いに交流し、会話全体を通じてそれに応じて適応する。しかし、それは現代のLLMの基礎である「次のトークンを予測する」ことの正反対ではないだろうか?以下で、対話システムの構成要素を見てみよう。
対話システムはどのように作られてきたか/作られているか?
1970年代に戻ってみよう。ロジャー・シャンクが「レストラン・スクリプト」を一種の対話システムとして導入した頃だ[1]。このスクリプトは、典型的なレストラン体験を、入店、注文、食事、支払いといったステップに分解し、それぞれに特定の台本化された発話を割り当てる。当時、これらのシナリオにおける対話のすべての部分は注意深く計画されており、AIシステムが現実的な会話を模倣することを可能にした。ELIZA(ロジャース派心理療法士シミュレーター)やPARRY(偏執病患者を模倣するシステム)は、機械学習の夜明け前までの、他の2つの初期の対話システムだった。
このアプローチを今日のLLMベースの対話システムと比較すると、次のトークンを予測するように訓練されたモデルが、どうして対話に従事できるのか不思議に思える。したがって、対話システムがどのように作られるか、特に対話フォーマットがどのように機能するかに重点を置いて、詳しく検討してみよう:
(1) 事前学習: シーケンスモデルが、インターネットの混合テキストの巨大なコーパスで次のトークンを予測するように訓練される。構成は様々だが、主にニュース、書籍、Githubのコードが占め、RedditやStack Exchangeなどからクロールされたフォーラムデータ(対話のようなデータを含む可能性がある)が少量混ざっている。
(2) 対話フォーマットの導入: シーケンスモデルは文字列のみを処理するが、対話履歴の最も自然な表現は、システムプロンプトと過去のやり取りの構造化されたインデックスであるため、変換のためにある種のフォーマットを導入しなければならない。Huggingfaceのトークナイザーの中には、ユーザーの利便性のために tokenizer.apply_chat_template と呼ばれるこの方法を提供するものがある。正確なフォーマットはモデルによって異なるが、通常、システムプロンプトを <system> や <INST> で囲み、事前学習済みモデルがそれらにより多くの注意の重みを割り当てることを期待する。システムプロンプトは、言語モデルを下流アプリケーションに適応させ、その安全な動作を確保する上で重要な役割を果たす(次のセクションで詳しく説明する)。特に、このステップでのフォーマットの選択は任意である——事前学習コーパスはこのフォーマットに従っていない。
(3) RLHF: このステップでは、チャットボットは、望ましい答えを生成した場合に直接報酬を受け、望ましくない答えを生成した場合に罰せられる。導入された対話フォーマットがトレーニングデータに初めて現れるのはこの時であることに注意する価値がある。RLHFはファインチューニングのステップである。それは、データサイズが事前学習コーパスと比べて非常に小さいからだけでなく、KLペナルティやターゲットを絞った重み調整(例:Lora)が行われるからでもある。ルカンのケーキ焼きの比喩を使えば、RLHFはほんの小さな上のチェリーに過ぎない。
既存の対話システムはどの程度一貫しているか(2024年現在)?
私たちが対話システムに対して持つことができる最低限の要件は、与えたタスクに留まることができることだ。実際、私たち人間はしばしば話題から話題へと移り変わる。現在のシステムはどの程度うまく機能しているだろうか?
現在、「システムプロンプト」はユーザーがLMの動作を制御するための主要な方法である。しかし、研究者は、LLMが敵対的条件下ではこれらの指示に従うことが脆いという証拠を発見している[12,13]。読者も、ChatGPTやClaudeとの日常的なやり取りを通じてこれを経験したことがあるかもしれない——新しいチャットウィンドウを開いたばかりの時は、モデルはあなたの指示をかなりよく従うが[2]、数ラウンドの対話の後、それはもはや新鮮ではなくなり、役割に従うことさえ完全に止めてしまう。
この経験談を定量的に捉えるにはどうすればよいか?ワンラウンドの指示追従については、MT-BenchやAlpaca-Evalなどの多くのベンチマークをすでに享受している。しかし、対話形式でモデルをテストする場合、モデルが何を生成するかを予測し、事前に返答を準備するのは難しい。私の共同研究者と私のプロジェクト[3]では、LLMチャットボットの指示追従能力をストレステストするために、無制限の長さの対話を合成する環境を構築した。
時間スケールで制約なくスケールさせるために、システムプロンプトを与えられた2つのLMエージェントに、長いラウンド数で互いに会話させた。これが対話の主要な幹を形成する[a1, b1, a2, b2, …, a8, b8](対話が8ラウンドだとしよう)。この時点で、おそらくこの対話を調べるだけで、LLMがどのようにシステムプロンプトに固執するかを理解できるかもしれない。しかし、会話の流れによっては、多くの発話が指示と無関係である可能性がある。したがって、私たちは仮説的に
原文を表示
LLM-based chatbots’ capabilities have been advancing every month. These improvements are mostly measured by benchmarks like MMLU, HumanEval, and MATH (e.g. sonnet 3.5, gpt-4o). However, as these measures get more and more saturated, is user experience increasing in proportion to these scores? If we envision a future of human-AI collaboration rather than AI replacing humans, the current ways of measuring dialogue systems may be insufficient because they measure in a non-interactive fashion.
Why does purposeful dialogue matter?
Purposeful dialogue refers to a multi-round user-chatbot conversation that centers around a goal or intention. The goal could range from a generic one like “harmless and helpful” to more specific roles like “travel planning agent”, “psycho-therapist” or “customer service bot.”
Travel planning is a simple, illustrative example. Our preferences, fellow travelers’ preference, and all the complexities of real-world situations make transmitting all information in one pass way too costly. However, if multiple back-and-forth exchanges of information are allowed, only important information gets selectively exchanged. Negotiation theory offers an analogy of this—iterative bargaining yields better outcomes than a take-it-or-leave-it offer.
In fact, sharing information is only one aspect of dialogue. In Terry Winograd’s words: “All language use can be thought of as a way of activating procedures within the hearer.” We can think of each utterance as a deliberate action that one party takes to alter the world model of the other. What if both parties have more complicated, even hidden goals? In this way, purposeful dialogue provides us with a way of formulating human-AI interactions as a collaborative game, where the goal of chatbot is to help humans achieve certain goals.
This might seem like an unnecessary complexity that is only a concern for academics. However, purposeful dialogue could be beneficial even for the most hard-nosed, product-oriented research direction like code generation. Existing coding benchmarks mostly measure performances in a one-pass generation setting; however, for AI to automate solving ordinary Github issues (like in SWE-bench), it’s unlikely to be achieved by a single action—the AI needs to communicate back and forth with human software engineers to make sure it understands the correct requirements, ask for missing documentation and data, and even ask humans to give it a hand if needed. In a similar vein to pair programming, this could reduce the defects of code but without the burden of increasing man-hours.
Moreover, with the introduction of turn-taking, many new possibilities can be unlocked. As interactions become long-term and memory is built, the chatbot can gradually update user profiles. It can also adapt to their preferences. Imagine a personal assistant (e.g., IVA, Siri) that, through daily interaction, learns your preferences and intentions. It can read your resources of new information automatically (e.g., twitter, arxiv, Slack, NYT) and provide you with a morning news summary according to your preferences. It can draft emails for you and keep improving by learning from your edits.
In a nutshell, meaningful interactions between people rarely begin with complete strangers and conclude in just one exchange. Humans naturally interact with each other through multi-round dialogues and adapt accordingly throughout the conversation. However, doesn’t that seem exactly the opposite of predicting the next token, which is the cornerstone of modern LLMs? Below, let’s take a look at the makings of dialogue systems.
How were/are dialogue systems made?
Let's jump back to the 1970s, when Roger Schank introduced his "restaurant script" as a kind of dialogue system [1]. This script breaks down the typical restaurant experience into steps like entering, ordering, eating, and paying, each with specific scripted utterances. Back then, every piece of dialogue in these scenarios was carefully planned out, enabling AI systems to mimic realistic conversations. ELIZA, a Rogerian psychotherapist simulator, and PARRY, a system mimicking a paranoid individual, were two other early dialogue systems until the dawn of machine learning.
Compare this approach to the LLM-based dialogue system today, it seems mysterious how models trained to predict the next token could do anything at all with engaging in dialogues. Therefore, let’s take a close examination of how dialogue systems are made, with an emphasis on how the dialogue format comes into play:
(1) Pretraining: a sequence model is trained to predict the next token on a gigantic corpus of mixed internet texts. The compositions may vary but they are predominantly news, books, Github code, with a small blend of forum-crawled data such as from Reddit, Stack Exchange, which may contain dialogue-like data.
(2) Introduce dialogue formatting: because the sequence model only processes strings, while the most natural representation of dialogue history is a structured index of system prompts and past exchanges, a certain kind of formatting must be introduced for the purpose of conversion. Some Huggingface tokenizers provide this method called tokenizer.apply_chat_template for the convenience of users. The exact formatting differs from model to model, but it usually involves guarding the system prompts with <system> or <INST> in the hope that the pretrained model could allocate more attention weights to them. The system prompt plays a significant role in adapting language models to downstream applications and ensuring its safe behavior (we will talk more in the next section). Notably, the choice of the format is arbitrary at this step—pretraining corpus doesn’t follow this format.
(3) RLHF: In this step, the chatbot is directly rewarded or penalized for generating desired or undesired answers. It’s worth noting that this is the first time the introduced dialogue formatting appears in the training data. RLHF is a fine-tuning step not only because the data size is dwarfed in comparison to the pretraining corpus, but also due to the KL penalty and targeted weight tuning (e.g. Lora). Using Lecun’s analogy of cake baking, RLHF is only the small cherry on the top.
How consistent are existing dialogue systems (in 2024)?
The minimum requirement we could have for a dialogue system is that it can stay on the task we gave them. In fact, we humans often drift from topic to topic. How well do current systems perform?
Currently, “system prompt” is the main method that allows users to control LM behavior. However, researchers found evidence that LLMs can be brittle in following these instructions under adversarial conditions [12,13]. Readers might also have experienced this through daily interactions with ChatGPT or Claude—when a new chat window is freshly opened, the model can follow your instruction reasonably well [2], but after several rounds of dialogue, it’s no longer fresh, even stops following its role altogether.
How could we quantitatively capture this anecdote? For one-round instruction following, we’ve already enjoyed plenty of benchmarks such as MT-Bench and Alpaca-Eval. However, when we test models in an interactive fashion, it’s hard to anticipate what the model generates and prepare a reply in advance. In a project by my collaborators and me [3], we built an environment to synthesize dialogues with unlimited length to stress-test the instruction-following capabilities of LLM chatbots.
To allow an unconstrained scaling on the time scale, we let two system-prompted LM agents chat with each other for an extended number of rounds. This forms the main trunk of dialogue [a1, b1, a2, b2, …, a8, b8] (say the dialogue is 8-round). At this point, we could probably figure out how the LLMs stick to its system prompts just by examining this dialogue, but many of the utterances can be irrelevant to the instructions, depending on where the conversation goes. Therefore, we hypothetically branch out at each round by asking a question directly related to the system prompts, and use a corresponding judging function to quantify how well it performs. All that's provided by the dataset is a bank of triplets of (system prompts, probe questions, and judging functions).
Averaging across scenarios and pairs of system prompts, we get a curve of instruction stability across rounds. To our surprise, the aggregated results on both LLaMA2-chat-70B and gpt-3.5-turbo-16k are alarming. Besides the added difficulty to prompt engineering, the lack of instruction stability also comes with safety concerns. When the chatbot drifts away from its system prompts that stipulate safety aspects, it becomes more susceptible to jailbreaking and prone to more hallucinations.
The empirical results also contrast with the ever-increasing context length of LLMs. Theoretically, some long-context models can attend to a window of up to 100k tokens. However, in the dialogue setting, they become distracted after only 1.6k tokens (assuming each utterance is 100 tokens). In [3], we further theoretically showed how this is inevitable in a Transformer based LM chatbot under the current prompting scheme, and proposed a simple technique called split-softmax to mitigate such effects.
One might ask at this point, why is it so bad? Why don't humans lose their persona just by talking to another person for 8 rounds? It’s arguable that human interactions are based on purposes and intentions [5] and these purposes precede the means rather than the opposite—LLM is fundamentally a fluent English generator, and the persona is merely a thin added layer.
What’s missing?
Pretraining? Pretraining endows the language model with the capability to model a distribution over internet personas as well as the lower-level language distribution of each persona [4]. However, even when one persona (or a mixture of a limited number of them) is specified by the instruction of system prompts, current approaches fail to single it out.
RLHF? RLHF provides a powerful solution to adapting this multi-persona model to a “helpful and harmless assistant.” However, the original RLHF methods formulate reward maximization as a one-step bandit problem, and it is not generally possible to train with human feedback in the loop of conversation. (I’m aware of many advances in alignment but I want to discuss the original RLHF algorithm as a prototypical example.) This lack of multi-turn planning may cause models to suffer from task ambiguity [6] and learning superficial human-likeness rather than goal-directed social interaction [7].
Will adding more dialogue data in RLHF help? My guess is that it will, to a certain extent, but it will still fall short due to a lack of purpose. Sergey Levine pointed out in his blog that there is a fundamental difference between preference learning and intentions: “the key distinction is between viewing language generation as selecting goal-directed actions in a sequential process, versus a problem of producing outputs satisfying user preferences.”
Purposeful dialogue system
Staying on task is a modest request for LLMs. However, even if an LLM remains focused on the task, it doesn't necessarily mean it can excel in achieving the goal.
The problem of long-horizon planning has attracted some attention in the LLM community. For example, “decision-oriented dialogue” is proposed as a general class of tasks [8], where the AI assistant collaborates with humans to help them make complicated decisions, such as planning itineraries in a city and negotiating travel plans among friends. Another example, Sotopia [10], is a comprehensive social simulation platform that compiles various goal-driven dialogue scenarios including collaboration, negotiation, and persuasion.
Setting up such benchmarks provides not only a way to gauge the progress of the field, it also directly provides reward signals that new algorithms could pursue, which could be expensive to collect and tri
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み