Counterfactual Token Generation in Large Language Models

要約

「もちろん、私は喜んであなたのために物語を作ります。ライラ船長は信頼できる船、メイルストロムズ・フューリー号の舵に立ち、果てしなく続く海を眺めていました。
[…] ライラは苦い真実を悟り、目に涙があふれました。彼女はつかの間の富のためにすべてを犠牲にし、乗組員、家族、そして自分自身の愛を失ったのです。」
大規模な言語モデルによって生成されたこのストーリーは魅力的ですが、モデルが代わりに「キャプテン メイブ」を主人公として選んでいたら、ストーリーはどのように展開しただろうかと疑問に思う人もいるかもしれません。
私たちには知ることができません。
最先端の大規模言語モデルはステートレスであり、内部メモリや状態を維持しません。
プロンプトが表示されると、自己回帰プロセスを使用して一連のトークンを出力として生成します。
結果として、彼らは過去に生成したトークンに対する反事実的な代替品について推論することができません。
この作業では、この機能を使用してそれらを強化することが目標です。
この目的を達成するために、Gumbel-Max 構造因果モデルに基づいてトークン生成の因果モデルを開発します。
私たちのモデルを使用すると、どんな大規模な言語モデルでも、バニラのトークン生成と比較して、ほとんどコストをかけずに反事実的なトークン生成を実行できます。実装は恥ずかしいほど簡単で、微調整や迅速なエンジニアリングは必要ありません。
私たちはモデルを Llama 3 8B 命令に実装し、反事実的に生成されたテキストの定性的分析と定量的分析の両方を実行します。
最後に、バイアス検出のための反事実トークン生成の実証的な応用例を示し、大規模な言語モデルによって構築された世界のモデルについての興味深い洞察を明らかにします。

要約(オリジナル)

‘Sure, I am happy to generate a story for you: Captain Lyra stood at the helm of her trusty ship, the Maelstrom’s Fury, gazing out at the endless sea. […] Lyra’s eyes welled up with tears as she realized the bitter truth – she had sacrificed everything for fleeting riches, and lost the love of her crew, her family, and herself.’ Although this story, generated by a large language model, is captivating, one may wonder — how would the story have unfolded if the model had chosen ‘Captain Maeve’ as the protagonist instead? We cannot know. State-of-the-art large language models are stateless — they maintain no internal memory or state. Given a prompt, they generate a sequence of tokens as an output using an autoregressive process. As a consequence, they cannot reason about counterfactual alternatives to tokens they have generated in the past. In this work, our goal is to enhance them with this functionality. To this end, we develop a causal model of token generation that builds upon the Gumbel-Max structural causal model. Our model allows any large language model to perform counterfactual token generation at almost no cost in comparison with vanilla token generation, it is embarrassingly simple to implement, and it does not require any fine-tuning nor prompt engineering. We implement our model on Llama 3 8B-instruct and conduct both qualitative and quantitative analyses of counterfactually generated text. We conclude with a demonstrative application of counterfactual token generation for bias detection, unveiling interesting insights about the model of the world constructed by large language models.

arxiv情報

著者 Ivi Chatzi,Nina Corvelo Benz,Eleni Straitouri,Stratis Tsirtsis,Manuel Gomez-Rodriguez
発行日 2024-09-25 15:30:24+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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