英語| 中文简体
グリモアを使用して、小言語モデルの機能を強化します。
コンテキスト学習(ICL)は、一連の少数の質問と回答の例を提供することにより、特定のタスク上の大規模な言語モデルのパフォーマンスを強化するための重要な方法の1つです。ただし、さまざまなタイプのモデルのICL機能は、モデルアーキテクチャ、学習データの量、パラメーターのサイズなどの要因により、大きな変動を示しています。一般に、モデルのパラメーターサイズが大きくなり、学習データがより広範囲に及ぶほど、ICL機能が強くなります。この論文では、 involves learning from examples using strong language models and then summarizing and transferring these learned skills to weak language models for inference and application.
これにより、ICLの安定性と有効性が保証されます。弱い言語モデルが迅速な例から学習できるように直接有効にすることと比較すると、SLEICLはこれらのモデルのICLの難しさを軽減します。 5つの言語モデルを備えた最大8つのデータセットで実施された実験は、SLEICLメソッドを使用して、ゼロショットまたは少ないショット機能よりも弱い言語モデルが一貫した改善を達成することを示しています。いくつかの弱い言語モデルは、SLEICLの助けを借りてGPT4-1106-PREVIEW(ゼロショット)のパフォーマンスを上回ります。

このプロジェクトは、いくつかの重要なディレクトリとモジュールに編成されています。プロジェクト構造の概要は次のとおりです。
.
├── archived # Store the grimoire and hard samples used in our experiment.
├── assets # Store project assets, such as images, diagrams, or any visual elements used to enhance the presentation and understanding of the project.
├── configs # Store configuration files.
├── core # Core codebase.
│ ├── data # Data processing module.
│ ├── evaluator # Evaluator module.
│ └── llm # Load Large Language Models (LLMs) module.
├── data # Store datasets and data processing scripts.
├── external # Store the Grimoire Ranking model based on the classifier approach.
├── outputs # Store experiment output files.
├── prompts # Store text files used as prompts when interacting with LLMs.
├── stats # Store experiment statistical results.
└── tests # Store test code or unit tests.
リポジトリをクローンします。
git clone https://github.com/IAAR-Shanghai/Grimoire.git && cd Grimoireコンドラ環境に備えます。
conda create -n grimoire python=3.8.18conda activate grimoirePython依存関係をインストールし、データを処理します。
chmod +x setup.sh./setup.sh設定します
cp -r ./archived/.cache ./実験を調べて、実験を実行する方法を確認してください。
Analyst.pyを実行して、 outputsで保存された結果を分析します。
注: LLMSの展開については、いくつかのリファレンスチュートリアルも提供しています。


質問、フィードバック、または提案については、GitHubの問題を開いてください。 Githubの問題を介して連絡できます。
setup.shを作成して、python依存関係のインストールとembed.pyおよびcompute_similarity.pyの実装を実装します。 huggingfaceから直接大きなモデルをロードします。 experiment.yamlに構成可能なアイテムを追加します。 @article{Grimoire,
title={Grimoire is All You Need for Enhancing Large Language Models},
author={Ding Chen and Shichao Song and Qingchen Yu and Zhiyu Li and Wenjin Wang and Feiyu Xiong and Bo Tang},
journal={arXiv preprint arXiv:2401.03385},
year={2024},
}