🚀 Open-Instruct Code Alpaca 7B
このモデルは、Code Alpacaデータセットでファインチューニングされた7BのLLaMaモデルです。これはモデル差分であることに注意してください - 使用方法については以下を参照してください。
このモデルは論文 How Far Can Camels Go? Exploring the State of Instruction Tuning on Open Resources の一部として学習されました。
このモデルを学習および評価するために使用されたコードベースは https://github.com/allenai/open-instruct で見つけることができます。
このモデルは、LICENSE.txtに記載されたAIモデルライセンスと元のLlamaライセンス (llama_license.txt) に基づいてライセンスされています。
🚀 クイックスタート
このモデルの使用には、すでにHF形式のLLaMaモデルにアクセスできることを前提としています。アクセス方法とモデルの変換に関する詳細は、こちらで確認できます。
https://huggingface.co/docs/transformers/main/model_doc/llama
https://github.com/allenai/open-instruct をクローンし、必要な依存関係をインストールするか、scripts/weight_diff.py
をコピーして weight-diff-requirements.txt
に記載された最小限の要件をインストールします。そして、このモデル差分を同じマシンにダウンロードまたはクローンします。
次に、以下のコマンドを実行します。
python scripts/weight_diff.py recover --path_raw ${hf_llama_path} --path_tuned ${output_path} --path_diff ${diff_location}
これで、復元されたモデルが得られます。ただし、この操作にはかなりの量のRAMが必要です。特に大きなモデルの場合には注意が必要です。
💻 使用例
基本的な使用法
モデルは以下の形式(改行に注意)で入力を受け付けるように学習されています。
<|user|>
Your message here!
<|assistant|>
最適な結果を得るには、すべての入力をこの形式で整形してください。
📚 ドキュメント
モデルの性能
論文 How Far Can Camels Go? Exploring the State of Instruction Tuning on Open Resources で検討されたベンチマークにおけるこのモデルの性能は以下の通りです。
Property |
Details |
MMLU 0-shot |
34.7 |
MMLU 5-shot |
34.5 |
GSM Direct |
6.5 |
GSM CoT |
7.5 |
BBH Direct |
29.6 |
BBH CoT |
30.5 |
TydiQA Gold-Passage |
36.7 |
TydiQA Closed-book |
10.5 |
Codex-Eval Pass@1 |
16.5 |
Codex-Eval Pass@10 |
29.2 |
AlpacaFarm vs Davinci-003 |
17.5 |
Average |
22.6 |
引用
このモデルを使用する場合は、以下の論文を引用してください。
@misc{wang2023far,
title={How Far Can Camels Go? Exploring the State of Instruction Tuning on Open Resources},
author={Yizhong Wang and Hamish Ivison and Pradeep Dasigi and Jack Hessel and Tushar Khot and Khyathi Raghavi Chandu and David Wadden and Kelsey MacMillan and Noah A. Smith and Iz Beltagy and Hannaneh Hajishirzi},
year={2023},
eprint={2306.04751},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@misc{touvron2023llama,
title={LLaMA: Open and Efficient Foundation Language Models},
author={Hugo Touvron and Thibaut Lavril and Gautier Izacard and Xavier Martinet and Marie-Anne Lachaux and Timothée Lacroix and Baptiste Rozière and Naman Goyal and Eric Hambro and Faisal Azhar and Aurelien Rodriguez and Armand Joulin and Edouard Grave and Guillaume Lample},
year={2023},
eprint={2302.13971},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@misc{codealpaca,
author = {Sahil Chaudhary},
title = {Code Alpaca: An Instruction-following LLaMA model for code generation},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/sahil280114/codealpaca}},
}
📄 ライセンス
このモデルは、LICENSE.txtに記載されたAIモデルライセンスと元のLlamaライセンス (llama_license.txt) に基づいてライセンスされています。