Aratako's picture
Update README.md
228a428 verified
|
raw
history blame
4.87 kB
---
library_name: transformers
license: cc-by-nc-sa-4.0
language:
- ja
- en
base_model:
- CohereForAI/c4ai-command-r-v01
---
# c4ai-command-r-v01-japanese-instruct
[GGUF版はこちら/Click here for the GGUF version](https://huggingface.co/Aratako/c4ai-command-r-v01-japanese-instruct-GGUF)
## 概要
[CohereForAI/c4ai-command-r-v01](https://huggingface.co/CohereForAI/c4ai-command-r-v01)を、[ichikara-instruction](https://liat-aip.sakura.ne.jp/wp/llm%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%A9%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%87%E3%83%BC%E3%82%BF%E4%BD%9C%E6%88%90/llm%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%A9%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%87%E3%83%BC%E3%82%BF-%E5%85%AC%E9%96%8B/)を使って追加で日本語インストラクションチューニングを施したモデルです。
## 学習の設定
RunpodでGPUサーバを借り、A6000x4で学習を行いました。主な学習パラメータは以下の通りです。
- lora_r: 64
- lisa_alpha: 128
- lora_dropout: 0.05
- lora_target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
- learning_rate: 2e-5
- num_train_epochs: 10epochs
- batch_size: 50
- max_seq_length: 2048
## 評価
jsquad(jsquad-1.1-0.3, 2-shots)、jcommonsenseqa(jcommonsenseqa-1.1-0.3, 3-shots)、jnli(jnli-1.3-0.3, 3-shots)、marc_ja(marc_ja-1.1-0.3, 3-shots)結果は以下の通りです。
(8ビット量子化/jsquadは100で割り、それぞれ小数点以下第4位を四捨五入)
平均スコアの向上が見受けられます。
|Model|jsquad(exact_match)|jcommonsenseqa(acc)|jnli(acc)|marc_ja(acc)|average|
|---|---|---|---|---|---|
| c4ai-command-r-v01 |0.809 | 0.902 | 0.466 | 0.954 | 0.783 |
| **c4ai-command-r-v01-japanese-instruct** | **0.836** | **0.911** | **0.537** | **0.940** | **0.806** |
評価には[lm-evaluation-harness](https://github.com/Stability-AI/lm-evaluation-harness)を利用しました。
また、元モデルと本モデルの[japanese-mt-bench](https://github.com/Stability-AI/FastChat/tree/jp-stable/fastchat/llm_judge)の結果は以下の通りです。(シングルターン、4ビット量子化)
スコア的にはあまり変わりませんでした。ただし、元モデルの出力の中には時々英語が混ざっていましたが、目視で確認した範囲だと混ざらなくなっていたので学習の効果は多少はありそうです。
|Model|Coding|Extraction|Humanities|Math|Reasoning|Roleplay|STEM|Writing|avg_score|
|---|---|---|---|---|---|---|---|---|---|
| c4ai-command-r-v01 | 6.1 | 7.9 | 9.7 | 2.4 | 6.0 | 8.3 | 9.8 | 8.6 | 7.35 |
| **c4ai-command-r-v01-japanese-instruct** | **5.6** | **8.3** | **8.1** | **3.4** | **6.1** | **7.9** | **9.2** | **8.6** | **7.15** |
![レーダーチャート](./japanese_mt_bench.png)
余談ですが、英語ベンチマークである[Open LLM Leaderboard]((https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard))のスコアもなぜかわずかに向上していました。
[詳細](https://huggingface.co/datasets/open-llm-leaderboard/details_Aratako__c4ai-command-r-v01-japanese-instruct)
| Metric |c4ai-command-r-v01|**c4ai-command-r-v01-japanese-instruct**|
|---------------------------------|----:|----:|
|Avg. |68.54|**68.85**|
|AI2 Reasoning Challenge (25-Shot)|65.53|**65.87**|
|HellaSwag (10-Shot) |87|**85.62**|
|MMLU (5-Shot) |68.2|**67.61**|
|TruthfulQA (0-shot) |52.32|**51.01**|
|Winogrande (5-shot) |81.53|**82.95**|
|GSM8k (5-shot) |56.63|**60.05**|
## ライセンス
元モデルである[CohereForAI/c4ai-command-r-v01](https://huggingface.co/CohereForAI/c4ai-command-r-v01)はCC-BY-NC 4.0と[C4AI's Acceptable Use Policy](https://docs.cohere.com/docs/c4ai-acceptable-use-policy)のもとに配布されています。
また、ファインチューニングに利用したデータセットである[ichikara-instruction](https://liat-aip.sakura.ne.jp/wp/llm%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%A9%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%87%E3%83%BC%E3%82%BF%E4%BD%9C%E6%88%90/llm%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%A9%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%87%E3%83%BC%E3%82%BF-%E5%85%AC%E9%96%8B/)はCC-BY-NC-SA 4.0の元配布されています。
そのため、このモデルのライセンスはCC-BY-NC-SA 4.0及び[C4AI's Acceptable Use Policy](https://docs.cohere.com/docs/c4ai-acceptable-use-policy)となります。(理解間違っていればご指摘ください)