Upgrade to Pro — share decks privately, control downloads, hide ads and more …

202309 kaggle 銀 LLM science exam まとめ資料

sugupoko
October 13, 2023
360

202309 kaggle 銀 LLM science exam まとめ資料

sugupoko

October 13, 2023
Tweet

Transcript

  1. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    1/xx • 3つのPPTが組み合わさっています • 前半:チュートリアルまで • 後半:コンペ終了後のまとめ(P18~) • その他:コンペ中のメモなど
  2. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    2/xx Kaggle LLM Science Exam ~大規模言語モデルのための小規模言語モデルのコンペ~ すぐーさん(id:sugupoko)
  3. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    3/xx コンペ概要:Kaggle - LLM Science Exam 科学に基づく難しい内容に関して質問応答モデルを作成し、正しい回答を選択する 言語 AIモデル 質問: Which of the following statements accurately describes the impact of Modified Newtonian Dynamics (MOND) on the observed "missing baryonic mass" discrepancy in galaxy clusters? 推論時のフロー 選択肢:5択 A:MOND is a theory that reduces the observed missing baryonic mass in galaxy clusters by postulating the existence of a new form of matter called "fuzzy dark matter." B:MOND is a theory that increases the discrepancy between the observed missing baryonic mass in galaxy clusters and the measured velocity dispersions from a factor of around 10 to a factor of about 20. C:MOND is a theory that explains the missing baryonic mass in galaxy clusters that was previously considered dark matter by demonstrating that the mass is in the form of neutrinos and axions. D:MOND is a theory that reduces the discrepancy between the observed missing baryonic mass in galaxy clusters and the measured velocity dispersions from a factor of around 10 to a factor of about 2. E:MOND is a theory that eliminates the observed missing baryonic mass in galaxy clusters by imposing a new mathematical formulation of gravity that does not require the existence of dark matter. 回答: D これを作成し、 回答精度で競う
  4. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    4/xx なんでkaggleが、こんなコンペ開いたの? ①LLMがLLM自身をテストする能力可能性と、②リソースに制約のある環境でのLLM可能性 を研究者がよりよく理解・分析できるようにするため ★現在の世の中、背景 大規模な言語モデルの能力が広がる中、LLMs(大規模言語モデル)自身を特徴付ける研究が増加しています。最先端 のモデルにとって多くの既存のNLPベンチマークが容易であることが示されたため、LLMsを使用してさらに強力なモデルをテストす るためのより難しいタスクを作成する興味深い研究も行われています。 同時に、量子化や知識蒸留のような方法が使用されて、言語モデルを効果的に小さくし、より控えめなハードウェア上で実行 するために使用されています。Kaggleの環境は、提出物がGPUと時間の制限の両方に従う必要があるため、これを独自の視 点から調査する絶好の場です。 ★kaggleでやるモチベ このチャレンジのデータセットは、gpt3.5にWikipediaから引用したさまざまな科学的トピックのテキストの断片を与え、多肢 選択の質問(既知の答え付き)を書かせることで生成されました。その後、簡単な質問は除外されました。 現在、Kaggleで実行されている最大のモデルは約100億のパラメーターを持っていると推定されていますが、gpt3.5は 1750億のパラメーターを持っています。質問応答モデルが、そのサイズの10倍以上の質問作成モデルによって書かれたテストに 完璧に合格した場合、これは真に興味深い結果となります。一方、大きなモデルが小さなモデルを効果的に難題に対応させる ことができれば、これはLLMsが自分自身をベンチマークとテストする能力に魅力的な意味合いを持ちます。
  5. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    5/xx データについて • train.csv – a set of 200 questions with the answer column • test.csv – your task it to predict the top three most probable answers given the prompt. – NOTE: the test data you see here just a copy of the training data without the answers. The unseen re-run test set is comprised of ~4,000 different prompts. • ※回答しなきゃいけない質問は、システムで隠蔽されて見ることができません。 • ただし、、、 – 外部のオープンなデータセットに関しては利用可能!!! • Wikiの科学記事など。 配布されるQAペアは200、回答しなきゃいけない質問は4000未満!!
  6. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    7/xx 分からん! とりあえず、 データとDiscussionを見よう!
  7. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    8/xx データの一部を見てみよう 番号 質問 0 Which of the following statements accurately describes the impact of Modified Newtonian Dynamics (MOND) on the observed "missing baryonic mass" discrepancy in galaxy clusters? 1 Which of the following is an accurate definition of dynamic scaling in self-similar systems? 2 Which of the following statements accurately describes the origin and significance of the triskeles symbol? 3 What is the significance of regularization in terms of renormalization problems in physics? 4 Which of the following statements accurately describes the relationship between the dimensions of a diffracting object and the angular spacing of features in the diffraction pattern? 5 Which of the following statements accurately depicts the relationship between Gauss's law, electric flux, electric field, and symmetry in electric fields? 6 Which of the following statements accurately describes the dimension of an object in a CW complex? 7 Which of the following statements accurately describes the blocking temperature of an antiferromagnetic layer in a spin valve? 8 What is the term used in astrophysics to describe light-matter interactions resulting in energy shifts in the radiation field? ほうほう。基本的に5W1Hで質問されてそうですね。
  8. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    9/xx Hey、ChatGPT!どんなタイプがどれだけあるか教えて! 基本的にはWhat質問が多いんですね。こりゃむずそうだ。
  9. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    10/xx 今のランキングってどれくらいの精度になってんだろ??@20230826 ふぁ!?トップは90%超えの精度かい!!化け物かよ
  10. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    11/xx どんなアプローチがkaggleに投稿されてるかをみてみる • BERTで学習して予測 – 公開Notebook:OpenBook DeBERTaV3-Large Baseline (Single Model) • リンク – 精度:0.771 – 学習方法: • TransfomerライブラリのAutoModelForMultipleChoiceクラスからBERTのモデル作成 – 複数の回答から選択するモデル – 参考:最強の言語モデルLUKEをJCommonsenseQA用にファインチューニングして公開してみた - Qiita • 学習を実行 学習これだけなんか。でもそもそも、BERTってなんやねん
  11. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    12/xx Transformerから派生して生まれたモデル エンコーダによる 意味の理解 デコーダによる 文章生成 TransfomerのEncoder側が進化したやつね。詳しく頼む。
  12. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    13/xx 補足:BERTとは • BERT : Bidirectional Encoder Representations from Transformers • Google AIが開発した TransformerベースのLLM • 双方向性 • Pre-trainingとFine-tuning Finetuning!
  13. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    14/xx つまり、この先どうするってばよ? • 外部データを混ぜる – すでにwikipediaのデータを使って30k程度作っている人がいる・・・! • 外部データで事前学習 – オープンなデータで基礎知識を付けさせて、基礎知識Upを狙う? • 別のモデルを利用 – 新しいモデルにする。SOTA探し – Llama2をQuantizeして使ってみる。 • 学習テクニック – Reward Trainingというものがあるらしい?他にも何があるか要調査(PEFT、QLoRA、 • アプローチ検討 – 文字列をEmbeddingして距離学習するとか??すでにライブラリに組み込まれてるのかも? • その他 – 学習パラメータをいろいろいじる。エポック数とか 自然言語の専門家じゃないので、まだ全然わかりませーん。
  14. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    15/xx 追加:現在上位者が使ってるだろうRAG(Retrieval Augmented Generation)とは • 大規模LLM / シンプルに学習させるだけの課題: – ①未学習に対応できない / しづらい、②社外秘文書などを学習させられない • RAGアルゴリズム: – ① 大量の知識をDB化して、質問の内容から関連しそうな内容をpickup – ② 見つけた情報と、QuestionをAIモデルに投入し回答を出力! LLM/BERT Wikipediaなど 参考:RAG (Retrieval Augmented Generation) を活用!LLMで外部データを参照する方法を解説 | 株式会社ARISE analytics(アライズ アナリティクス)
  15. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    16/xx 〆:October 10, 2023 NLPの専門家/興味ある人、一緒にやりましょ? 20230907現在50位。1日10位下がる。死ぬほどNLP勉強中。
  16. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    18/xx Kaggle LLM Science Exam ~大規模言語モデルのための小規模言語モデルのコンペ~ 初めてのNLPで上位1.1% (30/位2622チーム)で銀メダル取ったよ
  17. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    19/xx 所感 • 小並感 – 初NLPコンペで頑張れた。 • 金目指すには、まだまだ実力と根気が足りない – なんとなくNLPがどんなものかを理解 • 技術的な細かい所 – LLMの予測精度を上げるためには、Retrieveという手段がかなり鍵になるコトを理解 • 業務活用できそうではある。その場合はLangchainだろうけど。 • 小規模なLLMだろうが文書探索&引用で、大規模なLLMを凌駕できる可能性もある – 類似文書探索の精度改善のためのsBERTのFinetuningは難しかった。 • 3位の人は私が作ったデータセットで精度を上げていた。。。
  18. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    20/xx 説明の流れ • 公開ノートブックの手法について • 我らの手法 • 上位者の手法と差分 • 反省
  19. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    21/xx 公開ノートブックの遷移 • 初期 – BERT、Llamaなどをシンプルに学習させるのみ – 200しかデータがなかったので、独自データを作る人がちょいちょい現れる – 公開のBestScoreは0.5x程度 • 中期 – WikipediaのデータとsBERT使って、Retrieveによる情報埋込を組み込んだ手法が公開 – 学習に使える60kデータも同時に公開される – 公開のBestScoreは0.80程度 • 後期 – Wikipediaのデータから科学領域を抽出した270Kデータセットが公開 • みんなが使っていたデータに不備があることを指摘 – LBが0.9超え大量発生(大荒れ、終了2週間前に30位以下は公開ノートブック化) – 公開のBestScoreは0.87程度
  20. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    22/xx 中期にBest Scoreになった公開ノートブック Data source Retrieve method sBert L6-v2 sBert L6-v2 Wikipedia 6.5M data 5pages 20sentences 5pages 20sentences Retrieve data Model Deberta-v3 large Deberta-v3 large average Final submit Ensemble 50% 50% Wikipedia 6.5M data 概要:BERTの学習をする際に、wikipediaの関連文書を探索し、同時に入力する方法 このノートブックでリーダーボードの数字は大きく変化 • 推論フロー • wikiperiaデータを参照し、sBERTを用いて特徴量化して関連文書を検索 • 2つのモデルで推論しアンサンブル
  21. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    23/xx ②検索対象は、 wikipediaをダンプしたデータ ③BERTで下記を学習 入力:与えられた質問と類似文章 推論対象:選択しの回答 補足:推論のイメージ図 ①与えられた質問と回答 を基に類似文章を探索
  22. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    24/xx 補足:公開ノートブックの処理フロー詳細 Wiki data abst取り出し Wiki abst embedding Sentence Transformers Page search Test data Prompt Sentence Transformers Pageの中身 (5page分) Text embedding Sentence Transformers text search tex20行分 取り出し C: Multiple-choice Transfomer ページの中身の文章を 特徴量化 5ページの中身から 関連する文章を検索 Wikidataから関連する ページを検索 Test data Prompt + answers Sentence Transformers
  23. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    25/xx 戦い方の検討:公開ノートブックをベースに検討ポイントを考察 sBert L6-v2 sBert L6-v2 Wikipedia all data 5pages 20sentences 5pages 20sentences Deberta-v3 large Deberta-v3 large average Final submit 1. Data Variation 2. Method variation 3. Num of reference 4. interpretation and inference capability 5. Method 50% 50% Wikipedia 6.5M data 最終的な仮説:実験を進めるうちに1. と2. が重要であることに気付きアプローチを検討! 性能改善のための検討ポイントは5つ。これらをどれだけ検討できるかがポイント ★Examination points Data source Retrieve method Retrieve data Model Ensemble
  24. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    26/xx TF-IDF TF-IDF Data source Retrieve method sBert bge-small wikipedia 270k stem-wiki-cohere-no-emb sBert L6-12 Wikipedia all data 20chunk 20 paragraph 20pages 6sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large Deberta-v3 large average Final submit ensemble 20% 20% 20% 20% 20chunk sBert bge-small extract 20 sentence from 20 paragraph Deberta-v3 large wikipedia270k all-paraphs-parsed-expanded 20% wikipedia270k all-paraphs-parsed-expanded wikipedia270k all-paraphs-parsed-expanded 31th Place Solution : Kaggle - LLM Science Exam Public model : llm-science-run-context2 U-bex’s Main contribution Sugupoko 大きな変更点:データソースと参照する文書数を増やしアンサンブル!
  25. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    27/xx 上位アプローチと 我々との差異はどんなもの? ※一部読み取り間違ってるかもしれないです!
  26. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    28/xx 解法リンクと大まかな違い @20231012時点 • 1st : Kaggle – LLM Science Exam | Kaggle – self dump dataset + RAG ( sentence transformer, e5) + LLM( 7B & 13B) • 3rd: Kaggle - LLM Science Exam | Kaggle – self dump dataset + RAG(sentence transformer + tuned reranker) + BERT(sDeBERTa-V3) +LLM(難問をこっ ちで解く) • 4th : Kaggle - LLM Science Exam | Kaggle – wikipediaのテキストを全てsentenceに切ってelasticsearch on kaggle notebookして、wikipedia検索エンジンそのもの を推論カーネル上に再現+BERT • 5th : Kaggle – LLM Science Exam | Kaggle – Self dump dataset + RAG (sentence transformer + BM25)+LLM( llama2 70B + mistral7B) • 11th :Kaggle - LLM Science Exam | Kaggle – 4 datasets + RAG (tf-idf& sentence transformer) + BERT(sDeBERTa-V3) • 13th : Kaggle - LLM Science Exam | Kaggle – 3 datasets + RAG (sentence transformer => tf-idf) + BERT(sDeBERTa-V3) • 14th :Kaggle - LLM Science Exam | Kaggle – Self dump dataset + RAG ( sentence transformer, e5&gte-base) + BERT(sDeBERTa-V3) 似ている点:データソースのバリエーション、Retrieve部分の工夫に各々独自性 大きく違う点:LLM vs BERT ※一部読み取り間違ってるかもしれないです!
  27. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    29/xx 参考:5位の人のソリューション(LLMメイン) 5th : Kaggle – LLM Science Exam | Kaggle Self dump dataset + RAG (sentence transformer + BM25)+LLM( llama2 70B + mistral7B) ★BERTの解法に比べて、推論能力の高さで性能を向上させているタイプ QLoRAで finetuning
  28. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    30/xx 参考:11位の人のソリューション(BERTメイン) 11th :Kaggle - LLM Science Exam | Kaggle 4 datasets + RAG (tf-idf&bge-large-en) + BERT(sDeBERTa-V3) ★ LLMの解法に比べて補足データを持ってくるバリエーションで精度を上げている。
  29. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    31/xx 振り返りポイント • 金圏内のソリューションざっくり傾向は – LLMを利用(llama2, mistralなど):LLMの能力の高さで精度を向上 – BERTを利用 (deberta-v3):補足データを持ってくるバリエーションで精度をを向上 • 自分の仮説に対してどうだったか? – 方向性としてはあってた。やはりRetrieveのところが重要。 • ※但し、1位を狙うにはLLMの利用が必要だったかもしれない • 金圏内に入る、何が足りなかった? – Retrieveに関しての理解が浅かった。 • Retrieveの本質的な理解、古典的アルゴ・AIモデルとの特定の違いの理解などが分かっていなかった。 – Sentence transformer => tf-idfのような流れは思いつかなかった。 – 検討の優先順位決め • Retrieveが重要だと思ってからも、モデルの改善ができないかの検討もしていた。 • #気持ちがブレた・・・
  30. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    32/xx まとめ • 金圏内に入るためには、丁寧な作業が必須なことを改めて痛感 • LLM、文書探索、QAモデルの作成などの理解は深まった • この学びを業務改善などで使えるかを検討していきたい
  31. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    33/xx 補足:gpt-3.5を使ったデータセット生成 • 70$かけて70k行の文書探索精度を上げ るためのデータセットを作成 – Kaggle - LLM Science Exam | Kaggle – 私は使いこなせなかったためkaggleで公開 • 3位の人が使いこなした。#嬉しい。 – プロンプトは→ • 文書のQAと、QAを作るためにつかった sentenceを同時に生成 system_message = f""" You will be provided with TEXT from wikipedia. ¥ The TEXT will be delimited with {delimiter} characters. Output a python list of 3 dict objects, where each object is ¥ a multiple choice question whose answers should be in ¥ the given TEXT and that has 5 choices each. Each object should have the following format: 'question': <question on the TEXT> 'option_1': <question answer option> 'option_2': <question answer option> 'option_3': <question answer option> 'option_4': <question answer option> 'option_5': <question answer option> 'answer': <answer option key label> 'reference_sentence': <original sentence from the TEXT that supports the answer> You should tell me which one of your proposed options is right ¥ by assigning the corresponding option's key label in the 'answer' field. Also, provide the original sentence ¥ from the TEXT that supports the answer in the 'reference_sentence' field. The question, the answer, and question answer options should be broad, ¥ challenging, long, detailed, and based on the TEXT provided. Additionally, ensure the token distribution of question follows these statistics: - Mean: 14.22 tokens - Std Deviation: 7.223939 tokens - Min: 4 token - 25th Percentile: 9 tokens - Median: 13 tokens - 75th Percentile: 17.25 tokens - Max: 49 tokens Additionally, ensure the token distribution of each answer follows these statistics: - Mean: 30.840 tokens - Std Deviation: 19.883692 tokens - Min: 1 token - 25th Percentile: 16 tokens - Median: 27.5 tokens - 75th Percentile: 43.25 tokens - Max: 100 tokens Only output the list of objects, with nothing else.
  32. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    34/xx 参考:5位の人が書いた学びに関するまとめ • I learned a lot through the competition! – Kaggle - LLM Science Exam | Kaggle
  33. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    35/xx うまくいかなかったこと/できなかったこと • うまくいかなかったこと – 類似文書探索 • Sentence Transformerの学習 • Sentence Transformerの差し替え – 回答予測関連 • データを増やす – 70$かけて自作データを作ったが意味なかった • 出来なかったこと – 類似文書探索 • データソースを増やす – PCのスペック的に無理(RAM 200GB+必要) – 回答予測関連 • ラベルのソフトラベル化 – 回答の中に一部正しい文書が含まれてる場合に0.5点とかにしたかった
  34. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    36/xx メモ:実験の雑なメモ • 後半、参照するデータのバリエーションを上げると性能が上がることに気付く – 270kのデータが公開された時に、上位のLBも大きく底上げされたのを見てデータが重要と気づく • LBと公開ノートブックの変化の相関をみるのも大事なのかも? • 引用して来る文書が正確過ぎると過学習してしまうっぽい? – Td-idfで引用した文書で学習させるとCV0.9のように過学習 • モデル性能は割とすぐ飽和してしまった – 解釈、類推する性能は60kのデータで実現できてたっぽい – 終了1か月前に作成したモデルを最後まで利用 • ミスする傾向 – contextに存在しない / 情報過多、難問
  35. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    39/xx 大枠の改善方向 • 優先度:高 – 入力:Contextを精度高く持ってくる(all-mpnet-base-v2などに変える) • contriver – 入力:Contextを圧縮する方法にする(context compression retrievers、summarize) – 入力:もっと情報を集める(sentence20を増やす) – 入力:知らない単語がある – アルゴ:RAG-End2End ⇒ sentence Transfomerを改善するようにする。 – 学習/推論:BERTを長い文章で認識させる ⇒640でOK • 700tokenまでは学習可能。 – 学習:DebertaV2を学習させる – 分析:曖昧な回答が含まれる場合の精度を確認する。 – AddTokenする単語をChatGPTで作成 • 優先度:中 – 入力:データを自作する。現在60k。 ⇒生成なう • Question Augmentationなど? – 入力:Extraデータのクリーニングをする(かぶりなど。) – 学習:テクニック導入をする。 • 優先度:低 – 学習:モデルを変更する? – 学習:モデルのLossを距離の近さにしてみる。 – 学習:パラメータをサーチする 中期くらいのメモです
  36. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    40/xx NLP過去コンペ • Feedback Prize - English Language Learning | Kaggle • Google AI4Code – Understand Code in Python Notebooks | Kaggle • Feedback Prize - Predicting Effective Arguments | Kaggle • U.S. Patent Phrase to Phrase Matching | Kaggle • NBME - Score Clinical Patient Notes | Kaggle • Feedback Prize - Evaluating Student Writing | Kaggle
  37. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    41/xx 過去NLPコンペ • kaggle Feedback Prize 2022 上位解法まとめ (zenn.dev) • Recruit Data Blog | 【Kaggle】NBME - Score Clinical Patient Notesコンペに チーム参加し、4位となり金メダルを獲得しました • Kaggle「CommonLit Readability Prize」コンペ25位の振り返りと上位解法まとめ - u++の備忘録 (hatenablog.com) • 2021年のKaggle NLPコンペソリューションの共通戦略から学ぶ - Qiita • Kaggle Competitions
  38. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    42/xx 重要リンク • Debertav3 with LLAMA2 example | Kaggle • Q/A chatbot with LLMs + Harry Potter | Kaggle • 大規模言語モデルの知識を補完するための Retriever の紹介 - ACES エンジニアブ ログ (acesinc.co.jp) • Awesome-LLM/paper_list/augmentation.md at main · Hannibal046/Awesome-LLM · GitHub • Finetunign – Train and Fine-Tune Sentence Transformers Models (huggingface.co) – SetFit による Sentence TransformersのFew-Shotファインチューニングを試す|npaka (note.com)
  39. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    43/xx retrieve-then-read 詳説:GPT-3を利用して任意の文書を解析する - Qiita
  40. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    44/xx 汎用言語モデル「BERT」のビジネス実用化技術に迫る | NTT技術ジャーナル
  41. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    45/xx LLMを利用したRAG(Retrieval Augmented Generation)と著作権侵 害|知的財産・IT・人工知能・ベンチャービジネスの法律相談なら【STORIA法 律事務所】 (storialaw.jp)
  42. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    46/xx Improving the Domain Adaptation of Retrieval Augmented Generation (RAG) Models for Open Domain Question Answering | Transactions of the Association for Computational Linguistics | MIT Press
  43. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    47/xx よい文献 • 外部データをRetrievalしてLLM活用する上での課題と対策案 - ABEJA Tech Blog • ベクトル検索で欲しい情報が得られないときの問題点と改良方法を考えてみた | DevelopersIO (classmethod.jp) • 大規模言語モデルの知識を補完するための Retriever の紹介 - ACES エンジニアブ ログ (acesinc.co.jp) • Retrieval Augmented Generationを改良する2つの方法 | DevelopersIO (classmethod.jp)
  44. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    48/xx NLPテクニック – Adversarial Weight Perturbation • Introducing Adversarial Weight Perturbation (AWP) | Kaggle – few-shot prompting • LLMSE - deberta-v3-large few-shot prompting -i | Kaggle – Reward Training • Single Model - RewardTrainer LoRA - LLM | Kaggle – Parameter-Efficient Fine-Tuning (PEFT) technique with Low-Rank Adaptor (LoRA) • LB0.726 PEFT with 3K New data | Kaggle – MLM • NBME MLM | Kaggle / [Coleridge] BERT - Masked Dataset Modeling | Kaggle
  45. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    49/xx データ: Find Open Datasets and Machine Learning Projects | Kaggle • 📊 15k high-quality train examples 🏆🔥🚀 | Kaggle – 15k_gpt3.5-turbo.csv、5900_examples.csv • 📊 6.5k train examples for LLM Science Exam 📝 | Kaggle – 6000_train_examples.csv、extra_train_set.csv • Wikipedia STEM 1k | Kaggle – stem_1k_v1.csv • llm-science-3k-data | Kaggle – Test.csv • データ収集 – [EDA, Data gathering] LLM-SE ~ Wiki STEM | 1k DS | Kaggle – LLMSE - Data gathering with few-shot prompting | Kaggle – create science wikipedia dataset | Kaggle • 全部入り:llm-science-exam-dataset-w-context | Kaggle
  46. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    50/xx ExtraDatasetの作り方 • create science wikipedia dataset | Kaggle • [EDA, Data gathering] LLM-SE ~ Wiki STEM | 1k DS | Kaggle
  47. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    51/xx Parameter-Efficient Fine-Tuning (PEFT) [翻訳] Hugging faceのPEFT - Qiita • PEFT、あるいはParameter-Efficient Fine-Tuning (PEFT)は、モデルのすべてのパ ラメーターをファインチューニングすることなしにることなしに、さまざまな後段のアプリケー ションに事前学習済み言語モデル(PLM)を効率的に適応させるライブラリです。PEFT のメソッドは少数の(追加の)モデルパラメーターのみをファインチューンするので、大規模 なPLMのファインチューニングは非常に高コストですが、劇的に計算コストとストレージコ ストを削減することができます。最先端のPEFTテクニックは、完全なファインチューニング と同等のパフォーマンスを達成します。
  48. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    52/xx all-MiniLM-L6-v2: Sentence Transformers 2.2 : 事前訓練済みモデル – PyTorch 2.0, Hugging Face & Stable Diffusion (classcat.com) • すべての利用可能な訓練データ (10 億以上の訓練ペア) で訓練された all-* モデ ル は 汎用目的な モデルとして設計されています。all-mpnet-base-v2 モデルはベス トな品質を提供する一方で、all-MiniLM-L6-v2 は 5 倍高速でなおかつ良い品質 を提供します。すべての評価モデルを見るには All モデルをトグルするか、
  49. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    53/xx AutoModelForMultipleChoice Input Text (e.g., Question + Choice1) | V Transformer (e.g., BERT, RoBERTa) | V Embedding/Output for Choice1 | V ------------------------ | V Aggregation Layer (optional) | V Classification Layer | V Score for Choice1 | V ------------------------ Repeat for Choice2, Choice3, ... Final Prediction: Choice with highest score QuestionとChoiceを一緒にTransfomerへ。 Embeddingを出してそれをクラス分類へ。 AutoModelForMultipleChoiceの設計は、各選択肢を独立してモデルに入力する形式を想 定しています。 例えば、ある問題が4つの選択肢を持っているとしましょう。この場合、各選択肢と質問(または 文脈)が組み合わせられ、それぞれがモデルの入力として用いられます。これは、通常、バッチ処 理の形で行われ、複数の選択肢が同時にモデルに入力されます。 したがって、バッチの形状は次のようになります: (batch_size, num_choices, sequence_length) ここで、 batch_size は一度に処理するデータの数(例:問題の数)。 num_choices は選択肢の数(例:4)。 sequence_length は入力テキストの長さ(質問 + 選択肢)。 モデルは各選択肢に対して個別のスコアを出力します。最も高いスコアを持つ選択肢が、モデル による予測結果となります。
  50. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    55/xx Inference Flow exp00-2 @0.909 結果:+0.001 TF-IDF TF-IDF 270k Data source Retrieve method 270k sBert L6-12 wikidata ? paragraph ? sentences 5pages 20sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v2 xlarge average Final submit ensemble 33% 33% 33/2% 33/2%
  51. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    56/xx Inference Flow exp0 @0.913 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k sBert L6-12 wikidata ? paragraph 5 sentences 20pages 6sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large llm-science-run -context-2 average Final submit ensemble 25% 25% 25% 25% top_per_chunk = 10 top_per_query = 10
  52. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    57/xx Inference Flow exp0-3 @0.911 from exp0 結果:-0.002 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k sBert L6-12 wikidata ? paragraph 5 sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large llm-science-run -context-2 average Final submit ensemble 25% 25% 25% 25% 5pages 20sentences 変更 top_per_chunk = 10 top_per_query = 10
  53. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    58/xx Inference Flow [email protected] 結果:効果あり +0.001 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k sBert L6-12 wikidata ? paragraph 20 sentences 20pages 6sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large llm-science-run -context-2 average Final submit ensemble 25% 25% 25% 25% 変更 top_per_chunk = 10 top_per_query = 10
  54. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    59/xx Inference Flow exp02 @0.911 exp01との差分を見る -0.003 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k sBert L6-12 wikidata ? paragraph 20 sentences 5pages 20sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large llm-science-run -context-2 average Final submit ensemble 12.5% 12.5% 25% 25% 25% top_per_chunk = 10 top_per_query = 10
  55. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    60/xx Inference Flow exp03 @0.91 exp01との差分を見る -0.004 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k sBert L6-12 wikidata ? paragraph 20 sentences 20pages 6sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large Deberta-v2 xlarge average Final submit ensemble 25% 25% 25% 25% top_per_chunk = 10 top_per_query = 10
  56. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    61/xx Inference Flow exp04 @0.91 微妙・・・ TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k sBert L6-12 wikidata ? paragraph 20 sentences top_per_chunk = 10 top_per_query = 10 20pages 6sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large llm-science-run -context-2 average Final submit ensemble 12.5% 12.5% 25% 25% 25%
  57. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    62/xx Inference Flow exp05 @0.914 結果:変わりなく。 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k sBert L6-12 wikidata ? paragraph 20 sentences 20pages 6sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large llm-science-run -context-2 average Final submit ensemble 25% 25% 25% 25% 変更 top_per_chunk = 20 top_per_query = 20
  58. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    63/xx Inference Flow exp06 @0.912 結果: from exp05 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k sBert L6-12 wikidata ? paragraph 20 sentences 20pages 6sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large llm-science-run -context-2 average Final submit ensemble 25% 25% 25% 25% 変更 Stop_words追加 top_per_chunk = 20 top_per_query = 20
  59. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    64/xx Inference Flow exp07 @0.914 結果:効果あり +0.001 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k sBert L6-12 wikidata ? paragraph 20 sentences 20pages 6sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large llm-science-run -context-2 average Final submit ensemble 25% 25% 25% 25% 変更 top_per_chunk = 10 top_per_query = 10
  60. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    65/xx Inference Flow exp08 @ TF-IDF TF-IDF 270k paragraph Data source Retrieve method sBert Bge-small 270k sentence 270k paragraph ? paragraph 20 sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large average Final submit ensemble 25% 25% 25% 25% top_per_chunk = 10 top_per_query = 10 sBert Bge-small 270k sentence 20 sentences Deberta-v3 large 25%
  61. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    66/xx Inference Flow exp09 @0.916 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k ? paragraph 20 paragrah Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large average Final submit ensemble 25% 25% 25% 25% top_per_chunk = 10 top_per_query = 10 sBert Bge-small 20 paragraph =>pick20sentence Deberta-v3 large 270k 25%
  62. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    67/xx Inference Flow exp10 @912 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k sBert L6-12 wikidata ? paragraph 20 sentences 20pages 20sentences Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large average Final submit ensemble 25% 25% 25% 25% top_per_chunk = 10 top_per_query = 10 Deberta-v3 large
  63. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    68/xx Inference Flow exp11 @0.916 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k ? paragraph 20 paragrah Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large average Final submit ensemble 25% 25% 25% 25% top_per_chunk = 10 top_per_query = 10 sBert Bge-small 20 paragraph =>pick20sentence Deberta-v3 large 270k 25%
  64. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    69/xx Inference Flow exp12 @0.904 TF-IDF TF-IDF 270k Data source Retrieve method sBert Bge-small 270k 270k ? paragraph 20 paragrah Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large average Final submit ensemble 25% 25% 25% 25% top_per_chunk = 10 top_per_query = 10 sBert Bge-small 20 paragraph =>pick20sentence Deberta-v3 large 270k 25%
  65. Platform Technology Division Copyright 2020 Sony Semiconductor Solutions Corporation DATE

    70/xx Inference Flow exp13 exp09 @ time over TF-IDF TF-IDF 270k stem-wiki-cohere-no- emb Data source Retrieve method sBert Bge-small 270k all-paraphs-parsed- expanded 20 paragrah Retrieve data model Deberta-v3 large Deberta-v3 large Deberta-v3 large average Final submit ensemble 25% 25% 25% top_per_chunk = 10 top_per_query = 10 top_per_chunk = 10 top_per_query = 10 270k all-paraphs-parsed- expanded 25% sBert Bge-small 20 paragraph =>pick20sentence Deberta-v3 large 270k all-paraphs-parsed- expanded