Views
No views yet
GemmaX2-28-2B-v0.1, an LLM-based translation model developed by Xiaomi. The original model was finetuned from GemmaX2-28-2B-Pretrain, which itself is a continually pretrained version of Gemma2-2B using a diverse dataset of 56 billion tokens across 28 languages. These GGUF versions (f16, bf16, q8_0, tq1_0, tq2_0) were created to optimize the model for efficient inference on resource-constrained environments while preserving translation capabilities.f16 (16-bit float), bf16 (bfloat16), q8_0 (8-bit quantization), tq1_0 (ternary quantization 1), tq2_0 (ternary quantization 2)GemmaX2-28-2B-v0.1 is designed for multilingual machine translation, built on GemmaX2-28-2B-Pretrain, which was pretrained on a mix of monolingual and parallel data (56 billion tokens) across 28 languages. The finetuning process used a small, high-quality set of translation instruction data to enhance its performance. These GGUF quantizations were generated using convert_hf_to_gguf.py, converting the original Hugging Face model into formats compatible with tools like llama.cpp for efficient deployment.ModelSpace/GemmaX2-28-2B-v0.1convert_hf_to_gguf.pyf16: 16-bit floating-point, minimal precision loss, larger file size (~5-7GB).bf16: Brain floating-point 16-bit, optimized for certain hardware (e.g., TPUs), similar size to f16.q8_0: 8-bit quantization, reduced size (~3-4GB), slight precision trade-off.tq1_0: Ternary quantization (1-bit), smallest size (~1-2GB), higher precision loss.tq2_0: Ternary quantization (2-bit variant), slightly larger than tq1_0, balanced size vs. quality.llama.cpp).GemmaX2-28-2B-v0.1 model’s performance is detailed in the paper Multilingual Machine Translation with Open Large Language Models at Practical Scale: An Empirical Study. Quantization introduces varying degrees of performance trade-offs:f16 and bf16: Near-identical to the original model’s accuracy, with minimal degradation.q8_0: Slight reduction in translation quality, still suitable for most practical applications.tq1_0 and tq2_0: Noticeable quality loss, best for scenarios prioritizing speed and size over precision.1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "ModelSpace/GemmaX2-28-2B-v0.1"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id)
6
7text = "Translate this from Chinese to English:\nChinese: 我爱机器翻译\nEnglish:"
8inputs = tokenizer(text, return_tensors="pt")
9outputs = model.generate(**inputs, max_new_tokens=50)
10print(tokenizer.decode(outputs[0], skip_special_tokens=True))Tonic/GemmaX2-28-2B-gguf and use it with a GGUF-compatible inference tool like llama.cpp:1# Example with llama.cpp
2git clone https://github.com/ggerganov/llama.cpp.git
3cd llama.cpp
4make
5
6# Run inference with q8_0 model
7./main -m gemmax2-28-2b-q8_0.gguf -p "Translate from Chinese to English: 我爱机器翻译\nEnglish:""gemmax2-28-2b-f16.ggufgemmax2-28-2b-bf16.ggufgemmax2-28-2b-q8_0.ggufgemmax2-28-2b-tq1_0.ggufgemmax2-28-2b-tq2_0.gguftq1_0, tq2_0) may degrade translation quality, especially for complex sentences or rare language pairs.bf16 benefits from specific hardware support (e.g., NVIDIA Ampere GPUs, TPUs); performance may vary otherwise.GemmaX2-28-2B’s translation capabilities, which may not be reflected in these quantized versions until updated.1@misc{cui2025multilingualmachinetranslationopen,
2 title={Multilingual Machine Translation with Open Large Language Models at Practical Scale: An Empirical Study},
3 author={Menglong Cui and Pengzhi Gao and Wei Liu and Jian Luan and Bin Wang},
4 year={2025},
5 eprint={2502.02481},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2502.02481},
9}Tonic/GemmaX2-28-2B-gguf.