Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
- ja
|
6 |
+
programming_language:
|
7 |
+
- C
|
8 |
+
- C++
|
9 |
+
- C#
|
10 |
+
- Go
|
11 |
+
- Java
|
12 |
+
- JavaScript
|
13 |
+
- Lua
|
14 |
+
- PHP
|
15 |
+
- Python
|
16 |
+
- Ruby
|
17 |
+
- Rust
|
18 |
+
- Scala
|
19 |
+
- TypeScript
|
20 |
+
library_name: transformers
|
21 |
+
pipeline_tag: text-generation
|
22 |
+
inference: false
|
23 |
+
---
|
24 |
+
# llm-jp-1.3b-v1.0
|
25 |
+
|
26 |
+
This repository provides large language models developed by [LLM-jp](https://llm-jp.nii.ac.jp/), a collaborative project launched in Japan.
|
27 |
+
|
28 |
+
| Model Variant |
|
29 |
+
| :--- |
|
30 |
+
|**Instruction models**|
|
31 |
+
| [llm-jp-13b-instruct-full-jaster-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-full-jaster-v1.0) |
|
32 |
+
| [llm-jp-13b-instruct-full-jaster-dolly-oasst-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-full-jaster-dolly-oasst-v1.0) |
|
33 |
+
| [llm-jp-13b-instruct-full-dolly-oasst-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-full-dolly-oasst-v1.0) |
|
34 |
+
| [llm-jp-13b-instruct-lora-jaster-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-lora-jaster-v1.0) |
|
35 |
+
| [llm-jp-13b-instruct-lora-jaster-dolly-oasst-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-lora-jaster-dolly-oasst-v1.0) |
|
36 |
+
| [llm-jp-13b-instruct-lora-dolly-oasst-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-lora-dolly-oasst-v1.0) |
|
37 |
+
|
38 |
+
|
39 |
+
| |
|
40 |
+
| :--- |
|
41 |
+
|**Pre-trained models**|
|
42 |
+
| [llm-jp-13b-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-v1.0) |
|
43 |
+
| [llm-jp-1.3b-v1.0](https://huggingface.co/llm-jp/llm-jp-1.3b-v1.0) |
|
44 |
+
Checkpoints format: `transformers` (Megatron-DeepSpeed format available [here](https://huggingface.co/llm-jp/llm-jp-13b-v1.0-mdsfmt))
|
45 |
+
|
46 |
+
|
47 |
+
## Required Libraries and Their Versions
|
48 |
+
|
49 |
+
- torch>=2.0.0
|
50 |
+
- transformers>=4.34.0
|
51 |
+
- tokenizers>=0.14.0
|
52 |
+
|
53 |
+
## Usage
|
54 |
+
|
55 |
+
```python
|
56 |
+
import torch
|
57 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
58 |
+
tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-1.3b-v1.0")
|
59 |
+
model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-1.3b-v1.0", torch_dtype=torch.float16)
|
60 |
+
text = "自然言語処理とは何か"
|
61 |
+
tokenized_input = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt").to(model.device)
|
62 |
+
with torch.no_grad():
|
63 |
+
output = model.generate(
|
64 |
+
tokenized_input,
|
65 |
+
max_new_tokens=100,
|
66 |
+
do_sample=True,
|
67 |
+
top_p=0.95,
|
68 |
+
temperature=0.7,
|
69 |
+
)[0]
|
70 |
+
print(tokenizer.decode(output))
|
71 |
+
```
|
72 |
+
|
73 |
+
|
74 |
+
## Model Details
|
75 |
+
|
76 |
+
- **Model type:** Transformer-based Language Model
|
77 |
+
- **Total seen tokens:** 270B+
|
78 |
+
|
79 |
+
|Model|Params|Layers|Hidden size|Heads|Context length|
|
80 |
+
|:---:|:---:|:---:|:---:|:---:|:---:|
|
81 |
+
|13b model|13b|40|5120|40|2048|
|
82 |
+
|1.3b model|1.3b|24|2048|16|2048|
|
83 |
+
|
84 |
+
|
85 |
+
## Training
|
86 |
+
|
87 |
+
- **Pre-training:**
|
88 |
+
- **Hardware:** 96 A100 40GB GPUs ([mdx cluster](https://mdx.jp/en/))
|
89 |
+
- **Software:** Megatron-DeepSpeed
|
90 |
+
|
91 |
+
- **Instruction tuning:**
|
92 |
+
- **Hardware:** 8 A100 40GB GPUs ([mdx cluster](https://mdx.jp/en/))
|
93 |
+
- **Software:** [TRL](https://github.com/huggingface/trl), [PEFT](https://github.com/huggingface/peft), and [DeepSpeed](https://github.com/microsoft/DeepSpeed)
|
94 |
+
|
95 |
+
## Tokenizer
|
96 |
+
The tokenizer of this model is based on [huggingface/tokenizers](https://github.com/huggingface/tokenizers) Unigram byte-fallback model.
|
97 |
+
The vocab entries were converted from [`llm-jp-tokenizer v2.1 (50k)`](https://github.com/llm-jp/llm-jp-tokenizer/releases/tag/v2.1).
|
98 |
+
Please refer to [README.md](https://github.com/llm-jp/llm-jp-tokenizer) of `llm-ja-tokenizer` for the details of vocab constuction steps.
|
99 |
+
- **Model:** Hugging Face Fast Tokenizer using Unigram byte-fallback model which requires `tokenizers>=0.14.0`
|
100 |
+
- **Training algorithm:** SentencePiece Unigram byte-fallback
|
101 |
+
- **Training data:** A subset of the datasets for model pre-training
|
102 |
+
- **Vocabulary size:** 50,570 (mixed vocabulary of Japanese, English, and source code)
|
103 |
+
|
104 |
+
|
105 |
+
## Datasets
|
106 |
+
|
107 |
+
### Pre-training
|
108 |
+
|
109 |
+
The models have been pre-trained on approximately 287.5B tokens, sourced from a blend of the following datasets.
|
110 |
+
|
111 |
+
| Language | Dataset | Tokens|
|
112 |
+
|:---:|:---:|:---:|
|
113 |
+
|Japanese|[Wikipedia](https://huggingface.co/datasets/wikipedia)|1.5B
|
114 |
+
||[mC4](https://huggingface.co/datasets/mc4)|136B
|
115 |
+
|English|[Wikipedia](https://huggingface.co/datasets/wikipedia)|5B
|
116 |
+
||[The Pile](https://huggingface.co/datasets/EleutherAI/pile)|135B
|
117 |
+
|Codes|[The Stack](https://huggingface.co/datasets/bigcode/the-stack)|10B
|
118 |
+
|
119 |
+
Pretraining was done by 10-hold shards that consists approx. 27-28B tokens. We further finalized the pretraining with additional cleaned 27B tokens data.
|
120 |
+
|
121 |
+
### Instruction tuning
|
122 |
+
|
123 |
+
The models have been fine-tuned on the following datasets.
|
124 |
+
|
125 |
+
| Language | Dataset | description |
|
126 |
+
|:---|:---:|:---:|
|
127 |
+
|Japanese|[jaster](https://github.com/llm-jp/llm-jp-eval)| An automatically transformed data from the existing Japanese NLP datasets |
|
128 |
+
||[databricks-dolly-15k](https://huggingface.co/datasets/databricks/databricks-dolly-15k)| A translated one by DeepL in LLM-jp |
|
129 |
+
||[OpenAssistant Conversations Dataset](https://huggingface.co/datasets/OpenAssistant/oasst1)| A translated one by DeepL in LLM-jp |
|
130 |
+
|
131 |
+
|
132 |
+
## Evaluation
|
133 |
+
You can view the evaluation results of several LLMs on this [leaderboard](http://wandb.me/llm-jp-leaderboard). We used [llm-jp-eval](https://github.com/llm-jp/llm-jp-eval) for the evaluation.
|
134 |
+
|
135 |
+
## Risks and Limitations
|
136 |
+
|
137 |
+
The models released here are still in the early stages of our research and development and have not been tuned to ensure outputs align with human intent and safety considerations.
|
138 |
+
|
139 |
+
|
140 |
+
## Send Questions to
|
141 |
+
|
142 |
+
llm-jp(at)nii.ac.jp
|
143 |
+
|
144 |
+
|
145 |
+
## License
|
146 |
+
|
147 |
+
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
148 |
+
|
149 |
+
|
150 |
+
## Model Card Authors
|
151 |
+
*The names are listed in alphabetical order.*
|
152 |
+
|
153 |
+
Namgi Han, Hirokazu Kiyomaru, Hiroshi Matsuda, Shota Sasaki, Shuhei Kurita, Taishi Nakamura, Takumi Okamoto.
|