En2de-A

A 20M-parameter English→German translator, built from scratch in PyTorch

Params BLEU Dataset Framework GitHub


Results

Model Params BLEU ↑
En2de without Attention 19.7M 16.82
En2de-A + Attention 20.4M 25.14

Attention adds <1M params and gives +8.3 BLEU. (sacreBLEU, Multi30k test, greedy decoding)

Model

  • 2-layer LSTM encoder/decoder, 512 hidden, 256 embedding
  • Luong-style attention, 16k shared subword vocab, max length 50
  • Trained 25 epochs on Multi30k: Adam (1e-3), warmup + cosine, label smoothing 0.1

Example

EN: A man in an orange hat starring at something.
DE: Ein Mann mit einem orangefarbenen Hut starrt nach etwas .

Usage

model.load_state_dict(torch.load("En2de-A.pt", map_location="cpu"))
print(translate("A man is riding a bike."))  # Ein Mann fährt auf einem Fahrrad .

Note

Model on HF: Masharyy/En2de-A

Citation

If you use En2de-A in your work, please cite:

@misc{mashary2026en2dea,
  author       = {Mashary},
  title        = {En2de-A: A 20M-parameter LSTM Seq2Seq Model with Attention for English-German Translation},
  year         = {2026},
  howpublished = {\url{https://github.com/Meshojs/En2de-A}}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Masharyy/En2de-A

Evaluation results