Ahmad M Mustafa
Author directoryAlso published as: Ahmad Mustafa
2026
Sahar Melhem | Ahmad Mustafa
Proceedings of The Fourth Arabic Natural Language Processing Conference
Large language models (LLMs) can solve mathematical problems through prompting, yet not all reasoning is cost-justified when using paid APIs. We study prompt-only methods for overthinking control in the black-box setting across four datasets: Arabic GSM8K, English GSM8K, English SVAMP, and ArMATH, each evaluated on 100-question subsets divided into Easy, Medium, and Hard categories. We test Direct Answer, Chain-of-Thought (CoT), First Answer Anchoring (FAA-lite), Confidence-Triggered Escalation (CTE), Self-Consistency, Verification, Arabic prompt variations, and Language-Optimal Prompt Routing (LOPR). CTE achieves 90% accuracy on Arabic GSM8K at 1.14 calls/query, 96% on English GSM8K at 1.06 calls/query, and 98% on SVAMP at 1.08 calls/query. Self-Consistency leads on ArMATH at 90% but costs 2.00 calls/query. Verification consistently increases token cost without accuracy gains. Format-Controlled CoT is the best single-call Arabic method; Bilingual-Glossary CoT is consistently harmful. CTE calibration reveals that explicit low-confidence outputs are rare (<1%), so CTE succeeds mainly because high-confidence predictions are accurate, not through active uncertainty detection.
2019
Ahmad Ragab | Haitham Seelawi | Mostafa Samir | Abdelrahman Mattar | Hesham Al-Bataineh | Mohammad Zaghloul | Ahmad Mustafa | Bashar Talafha | Abed Alhakim Freihat | Hussein T. Al-Natsheh
Proceedings of the Fourth Arabic Natural Language Processing Workshop
In this paper we discuss several models we used to classify 25 city-level Arabic dialects in addition to Modern Standard Arabic (MSA) as part of MADAR shared task (sub-task 1). We propose an ensemble model of a group of experimentally designed best performing classifiers on a various set of features. Our system achieves an accuracy of 69.3% macro F1-score with an improvement of 1.4% accuracy from the baseline model on the DEV dataset. Our best run submitted model ranked as third out of 19 participating teams on the TEST dataset with only 0.12% macro F1-score behind the top ranked system.