Preprint
Article

This version is not peer-reviewed.

Dialect-Aware Retrieval-Augmented Generation for Arabic Question Answering: Measuring and Mitigating the Moroccan Darija–MSA Retrieval Gap

  † These authors contributed equally to this work and are joint first authors.

Submitted:

21 October 2026

Posted:

22 October 2026

You are already at the latest version

Abstract
Retrieval-augmented generation (RAG) systems for Arabic are evaluated almost exclusively with Modern Standard Arabic (MSA) queries, although users write in dialect. We study this mismatch with a parallel benchmark of 200 questions written in both MSA and Moroccan Darija over 3,054 Arabic Wikipedia passages. Dialectal queries lower hybrid-retrieval Recall@1 from 0.755 to 0.620, and the loss reaches the answers: with five retrieved passages, answer correctness falls from 0.810 to 0.690, mostly through additional refusals; part of this loss persists even when the gold passage is supplied directly, so retrieval is the larger but not the only component. Rewriting Darija queries into MSA does not help. Zero-shot cross-encoder reranking raises dialectal Recall@1 to 0.800 (MSA: 0.755 unreranked, 0.875 reranked) and lets a single retrieved passage replace five unreranked passages with no loss larger than five percentage points and a 3.7-fold shorter prompt. Because dialectal queries are retrieved with lower confidence, gating the reranker on the retriever’s score margin concentrates its cost on them without any dialect detection, retaining 94% of the benefit while reranking about half of the queries. The findings hold under a human-validated LLM judge (Cohen’s κ=0.797), Holm correction and three prompt wordings, and replicate judge-free on a second, Darija-trained generator. We release the benchmark, corpus, code and all result files.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  
pdfborder=0 0 0, colorlinks=true, citecolor=blue

1. Introduction

Arabic is spoken by more than 400 million people [1], but few of them write the way their reference documents are written. The language exists in a state of diglossia: Modern Standard Arabic (MSA) is the register of education, administration and publishing, while the regional dialects—Egyptian, Gulf and Maghrebi among others—are the varieties people actually speak and increasingly type. A government portal, a textbook or a health advisory is written in MSA. A citizen asking about it writes in their dialect.
This asymmetry creates a specific and under-examined problem for retrieval-augmented generation. RAG couples a generator to an external document store, retrieving passages at inference time and conditioning generation on them [2]. The architecture’s appeal is that answers are grounded in retrievable evidence rather than in parametric memory. But that guarantee is only as strong as the retrieval step: if the retriever does not surface the right passage, the generator cannot ground its answer in it. In the Arabic setting, the retriever is asked to match a dialectal query against an MSA passage, a matching problem that neither sparse lexical scoring nor dense encoders trained predominantly on standard-register text is built to solve.
The problem is compounded by how Arabic RAG is evaluated. Existing studies assess pipelines with MSA queries [3,4,5,6], and the standard multilingual retrieval benchmarks are monolingual and MSA-only for Arabic [7,8]. A system can therefore post strong reported numbers while failing on the query distribution it will actually receive in deployment. The failure is invisible precisely because the evaluation protocol holds the query register fixed at the one register users do not use.
We focus on Moroccan Darija, the Maghrebi variety, for two reasons. It is among the Arabic varieties furthest from MSA in lexicon, phonology and orthographic convention [9], drawing substantial vocabulary from Amazigh and French, which makes it a hard case and therefore an informative one. It is also the least served by existing resources: dialectal benchmarks for large language models cover Gulf, Egyptian and Levantine but exclude Maghrebi entirely [10], and work on dialect-to-MSA machine translation has likewise concentrated on the eastern varieties [11]. Resources built specifically for Darija have emerged only recently [12,13,14], and none of them targets retrieval.
Three lines of prior work approach this problem without closing it. Work on cross-dialectal Arabic question answering addresses the reading-comprehension stage, improving a reader’s ability to extract an answer span when the question and the passage are in different varieties [15,16]; the passage, however, is supplied rather than retrieved. Work on retrieval robustness across language varieties has demonstrated that neural rankers degrade when queries are written in a low-resource variety of the documents’ language, but for Romance varieties rather than Arabic, and with a fix that requires fine-tuning [17]. And the one public dataset pairing natively written dialectal Arabic questions with MSA Wikipedia passages frames the task as long-context reading comprehension over a supplied article, covers Algerian rather than Moroccan Arabic, and is not parallel across varieties [18]. The plain questions—how much retrieval degrades when only the query dialect changes, whether that loss reaches the answers, and whether it can be reduced without retraining and at an acceptable cost—remain open.
This paper answers them. Our contributions are:
  • A parallel MSA–Darija retrieval benchmark. 200 questions, each written in both MSA and Moroccan Darija, over a shared corpus of 3,054 Arabic Wikipedia passages, with a gold passage and answer for every item, so that the query variety is the only variable that changes between conditions.
  • A diagnosis of where retrieval fails. The dialect gap is concentrated at the top of the ranking: dialectal queries usually still retrieve the correct passage, but rank it first less often, and they are retrieved with measurably lower confidence. Rewriting the query into MSA does not reduce the gap.
  • Evidence that the gap reaches the answers, and a training-free way to reduce most of it. With a validated LLM judge and a judge-free metric, dialectal questions are answered correctly less often, and part of that loss persists even with the gold passage supplied. Zero-shot reranking with bge-reranker-v2-m3 raises dialectal Recall@1 to 0.800, above the unreranked MSA baseline of 0.755 though below reranked MSA (0.875), and lets a single retrieved passage replace five unreranked ones with no loss larger than five points. Within one reranker family the larger model helped and the smaller one hurt, and two Arabic-specific rerankers fell in between, consistent with capacity rather than Arabic-specific training driving the gain.
  • A cost analysis. Reranking costs about 52 times more than retrieval, and on our hardware more than the shorter prompt saves at generation time. We show that confidence-gated reranking, an established cost-saving technique, is implicitly dialect-aware: because dialectal queries are retrieved with lower confidence, it sends them to the reranker more often without any dialect detection, keeps most of the benefit at about half the cost, and clearly outperforms a random gate at the same reranking rate.
  • Robust, reproducible evidence. Results hold after Holm correction, across three prompt wordings and on held-out questions, and replicate without any judge on a second, Darija-trained generator. Where the design cannot separate effects, in particular the generation-side share of the penalty, we say so. The benchmark, corpus, code and all result files are released.

3. Materials and Methods

3.1. Retrieval Corpus

The retrieval corpus contains 3,054 Modern Standard Arabic (MSA) passages. Of these, 2,974 were extracted from 519 Morocco-related Arabic Wikipedia articles, collected from twelve seed categories and split at sentence boundaries into passages of 300–900 characters, then deduplicated. A further 80 author-written passages from an early development phase remain in the pool as distractors (Section 3.2). Every passage records its provenance. Wikipedia text is used under the CC BY-SA 4.0 licence.

3.2. Parallel Benchmark

The benchmark contains 200 items. Each item consists of an MSA question, a Moroccan Darija question expressing the same information need, a short gold answer, and the identifier of the single Wikipedia passage that contains the answer. Because passage and answer are shared, the query variety is the only variable that differs between the MSA and Darija conditions.
Source passages were sampled to exclude reference lists and other non-prose content, favouring passages with a clear factual statement, and no more than two items were drawn from any single article. Darija questions use characteristic Moroccan interrogatives, function words and verb morphology rather than lightly edited MSA, and every gold answer appears verbatim in its passage. Items were drafted with the assistance of a large language model and reviewed in full by a native speaker of Moroccan Darija, who corrected or discarded items whose Darija was unnatural or whose answer was not supported by the passage (Section 3.12).

3.2.1. Validation

Every item was checked for referential integrity (the gold passage exists in the corpus and contains the answer), for the presence of Moroccan Darija markers in the Darija question, and for verbatim grounding of every numeral in the gold answer in its passage. Items failing any check were corrected or replaced before the benchmark was frozen.

3.2.2. Dialect Authenticity

Two native speakers of Moroccan Darija among the authors (R.K. and Y.C.), neither of whom drafted the questions, independently rated a random sample of 100 Darija questions as natural Darija with the same information need as the MSA question (1) or not (0), following a one-page written instruction and without seeing each other’s ratings. Because almost all items were rated authentic, Cohen’s kappa is uninformative under such skewed labels [44]; we therefore report raw agreement together with Gwet’s AC1. The two annotators agreed on all 100 items (raw agreement 1.000; Gwet’s AC1 1.000). Items rated 0 by either annotator would have been returned for revision; in this sample there were none. Agreement this complete is consistent with the native-speaker review every item had already passed, but it is also what a lenient criterion would produce, and we do not claim more for it than that the sampled items were judged acceptable Darija by two readers.

3.2.3. Why the Benchmark Is Grounded in Wikipedia

A preliminary benchmark of 300 questions was written by the same author as its 80 passages. Its MSA questions shared on average 0.561 of their tokens with their gold passage, against 0.360 for an independently written rewrite of the same questions, so retrieval on that set partly rewarded copied wording. We therefore built the final benchmark on Wikipedia passages the question writer did not author, and report all results on it. Table 1 shows five items.

3.3. Hybrid Retrieval

Retrieval combines a sparse and a dense score. The sparse score is Okapi BM25 [19] over tokens produced by light Arabic normalisation: unification of alef variants, alef maqsura to ya, ta marbuta to ha, and removal of diacritics, tatweel and punctuation, following standard Arabic preprocessing practice [30]. The dense score is the cosine similarity of multilingual-e5-base [26] embeddings, using the model’s query and passage prefixes, with exact search over all passages. Both scores are min–max normalised over the corpus for each query before being combined:
s ( q , d ) = α s ^ dense ( q , d ) + ( 1 − α ) s ^ BM 25 ( q , d ) .
The weight α was selected on a held-out development split (Section 3.10) from { 0.0 , 0.2 , … , 1.0 } and set to α = 0.8 .

3.4. Cross-Encoder Reranking

For reranking, the 20 highest-scoring passages from hybrid retrieval are rescored by a cross-encoder, which reads the query and each candidate jointly [40]. We compare two general-purpose multilingual rerankers from the same family, bge-reranker-v2-m3 [41,45] (XLM-RoBERTa-large backbone, about 568M parameters) and bge-reranker-base [41] (XLM-RoBERTa-base, about 278M), and two Arabic-specific rerankers, GATE-Reranker-V1 [46] and Namaa-ARA-Reranker-V1 [47]. The two BGE models share a training recipe and differ in backbone size, which gives one controlled capacity comparison; the Arabic-specific models differ from both in training data as well as in size. All are used zero-shot. We also vary the number of reranked candidates over 10, 20 and 50.

3.5. Query Normalisation

