ANLP Assignment 2, Part 1: moe_top1
MoE, 4 experts, top-1 routing. Decoder-only transformer (6 layers, d_model 512, 8 heads, FFN hidden 2048)
trained from scratch for Vietnamese/Japanese -> English translation on
belumind/en-vi-ja-curated-500k-triplets (3 epochs, batch 64, AdamW lr 3e-4, bf16).
| Metric | Value |
|---|---|
| Train loss (epoch 1/2/3) | 3.905 / 2.448 / 1.988 |
| Val loss (epoch 1/2/3) | 3.099 / 2.363 / 2.103 |
| Test perplexity | 8.23 |
| Test BLEU (sacrebleu, greedy, 1000 samples) | 24.55 |
Files: model.pt (PyTorch state_dict), config.yaml (model/MoE config),
tokenizer.json (byte-level BPE, 32k, en+vi+ja), expert_usage.png (per-language expert usage).
Load with the assignment code: Transformer(yaml.safe_load(open('config.yaml'))) then
model.load_state_dict(torch.load('model.pt')).
Training logs: https://wandb.ai/rakshitagg06-iiit-hyderabad/anlp-assignment2 (run name moe_top1).