update model card
Browse files
README.md
CHANGED
@@ -1,3 +1,88 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
- ja
|
6 |
+
base_model:
|
7 |
+
- Rakuten/RakutenAI-2.0-mini
|
8 |
+
---
|
9 |
+
|
10 |
+
# RakutenAI-2.0-mini-instruct
|
11 |
+
## Model Description
|
12 |
+
RakutenAI-2.0-mini-instruct is a lightweight yet powerful fine-tuned variant of [RakutenAI-2.0-mini](https://huggingface.co/Rakuten/RakutenAI-2.0-mini), specifically designed for edge devices and resource-constrained environments. While compact in size, this model delivers efficient, high-quality instruction-following capabilities, making it an ideal choice for on-device AI applications, low-latency inference, and cost-effective deployment. It achieves competitive performance within the sub-2B parameter category on Japanese MT Bench, offering a balance of speed, efficiency, and accuracy for real-world use cases.
|
13 |
+
|
14 |
+
*If you are looking for foundation model, check [RakutenAI-2.0-mini](https://huggingface.co/Rakuten/RakutenAI-2.0-mini)*.
|
15 |
+
|
16 |
+
## Model Evaluation Results
|
17 |
+
|
18 |
+
|Instruct Model Name | Size | Japanese MT-Bench Score |
|
19 |
+
|:-------------------------------------------------------------|:-----------:|:-------------------------:|
|
20 |
+
| Rakuten/RakutenAI-2.0-mini-instruct | 1.5B | 4.91 |
|
21 |
+
| llm-jp/llm-jp-3-1.8b-instruct | 1.8B | 4.70 |
|
22 |
+
| llm-jp/llm-jp-3-3.7b-instruct | 3.7B | 4.98 |
|
23 |
+
| SakanaAI/EvoLLM-JP-A-v1-7B | 7B | 3.80 |
|
24 |
+
| SakanaAI/EvoLLM-JP-v1-7B | 7B | 4.58 |
|
25 |
+
|
26 |
+
|
27 |
+
<div style="text-align: center;">Table1: RakutenAI-2.0-mini-instruct performance on MT Bench in comparison with other Japanese open models.</div>
|
28 |
+
|
29 |
+
|
30 |
+
**Note on Evaluation Scores:**
|
31 |
+
- Japanese MT-bench is a set of 80 challenging open-ended questions for evaluating chat assistants on eight dimensions: writing, roleplay, reasoning, math, coding, extraction, stem, humanities. https://github.com/Stability-AI/FastChat/tree/jp-stable/fastchat/llm_judge Evaluation of responses is conducted with GPT4(gpt-4o-2024-05-13) as a judge, in line with public leaderboard.
|
32 |
+
- The Japanese research community cautions against not to evaluate fine-tuned models on LM Harness due to task contamination, so we have not included the LM-Harness scores in this model card for instruct models. ```LLM-jp: jasterを用いてインストラクションチューニングを施したモデルが、テストデータをインストラクションチューニングに使用していない場合でも, llm-jp-evalの評価スコアを非常に高くすることができることが明らかになっている. したがって、高い評価スコアを得たからといって、他のLLMよりも性能が優れていると断言するのは適切ではないことに注意されたい。 Machine Translation: It has become clear that models that have been instruction tuned using Jaster can achieve very high evaluation scores on LLM-JP-EVAL, even if test data is not used for instruction tuning. Therefore, please note that it is not appropriate to assert that a model's performance is superior to other LLMs just because it has a high evaluation score.``` More details can be found at [llm-jp-eval](https://github.com/llm-jp/llm-jp-eval/blob/dev/README.md).
|
33 |
+
- Final score `(4.91 +/- 0.023)` for RakutenAI-2.0-mini-instruct is average of 3 runs on Japanese MT-Bench. Model outputs and judge outputs are uploaded for reference.
|
34 |
+
|
35 |
+
|
36 |
+
## Model Usage
|
37 |
+
```python
|
38 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
39 |
+
|
40 |
+
model_path = "Rakuten/RakutenAI-2.0-mini-instruct"
|
41 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
42 |
+
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype="auto", device_map="auto")
|
43 |
+
model.eval()
|
44 |
+
|
45 |
+
chat = [
|
46 |
+
{"role": "system", "content": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions."},
|
47 |
+
{"role": "user", "content": "How to make an authentic Spanish Omelette?"},
|
48 |
+
]
|
49 |
+
|
50 |
+
input_ids = tokenizer.apply_chat_template(chat, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(device=model.device)
|
51 |
+
attention_mask = input_ids.ne(tokenizer.pad_token_id).long()
|
52 |
+
tokens = model.generate(
|
53 |
+
input_ids,
|
54 |
+
max_length=2048,
|
55 |
+
do_sample=False,
|
56 |
+
num_beams=1,
|
57 |
+
pad_token_id=tokenizer.eos_token_id,
|
58 |
+
attention_mask=attention_mask,
|
59 |
+
)
|
60 |
+
out = tokenizer.decode(tokens[0][len(input_ids[0]):], skip_special_tokens=True)
|
61 |
+
print("ASSISTANT:\n" + out)
|
62 |
+
print()
|
63 |
+
```
|
64 |
+
## Model Details
|
65 |
+
|
66 |
+
* **Developed by**: [Rakuten Group, Inc.](https://ai.rakuten.com/)
|
67 |
+
* **Language(s)**: Japanese, English
|
68 |
+
* **License**: This model is licensed under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
|
69 |
+
* **Model Architecture**: Transformer
|
70 |
+
|
71 |
+
### Limitations and Bias
|
72 |
+
|
73 |
+
The suite of RakutenAI-2.0 models is capable of generating human-like text on a wide range of topics. However, like all LLMs, they have limitations and can produce biased, inaccurate, or unsafe outputs. Please exercise caution and judgement while interacting with them.
|
74 |
+
|
75 |
+
## Citation
|
76 |
+
For citing our work on the suite of RakutenAI-2.0 models, please use:
|
77 |
+
|
78 |
+
```
|
79 |
+
@misc{rakutengroup2025rakutenai2.0,
|
80 |
+
author = {Rakuten Group, Inc.},
|
81 |
+
title = {RakutenAI-2.0},
|
82 |
+
year = {2025},
|
83 |
+
publisher = {Hugging Face},
|
84 |
+
url = {https://huggingface.co/Rakuten},
|
85 |
+
}
|
86 |
+
|
87 |
+
```
|
88 |
+
|