Skip to content
ufraan
← Back

Hindi NLI (XLM-R)

Cross-lingual textual entailment for Hindi, fine-tuning XLM-RoBERTa on XNLI, written up as an IEEE paper.

Machine LearningNLPTransformersPaper
Sep 2026GitHub

Does a Hindi sentence like "kuch bhi nahi" actually contradict "I ate everything"? This repo fine-tunes xlm-roberta-base on the Hindi split of XNLI and measures how well it does. The framing comes from Khader et al. (2016), where Arabic textual entailment was handled with lexical matching - the question here is whether a multilingual transformer, fine-tuned, can do the same job for Hindi.

Bencode Foo parser output showing decoded torrent data
Bencode Foo parser output showing decoded torrent data

The headline numbers are 54.94% validation accuracy for a one-epoch sanity run on 5% of the data, and 63.86% validation and 63.15% test accuracy for the reported two-epoch run on 9%. Every figure in that sentence comes out of the saved output and results directories after the runs rather than from a paper I copied.

The repo ships the training and evaluation scripts, the confusion matrix, a training-curve plot, and the writeup itself as LaTeX in IEEE two-column format.

The most useful thing I learned was a hardware one: on Apple Silicon, fused AdamW plus SDPA silently collapses the model to chance-level accuracy. Eager attention with unfused AdamW is the only configuration that trains correctly there, which is now the default in the code and is written up in the paper.