【DL輪読会】Positions, lengths, orders and surrounding matters in reasonings with LLM

2.3K Views

March 08, 24

スライド概要

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

DEEP LEARNING JP [DL Papers] Positions, lengths, orders and surrounding matters in reasonings with LLM Keno Harada, the University of Tokyo http://deeplearning.jp/ 1

2.

LLMの実世界応用を見据えて Inputに入れた情報、instructionはどこまで考慮でき る? • 正解passageを完全にretrieveできたとしてちゃん とreasoningできる? • 現状の限界は? 2

3.

Lost in the Middle現象: Multi-document QA • 質問に対しての答えが1つのpassageに含まれ、 残りk-1個のpassageには含まれていない設定 • 1passage 最大100 tokenの記述 from Wikipedia • NaturalQuestions-Openの中の2655件 • Google検索に投げられたクエリとWikipediaの該当箇所を抜き 出した正解、正解が文章のものを利用 F.Lie et al., 2023, Lost in the Middle: How Language Models Use Long Contexts 3

4.

正解Passageは中盤にない方が良い • 正解Passageのcontext上の位置と性能の関係 • 先頭 or 最後 > 中盤 • Distractor passageがあると性能低下 • Oracleや同じ位置比較 F.Lie et al., 2023, Lost in the Middle: How Language Models Use Long Contexts 4

5.

Distractor passageによって性能悪化 Shi et al., 2023, Large Language Models Can Be Easily Distracted by Irrelevant Context 5

6.

Lost in the Middle現象: Retrieval • Keyを与えてvalueの値を答えさせる問題 • K個のkey valueペアのあるJSONをinputとして与える • 先ほどの実験をより単純化した実験 F.Lie et al., 2023, Lost in the Middle: How Language Models Use Long Contexts 6

7.

補足: 最近のLLMのRetrieval性能 Gemini Team, 2024, Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context 7

8.

Lost in the Middleはなぜ起こる? • Decoder-only構造/Encoder-decoder構造 • 学習時のcontext長でのFlanはrobust • 学習時より長いcontextだとlost in the middle • Queryの前に情報があるとdecoder-onlyだとcontextualな表現が得られな い? • Queryを情報の前、後どちらにもつける • Retieval: ほぼ完璧に正解するように • Multi-document QA: そこまで影響なし(最初の場所のパフォーマ ンスのみよくなる)、悪くなる場合も F.Lie et al., 2023, Lost in the Middle: How Language Models Use Long Contexts 8

9.

Lost in the Middleはなぜ起こる? • Instruction tuningの有無 • 指示に従うようにinput contextの最初に重きおく? • → ベースモデルでもLost in the Middle • モデルサイズの違い • LLama2 7BだとLost in the Middleにはならず直近重視 • Finetuningはmiddleとのギャップを抑える • モデルサイズ小さいと顕著 F.Lie et al., 2023, Lost in the Middle: How Language Models Use Long Contexts 9

10.

Is More Context Is Always Better? • Retrievalのkの数と性能の関係 • Kが増えてaccがサチる前に回答のaccサチる • → 十分にcontextを使えてない • → Lost in the Middleを踏まえたprompting, rerank必 要 F.Lie et al., 2023, Lost in the Middle: How Language Models Use Long Contexts 10

11.

How input length affects LLMs reasoning? • Flexible LENgth Question Answering(FLENQA) • 2つの情報を組み合わせて解けるタスク • True/False • 問題解決上関係ない文章を挿入してcontext長との関係 性を調査 • 矛盾するような文章は入れていない • サポートしているContext長よりかなり短い段階で もパフォーマンスが低下 Levy et al., 2024, Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models 11

12.

FLenQA • Monotone Relationship(MonoRel) • X is larger than Y, Y is larger than Z • Is X larger than Z? • People in Rooms(PIR) • X is in Y, Y is/has Z(property) • Is X in Z room? • Simplified Ruletaker • X is Y, X is Z • If X is Y and X is Z then X is A • X is A? Levy et al., 2024, Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models 12

13.

FLenQA: 実験のためのバリエーション • Padding • Duplicate • 指定のcontext長までkey paragraphsをrepeat • QAの時にkeyとなる情報を探すという労力をなくす • Similar • 他の例から文章を抽出して足す • 矛盾しないようにfiltering • Different • Book corpusの文章にkey paragraphを埋め込む • Location • 最初、中間、最後、random Levy et al., 2024, Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models 13

14.

FLenQA: 実験 • 正解文だけ入力 • 高いスコアが取れる問題設定であることを確認 Levy et al., 2024, Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models 14

15.

FLenQA: 実験(Duplicate) • 単純にinput lengthが長くなると性能悪化 • 正解文をrepeatしただけなのに • GPT-3.5, GPT-4は頑健 Levy et al., 2024, Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models 15

16.

FLenQA: 実験(Similar, Different) • Lost in the Middle現象の確認 • FirstあるいはLastの方が良い • GPT3.5はMiddle良くてFirstが一番悪い • GeminiはFirst悪い • Random特に悪い • GPT-3.5, Gemini pro以外では一番悪い • Reasoningを行う文書は固まっていた方が良い? Levy et al., 2024, Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models 16

17.

FLenQA: 実験(Similar, Different, Random) • Reasoningを行う文書は固まっていた方が良い Levy et al., 2024, Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models 17

18.

FLenQA: 実験(Similar vs Different) • Differentの方が文の性質違うから見分けやすくてよ り解けるかな? • → Differentの方が性能悪い Levy et al., 2024, Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models 18

19.

FLenQA: 実験 • Next word predictionは良くなっているのにタスク は解けない • (実験設定よくわかっていない) Levy et al., 2024, Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models 19

20.

補足: 最近のLLMは長い文脈を活かせているか? • (In-context learningでも確認できる?) • (めっちゃ例入れてもどんどん良くなる?) Gemini Team, 2024, Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context 20

21.

FLenQA: 失敗の分析 • Context長が増えると • “There is not enough information in the text”と答えるケースが増える • Falseとよく答えるようになる • CoT Stepする前に答えるようになる • Instructionに従えなくなる • CoT Step中にkey sentenceをretrieveできなくなる Levy et al., 2024, Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models 21

22.

Order matters Chen et al., 2024, Premise Order Matters in Reasoning with Large Language Models 22