license: apache-2.0
language:
- 英语
- 日语
base_model:
- Rakuten/RakutenAI-7B
RakutenAI-7B-instruct
模型描述
RakutenAI-7B是一项系统性创新,旨在为日语大语言模型领域引入最新技术。该模型在日语理解基准测试中取得最佳成绩,同时在英语测试集上保持与OpenCalm、Elyza、Youri、Nekomata和Swallow等同类模型相当的竞争力。RakutenAI-7B采用Mistral模型架构,基于Mistral-7B-v0.1预训练检查点,成功实现了预训练模型权重的改造应用。此外,我们将Mistral的词汇表从32k扩展到48k,以提升日语的字符-标记比。
技术报告详见arXiv。
如需基础模型,请访问RakutenAI-7B。
如需对话调优模型,请访问RakutenAI-7B-chat。
模型评估结果
模型名称 |
7项平均(不含XLSum-ja) |
综合平均 |
JCS准确率 |
JNLI准确率 |
MARC-ja准确率 |
JSQuAD精确匹配 |
Jaqket v2精确匹配 |
XLSum-ja ROUGE-2 |
xWino准确率 |
MGSM准确率 |
|
|
|
3样本 |
3样本 |
3样本 |
2样本 |
1样本 |
1样本 |
0样本 |
5样本 |
rakuten-ai-7b-instruct |
77.32 |
68.74 |
93.03 |
90.39 |
96.00 |
80.44 |
81.79 |
8.67 |
75.18 |
24.40 |
youri-7b-instruction |
73.35 |
66.84 |
86.06 |
70.13 |
97.03 |
82.53 |
79.47 |
21.29 |
79.04 |
19.20 |
japanese-stablelm-instruct-gamma-7b |
65.46 |
59.98 |
83.82 |
16.97 |
95.68 |
76.20 |
81.87 |
21.58 |
82.06 |
21.60 |
swallow-7b-instruct |
64.29 |
58.25 |
83.38 |
26.50 |
94.46 |
75.62 |
81.01 |
16.01 |
76.23 |
12.80 |
elyza-japanese-Llama-2-7b-instruct |
60.04 |
53.19 |
65.15 |
57.44 |
91.51 |
67.29 |
58.51 |
5.20 |
70.80 |
9.60 |
elyza-japanese-Llama-2-7b-fast-instruct |
57.22 |
50.48 |
70.69 |
36.48 |
92.75 |
68.87 |
62.29 |
3.36 |
59.44 |
10.00 |
nekomata-7b-instruction |
49.04 |
44.14 |
85.08 |
42.48 |
96.99 |
8.51 |
10.91 |
9.81 |
76.12 |
23.20 |
表1:RakutenAI-7B-instruct模型在日本LM-Harness指标上与其他模型的性能对比
我们的模型以超过第二名3分以上的优势获得最高平均分。排序依据7项平均分。我们使用https://github.com/Stability-AI/lm-evaluation-harness/tree/0fa86429679f521161d5b81a94c0c385e0a0976d版本的日本LM-Harness工具,采用v0.3提示模板。
模型名称 |
综合平均 |
ARC准确率 |
HellaSwag准确率 |
MMLU准确率 |
TruthfulQA准确率 |
|
|
25样本 |
10样本 |
5样本 |
6样本 |
rakuten-ai-7b-instruct |
61.32 |
58.62 |
82.70 |
60.32 |
43.63 |
japanese-stablelm-instruct-gamma-7b |
55.91 |
50.43 |
77.10 |
54.61 |
41.50 |
elyza-japanese-Llama-2-7b-fast-instruct |
54.21 |
53.58 |
77.69 |
46.91 |
38.67 |
elyza-japanese-Llama-2-7b-instruct |
54.07 |
52.05 |
78.33 |
47.09 |
38.83 |
nekomata-7b-instruction |
52.84 |
50.34 |
73.67 |
48.53 |
38.81 |
youri-7b-instruction |
52.11 |
48.98 |
75.66 |
45.41 |
38.38 |
swallow-7b-instruct |
50.32 |
47.61 |
72.27 |
40.77 |
40.62 |
表2:RakutenAI-7B-instruct模型在英语LM-Harness指标上与其他模型的性能对比
我们的模型以超过第二名5分以上的优势获得最高平均分。我们使用https://github.com/EleutherAI/lm-evaluation-harness/tree/b281b0921b636bc36ad05c0b0b0763bd6dd43463版本的英语LM-Harness工具。
Kamata等人在Nejumi LLMリーダーボード Neo的独立评估中,采用llm-jp-eval和Japanese MT-bench的加权平均分数也证实,截至2024年3月22日,RakutenAI-7B的对话/指令调优版本在同类开源大模型中表现最佳,分别获得0.393/0.331的评分。
使用方式
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = "Rakuten/RakutenAI-7B-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype="auto", device_map="auto")
model.eval()
requests = [
"「馬が合う」はどう言う意味ですか",
"How to make an authentic Spanish Omelette?",
]
system_message = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {user_input} ASSISTANT:"
for req in requests:
input_req = system_message.format(user_input=req)
input_ids = tokenizer.encode(input_req, return_tensors="pt").to(device=model.device)
tokens = model.generate(
input_ids,
max_new_tokens=1024,
do_sample=True,
pad_token_id=tokenizer.eos_token_id,
)
out = tokenizer.decode(tokens[0][len(input_ids[0]):], skip_special_tokens=True)
print("用户提问:\n" + req)
print("助手回答:\n" + out)
print()
print()
模型详情
- 开发机构: 乐天集团
- 支持语言: 日语、英语
- 许可证: 本模型采用Apache许可证2.0版
- 指令调优数据集: 我们使用开源和内部手工制作的数据集混合对基础模型进行微调,创建RakutenAI-7B-instruct和RakutenAI-7B-chat。指令调优和对话调优模型使用以下数据集(CC by-SA许可)的train部分:
局限性及偏差
RakutenAI-7B系列模型能够生成涵盖广泛主题的类人文本。但与所有大语言模型一样,它们存在局限性,可能产生带有偏见、不准确或不安全的输出。使用时请保持谨慎判断。
引用
如需引用RakutenAI-7B系列模型的研究成果,请使用:
@misc{rakutengroup2024rakutenai7b,
title={RakutenAI-7B: Extending Large Language Models for Japanese},
author={{Rakuten Group, Inc.} and Aaron Levine and Connie Huang and Chenguang Wang and Eduardo Batista and Ewa Szymanska and Hongyi Ding and Hou Wei Chou and Jean-François Pessiot and Johanes Effendi and Justin Chiu and Kai Torben Ohlhus and Karan Chopra and Keiji Shinzato and Koji Murakami and Lee Xiong and Lei Chen and Maki Kubota and Maksim Tkachenko and Miroku Lee and Naoki Takahashi and Prathyusha Jwalapuram and Ryutaro Tatsushima and Saurabh Jain and Sunil Kumar Yadav and Ting Cai and Wei-Te Chen and Yandi Xia and Yuki Nakayama and Yutaka Higashiyama},
year={2024},
eprint={2403.15484},
archivePrefix={arXiv},
primaryClass={cs.CL}
}