Views
No views yet

1Translate this from <source language name> to <target language name>:
2<source language name>: <source language sentence>
3<target language name>:1from vllm import LLM, SamplingParams
2
3
4model_id = "xiaomi-research/GemmaX2-28-9B-v0.2"
5
6model = LLM(model=model_id)
7sampling_params = SamplingParams(top_k=1, temperature=0, max_tokens=2048)
8
9text = "Translate this from Chinese to English:\nChinese: 我爱机器翻译\nEnglish:"
10
11outputs = model.generate(text, sampling_params)
12print(outputs[0].outputs[0].text)1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3
4model_id = "xiaomi-research/GemmaX2-28-9B-v0.2"
5
6model = AutoModelForCausalLM.from_pretrained(model_id)
7tokenizer = AutoTokenizer.from_pretrained(model_id)
8
9text = "Translate this from Chinese to English:\nChinese: 我爱机器翻译\nEnglish:"
10inputs = tokenizer(text, add_special_tokens=False, return_tensors="pt")
11
12outputs = model.generate(**inputs, max_new_tokens=1024)
13print(tokenizer.decode(outputs[0], skip_special_tokens=True))1@inproceedings{cui-etal-2025-multilingual,
2 title = "Multilingual Machine Translation with Open Large Language Models at Practical Scale: An Empirical Study",
3 author = "Cui, Menglong and
4 Gao, Pengzhi and
5 Liu, Wei and
6 Luan, Jian and
7 Wang, Bin",
8 editor = "Chiruzzo, Luis and
9 Ritter, Alan and
10 Wang, Lu",
11 booktitle = "Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)",
12 month = apr,
13 year = "2025",
14 address = "Albuquerque, New Mexico",
15 publisher = "Association for Computational Linguistics",
16 url = "https://aclanthology.org/2025.naacl-long.280/",
17 doi = "10.18653/v1/2025.naacl-long.280",
18 pages = "5420--5443",
19 ISBN = "979-8-89176-189-6",
20 abstract = "Large language models (LLMs) have shown continuously improving multilingual capabilities, and even small-scale open-source models have demonstrated rapid performance enhancement. In this paper, we systematically explore the abilities of open LLMs with less than ten billion parameters to handle multilingual machine translation (MT) tasks. We conduct comprehensive evaluations on six popular LLMs and find that models like Gemma2-9B exhibit impressive multilingual translation capabilities. We then introduce the Parallel-First Monolingual-Second (PFMS) data mixing strategy in the continual pretraining stage to further enhance the MT performance and present GemmaX2-28, a 9B model achieving top-tier multilingual translation performance across 28 languages. Specifically, GemmaX2-28 consistently outperforms the state-of-the-art (SOTA) models such as TowerInstruct and X-ALMA and achieves competitive performance with Google Translate and GPT-4-turbo."
21}