NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ArzEn-LLM: Code-Switched Egyptian Arabic-English Translation and Speech Recognition Using LLMs

Ahmed Heakl, Youssef Zaghloul, Mennatullah Ali, Rania Hossam, Walid Gomaa

TL;DR

Researchers have developed ArzEn-LLM, a suite of models designed to handle the complex linguistic phenomenon of code-switching between Egyptian Arabic and English. By fine-tuning state-of-the-art Large Language Models (LLMs) like Llama 3 and Gemma, they achieved a massive 56% improvement in translation quality over previous benchmarks and significantly enhanced speech recognition accuracy.

What Problem Does This Paper Address?

In multilingual societies like Egypt, speakers frequently "code-switch," seamlessly blending Egyptian Arabic and English in a single conversation. While natural for humans, this presents a nightmare for AI.

Standard models struggle with two main issues:

  1. Data Scarcity: There are relatively few high-quality datasets for dialectal Arabic compared to Modern Standard Arabic (MSA).
  2. Linguistic Complexity: Egyptian Arabic has unique grammatical structures and cultural nuances that are often lost in translation or misidentified by speech recognition systems.

The authors aim to bridge this gap by creating a robust pipeline for both Automatic Speech Recognition (ASR) and Machine Translation (MT) specifically tailored for this code-switched environment.

Methods

The researchers employed a cascaded approach, where spoken audio is first transcribed and then translated.

  • Machine Translation (MT): They fine-tuned several open-source LLMs, including Llama 2, Llama 3 (8B), and Gemma (2B/7B). To make training efficient on consumer-grade hardware, they used QLoRA (Quantized Low-Rank Adaptation) and DoRA (Weight-Decomposed Low-Rank Adaptation).
  • Automatic Speech Recognition (ASR): They utilized OpenAI’s Whisper model (Small and Medium versions), fine-tuning it to handle the specific phonetics and vocabulary of Egyptian code-switching.
  • Optimization: The team implemented gradient checkpointing and accumulation to manage memory constraints, allowing them to train large models on standard GPUs (like the NVIDIA T4).
  • Quantization: To ensure the models are usable by the wider community, they released GGUF versions, which allow these powerful models to run efficiently on standard CPUs with minimal performance loss.

Datasets

The study utilized two primary resources:

  • ArzEn-ST: A three-way speech translation corpus containing 12 hours of recorded interviews with bilingual Egyptian students, including manual transcriptions and translations.
  • ArzEn-MultiGenre: A larger parallel corpus of 25,557 segment pairs from diverse sources like song lyrics, novels, and TV subtitles, used for additional pre-training to capture broader cultural nuances.

Key Insights and Ideas

  • The Tokenizer Trap: One of the most interesting findings was why Llama 2 underperformed. Its tokenizer does not natively support Arabic, causing it to break Arabic words down into individual characters rather than meaningful sub-word units. In contrast, Llama 3 and Gemma use Byte-Pair Encoding (BPE) that handles Arabic much more effectively.
  • Cultural Context Matters: The models demonstrated an impressive ability to capture local context. For example, the model correctly translated the Egyptian slang usage of "IG" as "Instagram," whereas a generic model might have misinterpreted it in a school-related context.
  • Rank and Performance: The researchers found that increasing the LoRA rank (up to 256) consistently improved results, though it required higher dropout rates to prevent overfitting.
Training curves showing the loss reduction across different LLMs for English translation.

Key Results

The performance gains were substantial across the board:

  • Translation: Llama 3 8B emerged as the top performer, reaching a BLEU score of 53.64 for English translation—a 56% increase over the previous state-of-the-art.
  • Speech Recognition: The fine-tuned Whisper Medium model achieved a Word Error Rate (WER) of 31.1%, significantly outperforming previous models (which sat at 34.7% even with extra data).
  • Efficiency: Through quantization, they reduced the model's memory footprint to just 5.6 GB, enabling real-time translation (7.2 tokens/sec) on standard consumer hardware.
Comparison of training loss for different QLoRA ranks, showing that higher ranks lead to better convergence.

Limitations and Future Work

While the results are promising, the authors noted a few areas for growth:

  • Cascaded vs. End-to-End: Due to resource limits, they used a cascaded ASR-to-MT pipeline. Future work could explore end-to-end speech-to-text models which might reduce error propagation.
  • Dialectal Breadth: The current focus is strictly on Egyptian Arabic. Expanding the training data to include other Arabic dialects (like Levantine or Maghrebi) would improve the models' versatility.
  • Optimization: Further research into advanced optimization techniques could push the boundaries of performance even further on low-resource hardware.

The authors have open-sourced their code and models, inviting the research community to build upon these foundations for better linguistic accessibility in the Arab world.

Summary updated

BibTeX
@misc{heakl2024arzen,
  author = {Ahmed Heakl and Youssef Zaghloul and Mennatullah Ali and Rania Hossam and Walid Gomaa},
  title = {{ArzEn-LLM: Code-Switched Egyptian Arabic-English Translation and Speech Recognition Using LLMs}},
  year = {2024},
  eprint = {2406.18120},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.18120},
}
Figure