A comprehensive evaluation framework for assessing Large Language Models' understanding and pragmatic use of figurative language across various cultural contexts in Arabic and English.
In the root directory, clone the lm-eval-harness fork to access new tasks:
git clone https://github.com/menaattia/lm-evaluation-harnessCreate and activate the conda environment:
conda create -n vllm-eval python=3.10 -y
conda activate vllm-evalpip install lm-eval==0.4.8
pip install --no-cache-dir vllm==0.9.0.1
pip install -U huggingface_hub
pip install transformers==4.52.4
pip install hf_transferNavigate to the cloned lm-evaluation-harness directory and install in editable mode:
cd lm-evaluation-harness
pip install -e .
cd ..If you plan to evaluate Claude or Gemini models, install their respective API libraries:
pip install anthropic
pip install google-generativeaiSet up a writable Hugging Face cache directory:
export HF_HOME=/workspace/hf_cache
mkdir -p "$HF_HOME"Login to Hugging Face:
huggingface-cli login
huggingface-cli whoami || trueAll tasks are located in lm-evaluation-harness/lm-eval/tasks/jawaher/
-
Pragmatic Use
prag_useprag_use_proverbs
-
MCQ Understanding (MAPS Dataset)
maps_mcq- Without contextmaps_mcq_context- With context
-
MCQ Understanding (Random Option Order with General Prompt)
figmcq_randfigmcq_rand_idioms
-
MCQ Contextual Understanding
figmcq_rand_idioms_context
-
MCQ Understanding (Random Option Order with Semantic-Role-Labeling (SRL) Prompt)
figmcq_rand_srlfigmcq_rand_idioms_srl
-
Negation
negation_proverbnegation_idiom
-
Completion Tasks
complete- Jawaher proverbscomplete_maps- MAPS proverbs
-
Explanation Generation
figgen- Jawaher Arabic proverbsfiggen_idiom- Kinayat Arabic idioms
-
Connotation Labeling
connotation_idiom- Kinayat Arabic idiomsconnotation_proverb- Jawaher Arabic proverbs
Note: For closed-source models that don't provide log-likelihoods, use the version of the task that contains
genin the name. For example, useprag_use_geninstead ofprag_use. Check thejawaherfolder for all available task files.
The repository includes three evaluation scripts for different model types:
eval.sh- Evaluation of open-source modelsgpt_eval.sh- Evaluation of GPT modelsapi_eval.sh- Evaluation of Claude and Gemini models
Beyond Understanding: Evaluating the Pragmatic Gap in LLMs' Cultural Processing of Figurative Language
If you use this work in your research, please cite:
@misc{attia2025understandingevaluatingpragmaticgap,
title={Beyond Understanding: Evaluating the Pragmatic Gap in LLMs' Cultural Processing of Figurative Language},
author={Mena Attia and Aashiq Muhamed and Mai Alkhamissi and Thamar Solorio and Mona Diab},
year={2025},
eprint={2510.23828},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2510.23828}
}This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or contributions, please contact the authors via email: [mena.attia@mbzuai.ac.ae]