3. Methodology
This section describes our proposed method for enhancing generalised cross-dialectal transfer performance in Arabic question answering. Specifically, our approach addresses scenarios where the context is in one Arabic variety, while the question is in a different variety. Generally, the approach relies on partially substituting words in the question with their counterparts in the Arabic dialect of the context. It systematically augments Arabic questions by generating diverse high-quality code-mixed questions. The approach helps bridge the lexical and semantic gaps between Arabic dialects, facilitating better alignment between questions and context. To this end, it integrates the following two primary methods: lexicon-based partial substitution, and neural machine translation with word-level alignment in an adaptive workflow.
Figure 1 shows the general framework of the proposed method.
Initially, multidialectal Arabic lexicons are developed, and then these lexicons are used to perform lexicon-based partial substitution on the original Arabic questions. Following this, the method employs semantic validation measures to assess how well the modified questions maintain their original meaning and remain logically coherent and understandable after modification. In addition, a balanced-substitution constraint is enforced, requiring that the proportion of replaced tokens remain between 20% and 60%. Candidates with fewer than 20% substitutions are too close to the original question to provide meaningful additional lexical overlap with the context, whereas candidates with more than 60% substitutions tend to behave more like full translations and are more vulnerable to lexicon and alignment noise. Therefore, the 20–60% band aims to preserve enough of the original wording of the question variety while injecting enough tokens from the context variety to be useful at test time. In SQuAD-style domains, where the context variety is MSA and the question variety is already very close to MSA, the rewritten question may occasionally become almost fully MSA-like. We consider this acceptable, since the primary goal is to improve lexical alignment between the question and the MSA context variety rather than to enforce a fixed degree of mixing in every individual question. Questions that meet both criteria are accepted as final code-mixed questions. If a question fails the validation, the lexicon-substituted version is discarded and the original question is passed to the neural machine translation with word-level alignment phase. Further details regarding each phase are provided in the subsections below.
Although our proposed code-mixed data augmentation method was developed to improve generalised cross-dialectal transfer in Arabic question answering, the procedure itself is inherently task-agnostic. Its ability to automatically generate balanced code-mixed versions of any text dataset makes it adaptable for diverse applications within NLP.
3.1. Lexicon Construction
This section explains the novel approach used in order to create an initial multidialectal Arabic lexicon between five Arabic varieties, namely, Egyptian, Gulf, Levantine, Maghrebi, and MSA. The proposed method involves a systematic and automated pipeline that integrates various translation models, embedding-based alignments, and semantic validation procedures to ensure the reliability of lexical mappings between MSA and various Arabic dialects.
Figure 2 summarises the steps followed to create the lexicons.
MSA serves as the central Arabic variety, used to gather initial words which are then translated into four other Arabic dialects. Wikipedia serves as the source for collecting these words due to its broad coverage of diverse topics and domains. The process of creating the initial lexicon was conducted on the 20 March 2025 Arabic version of the Wikipedia dump (
https://dumps.wikimedia.org/arwiki/, accessed on 10 August 2025). Then, we use WikiExtractor [
48] in order to discards markup/templates and extract plain text. Arabic text extracted from Wikipedia articles undergoes preprocessing steps, including diacritics stripping which involves removing the short vowel marks. The preprocessing steps also include orthographic normalisation where Arabic letters written in interchangeable orthographic forms are converted into a single consistent form. For example, converting all forms of Alif to a simple bare Alif. The aforementioned two preprocessing steps are important to standardise the text and reduce sparsity in the vocabulary. Then, we remove punctuation and non-Arabic characters. Finally, we apply simple tokenisation, the process of splitting the text into individual words based on whitespaces.
Following preprocessing, tokens undergo frequency-based selection to ensure lexicon construction is initially based on common lexical tokens and their associated sentences. Specifically, all tokens resulted from the preprocessed text are ranked based on their frequency of occurrence and only the top 500 most frequent tokens are selected. This initial list serves as a foundational resource. However, later, during the process of generating code-mixed augmented questions, the lexicon dynamically expands as additional tokens within contexts are identified, thus progressively enhancing the lexicon’s coverage.
For each identified top word, we select its associated sentence from the Wikipedia corpus by adopting the following steps:
Gathering candidate sentences: All sentences containing the identified top word within the corpus are initially collected.
Filtering candidate sentences: Short sentences (fewer than five words) are discarded. Short sentences usually lack sufficient context for accurate translation and alignment.
Selecting optimal sentence: From the remaining candidate sentences, the shortest sentence is chosen. This choice provides enough context for accurate machine translation without introducing unnecessary complexity or ambiguity.
The aforementioned steps ensure that each word selected for the lexicon is associated with a specific example sentence. This helps in accurate translation and semantic verification later on. That is, the translation process begins with two key inputs for each lexical entry as follows:
A source token, representing the word for which dialectal Arabic mapping is desired.
A corresponding source sentence, providing contextual information to facilitate accurate translation and alignment.
Forward translation: The source sentence in MSA undergoes forward translation into the target dialect (e.g., Gulf) using a neural translation model. The resulting translated sentence, referred to as the target sentence, provides a contextualised counterpart of the source sentence in the target Arabic dialect.
After translation, an embedding-based alignment algorithm is conducted on the pair of source and target sentences. The primary purpose of this step is to precisely identify the target token in the target sentence that semantically corresponds to the original source token. Accurate token-level alignment is crucial to establish reliable lexical mappings. The alignment algorithm exploits transformer-based contextual embeddings obtained from models trained on texts in MSA and various Arabic dialects. A detailed description of the algorithm is provided in
Section 3.2 and outlined in Algorithm 1.
| Algorithm 1: Embedding-based alignment |
![Information 17 00139 i001 Information 17 00139 i001]() |
Back translation: The target sentence is translated back into the original Arabic variety of the source sentence, generating a back-translated sentence. This step helps evaluate the consistency and reliability of the initial forward translation.
The embedding-based alignment algorithm (see
Section 3.2, Algorithm 1) is applied again, this time to align the source sentence with the back-translated sentence. This alignment identifies the back-translated token (referred to in the figure as “back_token” for brevity) aligned to the original source token, providing additional confirmation of lexical consistency throughout the translation process.
Semantic validation: Semantic validation involves two complementary assessments to ensure the semantic quality and reliability of the lexicon entries as follows:
Semantic fidelity (
): Semantic fidelity measures the semantic closeness between the original source sentence and the forward-translated (target) sentence. It evaluates how well the forward-translated (target) sentence preserves the meaning of the original source sentence [
49,
50].
Round-trip consistency (
): Round-trip consistency measures the semantic closeness between the original source sentence and the back-translated sentence. It evaluates whether meaning is preserved through a two-step transformation (i.e., translating a sentence from a source dialect to a target dialect and then back to a source dialect) [
51,
52].
Both semantic validation measures (i.e., semantic fidelity and round-trip consistency) are computed using cosine similarity between sentence-level embeddings produced by the Sentence-BERT (SBERT) model [
53]. In general, given two sentence embeddings
a and
b, cosine similarity is computed as follows:
where
d represents the dimensionality of the sentence embeddings produced by the Sentence-BERT model.
Although both semantic validation measures share the same mathematical formulation, they differ in the pairs of sentences they evaluate. For semantic fidelity (), embeddings from the original source sentence and the forward-translated target sentence are compared. For round-trip consistency (), embeddings from the original source sentence and the back-translated sentence are compared. The use of both semantic validation measures helps in checking different dimensions of semantic integrity in the lexicon creation process.
A higher semantic fidelity score (close to 1.0) indicates excellent semantic preservation, indicating a reliable translation for lexicon inclusion. Similarly, a high round-trip consistency score indicates that the source and its back-translation are semantically aligned, providing evidence of cycle-consistency.
Validation criteria: Lexicon entries undergo strict validation based on semantic thresholds to determine their acceptance into the final multidialectal Arabic lexicons.
Entries (i.e., source token and target token) are automatically accepted if they fulfil either of the following conditions:
- –
High semantic fidelity: .
- –
Moderately high scores in both round-trip consistency and semantic fidelity: and .
Entries that do not meet these conditions are marked for human review in order to ensure human oversight for uncertain cases.
3.2. Embedding-Based Alignment Algorithm
Embedding-based alignment is used to identify corresponding words between sentence pairs by comparing their contextual embeddings produced by a transformer-based model trained on texts from various Arabic varieties.
Below, the embedding-based alignment algorithm is described in detail using general notation. For simplicity and clarity, the sentences involved are referred to as the source sentence (S) and the translated sentence (T).
Algorithm 1 illustrates the embedding-based alignment, an unsupervised word-alignment technique that leverages contextual embeddings.
Implementation details for reproducibility (word-level alignment): We use MARBERT to obtain contextual representations, extracting embeddings from the 8th hidden layer (0-indexed). Since MARBERT applies subword tokenisation, we perform alignment at the word level by aggregating subword embeddings that belong to the same original word as follows: for each word, we compute the
mean of its subword vectors to obtain one word embedding. We exclude special tokens (e.g., [CLS] and [SEP]) and padding tokens using the attention mask. Alignment is computed in the direction
(many-to-one is allowed) by selecting, for each source word, the target word with maximum cosine similarity, while ties are broken by choosing the smallest target index. We keep an aligned pair only if its similarity is ≥
(we set
, see experimental settings in
Section 4.5).
The inputs, in addition to the source sentence (S) and translated sentence (T), are layer ℓ, which is the transformer layer selected for extracting hidden states, and threshold , which is a similarity cutoff value specifying acceptable alignments. The output is a set containing pairs of aligned token indices, where each pair represents a mapping from a source token to translated token. For example, indicate that source token index 0 aligned to translated index 0 and source index 1 aligned to translated index 2 and so on.
The sentences
S and
T are first encoded using a transformer-based model. The model produces hidden states (embeddings capturing contextual meaning) at multiple layers. We specifically extracted the hidden states from the selected layer
ℓ. The resulting matrices are
, the hidden states matrix for sentence
S with dimensions
, and
, the hidden states matrix for sentence
T with dimensions
, where
and
represent the token counts for each sentence, and
d is the dimensionality of the hidden state embeddings. By specifying
output_hidden_states = True, we are asking the model to return all of its layer-by-layer representations, not just the final output. This is necessary because our alignment algorithm requires extracting embeddings from an intermediate layer. Lower layers lack sufficient context, while top layers are too specialised. Therefore, using lower layers or only the final layer is insufficient [
54].
The special tokens introduced by the transformer such as
and
are removed from
and
in order to ensure that only meaningful and context-relevant tokens remain for accurate alignment. Then, each embedding vector (i.e., each row in matrices
and
) is normalised to have unit length in order to ensure that comparisons via cosine similarity are not affected by magnitude differences as follows:
The normalised embeddings are then used to compute a similarity matrix
, where each entry
represents the cosine similarity between token
i from the source sentence and token
j from the translated sentence as follows:
The algorithm iterates over each source token (row in ). For each source token i, the algorithm identifies the most similar translated token , having the highest similarity score, as follows:
If the similarity score exceeds the predefined threshold , the pair is added to the alignment set .
3.3. Proposed Code-Mixed Augmentation for QA
This section details the proposed two-stage pipeline for Arabic code-mixed data augmentation, which produces questions containing words from two Arabic varieties while preserving the original intent and meaning. Given an input question written in some Arabic variety, called the source variety
, the pipeline generates a code-mixed version by partially substituting tokens with counterparts drawn from a different mixing variety (
). We use source variety (
) to refer to the variety of the original question. The mixing variety (
) is the other variety from which replacements are drawn.
Figure 3 illustrates how our code-mixed data augmentation method works. It takes original questions and transforms them into code-mixed questions.
Lexicon-Based Partial Substitution: We begin with an original question written in the source variety () and a second variety, called the mixing variety (), from which we will draw replacements. The algorithm starts by applying preprocessing steps to remove all Arabic diacritics and punctuation marks. It also applies orthographic normalisation, standardizing word formats to prevent missed lexicon matches. Then, the original question is split into tokens, and each word is looked up in a lexicon. When a mapping exists, the word is replaced by its counterpart. When no mapping is found, the original word is kept. The method intentionally performs only a partial substitution, ensuring the number of replaced words does not exceed approximately 60% of the total tokens in the original question as the method’s goal is to mix varieties, not to fully convert the question.
After substitution, the algorithm computes two important measures to validate the candidate code-mixed question (i.e., modified question) produced by lexicon partial substitution. The first measure is lexical change percentage (LSP), which measures the proportion of substituted words relative to the total original words. The second is semantic similarity (SemSim), which assesses how closely the candidate code-mixed question aligns semantically with the original. We then apply the validation criteria that the candidate is accepted only if
and
. We provide extended, step-by-step examples of accepted/rejected code-mixed candidates and how LSP/SemSim preserve semantic fidelity in
Appendix B (
Figure A1). The semantic similarity is computed using the cosine similarity between sentence embeddings of the original and candidate questions (see
Section 3.1 for a detailed explanation and formulas regarding semantic validation). This explicit limitation of substituting no more than approximately 60% of the total tokens specifically intended to produce code-mixed questions with balanced Arabic dialect representation and semantic coherence. If the candidate passes, it is released as a final code-mixed question. If it fails, the modified question is discarded and the original question is sent to an alternative phase, which is neural machine translation with word-level alignment.
Neural Machine Translation and Word-Level Alignment: When the initial lexicon-based partial substitution does not produce an acceptable code-mixed text (i.e., fails to satisfy the lexical substitution and semantic similarity criteria), the algorithm employs a fallback approach involving neural machine translation (NMT) to obtain a full translation of the original question . The algorithm uses a transformer-based translation model to obtain a full translation of the original question. Translation here is instrumental as it provides a parallel sentence that allows to identify reliable word-level alignments between and .
After obtaining the fully translated question, the algorithm establishes a word-level alignment between words in the original question and their corresponding translated counterparts. To extract these alignments, we apply a specialised Arabic transformer model and reuse the embedding-based alignment algorithm described in
Section 3.2 (see Algorithm 1). In brief, the alignment algorithm runs a specialised Arabic transformer model which generates contextualised numeric representations (embeddings) for each word in both questions. These embeddings capture semantic information of words based on their context. Then the algorithm removes special markers, normalises those embeddings, and computes a similarity matrix between every source word and every translated word. For each source word it selects the best-matching translated word after checking if the similarity exceeds a predefined threshold. Finally, the pair is recorded as an aligned word pair.
Code-Mixed Sentence Generation: After alignment between source and translated questions, the algorithm proceeds to generate a code-mixed question through partial substitution of words, guided by the established word alignments. To ensure the generation of balanced sentences, the algorithm randomly selects approximately half and never exceeding 60% of the total words from the source question for replacement. Each randomly selected source word is replaced by its aligned translated counterpart as identified previously through the alignment process. This creates a new question composed of both original words and substituted translated words, resulting in a candidate code-mixed question. The process repeats iteratively, creating multiple candidate code-mixed questions, each time randomly choosing a different subset of source words for substitution. This process of random sampling promotes lexical diversity in the augmented data, while the alignments ensure substitutions remain context-appropriate. After each iteration, the candidate code-mixed question is evaluated according to the following two predefined criteria: percentage of substituted words (LSP) and cosine-based semantic similarity to the original question (SemSim). The pipeline accepts the first candidate that satisfies LSP = 20–60% and SemSim ≥ 0.65, and the iterative process stops immediately.
6. Discussion
The baseline generalised cross-dialectal results across context–question variety combinations reveal systematic weaknesses under dialect mismatch and domain shift. Performance is particularly sensitive to lexical divergence between question and context varieties, and it degrades further when moving from the more formal SQuAD texts to the more informal Vlogs and Narratives domains. These trends motivate explicitly addressing question–context lexical mismatch in a lightweight manner.
Table 3,
Table 4 and
Table 5 highlight three recurring limitations. First, performance drops substantially under domain shift from SQuAD to Vlogs and Narratives: for instance, the MSA/MSA diagonal decreases from 76.19/61.96 (SQuAD) to 67.01/42.20 (Vlogs) to 43.83/14.05 (Narratives). Second, Maghrebi questions tend to yield the lowest scores in dialect-mismatched settings, as follows: for non-Maghrebi contexts, the MGR question column is typically the lowest (e.g., in Narratives, EGY/MGR = 28.50/7.97 and LEV/MGR = 27.05/6.35 in
Table 5. Similar patterns appear in Vlogs and SQuAD in
Table 3 and
Table 4). Third, Levantine contexts tend to underperform relative to other context varieties, particularly in SQuAD and Narratives (e.g., the LEV context row is generally lower than the EGY/GLF/MSA rows in
Table 3 and
Table 5).
From a domain perspective,
Table 9 shows that aggregate gains are largest in Narratives, followed by Vlogs and SQuAD. This aligns with increasing informality and dialectal variability in the source material, and with the added difficulty of spontaneous conversational and narrative discourse.
Appendix A reports per-pair paired-bootstrap confidence intervals and Holm–Bonferroni-corrected
p-values (
Table A1,
Table A2 and
Table A3), clarifying which dialect-mismatched settings drive these domain-level trends. Notably, after correction, statistically significant improvements are much more frequent for EM than for F1 across domains, suggesting that the method more consistently helps recover exact spans than uniformly improving partial token overlap.
Our proposed method mitigates these issues by introducing simple lexical adaptation. Specifically, it reduces lexical divergence between dialects, especially in interrogative forms. This interpretation is consistent with
Appendix A, where the most robust gains are concentrated in dialect-mismatched pairs with higher lexical mismatch.
Figure 4 illustrates four representative test examples in which the baseline fails to extract the correct span, while the proposed code-mixed augmentation succeeds.
In the first example, given that the model used in our experiments was pretrained primarily on MSA and fine-tuned on the MSA Arabic-SQuADv2.0 corpus, the baseline model appears to prefer the most salient, SQuAD-like descriptive pattern in the local neighbourhood of the target mention. When the Maghrebi question asks about fAkhp bAkwry “bacuri fruit”, the model’s attention moves to the region around AlfAkhp AltAnyp bAkwry “The second fruit is bacuri”, where two competing descriptions occur: TEmhA zy Allwz mE AlEsl “It tastes like almonds with honey” (for fAkhp mAry mAry“mari-mari fruit”) and zy Aldhb Al>byD “like white gold” (for fAkhp bAkwry “bacuri fruit”). The baseline consistently prefers the familiar pattern TEmhA zy “tastes like” over the more colloquial hy zy “is like”. Therefore, the baseline incorrectly returns the description of “mari-mari fruit” rather than the correct description zy Aldhb Al>byD “like white gold” for bAkwry “bacuri fruit”.
In the second example (see
Figure 4), for duration questions in Maghrebi over MSA contexts, the baseline frequently misinterprets the construction as a “who?” question and returns the name (e.g., Pedro) rather than the correct temporal span (e.g.,
mn* 20 EAmA “for 20 years”). This reflects a lack of robustness to dialectal time expressions such as
mn $HAl hAdy “How long has it been”.
Our proposed code-mixed data augmentation method addresses these issues by partially substituting dialectal tokens in the questions with context-dialect or MSA equivalents while enforcing semantic fidelity and balanced substitution. This produces questions where dialect words are explicitly linked to their MSA or context-dialect forms and share more words with the context sentences. This makes it easier for the model to interpret the question type and select the correct answer span. As a result, the model learns to associate dialectal ways of asking “how is X?” and “how long has Y been…?” with the appropriate answer types (short descriptive phrases or time expressions) and to focus on the right sentences, allowing it to recover the correct gold spans in many cases where the baseline fails.
These improvements largely arise from reducing lexical divergence in short question sentences, particularly in interrogative forms. This is done by randomly replacing a subset of the question’s tokens with counterparts in the context’s dialect. Because question sentences are short and interrogatives carry high syntactic and semantic weight (e.g., what/when/where/why/how…etc.), substituting a few tokens, including interrogatives, can significantly improve the model’s ability to map the question to the context. The effect is strongest in high-mismatch settings (especially when the question is Maghrebi), although
Appendix A shows that many non-Maghrebi question varieties also exhibit significant EM gains across multiple pairs. For example, the question (
$HAl, “How much/How many”) in Maghrebi is replaced with the MSA interrogative form (
km). This substitution makes the interrogative directly recognisable by the MSA QA model and helps in aligning it with dialects that also use this near-MSA form. This pattern is also reflected in the per-pair significance analysis (
Appendix A), where the strongest and most consistently significant gains tend to occur in settings involving higher lexical mismatch.
Changing other tokens in the question, rather than interrogatives, also harmonises the question wording with the context’s dialect and enhances the indicators used to locate answer spans. This is illustrated in Example 3 in
Figure 4. In Egyptian context with Gulf question
w$ EaTt AlEjwz llwld? “What did the old woman give to the boy?”, replacing the Gulf verb
EaTt “gave” by the Egyptian equivalent
Adt refines the matching evidence for answer spans.
In the generalised cross-dialectal baselines, we observe that Levantine contexts underperform because their long colloquial passages, which contain clitics and discourse particles, may be underrepresented in pretraining. We observed once the questions are code-mixed (e.g., by randomly replacing some tokens in the question with tokens from the context’s dialect), the model no longer has to handle both context noise and question divergence simultaneously (see Example 4 in
Figure 4).
In terms of domains, the Narratives domain, where contexts are loosely structured, shows the largest improvements. This is consistent with
Table 9, which shows higher mean and median
improvements in Narratives compared to Vlogs and SQuAD when aggregating across the 20 dialect-mismatched pairs. This can be partially attributed to the fact that questions in Narratives often contain more dialectal interrogatives and function words that the model does not recognise well. Replacing these forms with those from the context’s variety makes the question intent explicit. By contrast, the SQuAD domain is formal and closer to MSA. As a result, there is less lexical divergence, so code-mixing helps, but only moderately. The Vlogs domain consists of spontaneous speech with fillers and colloquial forms. Therefore, code-mixing helps more than in SQuAD, but the contexts are shorter and more topical, so the gains remain moderate. This demonstrates that even minimal lexical adaptation can substantially reduce the cumulative effects of domain shift and dialect divergence.
Appendix A further shows that statistically significant improvements are more frequent for EM than for F1 across many dialect pairs, suggesting that the method more consistently helps the model recover exact spans than uniformly improving partial token overlap.
Qualitative Error Analysis
A qualitative error analysis is performed to better understand the limitations of our proposed code-mixed question augmentation. We manually inspect a set of test examples spanning the three ArDQA domains (SQuAD-style texts, Vlogs, and Narratives) and multiple context-question variety pairs. This analysis allows us to move beyond simple EM/F1 scores and to identify systematic patterns such as answer-type confusion, shallow temporal reasoning, weak use of location cues in narratives, confusion between lexical forms and their meta-descriptions, and discourse-level anaphora resolution errors.
Figure 5 presents four representative error cases.
Time Reasoning Failures. In some cases, our proposed method does not help because the error arises from temporal reasoning rather than dialect mismatch. As in example 1 in
Figure 5, when the context states that the story spans
AŝnwAt (1933–1935) “three years (1933–1935)” and the question asks “For how many years does To Kill a Mockingbird take place?”, the model selects the start year “1933” instead of the duration
AŝnwAt “three years”. In this example, lexical alignment is already good after code-mixed question augmentation, but the MSA QA model misinterprets the answer type (year vs duration). Also, the model exhibits shallow temporal reasoning. It seems to pick the first important temporal mention (1933). It does not perform basic temporal reasoning over the interval “1933–1935” as three years or connect this interval to the explicitly stated duration “three years”.
Spatial and Narrative Grounding Failures. In example 2 in
Figure 5 about the shepherd story, the Levantine question is asked over an Egyptian context. After our proposed code-mixed question augmentation, the Levantine interrogative
$w “what” is changed to its Egyptian equivalent
Ayh “what”. The remaining three words in the question are largely shared between the two Arabic dialects. However, the model incorrectly predicts “he sat watching the flock”, taken from an earlier sentence. Here, the model focuses on the visual verb “watching the flock” and fails to combine the object and location constraints (“What did the shepherd see in the pit?”). Therefore, dialectal alignment is no longer the main bottleneck. Indeed, such an error highlights a limitation in how the model links questions to specific locations within the narrative context.
Lexical-form Extraction Failures (Form vs. Description). In some cases, our proposed code-mixed questions help the MSA QA model correctly align the question with the relevant sentence in the context. Nevertheless, the model fails to extract the intended lexical form. In example 3 in
Figure 5 from the Tuvalu vlog, the Egyptian context states that
wdh Ally byqwlwh lmA yrHbwA blgthm: tAlwfA “and this is what they say when they welcome you in their language: talofa”, while the Maghrebi question asks
kyfA$ kAyqwlw mrHbA ftwfAlw? “How do they say welcome in Tuvalu?”. After applying our code-mixing algorithm to adapt the Maghrebi question to the Egyptian context, the model correctly focuses on the relevant sentence but predicts the phrase
blgthm “in their language” instead of the greeting word
tAlwfA “talofa” itself. In this example, the dialectal mismatch between the Egyptian context and the Maghrebi question is resolved by code-mixing. However, the model still prefers a meta-descriptive fragment “in their language” over the actual lexical form required by the question. This indicates that the model is not distinguishing between the target lexical item requested by the question and its surrounding descriptive context, and instead selects a semantically related descriptor.
Discourse-level Anaphora Failures. For example 4 in
Figure 5, the Maghrebi question
b$nw ky$bhw hAd AlEmlyp? “What does this process resemble?” contains a demonstrative noun phrase
hAd AlEmlyp “this process”, which should be resolved to the immediately preceding description
ltwsyE sTH Al>rD mlwA>jzA’ mn sTH AlmyAh bAlrmAl “To extend the land area, they fill parts of the water surface with sand”. The comparative phrase
zy jzr Alnxyl fy dby “like the Palm Islands in Dubai” is the correct answer to the question. After applying the code-mixing to the question, we resolve the problem of dialect mismatch between Maghrebi and Egyptian by replacing some Maghrebi words in the question with their equivalents in the Egyptian context. This involves changing the Maghrebi word
hAd “this” to the Egyptian word
dy “this”. Although the dialectal mismatch is removed, the model selects the noun
nZArAt “glasses”, taken from the earlier clause
HtY Endhm nZArAt mktwb ElyhA ’tgyr AlmnAx fy twfAlw’ “They even have glasses with ’Climate Change in Tuvalu’ written on them”. This span is semantically unrelated to the process being queried and ignores the anaphoric link between
hAd AlEmlyp “this process” and the land-filling description. The error thus reflects a failure to track discourse structure and resolve anaphora. The model prefers a salient noun over the event referred to by the demonstrative. Therefore, it seems that this error is not due to dialectal Arabic mismatch.
Error-driven Implications. The error analysis shows that the main challenges for the MSA QA model when applied on informal domains or dialectal Arabic are not only restricted to surface-level token matching. The challenges involve deeper semantic and discourse situations. The model often struggles to align the question with the appropriate answer type (e.g., duration vs. date) to exploit explicit spatial or comparative cues and to correctly resolve references to events or processes within multi-sentence narratives. These findings motivate future improvements focusing on stronger modelling of temporal and spatial reasoning and more explicitly handling the distinction between the required word form and its descriptive explanation in the answer spans. Incorporating such insights into model design, training objectives, or data augmentation strategies is likely to yield more robust cross-dialectal Arabic QA performance than relying on additional data or larger architectures alone.