Llama-3.2-1B-uz-en-translator

Built with Llama.

A 1.2B-parameter English ↔ Uzbek translation model, fine-tuned from Llama-3.2-1B-Instruct in three stages:

  1. Broad stage — ~2.5M sentence pairs, both directions (vocabulary and grammar).
  2. Quality stage — ~4.6M pairs of document- and dialogue-level text: chats, comments, slang, news, fiction, dialogues, textbooks, plus short everyday phrases (style, line structure, long inputs).
  3. Preference stage (DPO) — the model samples several translations per source; they are ranked by a mixed reward (COMET + chrF++, with penalties for wrong language, copying the source and bad length) and the best/worst pairs are used for DPO with an NLL term (~17K pairs).

Handles Latin and Cyrillic Uzbek input, keeps line breaks (chats, lists, documents), and writes Uzbek in Latin script with o‘ g‘ (U+2018) and ’ for the tutuq sign.

Benchmarks

FLORES-200 devtest (1012 sentences)

Full devtest, greedy decoding for LLMs (NLLB: beam 4), apostrophes normalised on both sides; COMET = Unbabel/wmt22-comet-da.

model size COMET en→uz COMET uz→en chrF++ en→uz chrF++ uz→en
Tilmoch — 0.913 0.886 57.9 62.0
gpt-6-luna — 0.911 0.896 52.2 62.9
Gemma-4-26B-A4B 26B 0.906 0.887 53.3 61.2
OvozifyLabs/nllb-200-uz-en-v1 0.6B 0.906 0.873 56.1 60.5
this model 1.2B 0.906 0.872 56.9 58.7
NeuronAI-4B 4.2B 0.887 0.862 49.7 55.4

Conversational / document test (300 held-out pairs, chrF++)

Chats, comments, slang and multi-line documents. Scored only on the subset whose reference side was written by humans. NLLB translates line by line (it does not keep line breaks itself).

model en→uz uz→en
this model 41.7 68.4
OvozifyLabs/nllb-200-uz-en-v1 26.7 61.9
NeuronAI-4B 25.7 59.7

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

name = "Saidakmal/Llama-3.2-1B-uz-en-translator"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForCausalLM.from_pretrained(name, dtype="bfloat16", device_map="cuda")

def translate(text, src="English", tgt="Uzbek"):
    prompt = f"Translate the following text from {src} to {tgt}. Output only the translation.\n\n{text}"
    ids = tok.apply_chat_template([{"role": "user", "content": prompt}], add_generation_prompt=True,
                                  return_tensors="pt", return_dict=True).to(model.device)
    out = model.generate(**ids, max_new_tokens=1024, do_sample=False)
    return tok.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True).strip()

print(translate("The weather is very hot today."))               # en -> uz
print(translate("Bugun havo juda issiq.", "Uzbek", "English"))   # uz -> en

Use the prompt exactly as above (English / Uzbek). Greedy decoding works best.

Limitations

  • English ↔ Uzbek only; other directions were not trained.
  • Inputs up to ~2K tokens were seen in training; split longer texts.
  • Formal registers and domain terminology are weaker than everyday and conversational text.
  • As with any MT system, review outputs before high-stakes use.

License

Llama 3.2 Community License — see LICENSE.txt and USE_POLICY.md. Llama 3.2 is licensed under the Llama 3.2 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.

Downloads last month
36
Safetensors
Model size
1B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Saidakmal/Llama-3.2-1B-uz-en-translator

Finetuned
(1,863)
this model
Quantizations
1 model