Papers › KinyaBERT: a Morphology-aware Kinyarwanda Language Model

KinyaBERT: a Morphology-aware Kinyarwanda Language Model

16 Mar 2022ACL 2022 5arXiv:2203.08459archive 2025-07-28

Antoine Nzeyimana, Andre Niyongabo Rubungo

Pre-trained language models such as BERT have been successful at tackling many natural language processing tasks. However, the unsupervised sub-word tokenization methods commonly used in these models (e.g., byte-pair encoding - BPE) are sub-optimal at handling morphologically rich languages. Even given a morphological analyzer, naive sequencing of morphemes into a standard BERT architecture is inefficient at capturing morphological compositionality and expressing word-relative syntactic regularities. We address these challenges by proposing a simple yet effective two-tier BERT architecture that leverages a morphological analyzer and explicitly represents morphological compositionality. Despite the success of BERT, most of its evaluations have been conducted on high-resource languages, obscuring its applicability on low-resource languages. We evaluate our proposed method on the low-resource morphologically rich Kinyarwanda language, naming the proposed model architecture KinyaBERT. A robust set of experimental results reveal that KinyaBERT outperforms solid baselines by 2% in F1 score on a named entity recognition task and by 4.3% in average score of a machine-translated GLUE benchmark. KinyaBERT fine-tuning has better convergence and achieves more robust results on multiple tasks even in the presence of translation noise.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2203.08459")

Code

Syntology Ran 6 of 12 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 3 ran · our draft was wrong; 1 ran · fixture could not drive it; 2 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 6 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

anzeyimana/kinyabert-acl2022 officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 6 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · our draft was wrong
1ran · fixture could not drive it
2ran
6unverified

Licence: 0 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from anzeyimana/kinyabert-acl2022. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

BertHeadTransform anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository ran fingerprinted MIT (permissive) · 569684d0b33a366a · report
TransformerEncoder anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository ran fingerprinted MIT (permissive) · 2a17165c2e7e0311 · report
_get_activation_fn anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository ran · our draft was wrong MIT (permissive) · b97233bc0d62d1ca · report
_get_clones anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository ran · our draft was wrong MIT (permissive) · 6f8db6b6c8658306 · report
multi_head_attention_forward anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository ran · our draft was wrong MIT (permissive) · 6b3df8438d1f1eb3 · report
tupe_relative_position_bucket anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 514537bcd2ff58d8 · report
KinyaBERT anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository unverified MIT (permissive) · f5ddc36bd8862619 · report
KinyaBERT_MorphoEncoder anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository unverified MIT (permissive) · e68dff82485137db · report
MorphoHeadPredictor anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository unverified MIT (permissive) · 5f012bd177034410 · report
MultiheadAttention anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository unverified MIT (permissive) · 4639b692ef625093 · report
TransformerEncoderLayer anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository unverified MIT (permissive) · 820fca5082f9435e · report
init_bert_params anzeyimana/kinyabert-acl2022/code/morpho_model.py official repository unverified MIT (permissive) · 3d27c291c5dad777 · report

Tasks

Language ModelingLanguage ModellingNamed Entity RecognitionNamed Entity Recognition (NER)modelnamed-entity-recognition

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AdamAttentionAttention DropoutBERTDense ConnectionsDropoutLayer NormalizationLinear LayerLinear Warmup With Linear DecayMulti-Head AttentionResidual ConnectionSoftmaxWeight DecayWordPiece

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections