Downloads · 30 days
190
0% of all-time downloads
DAMO-NLP-MT/polylm-13b
polylm-13b is a text generation model from DAMO-NLP-MT. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
1. Model Details 2. Usage 3. Uses 4. Bias, Risks, and Limitations 5. Next Steps 6. Citation
Downloads · 30 days
190
0% of all-time downloads
All-time downloads
60.1K
Public
Repo size
92.3 GB
Likes
53
Public
Click a slice to open those files.
.bin30.8 GB · 100%
From the Hugging Face model README
Large language models (LLMs) demonstrate remarkable ability to comprehend, reason, and generate following nature language instructions. However, the development of LLMs has been primarily focused on high-resource languages, such as English, thereby limiting their applicability and research in other languages. Consequently, we present PolyLM, a multilingual LLM trained on 640 billion (B) tokens, avaliable in two model sizes: 1.7B and 13B. To enhance its multilingual capabilities, we 1) integrate bilingual data into training data; and 2) adopt a curriculum learning strategy that increases the proportion of non-English data from 30% in the first stage to 60% in the final stage during pre-training. Further, we propose a multilingual self-instruct method which automatically generates 132.7K diverse multilingual instructions for model fine-tuning. To assess the model's performance, we collect several existing multilingual tasks, including multilingual understanding, question answering, generation, and translation. Extensive experiments show that PolyLM surpasses other open-source models such as LLaMA and BLOOM on multilingual tasks while maintaining comparable performance in English.
Find below some example scripts on how to use the model in transformers:
# pip install accelerate
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("DAMO-NLP-MT/polylm-13b", legacy=False, use_fast=False)
model = AutoModelForCausalLM.from_pretrained("DAMO-NLP-MT/polylm-13b", device_map="auto", trust_remote_code=True)
model.eval()
input_doc = f"Beijing is the capital of China.\nTranslate this sentence from English to Chinese."
inputs = tokenizer(input_doc, return_tensors="pt")
generate_ids = model.generate(
inputs.input_ids,
attention_mask=inputs.attention_mask,
do_sample=False,
num_beams=4,
max_length=128,
early_stopping=True
)
decoded = tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
print(f">>> {decoded}")
### results
### Beijing is the capital of China.\nTranslate this sentence from English to Chinese.\\n北京是中华人民共和国的首都。\n ...
</details>
The primary use is research on language models, including: research on zero-shot NLP tasks and in-context few-shot learning NLP tasks, such as reasoning, and question answering; advancing fairness and safety research, and understanding limitations of current large language models
See the research paper for further details.
More information needed.
The information below in this section are copied from the model's official model card:
Our contributions are fully methodological: adding the support of multilingualism to LLM during training and SFT phases. It is unavoidable that PolyLM might exhibit several common deficiencies of language models, e.g. hallucination and toxicity. PolyLM should not be used directly in any application, without a prior assessment of safety and fairness concerns specific to the application.
We are continuously enhancing the capabilities of PolyLM by focusing on the following aspects:
BibTeX:
@misc{wei2023polylm,
title={PolyLM: An Open Source Polyglot Large Language Model},
author={Xiangpeng Wei and Haoran Wei and Huan Lin and Tianhao Li and Pei Zhang and Xingzhang Ren and Mei Li and Yu Wan and Zhiwei Cao and Binbin Xie and Tianxiang Hu and Shangjie Li and Binyuan Hui and Bowen Yu and Dayiheng Liu and Baosong Yang and Fei Huang and Jun Xie},
year={2023},
eprint={2307.06018},
archivePrefix={arXiv},
primaryClass={cs.CL}
}