Update README.md
Browse files33 unmodified lines34353637383940414243443 unmodified lines484950515253549 unmodified lines6465666768697071727374757677787980818283842 unmodified lines8788899091929394959697989912 unmodified lines11211311411511611711814 unmodified lines1331341351361371381398 unmodified lines14814915015115215315434 unmodified lines1891901911921931941951961 unmodified line1981992002012022032042052061 unmodified line20820921021121221321433 unmodified lines<a href="https://arxiv.org/pdf/2312.00738.pdf" target="_blank" rel="noopener">Technical Report</a></p>We introduce SeaLLMs - 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 texts in Vietnamese ๐ป๐ณ, Indonesian ๐ฎ๐ฉ, Thai ๐น๐ญ, Malay ๐ฒ๐พ, Khmer๐ฐ๐ญ, Lao๐ฑ๐ฆ, Tagalog๐ต๐ญ and Burmese๐ฒ๐ฒ. The [SeaLLM-chat](https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b) underwent supervised finetuning (SFT) and specialized self-preferencing DPO using a mix of public instruction data and a small number 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**.SeaLLM-13b models exhibit superior performance across a wide spectrum of linguistic tasks and assistant-style instruction-following capabilities relative to comparable open-source models. Moreover, they outperform **ChatGPT-3.5** in non-Latin languages, such as Thai, Khmer, Lao, and Burmese.- DEMO: [SeaLLMs/SeaLLM-Chat-13b](https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b) DEMO allows **batch-inference** for evaluation purpose.- Model weights: To be released.- Technical report: [Arxiv: SeaLLMs - Large Language Models for Southeast Asia](https://arxiv.org/pdf/2312.00738.pdf).3 unmodified lines</blockquote>> **Disclaimer**:> 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 efforts in red teaming and safety finetuning and enforcement, our models come with potential risks, including but not limited to inaccurate, misleading or potentially harmful generation.> 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.> 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.9 unmodified linesOne of the most reliable ways to compare chatbot models is peer comparison.With the help of native speakers, we built an instruction test set, called [Sea-bench](https://huggingface.co/datasets/SeaLLMs/Sea-bench) that focuses on various aspects expected in a user-facing chatbot, namely:(1) task-solving (e.g. translation & comprehension),(2) math-reasoning (e.g., math and logical reasoning questions),(3) general-instruction (e.g., instructions in general domains),(4) natural-questions (e.g., questions about local context often written informally), and(5) safety-related questions.The test set also covers all languages that we are concerned with.Similar to [MT-bench](https://huggingface.co/spaces/lmsys/mt-bench), We use **GPT-4** as an evaluator to rate the comparison between our models versus ChatGPT-3.5 and other baselines.We evaluate Sea-bench in 2 mode: Score-based grading (0 to 10) and Peer comparison.As shown in the figure above, as aggregated by task category (left radar chart), our SeaLLM-13b model performs on-par or surpasses ChatGPT-3.5 across many linguistic and writing tasks. This is despite [reported evidence](https://arxiv.org/abs/2309.17012) that GPT-4 evaluator may favor ChatGPT more often than humans do.Comparing instruction-following capabilities of models in the angle of different SEA languages. As shown, SeaLLM-13b outperforms ChatGPT-3.5 by large margins in most non-Latin languages, such as Burmese (Mya), Lao, Khmer and Thai. In combination with the fact that SeaLLM can encode these languages with up to 9 times fewer tokens, our models are not only superior but also cheaper to operate in these languages than ChatGPT. This helps democratize the benefits of large language models to under-represented and potentially developing communities.<div class="row" style="display: flex; clear: both;">2 unmodified lines</div>We also compare our model head-on with ChatGPT in peer comparison, as seen above. SeaLLM-13b is equal or better than ChatGPT for up to 40% of the times for Latin-based languages (Eng, Vie, Ind, Msa). In contrast, for non-Latin languages, our SeaLLM-13b surpasses ChatGPT by up to 90%.### Safety Enchancement in Local ContextThere is growing [evidence](https://arxiv.org/pdf/2310.06474.pdf) that western-built LLMs often neglect safety protection in many lower-resource languages, or even promote contents that may be locally perceived as harmful, inappropriate or illegal by local norms and laws. We take efforts in adapting and safeguarding our SeaLLM models to achieve greater adoption and compliance for the regional audience of Southeast Asia.The below dropdown table showcases examples of potentially harmful content that ChatGPT generates whereas our model behaves safer and complies with the regulations.<details><summary><span style="color: red">WARNING:</span> The dropdown will display potentially harmful content.</summary>12 unmodified lines### M3Exam - World Knowledge in Regional Languages[M3Exam](https://arxiv.org/pdf/2306.05179.pdf) is a collection of real-life and native official human exam question benchmarks. This benchmark covers questions from multiple countries in the SEA region, which require strong multilingual proficiency and cultural knowledge across various critical educational periods, from primary- to high-school levels of difficulty.As shown in the table, our SeaLLM model outperforms most 13B baselines and reaches closer to ChatGPT's performance.Notably, for Thai - a seemingly low-resource language, our model is just 1% behind ChatGPT despite the large size difference.14 unmodified lines### MMLU - Preserving English-based knowledgeOn 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 dominant test set is not part of our goal.| MMLU (Acc) | Average|----------- | ------- |8 unmodified linesWe use the [Flores-200](https://huggingface.co/datasets/facebook/flores) to to test our models ability in machine translation. As shown in above figure, SeaLLM-13B exhibits clear superiority over ChatGPT-3.5 in low-resource languages, such as Lao and Khmer, while maintaining comparable performance with ChatGPT-3.5 in most high-resource languages (e.g., Vietnamese and Indonesian).34 unmodified lines### Supervised fine-tuning (SFT) DataOur supervised finetuning (SFT) data consists of many categories. The largest and most dominant of them are public and open-source. As the aforementioned are English only, we employ several established automatic techniques to gather more instruction data for SEA languages through synthetic means. For a small number of SFT data, we engaged native speakers to vet, verify and modify SFT responses so that they adapt 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.### SFT Strategies1 unmodified line### Self-preferencing DPOTo save the cost of human preference annotation work, [some](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta) have sought to use powerful LLMs like GPT-4 to play as a preference data generator. However, that may not even be feasible for low-resource non-Latin languages because of the unfavorable tokenization of ChatGPT as explained above. In other words, even short prompts would exceed their context-length and the API-call costs would explode by up to 17 times.Therefore, we use our own SeaLLM SFT models to generate preference data using a special prompting strategy, which we later use to employ direct preference optimization (DPO) to significantly improve the model abilities as an AI agent. As such, our models are free from relying on powerful close-sourced models like GPT-4 to improve the performance in low-resource languages.## Acknowledgement to Our Linguists1 unmodified line## CitationIf you find our project useful, hope you can star our repo and cite our work as follows. Corresponding Author: [l.bing@alibaba-inc.com](mailto:l.bing@alibaba-inc.com)```@article{damonlpsg2023seallm,33 unmodified lines34353637383940414243443 unmodified lines484950515253549 unmodified lines6465666768697071727374757677787980818283842 unmodified lines8788899091929394959697989912 unmodified lines11211311411511611711814 unmodified lines1331341351361371381398 unmodified lines14814915015115215315434 unmodified lines1891901911921931941951961 unmodified line1981992002012022032042052061 unmodified line20820921021121221321433 unmodified lines<a href="https://arxiv.org/pdf/2312.00738.pdf" target="_blank" rel="noopener">Technical Report</a></p>We introduce SeaLLMs - 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 texts in Vietnamese ๐ป๐ณ, Indonesian ๐ฎ๐ฉ, Thai ๐น๐ญ, Malay ๐ฒ๐พ, Khmer ๐ฐ๐ญ, Lao ๐ฑ๐ฆ, Tagalog ๐ต๐ญ and Burmese ๐ฒ๐ฒ. The [SeaLLM-chat](https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b) underwent supervised fine-tuning (SFT) and specialized self-preferencing DPO using a mix of public instruction data and a small number 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**.SeaLLM-13b models exhibit superior performance across a wide spectrum of linguistic tasks and assistant-style instruction-following capabilities relative to comparable open-source models. Moreover, they outperform **ChatGPT-3.5** in non-Latin languages such as Thai, Khmer, Lao, and Burmese.- DEMO: [SeaLLMs/SeaLLM-Chat-13b](https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b) DEMO allows **batch-inference** for evaluation purposes.- Model weights: To be released.- Technical report: [Arxiv: SeaLLMs - Large Language Models for Southeast Asia](https://arxiv.org/pdf/2312.00738.pdf).3 unmodified lines</blockquote>> **Disclaimer**:> 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 efforts in red teaming and safety fine-tuning and enforcement, our models come with potential risks, including but not limited to inaccurate, misleading or potentially harmful generation.> 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.> 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.9 unmodified linesOne of the most reliable ways to compare chatbot models is peer comparison.With the help of native speakers, we built an instruction test set, called [Sea-bench](https://huggingface.co/datasets/SeaLLMs/Sea-bench) that focuses on various aspects expected in a user-facing chatbot, namely:(1) task-solving (e.g., translation & comprehension),(2) math-reasoning (e.g., math and logical reasoning questions),(3) general-instruction (e.g., instructions in general domains),(4) natural-questions (e.g., questions about local context often written informally), and(5) safety-related questions.The test set also covers all languages that we are concerned with.Similar to [MT-bench](https://huggingface.co/spaces/lmsys/mt-bench), we use **GPT-4** as an evaluator to rate the comparison between our models versus ChatGPT-3.5 and other baselines.We evaluate Sea-bench in 2 modes: Score-based grading (0 to 10) and Peer comparison.As shown in the figure above, as aggregated by task category (left radar chart), our SeaLLM-13b model performs on-par or surpasses ChatGPT-3.5 across many linguistic and writing tasks. This is despite [reported evidence](https://arxiv.org/abs/2309.17012) that GPT-4 evaluator may favor ChatGPT more often than humans do.When comparing instruction-following capabilities of models from the angle of the different SEA languages, as shown, SeaLLM-13b outperforms ChatGPT-3.5 by large margins in most non-Latin languages, such as Burmese (Mya), Lao, Khmer and Thai. In combination with the fact that SeaLLM can encode these languages with up to 9 times fewer tokens, our models are not only superior but also cheaper to operate in these languages than ChatGPT. This helps democratize the benefits of large language models to under-represented and potentially developing communities.<div class="row" style="display: flex; clear: both;">2 unmodified lines</div>We also compare our model head-on with ChatGPT in peer comparison, as seen above. SeaLLM-13b is equal or better than ChatGPT for up to 40% of the time for Latin-based languages (Eng, Vie, Ind, Msa). In contrast, for non-Latin languages, SeaLLM-13b surpasses ChatGPT by up to 90%.### Safety Enchancement in Local ContextThere is growing [evidence](https://arxiv.org/pdf/2310.06474.pdf) that western-built LLMs often neglect safety protection in many lower-resource languages, or even promote contents that may be locally perceived as harmful, inappropriate or illegal by local norms and laws. We take great effort in adapting and safeguarding our SeaLLM models so as to achieve wider adoption and compliance for the regional audiences of Southeast Asia.The dropdown table below showcases examples of potentially harmful content that ChatGPT generates, whereas our model behaves safer and complies with the regulations.<details><summary><span style="color: red">WARNING:</span> The dropdown will display potentially harmful content.</summary>12 unmodified lines### M3Exam - World Knowledge in Regional Languages[M3Exam](https://arxiv.org/pdf/2306.05179.pdf) is a collection of real-life and native official human exam question benchmark. This benchmark covers questions from multiple countries in the SEA region, which require strong multilingual proficiency and cultural knowledge across various critical educational periods, from primary- to high-school levels of difficulty.As shown in the table, our SeaLLM model outperforms most 13B baselines and reaches closer to ChatGPT's performance.Notably, for Thai - a seemingly low-resource language, our model is just 1% behind ChatGPT despite the large size difference.14 unmodified lines### MMLU - Preserving English-based knowledgeOn the 5-shot [MMLU](https://arxiv.org/abs/2009.03300), our SeaLLM models not only preserve but also slightly outperforms 13B LLama-2 and Llama-2-chat, despite the fact that optimizing for this English dominant test set is not part of our goal.| MMLU (Acc) | Average|----------- | ------- |8 unmodified linesWe use the [Flores-200](https://huggingface.co/datasets/facebook/flores) to test our model's ability in machine translation. As shown in the above figure, SeaLLM-13B exhibits clear superiority over ChatGPT-3.5 in low-resource languages, such as Lao and Khmer, while maintaining comparable performances with ChatGPT-3.5 in most high-resource languages (e.g., Vietnamese and Indonesian).34 unmodified lines### Supervised fine-tuning (SFT) DataOur supervised fine-tuning (SFT) data consists of many categories. The largest and most dominant of them are public and open-source. As these data are available only in English, we employ several established automatic techniques to gather more instruction data for SEA languages through synthetic means. For a small number of SFT data, we engaged native speakers to vet, verify and modify SFT responses so that they adapt 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 native country-friendly and abide by local rules to a higher degree.### SFT Strategies1 unmodified line### Self-preferencing DPOTo save on costs of human preference annotation work, [some](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta) have sought to use powerful LLMs like GPT-4 to play as a preference data generator. However, that may not even be feasible for low-resource non-Latin languages because of the unfavorable tokenization of ChatGPT as explained above. In other words, even short prompts would exceed their context-length and the API-call costs would explode by up to 17 times.Therefore, we use our own SeaLLM SFT models to generate preference data using a special prompting strategy, which we later use to employ direct preference optimization (DPO) to significantly improve the models' abilities as an AI agent. As such, our models are free from relying on powerful close-sourced models like GPT-4 to improve the performance on low-resource languages.## Acknowledgement to Our Linguists1 unmodified line## CitationIf you find our project useful, we hope you would kindly star our repo and cite our work as follows: Corresponding Author: [l.bing@alibaba-inc.com](mailto:l.bing@alibaba-inc.com)```@article{damonlpsg2023seallm,
README.md+19-19