Initial Commit
Browse files
README.md
CHANGED
@@ -1,3 +1,152 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- id
|
5 |
+
- ta
|
6 |
+
- th
|
7 |
+
- vi
|
8 |
+
license: gemma
|
9 |
+
---
|
10 |
+
# Gemma2 9B CPT SEA-LIONv3.0 Instruct
|
11 |
+
|
12 |
+
SEA-LION is a collection of Large Language Models (LLMs) which has been pretrained and instruct-tuned for the Southeast Asia (SEA) region.
|
13 |
+
|
14 |
+
Gemma2 9B CPT SEA-LIONv3.0 Instruct is a multilingual model which has been fine-tuned with around **500,000 English instruction-completion pairs** alongside a larger pool of around **1,000,000 instruction-completion pairs** from other ASEAN languages, such as Indonesian, Thai and Vietnamese.
|
15 |
+
|
16 |
+
SEA-LION stands for _Southeast Asian Languages In One Network_.
|
17 |
+
|
18 |
+
- **Developed by:** Products Pillar, AI Singapore
|
19 |
+
- **Funded by:** Singapore NRF
|
20 |
+
- **Model type:** Decoder
|
21 |
+
- **Languages:** English, Indonesian, Thai, Vietnamese, Tamil
|
22 |
+
- **License:** [Gemma Community License](https://ai.google.dev/gemma/terms)
|
23 |
+
|
24 |
+
## Model Details
|
25 |
+
|
26 |
+
### Model Description
|
27 |
+
We performed instruction tuning in English and also in ASEAN languages such as Indonesian, Thai and Vietnamese on our [continued pre-trained Gemma2 9B CPT SEA-LIONv3](https://huggingface.co/aisingapore/gemma2-9b-cpt-sea-lionv3-base), a decoder model using the Gemma2 architecture, to create Gemma2 9B CPT SEA-LIONv3.0 Instruct.
|
28 |
+
|
29 |
+
The model has a context length of 8192.
|
30 |
+
|
31 |
+
### Benchmark Performance
|
32 |
+
We evaluated Gemma2 9B CPT SEA-LIONv3.0 Instruct on both general language capabilities and instruction-following capabilities.
|
33 |
+
|
34 |
+
#### General Language Capabilities
|
35 |
+
For the evaluation of general language capabilities, we employed the [BHASA evaluation benchmark](https://arxiv.org/abs/2309.06085v2) across a variety of tasks.
|
36 |
+
These tasks include Question Answering (QA), Sentiment Analysis (Sentiment), Toxicity Detection (Toxicity), Translation in both directions (Eng>Lang & Lang>Eng), Abstractive Summarization (Summ), Causal Reasoning (Causal) and Natural Language Inference (NLI).
|
37 |
+
|
38 |
+
Note: BHASA is implemented following a strict answer format, and only spaces and punctuations are cleaned. For tasks where options are provided, the answer should only include one of the pre-defined options, nothing else. If the model continues to generate more tokens (e.g. to explain its answer), it will be considered to be a wrong response. For the F1 score metric (as used in Sentiment Analysis and Toxicity Detection), all answers that do not fall under the pre-defined labels will be treated as a separate label (to mark it as a wrong answer) and included in the calculations so that the model is penalized for not generating one of the pre-defined labels.
|
39 |
+
|
40 |
+
The evaluation was done zero-shot with native prompts and only a sample of 100-1000 instances for each dataset was used as per the setting described in the paper.
|
41 |
+
|
42 |
+
|
43 |
+
#### Instruction-following Capabilities
|
44 |
+
Since Gemma2 9B CPT SEA-LIONv3.0 Instruct is an instruction-following model, we also evaluated it on instruction-following capabilities with two datasets, [IFEval](https://arxiv.org/abs/2311.07911) and [MT-Bench](https://arxiv.org/abs/2306.05685).
|
45 |
+
|
46 |
+
As these two datasets were originally in English, the linguists and native speakers in the team worked together to filter, localize and translate the datasets into the respective target languages to ensure that the examples remained reasonable, meaningful and natural.
|
47 |
+
|
48 |
+
**IFEval**
|
49 |
+
|
50 |
+
IFEval evaluates a model's ability to adhere to constraints provided in the prompt, for example beginning a response with a specific word/phrase or answering with a certain number of sections. The metric used is accuracy normalized by language (if the model performs the task correctly but responds in the wrong language, it is judged to have failed the task).
|
51 |
+
|
52 |
+
|
53 |
+
**MT-Bench**
|
54 |
+
|
55 |
+
MT-Bench evaluates a model's ability to engage in multi-turn (2 turns) conversations and respond in ways that align with human needs. We use `gpt-4-1106-preview` as the judge model and compare against `gpt-3.5-turbo-0125` as the baseline model. The metric used is the weighted win rate against the baseline model (i.e. average win rate across each category (Math, Reasoning, STEM, Humanities, Roleplay, Writing, Extraction)). A tie is given a score of 0.5.
|
56 |
+
|
57 |
+
|
58 |
+
For more details on Gemma2 9B CPT SEA-LIONv3.0 Instruct benchmark performance, please refer to the SEA HELM leaderboard, https://leaderboard.sea-lion.ai/
|
59 |
+
|
60 |
+
|
61 |
+
### Usage
|
62 |
+
Gemma2 9B CPT SEA-LIONv3.0 Instruct can be run using the 🤗 Transformers library
|
63 |
+
```python
|
64 |
+
# Please use transformers==4.43.2
|
65 |
+
|
66 |
+
import transformers
|
67 |
+
import torch
|
68 |
+
|
69 |
+
model_id = "aisingapore/gemma2-9b-cpt-sea-lionv3.0-instruct"
|
70 |
+
|
71 |
+
pipeline = transformers.pipeline(
|
72 |
+
"text-generation",
|
73 |
+
model=model_id,
|
74 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
75 |
+
device_map="auto",
|
76 |
+
)
|
77 |
+
messages = [
|
78 |
+
{"role": "user", "content": "Apa sentimen dari kalimat berikut ini?\nKalimat: Buku ini sangat membosankan.\nJawaban: "},
|
79 |
+
]
|
80 |
+
|
81 |
+
outputs = pipeline(
|
82 |
+
messages,
|
83 |
+
max_new_tokens=256,
|
84 |
+
)
|
85 |
+
print(outputs[0]["generated_text"][-1])
|
86 |
+
```
|
87 |
+
|
88 |
+
### Caveats
|
89 |
+
It is important for users to be aware that our model exhibits certain limitations that warrant consideration. Like many LLMs, the model can hallucinate and occasionally generates irrelevant content, introducing fictional elements that are not grounded in the provided context. Users should also exercise caution in interpreting and validating the model's responses due to the potential inconsistencies in its reasoning.
|
90 |
+
|
91 |
+
## Limitations
|
92 |
+
### Safety
|
93 |
+
|
94 |
+
Current SEA-LION models, including this commercially permissive release, have not been aligned for safety. Developers and users should perform their own safety fine-tuning and related security measures. In no event shall the authors be held liable for any claim, damages, or other liability arising from the use of the released weights and codes.
|
95 |
+
|
96 |
+
## Technical Specifications
|
97 |
+
### Fine-Tuning Details
|
98 |
+
The Gemma2 9B CPT SEA-LIONv3.0 Instruct was fully fine-tuned, and aligned using 8x H100-80GB.
|
99 |
+
|
100 |
+
## Data
|
101 |
+
Gemma2 9B CPT SEA-LIONv3.0 Instruct was trained on a wide range of synthetic instructions alongside those hand-curated by the team, with the assistance of native speakers. In addition, special care was taken to ensure that the datasets used had commercially permissive licenses through verification with the original data source.
|
102 |
+
|
103 |
+
## Call for Contributions
|
104 |
+
We encourage researchers, developers, and language enthusiasts to actively contribute to the enhancement and expansion of SEA-LION. Contributions can involve identifying and reporting bugs, sharing pre-training, instruction, and preference data, improving documentation usability, proposing and implementing new model evaluation tasks and metrics, or training versions of the model in additional Southeast Asian languages. Join us in shaping the future of SEA-LION by sharing your expertise and insights to make these models more accessible, accurate, and versatile. Please check out our GitHub for further information on the call for contributions.
|
105 |
+
|
106 |
+
## The Team
|
107 |
+
|
108 |
+
Choa Esther<br>
|
109 |
+
Cheng Nicholas<br>
|
110 |
+
Huang Yuli<br>
|
111 |
+
Lau Wayne<br>
|
112 |
+
Lee Chwan Ren<br>
|
113 |
+
Leong Wai Yi<br>
|
114 |
+
Leong Wei Qi<br>
|
115 |
+
Li Yier<br>
|
116 |
+
Liu Bing Jie Darius<br>
|
117 |
+
Lovenia Holy<br>
|
118 |
+
Montalan Jann Railey<br>
|
119 |
+
Ng Boon Cheong Raymond<br>
|
120 |
+
Ngui Jian Gang<br>
|
121 |
+
Nguyen Thanh Ngan<br>
|
122 |
+
Ong Brandon<br>
|
123 |
+
Ong Tat-Wee David<br>
|
124 |
+
Ong Zhi Hao<br>
|
125 |
+
Rengarajan Hamsawardhini<br>
|
126 |
+
Siow Bryan<br>
|
127 |
+
Susanto Yosephine<br>
|
128 |
+
Tai Ngee Chia<br>
|
129 |
+
Tan Choon Meng<br>
|
130 |
+
Teo Eng Sipp Leslie<br>
|
131 |
+
Teo Wei Yi<br>
|
132 |
+
Tjhi William<br>
|
133 |
+
Teng Walter<br>
|
134 |
+
Yeo Yeow Tong<br>
|
135 |
+
Yong Xianbin<br>
|
136 |
+
|
137 |
+
## Acknowledgements
|
138 |
+
|
139 |
+
[AI Singapore](https://aisingapore.org/) is a national programme supported by the National Research Foundation, Singapore and hosted by the National University of Singapore. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of the National Research Foundation or the National University of Singapore.
|
140 |
+
|
141 |
+
## Contact
|
142 |
+
|
143 |
+
For more info, please contact us using this [SEA-LION Inquiry Form](https://forms.gle/sLCUVb95wmGf43hi6)
|
144 |
+
|
145 |
+
[Link to SEA-LION's GitHub repository](https://github.com/aisingapore/sealion)
|
146 |
+
|
147 |
+
## Disclaimer
|
148 |
+
|
149 |
+
This is the repository for the commercial instruction-tuned model.
|
150 |
+
The model has _not_ been aligned for safety.
|
151 |
+
Developers and users should perform their own safety fine-tuning and related security measures.
|
152 |
+
In no event shall the authors be held liable for any claims, damages, or other liabilities arising from the use of the released weights and codes.
|