Initial release: MorphBART-Base checkpoint with BMES Fusion and IWMA
Browse filesFiles changed (9)
- .gitattributes+1
- README.mdAdded+64
- config.jsonAdded+55
- generation_config.jsonAdded+12
- model.safetensorsAdded+3
- morph_config.jsonAdded+11
- morph_fusion.ptAdded+3
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+74
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364---language:- tr- fi- ko- hu- et- kk- ja- multilinguallicense: mitlibrary_name: transformerstags:- translation- seq2seq- mbart-50- morphology- agglutinative- coling2027- nlppipeline_tag: translation---
# MorphBART: Intra-Word Structural Biases for Agglutinative Neural Machine Translation
This is the **MorphBART-Base** foundation checkpoint, integrating vocabulary-preserving intra-word inductive biases directly into the **mBART-50** (`facebook/mbart-large-50-many-to-many-mmt`) architecture.
MorphBART is specifically engineered to resolve subword fragmentation and morphological hallucinations when translating from rich agglutinative languages (Turkic, Uralic, Koreanic, Dravidian, etc.) into English and other languages.
## 🌟 Architectural Features- **GPU BMES Boundary Extractor:** Dynamically derives Begin, Middle, End, and Single morpheme positions directly from subword tokens.- **Adaptive Boundary-Token Fusion:** Learns continuous boundary representations and injects them via gated residual projection (+2.11M params / +0.34% parameter overhead).- **Intra-Word Morphological Attention (IWMA):** Directly modulates early encoder self-attention matrices (layers 0 & 1) with an intra-word structural reward lpha = 0.5.
---
## 🚀 Downstream Quickstart: How to Train on Your Data
Anyone can load this checkpoint to fine-tune on their agglutinative language translation datasets (e.g., Turkish
ightarrow English, Finnish
ightarrow English, Korean
ightarrow English, Hungarian
ightarrow English):
```pythonimport torchfrom transformers import AutoTokenizer, MBartForConditionalGeneration, Seq2SeqTrainer, Seq2SeqTrainingArgumentsfrom huggingface_hub import hf_hub_downloadimport json, os
# 1. Load Tokenizer & Base Checkpointmodel_name = "NIRVLab/MorphBART-base"tokenizer = AutoTokenizer.from_pretrained(model_name, src_lang="tr_TR", tgt_lang="en_XX")
# 2. Load MorphBART (or use the MorphBARTForConditionalGeneration wrapper class)# See notebooks in the MorphBART repository for the end-to-end training pipeline.```
## 📖 CitationIf you find MorphBART useful in your research, please cite our paper:```bibtex@inproceedings{morphbart2027, title = {When Morphology Hides in Flat Attention: Intra-Word Structural Biases for Agglutinative Neural Machine Translation}, author = {Anonymous}, booktitle = {Proceedings of the 31st International Conference on Computational Linguistics (COLING)}, year = {2027}}```12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455{ "_num_labels": 3, "activation_dropout": 0.0, "activation_function": "relu", "add_bias_logits": false, "add_final_layer_norm": true, "architectures": [ "MBartForConditionalGeneration" ], "attention_dropout": 0.0, "bos_token_id": 0, "classif_dropout": 0.0, "classifier_dropout": 0.0, "d_model": 1024, "decoder_attention_heads": 16, "decoder_ffn_dim": 4096, "decoder_layerdrop": 0.0, "decoder_layers": 12, "decoder_start_token_id": 2, "dropout": 0.1, "dtype": "bfloat16", "encoder_attention_heads": 16, "encoder_ffn_dim": 4096, "encoder_layerdrop": 0.0, "encoder_layers": 12, "eos_token_id": 2, "forced_eos_token_id": 2, "gradient_checkpointing": false, "id2label": { "0": "LABEL_0", "1": "LABEL_1", "2": "LABEL_2" }, "init_std": 0.02, "is_decoder": false, "is_encoder_decoder": true, "label2id": { "LABEL_0": 0, "LABEL_1": 1, "LABEL_2": 2 }, "max_position_embeddings": 1024, "model_type": "mbart", "normalize_before": true, "normalize_embedding": true, "output_past": true, "pad_token_id": 1, "scale_embedding": true, "static_position_embeddings": false, "tie_word_embeddings": true, "tokenizer_class": "MBart50Tokenizer", "transformers_version": "5.16.1", "use_cache": true, "vocab_size": 250054}123456789101112{ "_from_model_config": true, "bos_token_id": 0, "decoder_start_token_id": 2, "early_stopping": true, "eos_token_id": 2, "forced_eos_token_id": 2, "max_length": 200, "num_beams": 5, "pad_token_id": 1, "transformers_version": "5.16.1"}123version https://git-lfs.github.com/spec/v1oid sha256:258b9af618579d4e4bb877c03c68f5dcdb081e9a1136d67e02a0a4caa8cea3efsize 12223197561234567891011{ "model_type": "morphbart", "base_model": "facebook/mbart-large-50-many-to-many-mmt", "use_fusion": true, "use_iwma": true, "alpha": 0.5, "morph_layers": [ 0, 1 ]}123version https://git-lfs.github.com/spec/v1oid sha256:98d10a364324ffbf27fd603c8ed11182fe09f3f01480f9b2f813dd7cf34ea7d5size 4215632123version https://git-lfs.github.com/spec/v1oid sha256:233444bd094458865f7e4a9269a019759bef8489fdf1399906bfe451509b0129size 171098211234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374{ "backend": "tokenizers", "bos_token": "<s>", "cls_token": "<s>", "eos_token": "</s>", "extra_special_tokens": [ "<s>", "</s>", "ar_AR", "cs_CZ", "de_DE", "en_XX", "es_XX", "et_EE", "fi_FI", "fr_XX", "gu_IN", "hi_IN", "it_IT", "ja_XX", "kk_KZ", "ko_KR", "lt_LT", "lv_LV", "my_MM", "ne_NP", "nl_XX", "ro_RO", "ru_RU", "si_LK", "tr_TR", "vi_VN", "zh_CN", "af_ZA", "az_AZ", "bn_IN", "fa_IR", "he_IL", "hr_HR", "id_ID", "ka_GE", "km_KH", "mk_MK", "ml_IN", "mn_MN", "mr_IN", "pl_PL", "ps_AF", "pt_XX", "sv_SE", "sw_KE", "ta_IN", "te_IN", "th_TH", "tl_XX", "uk_UA", "ur_PK", "xh_ZA", "gl_ES", "sl_SI" ], "is_local": false, "language_codes": "ML50", "local_files_only": false, "mask_token": "<mask>", "model_max_length": 1000000000000000019884624838656, "pad_token": "<pad>", "sep_token": "</s>", "src_lang": "tr_TR", "tgt_lang": null, "tokenizer_class": "MBart50Tokenizer", "unk_id": 0, "unk_token": "<unk>"}.gitattributes+1
README.mdAdded+64
config.jsonAdded+55
generation_config.jsonAdded+12
model.safetensorsAdded+3
morph_config.jsonAdded+11
morph_fusion.ptAdded+3
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+74