weiqipedia
commited on
Commit
•
14b752c
1
Parent(s):
6960d2c
Update README.md
Browse files
README.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
---
|
2 |
license: cc-by-nc-sa-4.0
|
3 |
---
|
4 |
-
# SEA-LION-Instruct-NC
|
5 |
|
6 |
SEA-LION is a collection of Large Language Models (LLMs) which has been pretrained and instruct-tuned for the Southeast Asia (SEA) region.
|
7 |
The size of the models range from 3 billion to 7 billion parameters.
|
8 |
This is the card for the SEA-LION 7B Instruct (Non-Commercial) model.
|
9 |
|
|
|
|
|
10 |
SEA-LION stands for <i>Southeast Asian Languages In One Network</i>.
|
11 |
|
12 |
|
@@ -21,64 +23,39 @@ SEA-LION is built on the robust MPT architecture and has a vocabulary size of 25
|
|
21 |
|
22 |
For tokenization, the model employs our custom SEABPETokenizer, which is specially tailored for SEA languages, ensuring optimal model performance.
|
23 |
|
24 |
-
The training data for SEA-LION encompasses 980B tokens.
|
|
|
25 |
|
26 |
- **Developed by:** Products Pillar, AI Singapore
|
27 |
- **Funded by:** Singapore NRF
|
28 |
- **Model type:** Decoder
|
29 |
- **Languages:** English, Chinese, Indonesian, Malay, Thai, Vietnamese, Filipino, Tamil, Burmese, Khmer, Lao
|
30 |
-
- **License:**
|
31 |
-
|
32 |
-
|
33 |
-
## Training Details
|
34 |
|
35 |
-
###
|
36 |
|
37 |
-
SEA-LION
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
| mC4 - Chinese | 91.2B | 9.29% |
|
43 |
-
| mC4 - Indonesian | 14.7B | 1.50% |
|
44 |
-
| mC4 - Malay | 2.9B | 0.29% |
|
45 |
-
| mC4 - Filipino | 5.3B | 0.54% |
|
46 |
-
| mC4 - Burmese | 4.9B | 0.49% |
|
47 |
-
| mC4 - Vietnamese | 63.4B | 6.46% |
|
48 |
-
| mC4 - Thai | 21.6B | 2.20% |
|
49 |
-
| mC4 - Lao | 1.1B | 0.12% |
|
50 |
-
| mC4 - Khmer | 3.9B | 0.40% |
|
51 |
-
| mC4 - Tamil | 10.2B | 1.04% |
|
52 |
-
| the Stack - Python | 41.8B | 4.26% |
|
53 |
-
| the Stack - Javascript | 55.6B | 5.66% |
|
54 |
-
| the Stack - Shell | 2.5B | 0.26% |
|
55 |
-
| the Stack - SQL | 12.8B | 1.31% |
|
56 |
-
| the Stack - Markdown | 26.6B | 2.71% |
|
57 |
-
| RedPajama - StackExchange | 21.2B | 2.16% |
|
58 |
-
| RedPajama - ArXiv | 30.6B | 3.12% |
|
59 |
|
60 |
-
|
61 |
|
62 |
-
|
63 |
-
on the following hardware:
|
64 |
|
65 |
-
|
66 |
-
|----------------------|:------------:|
|
67 |
-
| AWS EC2 p4d.24xlarge | 32 instances |
|
68 |
-
| Nvidia A100 40GB GPU | 256 |
|
69 |
-
| Training Duration | 22 days |
|
70 |
|
|
|
71 |
|
72 |
-
|
73 |
|
74 |
-
|
|
75 |
-
|
76 |
-
|
|
77 |
-
|
|
78 |
-
|
|
79 |
-
|
|
80 |
-
| Global Batch Size | 2048 |
|
81 |
-
| Micro Batch Size | 4 |
|
82 |
|
83 |
|
84 |
## Technical Specifications
|
@@ -102,6 +79,27 @@ We sample 20M lines from the training data to train the tokenizer.<br>
|
|
102 |
The framework for training is [SentencePiece](https://github.com/google/sentencepiece).<br>
|
103 |
The tokenizer type is Byte-Pair Encoding (BPE).
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
|
107 |
## The Team
|
@@ -139,7 +137,7 @@ For more info, please contact us at [email protected]
|
|
139 |
|
140 |
## Disclaimer
|
141 |
|
142 |
-
This the repository for the
|
143 |
The model has _not_ been aligned for safety.
|
144 |
Developers and users should perform their own safety fine-tuning and related security measures.
|
145 |
In no event shall the authors be held liable for any claim, damages, or other liability
|
|
|
1 |
---
|
2 |
license: cc-by-nc-sa-4.0
|
3 |
---
|
4 |
+
# SEA-LION-7B-Instruct-NC
|
5 |
|
6 |
SEA-LION is a collection of Large Language Models (LLMs) which has been pretrained and instruct-tuned for the Southeast Asia (SEA) region.
|
7 |
The size of the models range from 3 billion to 7 billion parameters.
|
8 |
This is the card for the SEA-LION 7B Instruct (Non-Commercial) model.
|
9 |
|
10 |
+
For more details on the base model, please refer to the [base model's model card](https://huggingface.co/aisingapore/sealion7b).
|
11 |
+
|
12 |
SEA-LION stands for <i>Southeast Asian Languages In One Network</i>.
|
13 |
|
14 |
|
|
|
23 |
|
24 |
For tokenization, the model employs our custom SEABPETokenizer, which is specially tailored for SEA languages, ensuring optimal model performance.
|
25 |
|
26 |
+
The pre-training data for the base SEA-LION model encompasses 980B tokens.
|
27 |
+
The model was then further instruction-tuned on <b>Indonesian data only</b>.
|
28 |
|
29 |
- **Developed by:** Products Pillar, AI Singapore
|
30 |
- **Funded by:** Singapore NRF
|
31 |
- **Model type:** Decoder
|
32 |
- **Languages:** English, Chinese, Indonesian, Malay, Thai, Vietnamese, Filipino, Tamil, Burmese, Khmer, Lao
|
33 |
+
- **License:** CC BY-NC-SA 4.0 License
|
|
|
|
|
|
|
34 |
|
35 |
+
### Benchmark Performance
|
36 |
|
37 |
+
SEA-LION-7B-Instruct-NC performs better than other models of comparable size when tested on tasks in the Indonesian language.
|
38 |
|
39 |
+
We evaluated SEA-LION-7B-Instruct-NC on the [BHASA benchmark](https://arxiv.org/abs/2309.06085) and
|
40 |
+
compared it against [Llama-2-7B](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf), [Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1)
|
41 |
+
and [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b-instruct).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
+
We only evaluated it on the Indonesian tasks as the model was only instruction-tuned in Indonesian.
|
44 |
|
45 |
+
The scores shown in the tables below have been adjusted to only consider answers provided in the appropriate language.
|
|
|
46 |
|
47 |
+
For Natural Language Understanding (NLU) tasks, we tested the model on Sentiment Analysis (Sent) using the NusaX dataset, Question Answering (QA) using the TyDiQA dataset, and Toxicity Detection (Tox) using the Indonesian Multi-Label Hate Speech Detection dataset. The metrics used are F1 score for all three tasks.
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
For Natural Language Generation (NLG) tasks, we tested the model on Machine Translation from English to Indonesian (MT-EN-ID) and from Indonesian to English (MT-ID-EN) using the FLORES-200 dataset, and Abstractive Summarization (AbsSum) using the XLSum dataset. The metrics used for Machine Translation are ChrF++ and COMET22, and ROUGE-L is used for Abstractive Summarization.
|
50 |
|
51 |
+
For Natural Language Reasoning (NLR) tasks, we tested the model on Natural Language Inference (NLI) using the IndoNLI lay dataset and on Causal Reasoning (Causal) using the XCOPA dataset. The metrics are accuracy for both tasks.
|
52 |
|
53 |
+
| Model Name | Sent (F1) | QA (F1) | Tox (F1) | MT-EN-ID (ChrF++)| (COMET22)| MT-ID-EN (ChrF++)| (COMET22)| AbsSum (ROUGE-L)| NLI (Acc) | Causal (Acc) |
|
54 |
+
|--------------------------|-----------|----------|----------|------------------|----------|------------------|----------|-----------------|-----------|-------------|
|
55 |
+
| sealion7b-instruct-nc | **76.13** | 24.86 | **24.45**| **52.50** | **86.97**| 46.82 | 81.34 | **15.44** | **33.20** | **23.80** |
|
56 |
+
| Mistral-7B-Instruct-v0.1 | 73.66 | **26.08**| 18.60 | 31.08 | 55.29 | 51.20 | 82.38 | 14.41 | 29.20 | 11.00 |
|
57 |
+
| Llama-2-7b-chat-hf | 41.92 | 4.23 | 0.00 | 47.96 | 77.86 | **55.76** | **86.08**| 4.59 | 0.00 | 0.00 |
|
58 |
+
| falcon-7b-instruct | 0.00 | 8.47 | 7.21 | 1.66 | 30.07 | 16.82 | 46.32 | 1.55 | 0.00 | 2.20 |
|
|
|
|
|
59 |
|
60 |
|
61 |
## Technical Specifications
|
|
|
79 |
The framework for training is [SentencePiece](https://github.com/google/sentencepiece).<br>
|
80 |
The tokenizer type is Byte-Pair Encoding (BPE).
|
81 |
|
82 |
+
### Example Usage
|
83 |
+
|
84 |
+
```python
|
85 |
+
# Please use transformers==4.34.1
|
86 |
+
|
87 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
88 |
+
|
89 |
+
tokenizer = AutoTokenizer.from_pretrained("aisingapore/sealion7b-instruct-nc", trust_remote_code=True)
|
90 |
+
model = AutoModelForCausalLM.from_pretrained("aisingapore/sealion7b-instruct-nc", trust_remote_code=True)
|
91 |
+
|
92 |
+
prompt_template = "### USER:\n{human_prompt}\n\n### RESPONSE:\n"
|
93 |
+
prompt = """Apa sentimen dari kalimat berikut ini?
|
94 |
+
Kalimat: Buku ini sangat membosankan.
|
95 |
+
Jawaban: """
|
96 |
+
full_prompt = prompt_template.format(human_prompt=prompt)
|
97 |
+
|
98 |
+
tokens = tokenizer(full_prompt, return_tensors="pt")
|
99 |
+
output = model.generate(tokens["input_ids"], max_new_tokens=20, eos_token_id=tokenizer.eos_token_id)
|
100 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
101 |
+
|
102 |
+
```
|
103 |
|
104 |
|
105 |
## The Team
|
|
|
137 |
|
138 |
## Disclaimer
|
139 |
|
140 |
+
This the repository for the non-commercial instruction-tuned model.
|
141 |
The model has _not_ been aligned for safety.
|
142 |
Developers and users should perform their own safety fine-tuning and related security measures.
|
143 |
In no event shall the authors be held liable for any claim, damages, or other liability
|