-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Quran Eval & Simple Fact Model-Graded Definition #1511
base: main
Are you sure you want to change the base?
Conversation
I've made the code for generating this eval public to aid with reviewing this PR. https://github.com/sakher/open-ai-quran-eval-generation Thanks in advance! |
@andrew-openai Is there anything I can do to help aiding the review of this PR? I appreciate that it is from a domain and a language that can be challenging to review. I made the repo for the generation public which contains some hopefully useful comments - and happy to do more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. This PR looks good. I would like to request some changes.
-
guess_quran_verse_name
andguess_quran_verse_type
evals should be renamed toguess_quran_surah_name
andguess_quran_surah_type
because the eval is about the name and type of surah and not the verses. -
The "ModelGraded" evaluation method isn't suitable for this kind of prompt. That method is used when there is a subjective answer to a prompt. For these evals, the "Match" or "Include" evaluation method should be used.
-
When using the "Match" or "Include" evaluation method, the ideal answer should be a list of possible answers, i.e., the ideal answer should contain the correct answer with all possible variations, like
"ideal": ["سباء","سَبَاء"]
. Also, add instructions to provide an answer without airaab to avoid any mismatch between the model-provided answer and the ideal answer. -
It would be much appreciated if you put the dataset generation script and resource in the
evals/registry/data/quran_eval
directory.
We would love to review the PR again after the suggested changes.
I agree that ModelGraded is an overkill for guess_surah_name and guess_surah_type, as well as guess which text is quranic and that match or include would give very similar results, much cheaper. But the as for the latest eval (guess masked text), I have done many tests, the model guided is much better in spotting mistakes that can seem simple (e.g. differences in diacritics that severely change the meaning). Also, you can't really include add all possible variations given the model can output more or less diacritics while keeping the meaning valid. I will make the changes and test and report the results. EDIT 1:
I will change the guess_sourah_type and guess_which_text_is_from_quran to include but will keep the others as model-guided, I hope you don't mind. |
@usama-openai - I have done all of the changes and updated the documentation about the results (including the raw results and log files) here: As mentioned earlier, I have changed the evaluation method only for 2 of the 4 evals to use 'includes' instead of 'model-guided'. I hope this works! P.S. I applied for some credits via the research program earlier but didn't get any response, this is largely self-funded. I would appreciate if you can help with this! Also, I am very keen to help improving evaluation and training on the Arabic language; if you guys have any valuable evals in mind, please let me know (I have a few I am looking into already). And sorry for bundling a few changes in one PR - I am more than happy to separate if you prefer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks in good shape now. Kindly keep only evaluation-related changes in this PR and create a new PR for GPT-4o-related changes.
Thanks @usama-openai - I removed all code changes related to adding gpt-4o (my changes have been incorporated into another PR #1530 which I reviewed and happy with). Kindly look into this once you have a second. |
I have a few evals in mind to add related to Arabic language - but wanted to ensure that they would be valuable and likely accepted before putting the effort - is there a way to communicate with the evals team at OpenAI (e.g. chat or email)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks in good shape now. I'm approving this PR.
@usama-openai - the unit tests fail on this PR as well as on Please merge the fix, once done, I will rebase into this PR and re-run the unit tests which hopefully would make this eval ready to merge. |
Thank you for contributing an eval!♥️
🚨 Please make sure your PR follows these guidelines, failure to follow the guidelines below will result in the PR being closed automatically. Note that even if the criteria are met, that does not guarantee the PR will be merged nor GPT-4 access be granted. 🚨
PLEASE READ THIS:
In order for a PR to be merged, it must fail on GPT-4. We are aware that right now, users do not have access, so you will not be able to tell if the eval fails or not. Please run your eval with GPT-3.5-Turbo, but keep in mind as we run the eval, if GPT-4 gets higher than 90% on the eval, we will likely reject it since GPT-4 is already capable of completing the task.
We plan to roll out a way for users submitting evals to see the eval performance on GPT-4 soon. Stay tuned! Until then, you will not be able to see the eval performance on GPT-4. Starting April 10, the minimum eval count is 15 samples, we hope this makes it easier to create and contribute evals.
Also, please note that we're using Git LFS for storing the JSON files, so please make sure that you move the JSON file to Git LFS before submitting a PR. Details on how to use Git LFS are available here.
Eval details 📑
Eval name
Eval Set: quran-evals:
evals:
- guess_quran_verse_name
- guess_quran_verse_type
- guess_which_text_is_from_quran
- masked_quranic_text
Eval description
This evaluation assesses the comprehension and memorization capabilities of language models regarding Quranic texts. It features four distinct question types: Surah (Chapter) Identification, Meccan vs. Madinan Chapter type Revelation, Quranic Text Recognition (amongst non-Quranic text distractors), and Fill in the Blank. Each type is designed to test the models' abilities to recall, contextualize, and accurately interpret religious texts, providing insights into their potential use in educational and scholarly domains.
What makes this a useful eval?
This eval is valuable because it addresses a niche yet significant area of language model application: religious texts comprehension. It goes beyond general knowledge queries to test specific, detailed understanding and memorization of Quranic verses, challenging the models in a unique way that standard benchmarks may not. Additionally, this evaluation offers a perspective on the sensitivity and respectfulness and exactness required when handling religious texts, contributing to the development of more nuanced and culturally aware AI systems.
Here is a short report alongside the run results with different configurations:
https://sakher.notion.site/Using-OpenAI-Evals-for-Quranic-Text-Evaluation-06d8ca52d22449b4b7ac36f582c312e9
Criteria for a good eval ✅
Below are some of the criteria we look for in a good eval. In general, we are seeking cases where the model does not do a good job despite being capable of generating a good response (note that there are some things large language models cannot do, so those would not make good evals).
Your eval should be:
Basic
evals or theFact
Model-graded eval, or an exhaustive rubric for evaluating answers for theCriteria
Model-graded eval.If there is anything else that makes your eval worth including, please document it below.
Unique eval value
The creation of the this eval represents a unique and crucial endeavor within the sphere of AI language understanding, particularly in relation to the profound significance of the Quran in the lives of hundreds of millions of Muslims worldwide. It's noteworthy to acknowledge that the Quran is not just a religious text; it embodies a tradition of memorization that spans centuries, where individuals, including children under the age of ten, commit its entirety to memory with remarkable precision. This practice underscores the importance of the Quran's literal preservation, where even the slightest deviation from its text is considered unacceptable.
Given this context, it's striking to observe when advanced AI models like those developed by OpenAI struggle with tasks that are second nature to millions, such as accurately identifying the chapter (Surah) a verse (Aya) belongs to or completing a partially provided verse. This isn't just a measure of the models' technical capabilities but a reflection on their understanding of the Quran's critical and sacrosanct nature to the global Muslim community.
Furthermore, this evaluation holds the potential to shed light on the models' proficiency with the Arabic language, particularly the nuanced and diacritic-rich script of the Quranic and other formal Arabic texts. It brings to the forefront the challenges existing tokenization techniques face with Arabic and other non-Latin languages, urging a reevaluation and improvement in how these languages are processed.
Incorporating this evaluation into OpenAI's framework is not merely a step towards enhancing a model's performance in the Arabic language; it's an initiative towards fostering respect, precision, and cultural sensitivity in AI's handling of religious texts. It is a call to recognize and honor the profound tradition of Quranic preservation through the lens of AI, ensuring that these models can approach the Quran with the accuracy and reverence it demands. This effort is not just about improving tokenization or understanding nuances in language—it's about bridging AI's capabilities with the deep-rooted values and traditions of millions of people worldwide.
I am also working on other evals related to Arabic language and other similar aspects.
Eval structure 🏗️
Your eval should
evals/registry/data/{name}
evals/registry/evals/{name}.yaml
(For now, we will only be approving evals that use one of the existing eval classes. You may still write custom eval classes for your own cases, and we may consider merging them in the future.)
Final checklist 👀
Submission agreement
By contributing to Evals, you are agreeing to make your evaluation logic and data under the same MIT license as this repository. You must have adequate rights to upload any data used in an Eval. OpenAI reserves the right to use this data in future service improvements to our product. Contributions to OpenAI Evals will be subject to our usual Usage Policies (https://platform.openai.com/docs/usage-policies).
Email address validation
If your submission is accepted, we will be granting GPT-4 access to a limited number of contributors. Access will be given to the email address associated with the commits on the merged pull request.
Limited availability acknowledgment
We know that you might be excited to contribute to OpenAI's mission, help improve our models, and gain access to GPT-4. However, due to the requirements mentioned above and the high volume of submissions, we will not be able to accept all submissions and thus not grant everyone who opens a PR GPT-4 access. We know this is disappointing, but we hope to set the right expectation before you open this PR.
Submit eval
pip install pre-commit; pre-commit install
and have verified thatmypy
,black
,isort
,autoflake
andruff
are running when I commit and pushFailure to fill out all required fields will result in the PR being closed.
Eval JSON data
Since we are using Git LFS, we are asking eval submitters to add in as many Eval Samples (at least 5) from their contribution here:
View evals in JSON
Eval