# Mostafa ElAraby — Full Content > A flat-text concatenation of the key pages on mostafaelaraby.com so that > language models, agents, and offline tooling can ingest the canonical > content without having to crawl multiple URLs. Generated by Jekyll at > build time. For a structured site index, see /llms.txt. Site: Mostafa ElAraby URL: https://mostafaelaraby.com Description: Mostafa ElAraby — PhD candidate at Mila / Université de Montréal. Research on out-of-distribution detection, uncertainty estimation, robustness, and continual learning for safe AI. Author: Mostafa Elaraby Updated: 2026-08-31 ================================================================================ ABOUT ================================================================================ I completed my B.S.E. in Computer Science at Alexandria University in Egypt in 2014 and have since cultivated a rich professional background as a Research and Development Engineer. My expertise lies in the fields of computer vision and NLP, with a particular focus on out-of-distribution (OOD) detection to enhance AI model reliability and safety. Currently, I am a PhD candidate at Mila, University of Montréal, where my research delves into uncertainty and out-of-distribution detection in autonomous driving. My work is driven by a passion for advancing AI and its applications. Office hours: I'm happy to spend a free 30 minutes with anyone who wants to talk research, PhD applications, or career paths in ML — especially out-of-distribution detection, uncertainty estimation, robustness, or continual learning. Booking link: https://calendar.app.google/ZM1CMcYS7dkWNpFD9 Research areas: - Out-of-Distribution Detection - Uncertainty Estimation - Robustness in Machine Learning - Continual Learning - Computer Vision - Natural Language Processing - Autonomous Driving / Safe AI External profiles: - Google Scholar: https://scholar.google.com/citations?user=yksTgXkAAAAJ - GitHub: https://github.com/mostafaelaraby - LinkedIn: https://www.linkedin.com/in/mostafaelaraby - X: https://x.com/melaraby91 ================================================================================ SELECTED PUBLICATIONS ================================================================================ - GROOD: GRadient-aware Out-Of-Distribution detection in interpolated manifolds. ElAraby, Sahoo, Pequignot, Novello, Paull. Transactions on Machine Learning Research (TMLR), 2025. https://openreview.net/forum?id=2V7itvvMVJ — code: https://github.com/mostafaelaraby/Gradient-Aware-OOD-Detection - BACS: Background Aware Continual Semantic Segmentation. ElAraby, Harakeh, Paull. Conference on Robots and Vision, 2024. arXiv:2404.13148 — code: https://github.com/mostafaelaraby/bacs-continual-semantic-segmentation - Identifying efficient sub-networks using mixed integer programming. ElAraby, Wolf, Carvalho. OPT Workshop, NeurIPS 2020. arXiv:2002.07259 - A layer selection approach to test time adaptation. Sahoo, ElAraby, Ngnawe, Pequignot, Precioso, Gagné. AAAI 2025. ================================================================================ RECENT POSTS (titles + URLs + first paragraph) ================================================================================ --- Inference-time factuality improvement in LLMs: from layer contrasting to deep-thinking tokens URL: https://mostafaelaraby.com/paper%20review/2026/04/30/inference-time-factuality-improvement-in-llms/ Date: 2026-04-30 Categories: Paper Review Tags: LLM, Factuality, Hallucination, Decoding, Inference-Time, DoLa, SLED, DELTA, Lookback Lens, Attention, Deep-Thinking A tour of inference-time factuality methods for LLMs - DoLa, SLED, DELTA, Lookback Lens and Think@n - that fight hallucination by changing decoding instead of retraining. --- Out-of-Distribution Detection in Vision-Language Models: A Survey URL: https://mostafaelaraby.com/paper%20review/2026/03/07/vlm-ood-detection-survey/ Date: 2026-03-07 Categories: Paper Review Tags: OOD Detection, Vision-Language Models, CLIP, Zero-Shot Learning, Survey, Safety A survey of out-of-distribution detection for vision-language models like CLIP, covering training-free scoring, prompt-based detection and LLM-augmented pipelines. --- Reasoning's Razor: When Thinking More Makes Safety Worse URL: https://mostafaelaraby.com/paper%20review/2026/01/25/reasonings-razor-safety-hallucination-detection/ Date: 2026-01-25 Categories: Paper Review Tags: LLMs, Safety, Hallucination Detection, Reasoning Models, Calibration Reviewing Reasoning's Razor, a paper showing extended chain-of-thought reasoning can hurt LLM recall at the low-FPR thresholds that matter for safety and hallucination detection. --- How Can LoRA parameters improve the detection of Near-OOD data? URL: https://mostafaelaraby.com/paper%20review/2025/11/03/LoRA-parameters-improves-OOD-detection/ Date: 2025-11-03 Categories: Paper Review Tags: OOD Detection, deep learning, tutorials, LLMs Paper review showing that keeping LoRA modules unmerged at inference yields embeddings whose Mahalanobis distance is a strong near-OOD detector for fine-tuned LLMs. --- Weight Space Learning Treating Neural Network Weights as Data URL: https://mostafaelaraby.com/paper%20review/2025/10/09/treating-neural-network-weights-as-data/ Date: 2025-10-09 Categories: Paper Review Tags: weight space, deep learning, tutorials An overview of weight space learning, where neural network weights themselves become data for predicting generalization, robustness and even synthesizing new models. --- Dev on Docker, Deploy on Singularity The MLOps Workflow You've Been Missing URL: https://mostafaelaraby.com/tutorials/2025/09/18/docker-to-singularity-mlops-workflow/ Date: 2025-09-18 Categories: Tutorials Tags: docker, singularity, mlops, workflow A practical MLOps tutorial on developing ML workloads in Docker and deploying them to HPC clusters with Singularity (Apptainer) for rootless, GPU-ready execution. --- GROOD - GRadient-aware Out-Of-Distribution detection URL: https://mostafaelaraby.com/publications/2025/09/12/grood-gradient-aware-out-of-distribution-detection/ Date: 2025-09-12 Categories: Publications Tags: Deep Learning, Safety, Out Of Distribution Detection, Post-hoc, OOD, OpenOOD GROOD detects out-of-distribution inputs by measuring gradient sensitivity to an artificial OOD prototype, leveraging neural collapse to improve safety in deep learning systems. --- Decoding LLM Hallucinations An In-Depth Survey Summary URL: https://mostafaelaraby.com/paper%20review/2025/04/29/decoding-llm-hallucinations-an-in-depth-survey-summary/ Date: 2025-04-29 Categories: Paper Review A deep-dive summary of an LLM hallucination survey, with a taxonomy of factuality and faithfulness errors plus the root causes, detection and mitigation techniques behind them. --- Topology of Out-of-Distribution Examples in Deep Neural Networks URL: https://mostafaelaraby.com/paper%20review/2025/04/21/topology-of-out-of-distribution-samples/ Date: 2025-04-21 Categories: Paper Review Tags: Teaching, OOD, Research, Topology, Persistence Paper review using topological data analysis and persistent homology on penultimate-layer embeddings to characterise OOD samples that resist a network's topology simplification. --- Out-of-Distribution Detection Ensuring AI Robustness URL: https://mostafaelaraby.com/paper%20review/2025/01/15/introduction-to-out-of-distribution-detection/ Date: 2025-01-15 Categories: Paper Review Tags: OOD Detection, Anomaly Detection, AI Reliability An introduction to out-of-distribution detection for AI safety, covering anomaly, novelty, open-set and drift detection along with classification, density and distance methods. --- GAIA Gradient-Based Attribution for OOD Detection URL: https://mostafaelaraby.com/paper%20review/2024/11/01/gaia-out-of-distribution-detection/ Date: 2024-11-01 Categories: Paper Review Tags: OOD Detection, AI Safety, Research Paper review of GAIA, a gradient-based attribution framework that detects out-of-distribution samples through channel-wise and zero-deflation abnormality scores. --- BACS - Tackling Background Ambiguity in Continual Semantic Segmentation URL: https://mostafaelaraby.com/publications/2024/04/30/bacs-continual-semantic-segmentation/ Date: 2024-04-30 Categories: Publications Tags: Deep Learning, Semantic Segmentation, Continual Learning, Computer Vision, Scene Understanding Our BACS paper tackles background ambiguity in continual semantic segmentation with a transformer decoder, a Mahalanobis-based shift detector and masked knowledge distillation. --- Survey on Uncertainty Estimation in Deep Learning URL: https://mostafaelaraby.com/paper%20review/2022/12/01/uncertainty-estimation-survey/ Date: 2022-12-01 Categories: Paper Review Tags: Teaching, OOD, Research A survey of uncertainty estimation in deep learning covering aleatoric vs epistemic uncertainty, Bayesian inference, Fisher information and Gaussian processes. --- Empowering the Next Generation My Journey with MISE URL: https://mostafaelaraby.com/teaching/2022/09/01/empowering-the-next-generation-mise/ Date: 2022-09-01 Categories: Teaching Tags: Teaching, OOD, Research Mentoring high-school students in Ghana through the MISE program on machine learning fundamentals and OOD detection research, with one mentee admitted to MIT. --- Tackling Continual Learning: Our Journey in the CVPR 2021 Challenge URL: https://mostafaelaraby.com/projects/2022/06/01/cl-vision-competition/ Date: 2022-06-01 Categories: Projects Tags: Continual Learning, CVPR, Machine Learning, Deep Learning, Python, PyTorch Our 6th-place CVPR 2021 continual learning challenge submission using Dark Experience Replay with a 6000-sample memory buffer to fight catastrophic forgetting. --- Autonomous Lane Following in Duckietown: Our DAgger Approach URL: https://mostafaelaraby.com/projects/2021/10/01/imitation-learning-duckietown/ Date: 2021-10-01 Categories: Projects Tags: Imitation Learning, DAgger, Deep Learning, Autonomous Driving, Duckietown, Robotics Training a Duckiebot for lane following and obstacle avoidance with DAgger imitation learning, transferring a pure-pursuit expert policy from simulation to real hardware. --- Predicting Neural Network Accuracy from Weights URL: https://mostafaelaraby.com/paper%20review/2020/12/30/predicting-neural-network-accuracy-from-weights/ Date: 2020-12-30 Categories: Paper Review Tags: Generalization gap, weights, deep learning Paper review showing the generalization gap of a CNN can be predicted from layer-wise weight statistics alone, even across architectures and datasets via domain shift. --- Predicting The Generalization Gap In Deep Networks With Margin Distributions URL: https://mostafaelaraby.com/paper%20review/2020/12/21/predicting-generalization-gap-using-marginal-distribution/ Date: 2020-12-21 Categories: Paper Review Tags: Generalization gap, margin distribution, deep learning Paper review on predicting the deep network generalization gap from margin-distribution statistics across hidden layers, fed into a simple linear estimator. --- Introduction to Mixed Integer Programming URL: https://mostafaelaraby.com/tutorials/2020/06/26/introduction-to-mixed-integer-programming/ Date: 2020-06-26 Categories: Tutorials Tags: Linear Programming, Mixed-Integer Programming, Combinatorial Optimization, operations research, cvxpy A practical introduction to mixed-integer programming for ML engineers, covering branch-and-bound, presolve and cutting planes with hands-on examples in CVXPY. --- Identifying Critical Neurons in ANN Architectures using Mixed Integer Programming URL: https://mostafaelaraby.com/publications/2020/02/18/identifying-critical-neurons-in-ann-architectures-using-mixed-integer-programming/ Date: 2020-02-18 Categories: Publications Tags: Deep Learning Architectures, Meta-learning and Automated ML, Ranking and Preference Learning, Combinatorial Optimization Our paper on scoring neuron importance with mixed-integer programming to prune neural networks without fine-tuning, using ReLU bounds and a sparsity-driven objective. --- Explaining PackNet Adding Multiple Tasks to a Single Network by Iterative Pruning URL: https://mostafaelaraby.com/paper%20review/2020/02/13/packnet-adding-multiple-tasks-to-single-network-by-iterative-pruning/ Date: 2020-02-13 Categories: Paper Review Tags: Continual Learning, Parameter Isolation, PackNet Walkthrough of PackNet, a parameter-isolation method that fits multiple continual learning tasks into one network through iterative magnitude pruning and retraining. --- Stabilizing GAN training With Random Projections URL: https://mostafaelaraby.com/paper%20review/2019/04/15/stabilizing-gans-training-using-random-projections/ Date: 2019-04-15 Categories: Paper Review Tags: GANs (Generative Adversarial Networks), Stability in Neural Networks, Random Projections Paper review of stabilizing GAN training with random projections, using an ensemble of discriminators on fixed low-dimensional views to fight diminishing gradients. --- Working at Raisa URL: https://mostafaelaraby.com/experience/2018/09/10/working-at-raisa/ Date: 2018-09-10 Categories: Experience Tags: Data Science, Oil Forecasting, .Net Development, MsSql My time at Raisa Egypt forecasting oil and gas production with machine learning, modernizing legacy data collection tooling and running a company-wide hackathon. --- Avito Demand Prediction Kaggle competition URL: https://mostafaelaraby.com/competitions/projects/2018/08/16/avito-demand-prediction-kaggle-competition/ Date: 2018-08-16 Categories: Competitions, Projects Tags: Ad click prediction, image processing, Text Readability Features Engineering OpenCV image features such as simplicity, sharpness, contrast and face counts to boost a LightGBM ad-demand model for the Avito Kaggle competition. --- Learning Attentional LSTM model URL: https://mostafaelaraby.com/tutorials/2018/08/12/learning-attentional-lstm-model/ Date: 2018-08-12 Categories: Tutorials Tags: Attention, LSTM A hands-on Keras tutorial on attentional LSTM and GRU encoders, with embeddings and k-means clustering applied to the Seattle Library book inventory. --- Working at Microsoft Research Lab URL: https://mostafaelaraby.com/experience/2018/06/01/working-microsoft-research-lab/ Date: 2018-06-01 Categories: Experience Tags: Neural Machine Translation, Speech Recognition, Chat Bots My journey at Microsoft Research Lab Cairo working on Skype Translator: dialectal Arabic NMT, gender-aware translation, speech recognition and multilingual chatbots. --- Multi-lingual Bot Framework V4 URL: https://mostafaelaraby.com/projects/2018/05/18/multilingual-bot-framework-v4/ Date: 2018-05-18 Categories: Projects Tags: Chat Bots, Bot Framework v4 Contributing multilingual support to Microsoft Bot Framework v4 so chatbots can serve any language through a translation middleware over LUIS and QnA Maker. --- Gender aware spoken language translation Arabic To English URL: https://mostafaelaraby.com/publications/2018/04/15/gender-aware-slt-arabic-english/ Date: 2018-04-15 Categories: Publications Tags: Machine Translation, NMT, natural language processing, Spoken Language Translation Our IEEE paper on gender-aware Arabic-to-English spoken language translation, injecting speaker and listener gender tokens into NMT to preserve agreement and reduce bias. --- AI Challenger English Chinese Machine Translation URL: https://mostafaelaraby.com/competitions/2017/12/03/ai-challenger-english-chinese-machine-translation/ Date: 2017-12-03 Categories: Competitions Tags: NMT, machine learning Competing in AI Challenger's English-to-Chinese translation contest with an attentional seq2seq NMT model and BPE subwords, scoring 25.5 BLEU on the test set. --- Synthetic Spoken Data for Neural Machine Translation URL: https://mostafaelaraby.com/publications/2017/07/01/synthetic-spoken-data-for-neural-machine-translation/ Date: 2017-07-01 Categories: Publications Tags: Machine Translation, NMT, natural language processing, Data Generation Our Microsoft Research paper on generating synthetic parallel data for low-resource neural machine translation using word embeddings and three-way semantic projection. ================================================================================ NEWS ================================================================================ 2025-09-16 — ✨ Thrilled to announce our paper “GROOD” on enhancing OOD detection has been accepted to TMLR 2025! 📄 (Read the GROOD blog post) 2025-02-25 — 🤖 Is Test-Time Adaptation failing on hard OOD tasks? Our AAAI 2025 paper introduces GALA to fix it! 💡 (Read “A Layer Selection Approach to Test Time Adaptation”) 2023-05-01 — 🧠 How do you find the most critical neurons in a neural network? Our paper “OAMIP”, accepted to CPAIOR 2023, has an answer! 🧩 2023-05-01 — Boosting AI safety! 🛡️ My Mitacs internship project at Precision AI delivered a new framework for robust OOD detection in semantic segmentation. 🌾 2021-06-25 — 🏆 We’re proud to have placed 6th in the CVPR 2021 Continual Learning Challenge with our team, Real-DEEL! 🚀 (Read the story) 2020-09-01 — 🎓 M.S. in AI from UdeM complete! Excited to start my PhD journey at Mila, supported by an excellence scholarship. 🚀 ================================================================================ END ================================================================================