As an alternative to acting on the ranking, the Darija question can be rewritten into MSA before retrieval, in the spirit of rewrite–retrieve–read pipelines [37]. The generator model (Section 3.8) rewrites each Darija question into MSA with two fixed few-shot examples unrelated to the benchmark topics; the rewritten question is passed to the same hybrid retriever.

3.6. Alternative Interventions

Three families of alternatives were evaluated before settling on reranking. The question sets differ between them and are stated for each: the encoder comparison used all 200 Wikipedia-grounded questions under the protocol of the main results; the rule-based normalisation strategies were evaluated on both the 300-question author-written development set and the 200 Wikipedia questions; and contrastive fine-tuning used passage-level splits of the 200 Wikipedia questions. Each is reported against its own baseline on its own question set.

3.6.1. Encoder Choice

We replaced the dense encoder of the hybrid retriever while keeping everything else fixed, and swept α over { 0.0 , 0.2 , … , 1.0 } for each encoder. The six candidates were two general-purpose multilingual encoders, multilingual-e5-base [26] and paraphrase-multilingual-MiniLM-L12-v2 [48]; three Arabic sentence encoders, GATE-AraBert-v1 [27], Arabic-Triplet-Matryoshka-V2 [49] and Arabert-all-nli-triplet-Matryoshka [50]; and DarijaBERT [13], a masked language model pretrained on Moroccan Darija. Because DarijaBERT is not trained as a sentence encoder, its sentence embeddings were obtained by mean pooling over token representations.

3.6.2. Query Normalisation Strategies

Besides the LLM rewrite of Section 3.5, we tested rule-based substitution of Darija function words and interrogatives with their MSA equivalents using a fixed lexicon, and query expansion that appends the substituted form to the original Darija question. Each was combined with the six encoders above on both question sets, giving a family of 24 comparisons on Recall@5.

3.6.3. Contrastive Fine-tuning

We fine-tuned multilingual-e5-base with an in-batch contrastive loss (multiple negatives ranking loss [51]) on two kinds of training pairs: a Darija question with its gold passage, and a Darija question with its MSA counterpart. Questions were split into training and evaluation sets by source passage, so that no passage used in training appears in evaluation; across the five seeds the evaluation set held 64–73 questions (mean 68) and the training set 127–136 (mean 132). Training used a batch size of 16, a learning rate of 2 × 10 − 5 with 10% warm-up, and 2, 3 or 5 epochs, each setting repeated over 5 random seeds.

3.7. Retrieval Confidence and Gated Reranking

We measure the retriever’s confidence in a query as the score margin between its two highest-ranked passages,
m ^ ( q ) = s ( q , d ( 1 ) ) − s ( q , d ( 2 ) ) .
The margin requires no gold label and costs nothing, since the scores are already computed during retrieval. Gated reranking invokes the cross-encoder only when m ^ ( q ) ≤ τ and otherwise keeps the hybrid ranking. This is an instance of confidence-based selective computation in ranking cascades; our interest is in how such a gate interacts with dialectal queries. We sweep τ from 0 (never rerank) to ∞ (always rerank). The threshold is selected on the development split (Section 3.10) as the smallest τ that retains at least 90% of the always-rerank Recall@1 gain on that split, which gave τ = 0.07 . The end-to-end gated condition of Section 3.8 was run at τ = 0.10 , the value in use before this selection rule was fixed; both are reported. Figure 1 shows the resulting pipeline.

3.8. End-to-End Generation

To measure whether retrieval differences reach the answers, retrieved passages are passed to Qwen2.5-7B-Instruct [52,53], loaded in 4-bit NF4 quantisation [54]. The prompt instructs the model to answer only from the supplied passages, in Arabic only, in one short sentence, and to state explicitly when the answer is absent. The Arabic-only instruction was added because an unconstrained prompt led the model to switch into English in early runs. The question shown to the generator is always the user’s original question, so conditions differ only in the passages supplied.
Eight conditions combine a retrieval setting with the number of passages k placed in the context: MSA retrieval ( k = 5 ); Darija retrieval ( k = 5 and k = 1 ); Darija normalised to MSA ( k = 5 ); Darija reranked ( k = 5 and k = 1 ); Darija with gated reranking ( k = 1 ); and an oracle in which the gold passage is supplied directly. Comparing reranked and unreranked retrieval at k = 1 isolates the practical value of a reliable first rank: if reranking makes rank 1 dependable, one passage should suffice. The design has no oracle condition with the MSA question (gold passage plus MSA query), so it cannot fully separate the retrieval-stage and generation-stage components of the dialect penalty; Section 4.6, Section 5.5 and Section 5.6 return to this. To test whether conclusions depend on the generator, the main conditions were repeated with a second generator from a different model family and trained on Moroccan Darija, Atlas-Chat-9B [14].

3.9. Answer Evaluation

Answers are scored on three outcomes. A refusal is an answer containing the refusal phrase that the prompt prescribes, detected by exact phrase matching; a scan of all 1,600 answers for paraphrased refusals is reported in Section 4.6. For all other answers, an LLM judge decides correctness, whether the answer matches the gold answer in meaning, with paraphrase accepted but numbers, names and dates required to match; and faithfulness, whether every claim is supported by the supplied passages. Faithfulness is reported on answered items only, because a refusal is neither supported nor unsupported by the passages; the refusal rate is reported separately.

3.9.1. Judge Selection and Validation

A same-family judge (a Qwen model judging Qwen answers) risks self-preference [23]. We therefore compared four judge configurations—Qwen2.5-14B-Instruct [55] and Atlas-Chat-9B [14], each with two prompts—against human correctness labels on a sample of 96 generated answers, 12 drawn at random from each of the eight conditions (Table 2). The second prompt adds explicit rules: a refusal is never correct, and a correct answer may include additional true detail. The selected judge, Atlas-Chat-9B with this prompt, reached Cohen’s κ = 0.797 (raw agreement 0.906; parse rate 1.000), above the conventional threshold of 0.6 [56]. Because the judge was selected on the same 96 items, this estimate may be slightly optimistic. A second annotator labelled the same items independently, without access to the judge’s verdicts; the two annotators agreed on every item, so the judge’s agreement with the second annotator is identical. An unbiased estimate would require a fresh sample never seen during selection, which we have not collected; the reported κ should be read as an upper bound (Section 5.6).

3.9.2. Judge-free Metric

So that no conclusion rests on the judge alone, every answer is also scored by token-level F 1 against the gold answer, after the Arabic normalisation of Section 3.3. For the second generator, token- F 1 is the primary metric: when Atlas-Chat-9B judged its own answers, its verdicts showed signs of self-preference (Section 4.8).

3.10. Statistical Analysis

All confidence intervals are 95% percentile bootstrap intervals [57] with 4,000 resamples and a single fixed seed, so that every quantity has one value wherever it appears. Because every condition is evaluated on the same questions, differences between conditions are computed on paired per-question differences, and p-values are taken directly from the bootstrap distribution of the paired mean (two-sided: twice the smaller tail probability at zero). This matters for discrete outcomes such as correctness, where that distribution can carry a point mass at zero, so that an interval endpoint of exactly 0.000 coexists with a large p-value. The primary hypothesis, declared in advance, is the difference in Recall@1 between MSA and Darija queries under hybrid retrieval, and is not corrected for multiplicity. All secondary comparisons are corrected with the Holm–Bonferroni procedure [58] within each family of comparisons: the end-to-end comparisons (per metric), the encoder comparisons, the normalisation strategies, the reranker comparisons and the reranking asymmetry test. For the encoder and normalisation families of Section 3.6, whose result files store only intervals, p-values were recovered from the intervals under a normal approximation [59] and are approximate. With 200 paired questions, the minimum detectable difference in correctness at α = 0.05 and 80% power is 0.096; non-significant differences are interpreted accordingly, not as evidence of no effect.
The questions were split by source passage into a development set (49 questions) and a test set (151 questions) with no shared passages. The hybrid weight α and the gating threshold τ were selected on the development set. The dense encoder, the reranker and the reranking depth were compared on all 200 questions and are reported on the same 200 questions; those comparisons are therefore descriptive model comparisons rather than held-out estimates, and their per-query outputs were not retained in a form that allows re-selection on the development split. The context size k is not tuned: k = 1 and k = 5 are both reported as experimental conditions. All end-to-end comparisons, and the retrieval-stage results with and without reranking and gating, were also re-computed on the test set alone (Section 4.8).

3.11. Implementation and Reproducibility

End-to-end generation and answer judging ran on a single NVIDIA RTX A4000 (16 GB); retrieval, reranking, encoder and fine-tuning experiments and the latency measurements ran on Google Colab runtimes with an NVIDIA Tesla T4 (16 GB). The end-to-end runs used Python 3.10.13, PyTorch 2.5.1 (CUDA 12.1), Transformers 4.57.1, Sentence-Transformers 5.7.0, bitsandbytes 0.50.2 and rank-bm25 0.2.2. Generative models were loaded in 4-bit NF4 quantisation with double quantisation and a float16 compute dtype, and decoded greedily (up to 96 new tokens for answers and 32 for judge verdicts), with seed 42. Reranking latency was measured with the 20 candidate pairs scored in batches of 16, that is, two forward passes per query; a single batch of 20 would reduce it somewhat. The compute dtype must be fixed: in a preliminary run, changing only the compute dtype of the non-quantised modules from float16 to float32 changed most generated answers and shifted correctness substantially. The complete configuration and SHA-256 checksums of every result file are recorded in the released run_environment.json.

3.12. Use of Generative AI

Generative AI (Claude, Anthropic) was used to assist in drafting benchmark questions, which were then reviewed and corrected by a native speaker and passed the validation of Section 3.2; to assist in writing and debugging the experimental code; and to assist in drafting and editing this manuscript. Large language models were also used as experimental components (query rewriting, answer generation and answer judging), as described above. All design decisions and interpretations are the authors’ own, and all reported numbers were verified against the released result files.

4. Results

4.1. The Dialect Gap Is Concentrated at Rank 1

Darija queries lower Recall@1 from 0.755 to 0.620, a gap of 0.135 (95% CI [0.085, 0.185]; the primary hypothesis), and mean reciprocal rank from 0.837 to 0.742 (gap 0.096 [0.064, 0.132]). The gap shrinks further down the ranking: by Recall@5 the two varieties differ by 0.045, by Recall@10 by 0.025, and by Recall@20, the ceiling of a depth-20 reranker, also by 0.025 (0.995 against 0.970; Table 3, Figure 2). For most dialectal queries the correct passage is retrieved; it is simply not ranked first.

4.2. Dialectal Queries Are Retrieved with Lower Confidence

