Efficient and Effective Text Encoding for Chinese LLaMA and Alpaca

Yiming Cui, Ziqing Yang, Xin Yao
4/17/2023
cs.CLcs.HCcs.LG

Abstract

Large Language Models (LLMs), such as ChatGPT and GPT-4, have dramatically transformed natural language processing research and shown promising strides towards Artificial General Intelligence (AGI). Nonetheless, the high costs associated with training and deploying LLMs present substantial obstacles to transparent, accessible academic research. While several large language models, such as LLaMA, have been open-sourced by the community, these predominantly focus on English corpora, limiting their usefulness for other languages. In this paper, we propose a method to augment LLaMA with capabilities for understanding and generating Chinese text and its ability to follow instructions. We achieve this by extending LLaMA's existing vocabulary with an additional 20,000 Chinese tokens, thereby improving its encoding efficiency and semantic understanding of Chinese. We further incorporate secondary pre-training using Chinese data and fine-tune the model with Chinese instruction datasets, significantly enhancing the model's ability to comprehend and execute instructions. Our experimental results indicate that the newly proposed model markedly enhances the original LLaMA's proficiency in understanding and generating Chinese content. Additionally, the results on the C-Eval dataset yield competitive performance among the models with several times the size of ours. We have made our pre-trained models, training scripts, and other resources available through GitHub, fostering open research for our community. Chinese LLaMA series: \url{https://github.com/ymcui/Chinese-LLaMA-Alpaca} and Chinese Llama-2 series: \url{https://github.com/ymcui/Chinese-LLaMA-Alpaca-2}

View on arXivView PDF

Code Implementations(3)

Apache-2.0

中文LLaMA&Alpaca大语言模型+本地CPU/GPU训练部署 (Chinese LLaMA & Alpaca LLMs)

18,9441,855Shell, PythonMar 15, 20231 months agoApache-2.0
alpacaalpaca-2large-language-modelsllamallama-2+6 more
Apache-2.0

中文LLaMA-2 & Alpaca-2大模型二期项目 + 64K超长上下文模型 (Chinese LLaMA-2 & Alpaca-2 LLMs with 64K long context models)

7,146567Shell, PythonJul 18, 20231 months agoApache-2.0
64kalpacaalpaca-2alpaca2flash-attention+8 more
Apache-2.0

中文羊驼大模型三期项目 (Chinese Llama-3 LLMs) developed from Meta Llama 3

1,971170Shell, PythonNov 9, 20231 months agoApache-2.0
alpacalarge-language-modelsllamallama-2llama-3+3 more

Cite this paper

@article{cui2023efficient,
  title  = {Efficient and Effective Text Encoding for Chinese LLaMA and Alpaca},
  author = {Yiming Cui and Ziqing Yang and Xin Yao},
  year   = {2023},
  eprint = {2304.08177},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2304.08177v3}
}

Discussion