Translation
Transformers
Safetensors
gemma3
image-text-to-text
multilingual
text-generation-inference
Instructions to use lyf07/Translategemma-4B-it-WALAR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lyf07/Translategemma-4B-it-WALAR with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="lyf07/Translategemma-4B-it-WALAR")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("lyf07/Translategemma-4B-it-WALAR") model = AutoModelForMultimodalLM.from_pretrained("lyf07/Translategemma-4B-it-WALAR", device_map="auto") - Notebooks
- Google Colab
- Kaggle
lyf07 commited on
Commit ·
e8e0da8
1
Parent(s): 69ad8c7
update README
Browse files- .gitattributes +1 -0
- README.md +67 -0
- fig/.DS_Store +0 -0
- fig/generalization_xcomet.png +3 -0
- fig/lang_consistency.png +3 -0
- fig/main_tab.png +3 -0
- fig/walar.png +3 -0
.gitattributes
CHANGED
|
@@ -36,3 +36,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 36 |
model-00001-of-00002.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 37 |
model-00002-of-00002.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 38 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 36 |
model-00001-of-00002.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 37 |
model-00002-of-00002.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 38 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
base_model:
|
| 4 |
+
- LLaMAX/LLaMAX3-8B-Alpaca
|
| 5 |
+
tags:
|
| 6 |
+
- multilingual
|
| 7 |
---
|
| 8 |
+
<h1 align="center">WALAR</h1>
|
| 9 |
+
|
| 10 |
+
<p align="center">
|
| 11 |
+
<a href="https://arxiv.org/abs/2603.13045"> 📃 Paper</a> |
|
| 12 |
+
<a href="https://github.com/LeiLiLab/WALAR"> ⚙️ Code</a> |
|
| 13 |
+
<a href="https://huggingface.co/collections/lyf07/walar"> 🤗 Model</a> |
|
| 14 |
+
<a href="yfliu@smail.nju.edu.cn"> 📭 Contact</a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
## Overview
|
| 19 |
+
|
| 20 |
+
We propose **WALAR**, a reinforcement training method using only monolingual text to elevate LLMs' translation capabilities on massive low-resource languages. Our key insight is based on mending the holes of current state-of-the-art neural machine translation metrics, as training directly on these metrics will amplify such holes in trained LLMs. Specifically, we integrate quality estimation score, word alignment score and language alignment into WALAR's reward to mitigate the reward hacking brought by the holes. Finally, we trained three LLMs using WALAR. Extensive experiments on over 1400 language directions demonstrate that our model outperforms the strongest prior multilingual model of the same size.
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
<img src="./fig/walar.png" alt="Figure 1: WALAR Framework Illustration" title="WALAR Framework Illustration" />
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
## 📐 Experimental Results
|
| 29 |
+
|
| 30 |
+
### 📊 **FLORES-101**
|
| 31 |
+
|
| 32 |
+
We conducted extensive experiments on FLORES-101 and reported xCOMET and MetricX scores for over 1400 language directions. Results demonstrate that WALAR improves LLM translation quality by a large margin. By comparing Qwen3-8B, Translategemma-4B-it and LLaMAX3-8B-Alpaca before and after training with WALAR, we observe significant average improvements across all metrics, demonstrating the generalizability of WALAR across different model families.
|
| 33 |
+
|
| 34 |
+
We also leveraged Gemini 3 Flash to perform LLM-as-a-Judge to provide a more comprehensive evaluation of the translations generated by LLaMAX and LLaMAX+WALAR. Results show that LLaMAX3-8B-Alpaca trained with WALAR outperforms the base model on all language directions and the average score achieved by WALAR-trained LLaMAX3-8B-Alpaca is higher than 66, corresponding to translations with only minor issues according to the judging rubric.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
### 📄 Language Consistency
|
| 45 |
+
|
| 46 |
+
To systematically assess an LLM's ability to generate translations in the desired target language, we define the *Language Consistency Rate* (LCR) as the proportion of test instances whose outputs are identified as being in the correct target language. As shown in the figure below, WALAR also improves language consistency by a large margin, especially for low-resource target language, such as Swahili.
|
| 47 |
+
|
| 48 |
+
<img src="./fig/lang_consistency.png" alt="Figure 3: Lang Consistency of WALAR" title="Lang Consistency of WALAR" />
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
### 📈Generalization of WALAR
|
| 55 |
+
|
| 56 |
+
Our model trained with WALAR also demonstrated strong generalization ability on language directions that are unseen during training. These results indicate that the improvements induced by WALAR can transfer beyond the training language set, potentially reducing the amount of parallel data and the number of language directions required to train massive multilingual models.
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
<img src="./fig/generalization_xcomet.png" alt="Figure 4: Generalization" title="Generalization" />
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
### Model Index
|
| 64 |
+
We trained three models using WALAR. In this repo, we present LLaMAX3-8B-Alpaca-WALAR, which is a variant of LLaMAX3-8B-Alpaca trained with WALAR. The model index is shown below:
|
| 65 |
+
|
| 66 |
+
| Model | Link |
|
| 67 |
+
| -------------------------- | ------------------------------------------------------- |
|
| 68 |
+
| LLaMAX3-8B-Alpaca-WALAR | https://huggingface.co/lyf07/LLaMAX3-8B-Alpaca-WALAR |
|
| 69 |
+
| Qwen3-8B-WALAR | https://huggingface.co/lyf07/Qwen3-8B-WALAR |
|
| 70 |
+
| ***Translategemma-4B-it-WALAR*** | https://huggingface.co/lyf07/Translategemma-4B-it-WALAR |
|
fig/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
fig/generalization_xcomet.png
ADDED
|
Git LFS Details
|
fig/lang_consistency.png
ADDED
|
Git LFS Details
|
fig/main_tab.png
ADDED
|
Git LFS Details
|
fig/walar.png
ADDED
|
Git LFS Details
|