The mean top-1/top-2 score margin is 0.135 for MSA queries and 0.111 for Darija queries, a paired difference of 0.024 with 95% CI [0.014, 0.034]. For dialectal queries the leading candidates are more nearly tied, so the correct passage is more easily displaced from first place. This locates where a remedy should act: on the ordering of the top candidates rather than on whether the correct passage is retrieved (Figure 3).

4.3. Rewriting the Query into MSA Does Not Help

Rewriting Darija questions into MSA before retrieval changed Darija Recall@1 from 0.620 to 0.640, a difference of +0.020 (95% CI [ − 0.030 , +0.075]) that is not significant. End to end, it changed answer correctness by − 0.055 ([ − 0.120 , +0.010]; Holm-adjusted p = 0.444 ). In earlier experiments, rule-based substitution and query expansion likewise produced no significant change in dialectal Recall@5 with any of six encoders (Appendix A.3). Removing the register difference from the query therefore does not remove the retrieval penalty. Table 4 compares every query condition used in the end-to-end experiments at the retrieval stage.

4.4. Reranking Restores the First Rank

Reranking the top 20 candidates with bge-reranker-v2-m3 raised Darija Recall@1 from 0.620 to 0.800 (+0.180, 95% CI [+0.120, +0.245]) and MSA Recall@1 from 0.755 to 0.875 (+0.120 [+0.075, +0.170]); it was also the best reranker on Darija Recall@5 (0.960) and MRR (0.872) (Table 5). Reranked Darija queries thus exceed the original MSA baseline. The MSA–Darija gap after reranking is 0.075 [0.040, 0.115]: smaller, but still significant. Reranking improved Darija more than MSA (+0.180 vs +0.120), but the paired test of this difference was not significant (+0.060, 95% CI [0.000, +0.120]), so we report the asymmetry as descriptive only.
Reranker choice matters. bge-reranker-v2-m3 left a smaller gap than both Arabic-specific rerankers (GATE-Reranker-V1: gap 0.130, Darija Recall@1 0.690; Namaa-ARA-Reranker-V1: gap 0.100, Darija Recall@1 0.500). Namaa-ARA-Reranker-V1 and the smaller general-purpose bge-reranker-base both lowered Recall@1 below hybrid retrieval alone (Darija 0.500 and 0.365, against 0.620 without reranking), so their gaps are not evidence of improvement (Figure 4). Within the BGE family, whose two members share a training recipe and differ in backbone size, the larger model helped and the smaller one hurt, and the two Arabic-specific rerankers fell between them. This is consistent with reranker capacity, rather than Arabic-specific training, driving the gain; but the four models also differ in the amount and diversity of their training data, which is confounded with size, so we present this as a hypothesis the data are consistent with rather than as a demonstrated cause.
The number of reranked candidates mattered little for the strongest model and a great deal for the weakest (Table 6). bge-reranker-v2-m3 reached the same Darija Recall@1 of 0.800 whether it rescored 10, 20 or 50 candidates, with Recall@5 rising slightly with depth as more relevant passages entered the reranked pool. bge-reranker-base, by contrast, lost accuracy as depth increased (Darija Recall@1 0.445, 0.365 and 0.305 at depths 10, 20 and 50): a reranker that cannot reliably separate relevant from irrelevant passages is given more opportunities to promote an irrelevant one. We therefore fix the depth at 20 in all later experiments.

4.5. Alternatives That Do Not Close the Gap

Appendix A explains why each of these alternatives was not adopted.

4.5.1. Encoders

multilingual-e5-base gave the best dialectal retrieval of all encoders evaluated, on every metric (Darija Recall@1 0.620, Recall@5 0.905, MRR 0.742), ahead of the Arabic-specific sentence encoders GATE-AraBert-v1 [27], Arabic-Triplet-Matryoshka-V2 and Arabert-all-nli-Matryoshka (Darija Recall@1 0.570–0.600) and the second general-purpose encoder, paraphrase-multilingual-MiniLM-L12-v2 (0.530; Appendix Table A1). It also left the smallest dialect gap at Recall@5 and in MRR; three encoders (GATE-AraBert-v1, Arabert-all-nli-Matryoshka and DarijaBERT) left slightly smaller Recall@1 gaps, but only because their MSA scores were lower, not because their Darija scores were higher. DarijaBERT [13], pretrained on Moroccan Darija, performed well on the small author-written development corpus but poorly on the Wikipedia corpus (Darija Recall@1 0.245, against 0.620 for e5). Matching the register of the documents mattered more than matching the dialect of the query. Together with Section 4.4, the strongest general-purpose multilingual models we tested outperformed the Arabic-specific alternatives both as encoder and as reranker, although not every general-purpose model did.

4.5.2. Fine-Tuning

Contrastive fine-tuning of the encoder on the parallel MSA/Darija pairs, evaluated on held-out passages (68 questions per seed on average), raised Darija Recall@1 from 0.559 to 0.630 (+0.070, positive in 5 of 5 seeds at every training length). MSA Recall@1 on the same split rose from 0.706 to 0.742, so the gap on that split fell from 0.147 to 0.113, a 23% reduction. Recall@5 changed by only +0.008 (Appendix A.2). Fine-tuning also requires training data, whereas reranking works zero-shot and recovers more of the gap.

4.6. End-to-End Answer Quality

Table 7 and Figure 5 report answer quality for the eight conditions, and Table 8 the Holm-corrected comparisons.

4.6.1. The Gap Reaches the Answers

With five passages in context, Darija questions were answered correctly less often than MSA questions: 0.690 versus 0.810, a difference of − 0.120 (95% CI [ − 0.190 , − 0.055 ]; Holm p = 0.002 ). The judge-free token- F 1 gives the same result ( − 0.088 [ − 0.129 , − 0.045 ]). The loss appears mainly as refusals rather than hallucinations: the refusal rate rose from 0.060 for MSA to 0.200 for Darija, while answered responses remained grounded, with faithfulness between 0.86 and 0.95 in every condition.

4.6.2. Reranking Makes a Single Passage Sufficient

Reducing the context to one passage without reranking lowered correctness by 0.130 ( − 0.130 [ − 0.200 , − 0.060 ]; Holm p = 0.003 ), because rank 1 is unreliable for dialectal queries. With reranking, the same one-passage context raised correctness by +0.145 over unreranked k = 1 ([+0.095, +0.200]; Holm p = 0.002 ), and was not significantly different from unreranked retrieval with five passages (+0.015 [ − 0.050 , +0.080]; Holm p = 1.000 ), while using prompts about 3.7 times shorter (about 450 versus 1,660 tokens). The confidence interval rules out a loss larger than 5 percentage points relative to the five-passage context. Reranking with five passages made no difference to correctness ( − 0.005 [ − 0.055 , +0.045]) or to token- F 1 (+0.000), although it raised gold coverage from 0.905 to 0.960: eleven more questions had the gold passage in context and none was answered better. Presence, not order, is the variable in this comparison, so the absence of any gain is a further sign of a generation-side component in the penalty, taken up below. The benefit of a reliable first rank appears when the context is small.

4.6.3. Oracle

Supplying the gold passage directly gave the highest correctness among Darija conditions, 0.765, significantly above the reranked single-passage setting (+0.060 [+0.025, +0.100]; Holm p = 0.007 ) and above every other Darija condition (Table 9), so it behaves as the ceiling it is meant to be. It is not, however, a ceiling for MSA: with the gold passage in front of the generator, one Darija question in eight was still refused (refusal rate 0.125), whereas MSA retrieval with five passages, of which only 95% contained the gold one, reached 0.810 with a refusal rate of 0.060. The difference between the Darija oracle and MSA retrieval ( − 0.045 [ − 0.110 , +0.020]) is not significant, but its sign and the doubled refusal rate show that a Darija question is answered less well than an MSA question even when retrieval is perfect: a generation-side component of the penalty exists. The design has no MSA-question oracle, so this component cannot be separated from retrieval here; Section 5.5 and Section 5.6 return to it.
Of the 25 oracle refusals, question length (8.4 against 8.0 tokens for answered items), gold-answer length (9.1 against 8.8), the share of numeric gold answers (0.52 against 0.55) and the token overlap between the Darija question and its passage (0.43 against 0.43) did not differ from the answered items, so the refusals are not explained by surface difficulty. The three refused items in Table 1 are all short numeric questions whose Darija form carries the interrogative شحال (`how much’) and the particle ديال (possessive `of’), neither of which appears in the MSA passage, while the MSA form shares its key terms with the passage. We read these refusals as the generator failing to align the dialectal question with a passage it was given, which is a reading the MSA-question oracle would test.

4.6.4. Correct Answers from Non-Gold Passages

Not every correct answer rests on the gold passage. At k = 1 with reranking, 40 questions had a non-gold passage as their only context and 10 of them (25%) were nevertheless answered correctly, against 82% when the gold passage was present; without reranking, 10 of 76 (13%). A scan of the corpus found the gold answer of 9 of the 200 questions appearing verbatim in at least one other passage (27 passages in total, all from Wikipedia; none of the 80 author-written distractors). Single-gold Recall@1 therefore slightly understates retrieval, and a small share of correct answers is grounded in redundant passages. Because both varieties are scored against the same single gold passage, this affects the absolute level of Recall@1 more than the MSA−Darija difference.

4.6.5. Refusal Detection

Refusals are detected by the exact phrase the prompt prescribes. A scan of all 1,600 answers for paraphrased refusals (thirteen Arabic expressions of unavailability) found exactly one that escaped the detector, in the reranked k = 5 condition (“the topic is not available in the passages”); it was judged incorrect. The effect on any reported rate is below 0.001.

4.7. Cost and Gated Reranking

Hybrid retrieval took a median of 26 ms per query (95th percentile 88 ms) and reranking 20 candidates a median of 1,361 ms (1,726 ms), about 52 times more (Table 10).
Figure 6. Per-query latency of hybrid retrieval and of cross-encoder reranking of 20 candidates, on a logarithmic scale. Each point is one query; bars mark the medians of Table 10.
Figure 6. Per-query latency of hybrid retrieval and of cross-encoder reranking of 20 candidates, on a logarithmic scale. Each point is one query; bars mark the medians of Table 10.
Preprints 239562 g006
Generation is not free either: on the A4000, answering from one passage took on average 465 ms per question and from five passages 1,133 ms (Table 10). Combining the two stages indicatively, since they were timed on different GPUs, gives about 1.16 s per question for five unreranked passages, 1.85 s for a reranked single passage, and 1.23 s for a gated single passage at τ = 0.10 . On this hardware the shorter prompt does not pay for the reranker: the case for the reranked single-passage pipeline is accuracy at k = 1 and prompt length, and with gating cost parity, not a speed-up. The LLM rewrite used for normalisation adds one further generation call per query; its latency was not logged separately.
Gating the reranker on retrieval confidence recovers most of the benefit at a fraction of the reranking cost (Figure 7). At τ = 0.10 , Darija Recall@1 reached 0.790, 94% of the gain from reranking every query, while only 54.5% of Darija queries were reranked. The gate is informative, not merely cheaper: reranking the same share of Darija queries chosen at random would be expected to reach a Recall@1 of 0.718 (simulation over 4,000 random subsets: [0.690, 0.750]), against 0.790 for the margin gate, and the same holds at every threshold and for MSA (Figure 7, Appendix Table A3). Because dialectal queries are retrieved with lower confidence (Section 4.2), the same threshold sent 54.5% of Darija queries but only 40.5% of MSA queries to the reranker: the gate directed effort toward dialectal queries without any dialect detection. Higher thresholds trade cost for accuracy: at τ = 0.20 , gating retained the full benefit of reranking while skipping 18.5% of reranker calls. Selecting τ on the development split alone gave τ = 0.07 ; on the 151 test questions this reached Darija Recall@1 0.795 while reranking 39.7% of queries, against 0.609 without reranking and 0.828 with reranking every query (Table 13). End to end, gated reranking at τ = 0.10 was not significantly different from always reranking ( − 0.010 [ − 0.025 , 0.000]; Holm p = 0.836 ).

