TranslatorUM
English-to-Polish 235M Transformer — compact translation model update
2 min readupdated
The compact AI model TranslatorUM v2.0 with 235.1 million parameters specializes in bidirectional translation between English and Polish. Trained from scratch in pure PyTorch on a consumer graphics card, it offers an expanded context of up to 512 tokens, a three-stage training pipeline, and high inference speed. The model delivers quality results comparable across a range of metrics to larger alternatives and is well suited for integration into local translation utilities or bots.
Key features
- Doubled context (up to 512 tokens) thanks to a redesigned corpus of 23.75 million sentence pairs and a new SentencePiece tokenizer.
- A three-stage training pipeline including SFT (supervised fine-tuning), Gold Annealing, and CPO v2 Model Soup.
- High decoding speed (~105.6 sentences per second on an RTX 4070 with a batch size of 32).
- Full set of weights in BF16 format (safetensors, about 448 MB) with support for a lightweight FP8 version.
What you can do
- Integrate the model into a local Telegram bot or web service for fast text translation from English to Polish.
- Use the model weights in custom text processing pipelines and content localization on consumer hardware.
- Apply it for automatic translation of articles, help guides, and documentation within supported domains.
- Study the Encoder-Decoder Transformer architecture with RMSNorm, RoPE, and tied embeddings for your own research.
Example
import json
import sentencepiece as spm
import torch
from safetensors.torch import load_file
from modeling_translator import TranslatorConfig, TranslatorTransformer
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
with open("config.json", "r", encoding="utf-8") as f:
cfg = TranslatorConfig(**json.load(f))
model = TranslatorTransformer(cfg)
sd = load_file("model.safetensors", device="cpu")
model.load_state_dict(sd, strict=False)
model.lm_head.weight = model.embed.weight
model = model.to(device=device, dtype=torch.bfloat16).eval()Read more
Details• Benchmarks (FLORES+ devtest): BLEU 21.49, chrF++ 48.30, MetricX-Ref 4.649.
• Hardware requirements: consumer graphics card on the level of RTX 4070 (12 GB VRAM) and higher.
• Architecture: Encoder-Decoder Transformer (12+12 layers, d_model=768, SwiGLU, RoPE).
• Limitations: highly specialized model only for the EN -> PL direction, not a universal chatbot.










Comments