multilingual
sea
maljunied commited on
Commit
cd0e8a4
ยท
1 Parent(s): 0252317

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +16 -16
README.md CHANGED
@@ -19,26 +19,26 @@ inference: false
19
 
20
  We introduce SeaLLM - a family of language models optimized for Southeast Asian (SEA) languages. The SeaLLM-base models (to be released) were pre-trained from [Llama-2](https://huggingface.co/meta-llama/Llama-2-13b-hf), on a tailored publicly-available dataset, which comprises mainly Vietnamese ๐Ÿ‡ป๐Ÿ‡ณ, Indonesian ๐Ÿ‡ฎ๐Ÿ‡ฉ and Thai ๐Ÿ‡น๐Ÿ‡ญ texts, along with those in English ๐Ÿ‡ฌ๐Ÿ‡ง and Chinese ๐Ÿ‡จ๐Ÿ‡ณ. The pre-training stage involves multiple stages with dynamic data control to preserve the original knowledge base of Llama-2 while gaining new abilities in SEA languages.
21
 
22
- The [SeaLLM-chat](https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b) model underwent supervised finetuning (SFT) on a mix of public instruction data (e.g. [OpenORCA](https://huggingface.co/datasets/Open-Orca/OpenOrca)) and a small internally-collected amount of natural queries from SEA native speakers, which **adapt to the local cultural norms, customs, styles and laws in these regions**, as well as other SFT enhancement techniques (to be revealed later).
23
 
24
  Our customized SFT process helps enhance our models' ability to understand, respond and serve communities whose languages are often neglected by previous [English-dominant LLMs](https://arxiv.org/abs/2307.09288), while outperforming existing polyglot LLMs, like [BLOOM](https://arxiv.org/abs/2211.05100) or [PolyLM](https://arxiv.org/pdf/2307.06018.pdf).
25
 
26
- Our [first released SeaLLM](https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b) supports Vietnamese ๐Ÿ‡ป๐Ÿ‡ณ, Indonesian ๐Ÿ‡ฎ๐Ÿ‡ฉ and Thai ๐Ÿ‡น๐Ÿ‡ญ. Future verions endeavor to cover all languages spoken in Southeast Asia.
27
 
28
  - DEMO: [SeaLLMs/SeaLLM-Chat-13b](https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b)
29
  - Model weights: To be released.
30
  - Technical report: To be released.
31
 
32
  <blockquote style="color:red">
33
- <p><strong style="color: red">Terms of Use</strong>: By using our released weights, codes and demos, you agree and comply with the following terms and conditions:</p>
34
  <ul>
35
  <li>Follow LLama-2 <a rel="noopener nofollow" href="https://ai.meta.com/llama/license/">License</a> and <a rel="noopener nofollow" href="https://ai.meta.com/llama/use-policy/">Terms of Use</a>.</li>
36
- <li>Strictly comply with the local regulations where you operate at and not attempt to generate or illicit our models to generate locally and internationally illegal and inappropriate content.</li>
37
  </ul>
38
  </blockquote>
39
 
40
  > **Disclaimer**:
41
- > We must note that even though the weights, codes and demos are released in an open manner, similar to other pre-trained language models, and despite our best effort in red teaming and safety finetuning and enforcement, our models come with potential risks influenced by complex factors, including but not limited to over-diversified, inaccurate, misleading or potentially harmful generation.
42
  > Developers and stakeholders should perform their own red teaming and provide related security measures before deployment, and they must abide by and comply with local governance and regulations.
43
  > In no event shall the authors be held liable for any claim, damages, or other liability arising from the use of the released weights, codes or demos.
44
 
@@ -49,11 +49,11 @@ The following sections summarize the [Pre-training](#pre-training), [Supervised-
49
  ## Pre-training
50
 
51
  ### Vocabulary Expansion
52
- Like many English/Latin-dominant LLMs, Llama-2's BPE tokenizer breaks non-european and non-latin linguistic texts into unsustainably long byte-level sequences that cover much shorter semantic meanings, leading to [degraded performance](https://arxiv.org/abs/2306.11372). For instance, it takes 4.3x more tokens to encode the same sentence in Thai compared to that in English. This leads to the models failing to perform summarization and comprehension tasks without exceeding the context length.
53
 
54
  Our goal for vocabulary expansion is threefold: (1) the number of newly-added tokens must be minimal and only cover the new languages, (2) the tokens should bring the compression ratios of new languages close to that of English, and (3) minimize the disruption of existing European tokens to preserve Llama-2 knowledge. In the end, we obtain **~11K** new tokens for Vi, Id, Th and Zh to augment the original 32000-token vocabulary. Details of our expansion technique will be revealed in our upcoming technical report.
55
 
56
- As seen in the below table, our new vocabulary reduce the compression ratio from 4.29 to 1.57 for Thai, meaning it can now encode 2.7x longer Thai text given the same context length. Meanwhile, English is only compressed by 0.3%, thus preserving its integrity.
57
 
58
  |Language | Llama's ratio | Our ratio | # New tokens
59
  | --- | --- | --- | --- |
@@ -70,9 +70,9 @@ As seen in the below table, our new vocabulary reduce the compression ratio from
70
 
71
  ### Pre-training Strategies
72
 
73
- We conduct pre-training in 4 different stages. Each stage serves different specific objectives and involves dynamic control of data mixture, both unsupervised and supervised, and data specification and categorization. We also employ a novel sequence construction and masking techniques during these stages. More details are to be provided in the technical report.
74
 
75
- As our goal is for Llama-2 to learn new languages with the least number tokens and computing resources, we control appropriate data mix of new (Vi, Id & Th) and old (En, Zh) languages so that the new vocabulary and knowledge is trained quickly, while relatively maintaining the performance of the original Llama-2 model and establishing a knowledge bridge between new and existing languages.
76
 
77
  We pre-train our SeaLLM-base in ~4 weeks on 32gpus, clocking ~150B tokens.
78
 
@@ -80,13 +80,13 @@ We pre-train our SeaLLM-base in ~4 weeks on 32gpus, clocking ~150B tokens.
80
 
81
  ### SFT Data
82
 
83
- Our supervised finetuning (SFT) data consists of many categories. The largests of them are public and open-source, such as [OpenORCA](https://huggingface.co/datasets/Open-Orca/OpenOrca) and [Platypus](https://huggingface.co/datasets/garage-bAInd/Open-Platypus). As the aforementioned is monolingual, we employ several established or novel automatic techniques to gather more instruction data for SEA languages.
84
 
85
- More importantly, we engaged native speakers to collect a small amount of natural queries and responses data, which adapts to the local cultural customs, norms and laws. We also collect country-relevant safety data that covers many culturally and legally sensitive topics in each of these countries, which are often ignored, or even in conflict, with western safety data. Therefore, we believe our models are more local-friendly and abide by local rules to a higher degree.
86
 
87
  ### SFT Strategies
88
 
89
- We conduct SFT with a relatively balanced mix of SFT data from different categories. We make use of the system prompt during training, as we found it helps induce a prior which conditions the model to a behavioral distribution that focus on safety and usefulness. More details will be provided in the technical report.
90
 
91
 
92
  ## Evaluation
@@ -94,7 +94,7 @@ We conduct SFT with a relatively balanced mix of SFT data from different categor
94
  ### Peer Comparison
95
 
96
  One of the most reliable ways to compare chatbot models is peer comparison.
97
- With the help of native speakers, we built an instruction test set that focus on various aspects expected in a user-facing chatbot, namely"
98
  (1) NLP tasks (e.g. translation & comprehension), (2) Reasoning, (3) Instruction-following and
99
  (4) Natural and Informal questions. The test set also covers all languages that we are concerned with.
100
 
@@ -130,7 +130,7 @@ As shown in the table, our SeaLLM model outperforms most 13B baselines and reach
130
 
131
  ### MMLU - Preserving English-based knowledge
132
 
133
- On the 5-shot [MMLU](https://arxiv.org/abs/2009.03300), our SeaLLM models not only preserve but also slightly outperform 13B LLama-2 and Llama-2-chat, despite the fact that we never intent to optimize for this English and Chinese dominant test set.
134
 
135
  | MMLU (Acc) | STEM | Humanities | Social | Others | Average
136
  |-----------| ------- | ------- | ------- | ------- | ------- |
@@ -146,7 +146,7 @@ We also test our models on many different NLP tasks.
146
 
147
  #### Reading Comprehension (XQUAD & IndoQA)
148
 
149
- [XQUAD](https://github.com/google-deepmind/xquad) is a popular multilingual variant of [SQUAD](https://www.aclweb.org/anthology/D16-1264/) benchmark, which evaluates models on reading comprehension ability. As XQUAD does not support Indonesian, we substitute it with [IndoQA](https://huggingface.co/datasets/jakartaresearch/indoqa), which was built for the same purpose.
150
 
151
  As shown in the table below, the 1-shot reading comprehension performance is significantly better than Llama-2 for the SEA languages, while preserving the high performance in existing languages (En & Zh).
152
 
@@ -196,7 +196,7 @@ If you find our project useful, hope you can star our repo and cite our work as
196
 
197
  ```
198
  @article{damonlpsg2023seallm,
199
- author = {Xuan-Phi Nguyen*, Wenxuan Zhang*, Xin Li*, Sharifah Mahani Aljunied*, Qingyu Tan, Liying Cheng, Guanzheng Chen, Yue Deng, Sen Yang, Chaoqun Liu, Hang Zhang, Lidong Bing},
200
  title = {SeaLLMs - Large Language Models for Southeast Asia},
201
  year = 2023,
202
  }
 
19
 
20
  We introduce SeaLLM - a family of language models optimized for Southeast Asian (SEA) languages. The SeaLLM-base models (to be released) were pre-trained from [Llama-2](https://huggingface.co/meta-llama/Llama-2-13b-hf), on a tailored publicly-available dataset, which comprises mainly Vietnamese ๐Ÿ‡ป๐Ÿ‡ณ, Indonesian ๐Ÿ‡ฎ๐Ÿ‡ฉ and Thai ๐Ÿ‡น๐Ÿ‡ญ texts, along with those in English ๐Ÿ‡ฌ๐Ÿ‡ง and Chinese ๐Ÿ‡จ๐Ÿ‡ณ. The pre-training stage involves multiple stages with dynamic data control to preserve the original knowledge base of Llama-2 while gaining new abilities in SEA languages.
21
 
22
+ The [SeaLLM-chat](https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b) model underwent supervised finetuning (SFT) on a mix of public instruction data (e.g. [OpenORCA](https://huggingface.co/datasets/Open-Orca/OpenOrca)) and a small amount of queries used by SEA language native speakers in natural settings, which **adapt to the local cultural norms, customs, styles and laws in these areas**, as well as other SFT enhancement techniques (to be revealed later).
23
 
24
  Our customized SFT process helps enhance our models' ability to understand, respond and serve communities whose languages are often neglected by previous [English-dominant LLMs](https://arxiv.org/abs/2307.09288), while outperforming existing polyglot LLMs, like [BLOOM](https://arxiv.org/abs/2211.05100) or [PolyLM](https://arxiv.org/pdf/2307.06018.pdf).
25
 
26
+ Our [first released SeaLLM](https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b) supports Vietnamese ๐Ÿ‡ป๐Ÿ‡ณ, Indonesian ๐Ÿ‡ฎ๐Ÿ‡ฉ and Thai ๐Ÿ‡น๐Ÿ‡ญ. Future versions endeavor to cover all languages spoken in Southeast Asia.
27
 
28
  - DEMO: [SeaLLMs/SeaLLM-Chat-13b](https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b)
29
  - Model weights: To be released.
30
  - Technical report: To be released.
31
 
32
  <blockquote style="color:red">
33
+ <p><strong style="color: red">Terms of Use</strong>: By using our released weights, codes and demos, you agree to and comply with the following terms and conditions:</p>
34
  <ul>
35
  <li>Follow LLama-2 <a rel="noopener nofollow" href="https://ai.meta.com/llama/license/">License</a> and <a rel="noopener nofollow" href="https://ai.meta.com/llama/use-policy/">Terms of Use</a>.</li>
36
+ <li>Strictly comply with the local regulations from where you operate, and not attempt to generate or elicit content that are locally or internationally illegal and inappropriate from our models.</li>
37
  </ul>
38
  </blockquote>
39
 
40
  > **Disclaimer**:
41
+ > We must note that even though the weights, codes and demos are released in an open manner, similar to other pre-trained language models, and despite our best effort in red teaming and safety finetuning and enforcement, our models come with potential risks. These risks are influenced by various complex factors, including but not limited to over-diversified, inaccurate, misleading or potentially harmful generation.
42
  > Developers and stakeholders should perform their own red teaming and provide related security measures before deployment, and they must abide by and comply with local governance and regulations.
43
  > In no event shall the authors be held liable for any claim, damages, or other liability arising from the use of the released weights, codes or demos.
44
 
 
49
  ## Pre-training
50
 
51
  ### Vocabulary Expansion
52
+ Like many English/Latin-dominant LLMs, Llama-2's BPE tokenizer breaks non-European and non-latin linguistic texts into unsustainably long byte-level sequences that cover much shorter semantic meanings, leading to [degraded performance](https://arxiv.org/abs/2306.11372). For instance, it takes 4.3x more tokens to encode the same sentence in Thai compared to that in English. This leads to the models failing to perform summarization and comprehension tasks without exceeding the context length.
53
 
54
  Our goal for vocabulary expansion is threefold: (1) the number of newly-added tokens must be minimal and only cover the new languages, (2) the tokens should bring the compression ratios of new languages close to that of English, and (3) minimize the disruption of existing European tokens to preserve Llama-2 knowledge. In the end, we obtain **~11K** new tokens for Vi, Id, Th and Zh to augment the original 32000-token vocabulary. Details of our expansion technique will be revealed in our upcoming technical report.
55
 
56
+ As seen in the table below, our new vocabulary reduce the compression ratio from 4.29 to 1.57 for Thai - meaning it can now encode 2.7x longer Thai text given the same context length. Meanwhile, English is only compressed by 0.3%, thus preserving its integrity.
57
 
58
  |Language | Llama's ratio | Our ratio | # New tokens
59
  | --- | --- | --- | --- |
 
70
 
71
  ### Pre-training Strategies
72
 
73
+ We conduct pre-training in 4 different stages. Each stage serves a different specific objective and involves dynamic control of (unsupervised and supervised) data mixture, as well as data specification and categorization. We also employ a novel sequence construction and masking techniques during these stages. More details are to be provided in the technical report.
74
 
75
+ As our goal is for Llama-2 to learn new languages with the least number tokens and computing resources, we control an appropriate data mix of new (Vi, Id & Th) and old (En, Zh) languages so that the new vocabulary and knowledge are trained quickly, while relatively maintaining the performance of the original Llama-2 model and establishing a knowledge bridge between new and existing languages.
76
 
77
  We pre-train our SeaLLM-base in ~4 weeks on 32gpus, clocking ~150B tokens.
78
 
 
80
 
81
  ### SFT Data
82
 
83
+ Our supervised finetuning (SFT) data consists of many categories. The largest of them are public and open-source, such as [OpenORCA](https://huggingface.co/datasets/Open-Orca/OpenOrca) and [Platypus](https://huggingface.co/datasets/garage-bAInd/Open-Platypus). As the aforementioned are monolingual, we employ several established or novel automatic techniques to gather more instruction data for SEA languages.
84
 
85
+ Even more noteworthy is that we engaged native speakers to collect a small amount of queries used by SEA-languages native speakers in natural settings, which helps in adaptation to the local cultural customs, norms and laws. We also collect country-relevant safety data that cover many culturally and legally sensitive topics in each of these SEA countries - such data tend to be ignored, or may even appear in conflict with western safety data. Therefore, we believe that our models are more local-friendly and abide by local rules to a higher degree.
86
 
87
  ### SFT Strategies
88
 
89
+ We conduct SFT with a relatively balanced mix of SFT data from different categories. We make use of the system prompt during training, as we found it helps induce a prior which conditions the model to a behavioral distribution that focuses on safety and usefulness. More details will be provided in the technical report.
90
 
91
 
92
  ## Evaluation
 
94
  ### Peer Comparison
95
 
96
  One of the most reliable ways to compare chatbot models is peer comparison.
97
+ With the help of native speakers, we built an instruction test set that focuses on various aspects expected in a user-facing chatbot, namely:
98
  (1) NLP tasks (e.g. translation & comprehension), (2) Reasoning, (3) Instruction-following and
99
  (4) Natural and Informal questions. The test set also covers all languages that we are concerned with.
100
 
 
130
 
131
  ### MMLU - Preserving English-based knowledge
132
 
133
+ On the 5-shot [MMLU](https://arxiv.org/abs/2009.03300), our SeaLLM models not only preserve but also slightly outperform 13B LLama-2 and Llama-2-chat, despite the fact that optimizing for this English and Chinese dominant test set is not part of our goal.
134
 
135
  | MMLU (Acc) | STEM | Humanities | Social | Others | Average
136
  |-----------| ------- | ------- | ------- | ------- | ------- |
 
146
 
147
  #### Reading Comprehension (XQUAD & IndoQA)
148
 
149
+ [XQUAD](https://github.com/google-deepmind/xquad) is a popular multilingual variant of [SQUAD](https://www.aclweb.org/anthology/D16-1264/) benchmark, which evaluates models on reading comprehension ability. As XQUAD does not support Indonesian, we substitute it with [IndoQA](https://huggingface.co/datasets/jakartaresearch/indoqa), which was created for the same purpose.
150
 
151
  As shown in the table below, the 1-shot reading comprehension performance is significantly better than Llama-2 for the SEA languages, while preserving the high performance in existing languages (En & Zh).
152
 
 
196
 
197
  ```
198
  @article{damonlpsg2023seallm,
199
+ author = {Xuan-Phi Nguyen*, Wenxuan Zhang*, Xin Li*, Mahani Aljunied*, Qingyu Tan, Liying Cheng, Guanzheng Chen, Yue Deng, Sen Yang, Chaoqun Liu, Hang Zhang, Lidong Bing},
200
  title = {SeaLLMs - Large Language Models for Southeast Asia},
201
  year = 2023,
202
  }