4.8. Robustness

4.8.1. Without the Judge

Every significant correctness comparison is also significant with token- F 1 , which involves no judge: the dialect gap ( − 0.088 [ − 0.129 , − 0.045 ]), reranking at k = 1 (+0.085 [+0.054, +0.119]), one passage without reranking ( − 0.058 [ − 0.104 , − 0.013 ]) and the oracle headroom (+0.035 [+0.014, +0.057]), all surviving Holm correction.

4.8.2. Prompt Wording

With three semantically equivalent prompts, the dialect gap in correctness was − 0.120 , − 0.135 and − 0.115 , significant for all three, and correctness varied by at most 0.015 across prompts for MSA and Darija (Table 11). Reranked k = 1 versus unreranked k = 5 was +0.015, +0.070 and +0.020: never negative, and significantly positive for one prompt.

4.8.3. Second Generator

With Atlas-Chat-9B as the generator, all four key comparisons kept their direction and significance under token- F 1 (Table 12). The dialect gap was, if anything, larger ( − 0.117 [ − 0.146 , − 0.086 ]), although Atlas-Chat-9B scored higher overall (token- F 1 0.511 versus 0.458 for MSA questions): a generator trained on Darija did not remove a penalty that arises at retrieval. When Atlas-Chat-9B judged its own answers, the dialect gap shrank to − 0.040 ([ − 0.085 , +0.005]) and lost significance, a concrete instance of self-preference [23] and the reason we evaluate this generator with a judge-free metric.

4.8.4. Held-out Questions

On the 151 test questions, never used for any tuning decision, every end-to-end comparison kept the same direction as on the full 200 questions, and all but one kept the same significance. Reranked k = 1 remained not significantly different from unreranked k = 5 (+0.046, 95% CI [ − 0.026 , +0.119]). The exception was the oracle’s advantage over reranked k = 1 , which remained positive (+0.053 [+0.013, +0.099]) but did not survive Holm correction on the smaller split, where the minimum detectable difference rises from 0.096 to 0.119. At the retrieval stage, the dialect gap on the test split alone was 0.152 (95% CI [0.099, 0.212]; Table 13), consistent with the 0.135 measured on all 200 questions.
Table 13. Retrieval on the 151 held-out test questions, never used for selecting α or τ . Reranked share: fraction of Darija queries sent to the reranker.
Table 13. Retrieval on the 151 held-out test questions, never used for selecting α or τ . Reranked share: fraction of Darija queries sent to the reranker.
Condition Recall@1 Recall@5 Reranked share
MSA, hybrid 0.762 0.954 —
Darija, hybrid 0.609 0.921 0%
Darija, normalised 0.656 — 0%
Darija, reranked 0.828 0.967 100%
Darija, gated, τ = 0.07 (selected on dev.) 0.795 — 39.7%
Darija, gated, τ = 0.10 0.808 — 51.7%
MSA − Darija gap (hybrid) 0.152 [0.099, 0.212]

4.8.5. Multiple Comparisons at the Retrieval Stage

After Holm correction within each family, the reranker comparisons of Section 4.4 remain significant for all five rerankers tested. None of the 24 query-normalisation comparisons (six encoders, two question sets, two strategies; three nominally significant before correction) remain significant, which strengthens rather than weakens Section 4.3: no configuration survives correction. The reranking-asymmetry comparison of Section 4.4, already reported as descriptive, is confirmed non-significant after correction. All 36 encoder-gap comparisons (six encoders, two question sets, three metrics) remain significant. The p-values for these two families are recovered from stored intervals (Section 3.10).

5. Discussion

5.1. Where the Penalty Arises, and Why the Obvious Fix Fails

The dialect penalty is not a failure to retrieve. Recall@5 differs by only 0.045 between MSA and Darija (Table 3); the correct passage is present for the large majority of dialectal queries. What differs is confidence: the score margin between the two highest-ranked passages is narrower for Darija queries (Section 4.2), which is consistent with the correct passage being displaced from rank 1 more easily. This reframes the problem from “the retriever does not understand Darija” to “the retriever is less certain when the query is Darija,” which is a narrower and more tractable claim, and one that points directly at a remedy: something that sharpens ranking among near-tied candidates, rather than something that changes how the query is understood.
The same reframing suggests why rewriting the query into MSA does not help (Section 4.3). A plausible explanation, which our data are consistent with but do not isolate, is that a fluent MSA paraphrase removes the register mismatch but also resembles the corpus’s many related passages, so the top candidates remain closely scored and the ordering problem survives the rewrite. Cross-language retrieval has long shown that translating a query does not guarantee better retrieval, because translation can blur the terms that distinguish the relevant document from its neighbours [39]. Reranking, by contrast, acts directly on the ordering of the top candidates, with a model built to resolve close calls, and does so without touching the query at all.

5.2. What Reranking Changes, and What It Does Not

Reranking restores rank 1 (Section 4.4) but raises Recall@5 only modestly (0.905 to 0.960), because the passages it reorders were already, for the most part, in the top five. This is why reranking at k = 5 made no measurable difference to answer quality (Section 4.6): a generator that reads five passages is largely insensitive to which one of them is listed first. The practical value of reranking in this pipeline therefore does not lie in improving a five-passage answer. It lies in making a one-passage answer viable, because a dependable rank 1 is precisely what a single-passage context requires. Fine-tuning (Section 4.5) points the same way: it moved Recall@1 but barely Recall@5. Recall@1 and Recall@5 answer different questions, and only the second is the question a five-passage generator asks.

5.3. How the Penalty Reaches Users

Where the dialect penalty does reach answers, it shows up mainly as an increase in refusals rather than in confidently wrong answers: the refusal rate roughly tripled for Darija relative to MSA, while faithfulness among answered questions stayed high in every condition (Section 4.6). A system built on this pipeline degrades toward declining to answer rather than toward hallucinating, which is the safer failure mode of the two, but not a costless one: a user asking in dialect is more often told the system does not know, for a question an MSA speaker asking the same thing would have answered.

5.4. The Cost of Reranking, and What Gating Buys

Reranking is roughly 52 times slower than retrieval per query (Section 4.7), which makes applying it to every query a real deployment cost, not a rounding error. Gating on the retriever’s own score margin is not, in itself, a new idea; what is specific to this setting is that the margin distribution is not the same for the two query varieties (Section 4.2). Because dialectal queries sit closer to the gating threshold on average, a gate tuned only for overall cost happens to spend a larger share of its budget on dialectal queries, without ever being told which queries are dialectal. The gate is also informative rather than merely cheaper: at the same reranking rate a random gate would reach a Darija Recall@1 of about 0.718, against 0.790 for the margin gate (Section 4.7). The end-to-end results show this is not a free lunch dressed up as one: gating was not significantly different from reranking every query, but the point estimate was slightly lower, and a deployment that cannot tolerate any loss should rerank exhaustively. On our hardware, reranking every query and reading one passage was slower end to end than reading five passages without reranking, and gating brought the two to parity (Section 4.7); where the latency budget is the binding constraint, gating is therefore the better default, and the shorter prompt is a memory and context-window benefit rather than a speed-up.

5.5. What the Generator Contributes, and How to Measure It

The retrieval stage is the larger component of the dialect penalty, but the oracle shows it is not the only one. With the gold passage supplied directly, Darija questions were still refused twice as often as MSA questions answered from retrieved passages (0.125 against 0.060) and answered correctly less often (0.765 against 0.810; Section 4.6), and reranking at k = 5 raised gold coverage without raising correctness. A Darija question is therefore answered less well than an MSA question even when retrieval is perfect. Our design cannot say how much of the end-to-end gap this generation-side component accounts for, because it lacks the condition that would isolate it: the gold passage paired with the MSA question. The Darija oracle minus that MSA oracle would be the generation-side penalty, and we identify it as the first experiment to add (Section 5.6). What the present evidence does establish is that a generator trained on Darija does not remove the retrieval-stage gap (token- F 1 − 0.117 with Atlas-Chat-9B), that dedicated retrieval components decide which passage the generator reads, and that where the pipeline failed on dialectal input it failed by declining to answer rather than by producing fluent, ungrounded text.
Three further results bear on how such systems should be evaluated. First, a same-family judge is not a neutral default: when the second generator judged its own output, a judge-free effect of − 0.117 (95% CI excluding zero) became a self-judged − 0.040 whose interval included zero. This is a direct demonstration of self-preference [23], and it argues for a judge-free metric as a required check alongside any LLM judge, and for validating the judge against human labels on a sample never used to select it, which we recommend and have not yet done. Second, the minimum detectable difference at n = 200 (0.096) and at the held-out n = 151 (0.119) explains why a comparison significant on the full sample can fail on the smaller split; treating such a null as a negative finding would be a mistake. Third, every end-to-end comparison was re-computed on held-out questions never used for tuning, and all kept their direction.

5.6. Limitations

