NADI 2026 ADI-20 — wav2vec2 XLS-R 300M
The largest backbone in the release and, notably, not the best one: wav2vec2 XLS-R 300M with masked mean pooling and a 20-way linear head.
Part of the NAMAA at NADI 2026 Shared Task collection.
At a glance
| Property | Details |
|---|---|
| Task | 20-way spoken Arabic dialect / country identification |
| Shared task | NADI 2026, Subtask 2 (Spoken Dialect ID) |
| Architecture | wav2vec2 XLS-R 300M + masked mean pooling + linear head |
| Base model | facebook/wav2vec2-xls-r-300m |
| Parameters | 315,459,220 trained + 1,049,600 identity projector |
| Weights | 1.27 GB safetensors (fp32) |
| Audio input | mono, 16,000 Hz |
| Output | logits over 20 classes |
| Dev accuracy | 66.69% |
| Dev average cost | 0.2402 (lower is better) |
| Checkpoint | best eval at step 84,000 of 90,000 |
Results
All four systems in this release share one training recipe and one evaluation protocol, so these numbers are directly comparable.
| System | Backbone | Params | Dev accuracy | Avg cost |
|---|---|---|---|---|
nadi26-adi20-whisper-small |
whisper-small | 88,169,492 | 85.53% | 0.0938 |
nadi26-adi20-ecapa-tdnn |
lang-id-voxlingua107-ecapa | 21,242,081 | 80.57% | 0.1099 |
nadi26-adi20-xls-r-300m — this model |
wav2vec2-xls-r-300m | 315,459,220 | 66.69% | 0.2402 |
nadi26-adi20-ecapa-tdnn-v0 |
lang-id-voxlingua107-ecapa | 21,242,081 | 36.79% | 0.4956 |
| Two-way ECAPA + Whisper blend (alpha 0.55) | probability average | — | 85.58% | — |
| Four-way ensemble (+ 2 public classifiers) | weighted soft vote | — | 95.00% | 0.0507 |
Two results worth noting. Parameter count did not predict quality — XLS-R 300M is 3.6x the size of the Whisper encoder and lands 18.8 points behind it; pretraining domain mattered more than capacity. And combination paid more than any single architecture choice: the four-way weighted soft vote reported in the team paper reaches 95.00% development accuracy against 85.53% for the best single member, by adding two public classifiers to the two released here.
The two-way row was measured on 2026-07-18 against an earlier Whisper
checkpoint (dev 81.07%), where it beat its better member by 4.51 points. The
Whisper weights released here are the later step-90,000 checkpoint at 85.53%,
so that blend has not been re-measured against them. The four-way row is the
paper's development figure; its members and weights are described in
nadi26-adi20-ensemble.
Neither is a blind-set number — see below.
Official NADI 2026 result
The numbers above are development accuracy. The shared task was scored on a held-out blind set, and that gap is the headline finding of this release:
| Accuracy | Avg cost | Set | |
|---|---|---|---|
| Four-way development ensemble | 95.00% | 0.0507 | ADI-20 micro validation (10,806 clips) |
| Official blind submission (three-model ensemble) | 37.70% | 0.1674 | NADI 2026 blind (878 clips) |
Organisers describe the blind evaluation as out of domain: it need not cover every class, and the recordings differ from the ADI-20 micro training material. A system at 95% on validation landing at 37.7% on the blind set is the honest measure of how far ADI-20-micro-trained dialect ID generalises — and the reason the per-model development numbers on this page should be read as in-domain results, not as a capability claim.
For reference, the organisers' own development baseline scores 81.19%, so the single systems here are competitive in-domain; the collapse is a shift problem, not a fitting problem.
Official blind figures from the team paper, CodaBench submission 861912. Blind-set feedback influenced which of ten submissions was retained, so the selected score is not an independent estimate of a pre-specified rule.
Usage
import torch, librosa
from transformers import AutoFeatureExtractor, AutoModelForAudioClassification
REPO = "NAMAA-Space/nadi26-adi20-xls-r-300m"
fe = AutoFeatureExtractor.from_pretrained(REPO)
model = AutoModelForAudioClassification.from_pretrained(REPO).eval()
wav, _ = librosa.load("clip.wav", sr=16_000, mono=True)
wav = wav[:16_000 * 30] # scored on the first 30 s, as in training
inputs = fe(wav, sampling_rate=16_000, return_tensors="pt", return_attention_mask=True)
with torch.no_grad():
probs = model(**inputs).logits.softmax(-1)[0]
top = probs.argsort(descending=True)[:3]
for i in top:
print("{:<4} {:.3f}".format(model.config.id2label[int(i)], float(probs[i])))
Batched inference works the same way — pass a list of waveforms to the feature extractor — it pads and returns the attention mask that the masked pooling needs.
Label set
Class order is fixed; index i in the output vector is the code below.
| ID | Code | Variety | ID | Code | Variety |
|---|---|---|---|---|---|
| 0 | MSA |
Modern Standard Arabic | 10 | LIB |
Libya |
| 1 | BAH |
Bahrain | 11 | MAU |
Mauritania |
| 2 | TUN |
Tunisia | 12 | MOR |
Morocco |
| 3 | ALG |
Algeria | 13 | OMA |
Oman |
| 4 | EGY |
Egypt | 14 | PAL |
Palestine |
| 5 | IRA |
Iraq | 15 | QAT |
Qatar |
| 6 | JOR |
Jordan | 16 | SUD |
Sudan |
| 7 | KSA |
Saudi Arabia | 17 | SYR |
Syria |
| 8 | KUW |
Kuwait | 18 | UAE |
United Arab Emirates |
| 9 | LEB |
Lebanon | 19 | YEM |
Yemen |
How it was trained
A single multi-backbone recipe trained all four systems in this release, so the numbers above compare architectures rather than training tricks. Every run used the same data, schedule length, augmentation, metric and seed.
| Dataset | UBC-NLP/NADI_2026_ADI20_micro — 67,015 train / 10,806 validation clips |
| Classes | 20-way single-label country / variety ID |
| Objective | cross-entropy (logits + cross-entropy) |
| Schedule | warmup -> linear decay |
| Max steps | 90,000 (this checkpoint is the best eval at step 84,000) |
| Frozen warmup | first 15,000 steps train the head only, then the backbone unfreezes |
| Backbone LR / head LR | 1e-05 / 0.0001 |
| Batch | 4 x 4 grad-accum = 16 clips per update |
| Precision | bfloat16 autocast |
| Gradient clipping | 5.0 |
| Weight decay | 0.0 |
| Augmentation | random gain -4 to +4 dB, additive Gaussian noise at 15-30 dB SNR |
| Train crop | 6 s random crop |
| Eval cadence | every 2,000 steps, best kept on accuracy |
| Seed | 1337 |
Evaluation protocol
Both metrics come from the validation split of
UBC-NLP/NADI_2026_ADI20_micro (10,806 clips), scored with the
NADI baseline's own evaluation code:
- Accuracy — top-1 over the 20 classes.
- Average cost — the NIST LRE-style detection cost: for each target class,
the log-likelihood ratio against all others is thresholded at the Bayes point
for
p_target = 0.5,C_miss = C_fa = 1, and the per-class false-alarm and miss rates are averaged. Lower is better; it penalises confident mistakes that accuracy alone hides.
Audio is capped at 30 s at evaluation time (the first 30 s of any longer clip is used). No augmentation is applied at evaluation.
These are validation numbers, not blind-test numbers. The NADI 2026 blind test labels are held by the organisers; nothing in this repo was tuned on them.
What changed relative to the raw training checkpoint
The original artefact was a best.pt produced by torch.save mid-training: it
carried the optimizer moments, the LR-scheduler state and the Python/NumPy/CUDA
RNG state alongside the weights, and it only loaded into a bespoke
backbone + pooling + Linear wrapper class.
This repo contains the weights only, in safetensors, remapped onto the stock
Wav2Vec2ForSequenceClassification class. Two things follow: the download is roughly half the size,
and the model loads with from_pretrained without any custom code or pickle
execution.
The remap is numerically exact, not approximate. The stock head computes
classifier(mean(projector(h))) while the trained module computed
head(mean(h)). Projection and mean-pooling are both linear, so they commute:
setting classifier_proj_size = 1024 and freezing projector to the identity
makes the two computation graphs the same function. This was verified by loading
the same trained weights into both and comparing logits — the maximum absolute
difference was exactly 0.0 -- the two computation graphs are bit-identical.
The identity projector is the only tensor in this repo that was not trained: it
adds 1,049,600 parameters that compute a no-op, so the 315,459,220 trained
parameters are unchanged and model.safetensors holds 316,508,820 in total.
If you need the optimizer state to resume training, it is in the original private checkpoint; ask the authors.
Intended use and limitations
Intended use. Research on spoken Arabic dialect identification, NADI 2026 Subtask 2 reproduction, and as a component or baseline in Arabic speech pipelines.
Known limitations.
- Country is not dialect. The labels are the speaker's country of origin as annotated in ADI-20. Dialect boundaries cross national borders and several Levantine and Gulf varieties are mutually near-identical in short clips; the confusions the model makes often reflect genuine linguistic overlap rather than model failure.
- Domain. ADI-20 is built from broadcast and online speech. Accuracy on telephone audio, far-field recordings, heavy code-switching or sung speech is untested.
- Clip length. Evaluation caps audio at 30 s and training cropped to short windows. Very short clips (under ~3 s) carry little dialectal evidence and accuracy degrades.
- Class balance. Per-class performance is not uniform; MSA and the high-resource dialects are easier than the low-resource ones. Do not read the aggregate accuracy as a per-country guarantee.
- Not a speaker or language detector. Non-Arabic input will still be forced into one of the 20 Arabic classes.
Out of scope. Do not use this to infer a person's nationality, residency, ethnicity or immigration status. Accent is not identity, the label space is a coarse proxy, and errors fall hardest on the varieties that are already least represented.
Provenance and citation
This model is part of the NAMAA Community submission to the NADI 2026 shared task, by Mohamed Abdelaziz, Fatima Emad Eldin, Mousa Ashraf Abd El Malak and Omer Nacar, released through NAMAA-Space (Network for Advancing Modern ArabicNLP & AI). Cite the team paper, not this repository alone.
@inproceedings{namaa_nadi2026,
title = {NAMAA Community at NADI 2026 shared task: Mixed-Dialect and
Code-Switched Arabic ASR and Dialect Identification},
author = {Abdelaziz, Mohamed and Emad Eldin, Fatima and
Abd El Malak, Mousa Ashraf and Nacar, Omer},
booktitle = {Proceedings of the Fourth Arabic Natural Language Processing
Conference (ArabicNLP 2026)},
year = {2026}
}
Please also cite the NADI 2026 shared-task overview (Sullivan et al., 2026), the
ADI-20 dataset (Elleuch et al., 2025),
and the base model facebook/wav2vec2-xls-r-300m.
| Model repository | NAMAA-Space/nadi26-adi20-xls-r-300m |
| Original checkpoint | FatimahEmadEldin/nadi26-xlsr-ckpts (private) |
| Collection | NAMAA at NADI 2026 Shared Task |