The study covers one dialect (Moroccan Darija), one topical domain (Morocco-related Wikipedia articles), and a corpus of 3,054 passages, smaller than a production Arabic knowledge base; the size of the measured gap, though plausibly not its direction, should be expected to depend on corpus scale. Because the corpus is Morocco-specific, many named entities in the Darija questions are identical to their MSA forms and match lexically, so the measured gap may be a lower bound for domains in which entity names also vary. The benchmark’s 200 items were drafted with LLM assistance and reviewed by one native speaker, with a second annotator’s ratings reported in Section 3.2 for a sample rather than the full set; LLM-drafted questions may also be stylistically more homogeneous than questions written by many users, an artefact of the kind documented for crowd-written benchmarks [33]. The LLM judge was validated against human labels on a sample of 96 answers and reached substantial but not perfect agreement ( κ = 0.797 , which may be slightly optimistic because the judge was selected on the same sample); every significant conclusion was additionally confirmed with a judge-free metric, but weaker or more marginal effects are reported with the judge’s limitations in mind. Refusals were detected by exact string match; a scan of all answers found one paraphrased refusal that escaped it, so the effect on any reported rate is negligible here, but a generator with a different refusal style would need judge-based detection. All rerankers were used zero-shot at depth 20 and none was fine-tuned, so our comparison with fine-tuned variety-robust rankers [17] is one between training-free and trained mitigations. The dense encoder, the reranker and the reranking depth were compared and reported on the same 200 questions, so those model comparisons are descriptive rather than held-out; only α and τ were selected on the development split. The judge’s κ was estimated on the sample used to select it and is an upper bound. Finally, the generation-side component of the penalty was not isolated: the design lacks an MSA-question oracle, and adding it, for both generators, is the most direct next step, followed by a second dialect and a production-scale corpus.

6. Conclusions

Dialectal queries against a Modern Standard Arabic corpus lose 0.135 Recall@1 relative to MSA queries, almost entirely as a rank-1 effect rather than a retrieval failure, and dialectal queries are retrieved with lower confidence: the score margin between the two highest-ranked passages is narrower. The intuitive repair, rewriting the dialectal query into MSA, does not close this gap in our experiments, which echoes the long-standing observation in cross-language retrieval that translating a query does not guarantee better retrieval. Zero-shot cross-encoder reranking raises dialectal Recall@1 to 0.800, above the unreranked MSA baseline of 0.755 though below reranked MSA (0.875), leaving a smaller but still significant gap (0.075, against 0.135); its practical value is concentrated where a five-passage generator is otherwise insensitive to rank: a single reranked passage replaces five unreranked ones with no loss larger than five points, at a fraction of the prompt length. Part of the answer-level penalty survives even a perfect retriever, and isolating that generation-side component is the first experiment we recommend. Because reranking is substantially more expensive than retrieval, and because dialectal queries are identifiably lower-confidence under the retriever’s own scoring, gating reranking on that confidence keeps most of the benefit at a reduced cost, without any explicit dialect signal, and does better than a random gate at the same rate. These conclusions were tested, not merely reported: they hold after correction for multiple comparisons, across three prompt wordings, on a held-out split of the benchmark, and—using a judge-free metric to rule out self-preference—on a second, dialect-trained generator. We release the benchmark, corpus, code and complete result files so that the retrieval-stage diagnosis, the reranking mitigation, and the gating policy can each be tested independently on other dialects, domains and corpora.

Author Contributions

Conceptualization, A.E.A. and K.B.; methodology, A.E.A.; software, A.E.A.; validation, R.K. and Y.C.; annotation of dialect authenticity and of judge-validation labels, R.K. and Y.C.; formal analysis, A.E.A.; investigation, A.E.A. and R.K.; data curation, R.K.; writing—original draft preparation, A.E.A.; writing—review and editing, Y.C. and K.B.; visualization, A.E.A.; supervision, K.B.; project administration, A.E.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Ethical review and approval were waived for this study, because the only human involvement was the annotation of question text and model-generated answers by adult native-speaker volunteers, and no personal data were collected.

Data Availability Statement

The benchmark, retrieval corpus, human annotation sheets, code and all result files underlying this article are openly available in the project repository at https://github.com/Rania-khaoudane/MSA and from the corresponding author’s GitHub account (https://github.com/elamraniadnane1); a versioned archive of the repository is deposited on Zenodo (DOI to be inserted at deposit, before submission). Passages derived from Arabic Wikipedia are distributed under CC BY-SA 4.0; the questions, labels, results and documentation under CC BY-SA 4.0; and the code under the Apache License, Version 2.0. Library versions, hardware, quantisation settings and checksums of every result file are recorded in the included run_environment.json.

Acknowledgments

The authors thank the native speakers of Moroccan Darija who reviewed the benchmark and provided the annotations used to validate it. During the preparation of this study and manuscript, the authors used Claude (Anthropic) to assist in drafting benchmark questions, in writing and debugging the experimental code, and in drafting and editing the text, as described in Section 3.12. The authors have reviewed and edited all output and take full responsibility for the content of this publication.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

   The following abbreviations are used in this manuscript:
MSA Modern Standard Arabic
RAG Retrieval-Augmented Generation
MRR Mean Reciprocal Rank
BM25 Best Matching 25 (ranking function)
LLM Large Language Model
QA Question Answering
CI Confidence Interval

Appendix A. Alternatives Not Adopted

This appendix summarises the alternatives evaluated before settling on hybrid retrieval with multilingual-e5-base and zero-shot reranking. They were run during development, partly on held-out passages, so each is compared with its own baseline.

Appendix A.1. Dense Encoders and DarijaBERT

Table A1. The six dense encoders under hybrid retrieval on all 200 Wikipedia-grounded questions, each at its best mixing weight. Gaps are MSA−Darija differences.
Table A1. The six dense encoders under hybrid retrieval on all 200 Wikipedia-grounded questions, each at its best mixing weight. Gaps are MSA−Darija differences.
Encoder MSA R@1 Darija R@1 Darija R@5 Darija MRR R@1 gap R@5 gap
multilingual-e5-base 0.755 0.620 0.905 0.742 0.135 0.045
GATE-AraBert-v1 0.730 0.600 0.855 0.705 0.130 0.055
Arabic-Triplet-Matryoshka-V2 0.745 0.580 0.835 0.691 0.165 0.095
Arabert-all-nli-Matryoshka 0.690 0.570 0.850 0.693 0.120 0.090
paraphrase-multilingual-MiniLM-L12-v2 0.700 0.530 0.820 0.645 0.170 0.090
DarijaBERT (mean pooling) 0.365 0.245 0.515 0.359 0.120 0.130
multilingual-e5-base gave the best dialectal retrieval on every metric (Table A1). Two Arabic encoders show slightly smaller Recall@1 gaps only because their MSA scores are lower. DarijaBERT, the only model pretrained on Moroccan Darija, was not adopted: it is a masked language model rather than a sentence encoder, its pretraining on informal Darija does not match the encyclopedic MSA of the documents, and its results reversed with the corpus—best of all encoders on the small development corpus (Darija Recall@1 0.737), worst on the Wikipedia corpus (0.245).

Appendix A.2. Contrastive Fine-Tuning

Table A2. Contrastive fine-tuning of multilingual-e5-base, evaluated on held-out passages (64–73 questions per seed); means over 5 random seeds, each column rounded independently from per-seed values, so a gain may differ from after-minus-before by 0.001. Before fine-tuning: Darija Recall@1 0.559, MSA 0.706.
Table A2. Contrastive fine-tuning of multilingual-e5-base, evaluated on held-out passages (64–73 questions per seed); means over 5 random seeds, each column rounded independently from per-seed values, so a gain may differ from after-minus-before by 0.001. Before fine-tuning: Darija Recall@1 0.559, MSA 0.706.
Epochs Darija R@1 Seeds improved Δ Darija R@5 Δ Darija MRR Δ MSA R@1
2 0.600 (+0.041) 5/5 −0.016 +0.024 +0.013
3 0.622 (+0.062) 5/5 +0.002 +0.038 +0.034
5 0.630 (+0.070) 5/5 +0.008 +0.043 +0.036
Fine-tuning improved Darija Recall@1 in every seed at every training length (Table A2), without lowering MSA retrieval. It was not adopted because it leaves Recall@5—what a five-passage generator reads—almost unchanged, because it requires parallel dialect–MSA training data that reranking does not, and because on the author-written development set it learned the question writer’s style rather than the dialect [33].

Appendix A.3. Query Normalisation

Rule-based substitution of Darija function words and query expansion, each combined with six encoders on two question sets, produced no significant change in dialectal Recall@5; three of the 24 comparisons were nominally significant, none remained so after Holm correction, and some were decreases. On the final benchmark, the full LLM rewrite changed Darija Recall@1 by +0.020 (95% CI [ − 0.030 , +0.075]) and answer correctness by − 0.055 ([ − 0.120 , +0.010]). Normalisation was not adopted: it did not improve retrieval or answers, and the LLM rewrite adds a generation step before every retrieval.

Appendix B. Gated Reranking at Every Threshold

Table A3. Confidence-gated reranking across thresholds τ (200 questions). Random gate: expected Darija Recall@1 if the same share of queries were reranked at random, ( 1 − p ) × 0.620 + p × 0.800 . Benefit kept is the share of the Darija Recall@1 gain from always reranking ( 0.620 → 0.800 ); calls saved is the share of Darija queries not reranked.
Table A3. Confidence-gated reranking across thresholds τ (200 questions). Random gate: expected Darija Recall@1 if the same share of queries were reranked at random, ( 1 − p ) × 0.620 + p × 0.800 . Benefit kept is the share of the Darija Recall@1 gain from always reranking ( 0.620 → 0.800 ); calls saved is the share of Darija queries not reranked.
τ Darija R@1 Random gate Darija reranked MSA reranked Benefit kept Calls saved
0 (never) 0.620 0.620 0.0% 0.0% 0% 100.0%
0.05 0.735 0.673 29.5% 21.0% 64% 70.5%
0.07 0.780 0.696 42.0% 29.5% 89% 58.0%
0.10 0.790 0.718 54.5% 40.5% 94% 45.5%
0.15 0.795 0.751 72.5% 62.0% 97% 27.5%
0.20 0.800 0.767 81.5% 74.0% 100% 18.5%
∞ (always) 0.800 0.800 100.0% 100.0% 100% 0.0%

Appendix C. Development-Split Selection

The 200 questions were split by source passage into a development set of 49 questions and a test set of 151, with no passage shared between the two. The hybrid weight α was chosen on the development set alone (Table A4); α = 0.8 maximised development Recall@1. Reranking depth did not affect development Recall@1 (0.714 at depths 10, 20 and 50), and 20 was retained. Table 13 in the main text reports retrieval on the test split.
Table A4. Selection of the hybrid weight α on the 49 development questions (Darija queries, hybrid retrieval without reranking).
Table A4. Selection of the hybrid weight α on the 49 development questions (Darija queries, hybrid retrieval without reranking).
α Dev. Recall@1 Dev. Recall@5
0.0 (BM25 only) 0.551 0.755
0.2 0.571 0.796
0.4 0.571 0.878
0.6 0.592 0.898
0.8 0.653 0.857
1.0 (dense only) 0.490 0.694
Neither extreme performed well: BM25 alone loses the semantic matching that dialectal paraphrase requires, and the dense encoder alone loses the exact-term matches on names and numbers that BM25 supplies. The hybrid is not a convenience but a necessity for dialectal queries on this corpus.

Appendix D. Prompt Specifications

All prompts were written in Arabic; they are rendered here in English. The exact Arabic strings are in the released code.

Appendix D.0.1. Generation Prompt

Answer the following question relying only on the attached passages. Mandatory rules: answer in Arabic only, and do not use any word in Latin script; if the answer is not present in the passages, write exactly: “The information is not available in the passages”; do not use any outside knowledge; answer in one short sentence only. The passages follow, numbered, then the question, then the cue “Answer:”. The three prompt wordings of Section 4.8 express these four rules in three different phrasings with the same structure and the same refusal string.

Appendix D.0.2. Normalisation Prompt

Rephrase the question written in Moroccan Darija into Modern Standard Arabic, keeping exactly the same meaning. Write only the rephrased question, without explanation. Two fixed examples precede the input, one asking where a city’s new airport is and one asking why people prefer the train to the bus; neither topic occurs in the benchmark.

Appendix D.0.3. Judge Prompt (Selected, Version 2)

The judge receives the reference passages, the MSA form of the question, the gold answer and the submitted answer, then three rules. Refusal rule: if the submitted answer states that the information is unavailable, the verdict is unsupported and non-matching, unless the gold answer itself states unavailability. Matching rule: it suffices that the submitted answer contains the correct essence; not every detail of the gold answer must be mentioned; additional correct detail does not invalidate a match; the correct number within a broader correct context counts as a match; differences of wording or order are accepted; a difference in numbers, names or dates means non-matching. Support rule: supported means that everything in the submitted answer is explicitly present in the reference passages. The judge answers on two lines, “Supported: yes/no” and “Matching: yes/no”, with no explanation. Version 1 of the prompt asks the same two questions without the explicit rules; its lower agreement with human labels (Table 2) is attributable mainly to inconsistent handling of refusals and of answers that add correct detail.

References

  1. Eberhard, D.M.; Simons, G.F.; Fennig, C.D., Eds. Ethnologue: Languages of the World, 27th ed.; SIL International: Dallas, TX, USA, 2024. Available online: https://www.ethnologue.com (accessed on 29 September 2026).
  2. Lewis, P.; Perez, E.; Piktus, A.; Petroni, F.; Karpukhin, V.; Goyal, N.; Küttler, H.; Lewis, M.; Yih, W.; Rocktäschel, T.; Riedel, S.; Kiela, D. Retrieval-augmented generation for knowledge-intensive NLP tasks. In Advances in Neural Information Processing Systems; Curran Associates: Red Hook, NY, USA, 2020; Volume 33, pp. 9459–9474.
  3. El-Beltagy, S.R.; Abdallah, M.A. Exploring retrieval augmented generation in Arabic. Procedia Comput. Sci. 2024. Available online: https://arxiv.org/abs/2408.07425 (accessed on 11 September 2026).
  4. Mahboub, A.; Za’ter, M.E.; Al-Rfooh, B.; Estaitia, Y.; Jaljuli, A.; Hakouz, A. Evaluation of semantic search and its role in retrieved-augmented-generation (RAG) for Arabic language. arXiv 2024, arXiv:2403.18350.
  5. Alsubhi, J.; Alahmadi, M.D.; Alhusayni, A.; Aldailami, I.; Hamdine, I.; Shabana, A.; Iskandar, Y.; Khayyat, S. Optimizing RAG pipelines for Arabic: A systematic analysis of core components. arXiv 2025, arXiv:2506.06339.
  6. Alothman, M.; Altammami, A.; Alhoshan, M.; Almazrua, A.; Al-Rasheed, R.; Almatham, R. ARAG: An agent-based hybrid semantic-lexical retrieval-augmented generation pipeline for Arabic texts. Procedia Comput. Sci. 2026, 275, 682–691.
  7. Zhang, X.; Thakur, N.; Ogundepo, O.; Kamalloo, E.; Alfonso-Hermelo, D.; Li, X.; Liu, Q.; Rezagholizadeh, M.; Lin, J. MIRACL: A multilingual retrieval dataset covering 18 diverse languages. Trans. Assoc. Comput. Linguist. 2023, 11, 1114–1131. [CrossRef]
  8. Zhang, X.; Ma, X.; Shi, P.; Lin, J. Mr. TyDi: A multi-lingual benchmark for dense retrieval. In Proceedings of the 1st Workshop on Multilingual Representation Learning, Punta Cana, Dominican Republic, 11 November 2021.
  9. Bouamor, H.; Habash, N.; Salameh, M.; Zaghouani, W.; Rambow, O.; Abdulrahim, D.; Obeid, O.; Khalifa, S.; Eryani, F.; Erdmann, A.; Oflazer, K. The MADAR Arabic dialect corpus and lexicon. In Proceedings of the 11th Language Resources and Evaluation Conference (LREC), Miyazaki, Japan, 7–12 May 2018; pp. 3387–3396.
  10. Mousi, B.; Durrani, N.; Ahmad, F.; Hasan, M.A.; Hasanain, M.; Kabbani, T.; Dalvi, F.; Chowdhury, S.A.; Alam, F. AraDiCE: Benchmarks for dialectal and cultural capabilities in LLMs. In Proceedings of the 31st International Conference on Computational Linguistics (COLING), Abu Dhabi, United Arab Emirates, 19–24 January 2025; pp. 4186–4218.
  11. Alam, A.; et al. Advancing dialectal Arabic to Modern Standard Arabic machine translation. arXiv 2025, arXiv:2507.20301.
  12. Outchakoucht, A.; Es-Samaali, H. Moroccan dialect—Darija open dataset. arXiv 2021, arXiv:2103.09687.
  13. Gaanoun, K.; Naira, A.M.; Allak, A.; Benelallam, I. DarijaBERT: A step forward in NLP for the written Moroccan dialect. Int. J. Data Sci. Anal. 2024. [CrossRef]
  14. Shang, G.; Abdine, H.; Khoubrane, Y.; Mohamed, A.; Abbahaddou, Y.; Ennadir, S.; Momayiz, I.; Ren, X.; Moulines, E.; Nakov, P.; Vazirgiannis, M.; Xing, E. Atlas-Chat: Adapting large language models for low-resource Moroccan Arabic dialect. In Proceedings of the First Workshop on Language Models for Low-Resource Languages (LoResLM) at COLING, Abu Dhabi, United Arab Emirates, 19–20 January 2025.
  15. Althobaiti, M.J. ArDQA: A parallel multidomain benchmark for cross-dialectal Arabic question answering. Research Square 2025, preprint (not peer reviewed). [CrossRef]
  16. Althobaiti, M.J. Generalised cross-dialectal Arabic question answering through adaptive code-mixed data augmentation. Information 2026, 17, 139.
  17. Chari, A.; MacAvaney, S.; Ounis, I. Improving low-resource retrieval effectiveness using zero-shot linguistic similarity transfer. In Advances in Information Retrieval (ECIR 2025); Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2025; Volume 15575, pp. 290–306.
  18. Riley, P.; Shakeri, S.; Ammar, W.; Clark, J.H. TyDi QA-WANA: A benchmark for information-seeking question answering in languages of West Asia and North Africa. arXiv 2025, arXiv:2507.17709.
  19. Robertson, S.; Zaragoza, H. The probabilistic relevance framework: BM25 and beyond. Found. Trends Inf. Retr. 2009, 3, 333–389. [CrossRef]
  20. Karpukhin, V.; Oğuz, B.; Min, S.; Lewis, P.; Wu, L.; Edunov, S.; Chen, D.; Yih, W. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Online, 16–20 November 2020; pp. 6769–6781. [CrossRef]
  21. Es, S.; James, J.; Espinosa-Anke, L.; Schockaert, S. RAGAS: Automated evaluation of retrieval augmented generation. In Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (EACL): System Demonstrations, St. Julians, Malta, 17–22 March 2024.
  22. Saad-Falcon, J.; Khattab, O.; Potts, C.; Zaharia, M. ARES: An automated evaluation framework for retrieval-augmented generation systems. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), Mexico City, Mexico, 16–21 June 2024; pp. 338–354.
  23. Panickssery, A.; Bowman, S.R.; Feng, S. LLM evaluators recognize and favor their own generations. In Advances in Neural Information Processing Systems; 2024; Volume 37.
  24. Thakur, N.; Bonifacio, L.; Zhang, X.; Ogundepo, O.; Kamalloo, E.; Alfonso-Hermelo, D.; Li, X.; Liu, Q.; Chen, B.; Rezagholizadeh, M.; Lin, J. “Knowing when you don’t know”: A multilingual relevance assessment dataset for robust retrieval-augmented generation. In Findings of the Association for Computational Linguistics: EMNLP 2024; Miami, FL, USA, 12–16 November 2024.
  25. Fanar Team. Fanar: An Arabic-centric multimodal generative AI platform. arXiv 2025, arXiv:2501.13944.
  26. Wang, L.; Yang, N.; Huang, X.; Yang, L.; Majumder, R.; Wei, F. Multilingual E5 text embeddings: A technical report. arXiv 2024, arXiv:2402.05672.
  27. Nacar, O.; Koubaa, A.; Sibaee, S.; Al-Habashi, Y.; Ammar, A.; Boulila, W. GATE: General Arabic text embedding for enhanced semantic textual similarity with Matryoshka representation learning and hybrid loss training. arXiv 2025, arXiv:2505.24581.
  28. Antoun, W.; Baly, F.; Hajj, H. AraBERT: Transformer-based model for Arabic language understanding. In Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools (OSACT) at LREC, Marseille, France, 12 May 2020.
  29. Abdul-Mageed, M.; Elmadany, A.; Nagoudi, E.M.B. ARBERT & MARBERT: Deep bidirectional transformers for Arabic. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics (ACL), Online, 1–6 August 2021.
  30. Obeid, O.; Zalmout, N.; Khalifa, S.; Taji, D.; Oudah, M.; Alhafni, B.; Inoue, G.; Eryani, F.; Erdmann, A.; Habash, N. CAMeL Tools: An open source Python toolkit for Arabic natural language processing. In Proceedings of the 12th Language Resources and Evaluation Conference (LREC), Marseille, France, 11–16 May 2020; pp. 7022–7032.
  31. Abdul-Mageed, M.; Keleg, A.; Elmadany, A.; Zhang, C.; Hamed, I.; Magdy, W.; Bouamor, H.; Habash, N. NADI 2024: The fifth nuanced Arabic dialect identification shared task. In Proceedings of the Second Arabic Natural Language Processing Conference (ArabicNLP), Bangkok, Thailand, 16 August 2024.
  32. Meftouh, K.; Harrat, S.; Jamoussi, S.; Abbas, M.; Smaili, K. PADIC: A parallel Arabic dialect corpus and its applications. In Proceedings of the 29th Pacific Asia Conference on Language, Information and Computation (PACLIC), Shanghai, China, 30 October–1 November 2015.
  33. Gururangan, S.; Swayamdipta, S.; Levy, O.; Schwartz, R.; Bowman, S.R.; Smith, N.A. Annotation artifacts in natural language inference data. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), New Orleans, LA, USA, 1–6 June 2018; pp. 107–112. [CrossRef]
  34. Faisal, F.; Ahia, O.; Srivastava, A.; Ahuja, K.; Chiang, D.; Tsvetkov, Y.; Anastasopoulos, A. DIALECTBENCH: An NLP benchmark for dialects, varieties, and closely-related languages. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (ACL), Bangkok, Thailand, 11–16 August 2024.
  35. Lin, F.; Mao, S.; La Malfa, E.; Hofmann, V.; de Wynter, A.; Yao, J.; Chen, S.-Q.; Wooldridge, M.; Wei, F. One language, many gaps: Evaluating dialect fairness and robustness of large language models in reasoning tasks. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (ACL), Vienna, Austria, 27 July–1 August 2025.
  36. Li, B.; Haider, F.; Callison-Burch, C.; Ritter, A. BordIRlines: Multilingual retrieval augmented generation for culturally-sensitive tasks. arXiv 2024, arXiv:2410.01171.
  37. Ma, X.; Gong, Y.; He, P.; Zhao, H.; Duan, N. Query rewriting for retrieval-augmented large language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing (EMNLP), Singapore, 6–10 December 2023.
  38. Gao, L.; Ma, X.; Lin, J.; Callan, J. Precise zero-shot dense retrieval without relevance labels. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (ACL), Toronto, ON, Canada, 9–14 July 2023; pp. 1762–1777.
  39. Ballesteros, L.; Croft, W.B. Phrasal translation and query expansion techniques for cross-language information retrieval. In Proceedings of the 20th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, Philadelphia, PA, USA, 27–31 July 1997; pp. 84–91. [CrossRef]
  40. Nogueira, R.; Cho, K. Passage re-ranking with BERT. arXiv 2019, arXiv:1901.04085.
  41. Chen, J.; Xiao, S.; Zhang, P.; Luo, K.; Lian, D.; Liu, Z. BGE M3-Embedding: Multi-lingual, multi-functionality, multi-granularity text embeddings through self-knowledge distillation. arXiv 2024, arXiv:2402.03216.
  42. Wang, L.; Lin, J.; Metzler, D. A cascade ranking model for efficient ranked retrieval. In Proceedings of the 34th International ACM SIGIR Conference on Research and Development in Information Retrieval, Beijing, China, 24–28 July 2011; pp. 105–114. [CrossRef]
  43. Carmel, D.; Yom-Tov, E. Estimating the Query Difficulty for Information Retrieval; Synthesis Lectures on Information Concepts, Retrieval, and Services; Morgan & Claypool: San Rafael, CA, USA, 2010.
  44. Gwet, K.L. Computing inter-rater reliability and its variance in the presence of high agreement. Br. J. Math. Stat. Psychol. 2008, 61, 29–48. [CrossRef]
  45. BAAI. bge-reranker-v2-m3 (model card). Hugging Face. Available online: https://huggingface.co/BAAI/bge-reranker-v2-m3 (accessed on 29 September 2026).
  46. NAMAA-Space. GATE-Reranker-V1 (model card). Hugging Face. Available online: https://huggingface.co/NAMAA-Space/GATE-Reranker-V1 (accessed on 29 September 2026).
  47. NAMAA-Space. Namaa-ARA-Reranker-V1 (model card). Hugging Face. Available online: https://huggingface.co/NAMAA-Space/Namaa-ARA-Reranker-V1 (accessed on 29 September 2026).
  48. Reimers, N.; Gurevych, I. Sentence-BERT: Sentence embeddings using Siamese BERT-networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, China, 3–7 November 2019; pp. 3982–3992. [CrossRef]
  49. Omartificial Intelligence Space. Arabic-Triplet-Matryoshka-V2 (model card). Hugging Face. Available online: https://huggingface.co/Omartificial-Intelligence-Space/Arabic-Triplet-Matryoshka-V2 (accessed on 29 September 2026).
  50. Omartificial Intelligence Space. Arabert-all-nli-triplet-Matryoshka (model card). Hugging Face. Available online: https://huggingface.co/Omartificial-Intelligence-Space/Arabert-all-nli-triplet-Matryoshka (accessed on 29 September 2026).
  51. Henderson, M.; Al-Rfou, R.; Strope, B.; Sung, Y.-H.; Lukács, L.; Guo, R.; Kumar, S.; Miklos, B.; Kurzweil, R. Efficient natural language response suggestion for smart reply. arXiv 2017, arXiv:1705.00652.
  52. Qwen Team. Qwen2.5 technical report. arXiv 2024, arXiv:2412.15115.
  53. Qwen. Qwen2.5-7B-Instruct (model card). Hugging Face. Available online: https://huggingface.co/Qwen/Qwen2.5-7B-Instruct (accessed on 29 September 2026).
  54. Dettmers, T.; Pagnoni, A.; Holtzman, A.; Zettlemoyer, L. QLoRA: Efficient finetuning of quantized LLMs. In Advances in Neural Information Processing Systems; Curran Associates: Red Hook, NY, USA, 2023; Volume 36.
  55. Qwen. Qwen2.5-14B-Instruct (model card). Hugging Face. Available online: https://huggingface.co/Qwen/Qwen2.5-14B-Instruct (accessed on 29 September 2026).
  56. Landis, J.R.; Koch, G.G. The measurement of observer agreement for categorical data. Biometrics 1977, 33, 159–174. [CrossRef]
  57. Efron, B.; Tibshirani, R.J. An Introduction to the Bootstrap; Chapman and Hall/CRC: Boca Raton, FL, USA, 1994.
  58. Holm, S. A simple sequentially rejective multiple test procedure. Scand. J. Stat. 1979, 6, 65–70.
  59. Altman, D.G.; Bland, J.M. How to obtain the P value from a confidence interval. BMJ 2011, 343, d2304. [CrossRef]
Figure 1. The retrieval pipeline. Hybrid retrieval (BM25 and multilingual-e5-base) returns a ranked candidate list together with the score margin m ^ ( q ) between its two highest-ranked passages. If the margin exceeds the threshold τ , the hybrid ranking is used as it is; otherwise the top 20 candidates are rescored by a cross-encoder. The median latencies shown are those measured in Section 4.7.
Figure 1. The retrieval pipeline. Hybrid retrieval (BM25 and multilingual-e5-base) returns a ranked candidate list together with the score margin m ^ ( q ) between its two highest-ranked passages. If the margin exceeds the threshold τ , the hybrid ranking is used as it is; otherwise the top 20 candidates are rescored by a cross-encoder. The median latencies shown are those measured in Section 4.7.
Preprints 239562 g001
Figure 2. Recall@k for MSA and Darija queries, with hybrid retrieval only (dashed) and after reranking with bge-reranker-v2-m3 (solid).
Figure 2. Recall@k for MSA and Darija queries, with hybrid retrieval only (dashed) and after reranking with bge-reranker-v2-m3 (solid).
Preprints 239562 g002
Figure 3. Distribution of the top-1/top-2 score margin under hybrid retrieval, by query variety (200 questions each). The dotted line marks τ = 0.10 ; more of the Darija distribution lies below it, which is what a margin gate exploits. The paired MSA−Darija difference in means is 0.024 (95% CI [0.014, 0.034]).
Figure 3. Distribution of the top-1/top-2 score margin under hybrid retrieval, by query variety (200 questions each). The dotted line marks τ = 0.10 ; more of the Darija distribution lies below it, which is what a margin gate exploits. The paired MSA−Darija difference in means is 0.024 (95% CI [0.014, 0.034]).
Preprints 239562 g003
Figure 4. MSA−Darija Recall@1 gap without reranking and with each reranker, with 95% bootstrap confidence intervals. A smaller gap is not by itself an improvement: Namaa-ARA-Reranker-V1 narrowed the gap while lowering Recall@1 for both varieties (Table 5).
Figure 4. MSA−Darija Recall@1 gap without reranking and with each reranker, with 95% bootstrap confidence intervals. A smaller gap is not by itself an improvement: Namaa-ARA-Reranker-V1 narrowed the gap while lowering Recall@1 for both varieties (Table 5).
Preprints 239562 g004
Figure 5. Answer correctness by condition under the selected judge (Table 2), with 95% bootstrap confidence intervals. Filled markers denote a single-passage context; labels give the mean prompt length.
Figure 5. Answer correctness by condition under the selected judge (Table 2), with 95% bootstrap confidence intervals. Filled markers denote a single-passage context; labels give the mean prompt length.
Preprints 239562 g005
Figure 7. Recall@1 against the share of queries sent to the reranker across thresholds τ , for Darija and MSA queries. Dotted lines give the expected Recall@1 of a random gate at the same reranking rate.
Figure 7. Recall@1 against the share of queries sent to the reranker across thresholds τ , for Darija and MSA queries. Dotted lines give the expected Recall@1 of a random gate at the same reranking rate.
Preprints 239562 g007
Table 1. Five benchmark items. Darija questions use characteristic interrogatives (شحال `how much’, فين `where’) and the possessive particle ديال, none of which occur in the MSA passages. Margins are the top-1/top-2 hybrid-retrieval score margins for the MSA and Darija forms of the question. ‡: the generator refused this item even with the gold passage supplied (Section 4.6).
Table 1. Five benchmark items. Darija questions use characteristic interrogatives (شحال `how much’, فين `where’) and the possessive particle ديال, none of which occur in the MSA passages. Margins are the top-1/top-2 hybrid-retrieval score margins for the MSA and Darija forms of the question. ‡: the generator refused this item even with the gold passage supplied (Section 4.6).
Item Darija question MSA question Gold answer English gloss (question — answer) Margins (MSA / Darija)
w011‡ شحال وصلات نسبة البطالة عند النساء حسب تقرير البنك الدولي؟ كم بلغت نسبة البطالة لدى النساء حسب تقرير البنك الدولي؟ بلغت نسبة البطالة لدى النساء 14.7%. What did the female unemployment rate reach according to the World Bank report? — It reached 14.7%. 0.067 / 0.032
w016‡ شحال وصل معدل النمو السكاني ما بين 2014 و2024؟ كم بلغ معدل النمو السكاني خلال الفترة 2014-2024؟ بلغ 0,85% فقط خلال الفترة 2014–2024. What was the population growth rate between 2014 and 2024? — Only 0.85% over 2014–2024. 0.106 / 0.030
w018‡ شحال كيمثل الإنتاج الوطني ديال الطاقة من الحاجيات ديال البلاد؟ كم يمثل الإنتاج الوطني من الطاقة الأولية من احتياجات البلد؟ لا يمثل الإنتاج الوطني سوى 9,4% من احتياجات البلد. What share of the country’s needs does national primary-energy production cover? — Only 9.4% of the country’s needs. 0.127 / 0.028
w001 شحال ديال الطوموبيلات الجديدة تباعو فالمغرب فـ2017؟ كم عدد السيارات الجديدة التي بيعت في المغرب سنة 2017؟ بلغت مبيعات السيارات الجديدة 593 168 وحدة بنهاية عام 2017، بزيادة قدرها 3.4% مقارنة بـ2016. How many new cars were sold in Morocco in 2017? — 168,593 units by the end of 2017, up 3.4% on 2016. 0.305 / 0.086
w002 فين كاين المصنع ديال رينو-نيسان فالمغرب؟ أين يوجد مصنع رينو-نيسان في المغرب؟ يوجد مصنع رينو-نيسان في طنجة، ملوسة. Where is the Renault–Nissan plant in Morocco? — In Tangier (Melloussa). 0.121 / 0.090
Table 2. Judge configurations compared against human correctness labels ( n = 96 ).
Table 2. Judge configurations compared against human correctness labels ( n = 96 ).
Judge / prompt Cohen’s κ Agreement Parse rate
Atlas-Chat-9B, prompt v2 (selected) 0.797 0.906 1.000
Atlas-Chat-9B, prompt v1 0.776 0.896 1.000
Qwen2.5-14B, prompt v1 0.565 0.802 1.000
Qwen2.5-14B, prompt v2 0.537 0.802 1.000
Table 3. Hybrid retrieval by query variety (200 questions). Gaps are paired MSA−Darija differences with 95% bootstrap confidence intervals.
Table 3. Hybrid retrieval by query variety (200 questions). Gaps are paired MSA−Darija differences with 95% bootstrap confidence intervals.
Metric MSA Darija Gap
Recall@1 0.755 0.620 0.135 [0.085, 0.185]
Recall@3 0.895 0.830 0.065
Recall@5 0.950 0.905 0.045
Recall@10 0.975 0.950 0.025
Recall@20 0.995 0.970 0.025
MRR 0.837 0.742 0.096 [0.064, 0.132]
Table 4. Retrieval quality for every query condition (200 questions). Δ R@1 is the paired difference from the Darija query with its 95% bootstrap confidence interval.
Table 4. Retrieval quality for every query condition (200 questions). Δ R@1 is the paired difference from the Darija query with its 95% bootstrap confidence interval.
Query condition R@1 R@5 MRR ΔR@1 vs. Darija
MSA query 0.755 0.950 0.837 +0.135 [+0.085, +0.185]
Darija query 0.620 0.905 0.742 –
Darija, normalised to MSA 0.640 0.870 0.743 +0.020 [−0.030, +0.075]
Darija, reranked 0.800 0.960 0.872 +0.180 [+0.120, +0.245]
Darija, margin-gated (τ = 0.10) 0.790 0.955 0.863 +0.170 [+0.115, +0.230]
Table 5. Retrieval after reranking the top 20 candidates (200 questions). The gap is the paired MSA−Darija difference in Recall@1 with its 95% bootstrap confidence interval.
Table 5. Retrieval after reranking the top 20 candidates (200 questions). The gap is the paired MSA−Darija difference in Recall@1 with its 95% bootstrap confidence interval.
Reranker MSA R@1 Darija R@1 Darija R@5 Darija MRR R@1 gap (95% CI)
None (hybrid retrieval) 0.755 0.620 0.905 0.742 0.135 [0.085, 0.185]
bge-reranker-v2-m3 0.875 0.800 0.960 0.872 0.075 [0.040, 0.115]
GATE-Reranker-V1 0.820 0.690 0.920 0.790 0.130 [0.080, 0.180]
Namaa-ARA-Reranker-V1 0.600 0.500 0.765 0.627 0.100 [0.040, 0.160]
bge-reranker-base 0.520 0.365 0.720 0.527 0.155 [0.085, 0.225]
Table 6. Effect of the number of reranked candidates (200 questions). Recall@1 of bge-reranker-v2-m3 is stable across depths; the smaller bge-reranker-base degrades as depth grows.
Table 6. Effect of the number of reranked candidates (200 questions). Recall@1 of bge-reranker-v2-m3 is stable across depths; the smaller bge-reranker-base degrades as depth grows.
Reranker Depth MSA R@1 Darija R@1 Darija R@5 Darija MRR
bge-reranker-v2-m3 10 0.880 0.800 0.950 0.867
20 0.875 0.800 0.960 0.872
50 0.880 0.800 0.975 0.877
GATE-Reranker-V1 10 0.825 0.685 0.910 0.789
20 0.820 0.690 0.920 0.790
50 0.810 0.675 0.905 0.778
bge-reranker-base 10 0.600 0.445 0.785 0.598
20 0.520 0.365 0.720 0.527
50 0.445 0.305 0.620 0.434
Table 7. End-to-end results (200 questions per condition). k is the number of passages in the generator’s context; Gold is the share of questions whose gold passage is in that context. Faithfulness is computed on answered items; token- F 1 uses no judge; Tokens is the mean prompt length.
Table 7. End-to-end results (200 questions per condition). k is the number of passages in the generator’s context; Gold is the share of questions whose gold passage is in that context. Faithfulness is computed on answered items; token- F 1 uses no judge; Tokens is the mean prompt length.
Query Retrieval k Gold Correct Faithful Refusal Tok. F 1 Tokens
MSA hybrid 5 0.950 0.810 0.941 0.060 0.458 1,657
Darija hybrid 5 0.905 0.690 0.919 0.200 0.370 1,659
Darija hybrid 1 0.620 0.560 0.884 0.310 0.312 447
Darija normalised 5 0.870 0.635 0.858 0.190 0.341 1,666
Darija reranked 5 0.960 0.685 0.888 0.155 0.370 1,673
Darija reranked 1 0.800 0.705 0.917 0.160 0.397 450
Darija gated 1 0.790 0.695 0.921 0.175 0.391 449
Darija gold passage 1 1.000 0.765 0.954 0.125 0.432 449
Table 8. Paired comparisons of answer quality (200 questions), with 95% bootstrap confidence intervals; p-values are taken from the bootstrap distribution and Holm-adjusted within each metric. Token- F 1 uses no judge. Bold: significant after correction.
Table 8. Paired comparisons of answer quality (200 questions), with 95% bootstrap confidence intervals; p-values are taken from the bootstrap distribution and Holm-adjusted within each metric. Token- F 1 uses no judge. Bold: significant after correction.
Comparison Correctness p Holm Token F 1 p Holm
Dialect gap (Darija vs. MSA) −0.120 [−0.190, −0.055] 0.002 −0.088 [−0.129, −0.045] 0.002
One passage, no reranking −0.130 [−0.200, −0.060] 0.003 −0.058 [−0.104, −0.013] 0.048
Reranking at k = 1 +0.145 [+0.095, +0.200] 0.002 +0.085 [+0.054, +0.119] 0.002
Reranked k = 1 vs. hybrid k = 5 +0.015 [−0.050, +0.080] 1.000 +0.027 [−0.011, +0.064] 0.525
Reranking at k = 5 −0.005 [−0.055, +0.045] 1.000 +0.000 [−0.034, +0.035] 0.999
Normalisation −0.055 [−0.120, +0.010] 0.444 −0.029 [−0.067, +0.007] 0.442
Gated vs. always reranked −0.010 [−0.025, +0.000] 0.836 −0.006 [−0.018, +0.003] 0.745
Gold passage vs. reranked k = 1 +0.060 [+0.025, +0.100] 0.007 +0.035 [+0.014, +0.057] 0.002
Table 9. Correctness of the oracle (gold passage supplied) minus each other condition, paired over 200 questions, with 95% bootstrap confidence intervals (uncorrected).
Table 9. Correctness of the oracle (gold passage supplied) minus each other condition, paired over 200 questions, with 95% bootstrap confidence intervals (uncorrected).
Oracle minus Difference Reading
MSA, hybrid, k = 5 − 0.045 [ − 0.110 , +0.020] not distinguishable
Darija, hybrid, k = 5 +0.075 [+0.005, +0.140] oracle better
Darija, hybrid, k = 1 +0.205 [+0.145, +0.265] oracle better
Darija, normalised, k = 5 +0.130 [+0.055, +0.205] oracle better
Darija, reranked, k = 5 +0.080 [+0.015, +0.150] oracle better
Darija, reranked, k = 1 +0.060 [+0.025, +0.100] oracle better
Darija, gated, k = 1 +0.070 [+0.030, +0.110] oracle better
Table 10. Per-query latency. Retrieval and reranking: Google Colab runtime with an NVIDIA Tesla T4, 100 Darija queries after warm-up, median and 95th percentile. *Generation: NVIDIA RTX A4000, mean per-question share of a batch of eight over the 200 questions of each condition, so a different GPU and a different statistic; the two are combined only indicatively in the text.
Table 10. Per-query latency. Retrieval and reranking: Google Colab runtime with an NVIDIA Tesla T4, 100 Darija queries after warm-up, median and 95th percentile. *Generation: NVIDIA RTX A4000, mean per-question share of a batch of eight over the 200 questions of each condition, so a different GPU and a different statistic; the two are combined only indicatively in the text.
Stage Median (ms) 95th pct. (ms) Relative
Hybrid retrieval 26 88 1×
Reranking (20 candidates) 1,361 1,726 52×
Generation, one passage* 465 — 18×
Generation, five passages* 1,133 — 44×
Table 11. Answer correctness under three equivalent prompts.
Table 11. Answer correctness under three equivalent prompts.
Condition Prompt 1 Prompt 2 Prompt 3 Spread
MSA, hybrid, k = 5 0.810 0.820 0.805 0.015
Darija, hybrid, k = 5 0.690 0.685 0.690 0.005
Darija, reranked, k = 1 0.705 0.755 0.710 0.050
Table 12. Key comparisons for both generators, measured with token- F 1 (no judge); the Qwen2.5-7B column repeats Table 8.
Table 12. Key comparisons for both generators, measured with token- F 1 (no judge); the Qwen2.5-7B column repeats Table 8.
Comparison Qwen2.5-7B Atlas-Chat-9B
Dialect gap in answers −0.088 [−0.131, −0.045] −0.117 [−0.146, −0.086]
Reranking at k = 1 +0.085 [+0.055, +0.120] +0.070 [+0.041, +0.100]
One passage without reranking −0.058 [−0.104, −0.014] −0.050 [−0.085, −0.015]
Headroom to the oracle +0.035 [+0.014, +0.058] +0.054 [+0.033, +0.077]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.