About the eval_instruct
I am very impressed by your wonderful work!
However, I encountered an issue.
I tested the Dream-7B-Instruct model using Dream/eval_instruct/eval.sh on the mmlu_generative task and found that the model's accuracy is lower than what is mentioned in the blog.
In the blog, the reported accuracy for MMLU is approximately 67.0.
However, what i got is about 60.9.
Below are the settings I used in eval.sh (with only the batch_size changed from the original):
PYTHONPATH=. accelerate launch --main_process_port 12334 -m lm_eval \
--model diffllm \
--model_args pretrained=Dream-org/Dream-v0-Instruct-7B,trust_remote_code=True,max_new_tokens=128,diffusion_steps=128,dtype="bfloat16",temperature=0.1,top_p=0.9,alg="entropy" \
--tasks mmlu_generative \
--device cuda \
--batch_size 12 \
--num_fewshot 4 \
--output_path output_reproduce/mmlu \
--log_samples --confirm_run_unsafe_code \
--apply_chat_template
What could be the reason for this? Could it be due to incorrect configuration of eval.sh?
More Information: torch==2.5.1+cu124, transformers==4.46.2
Hi @INV-WZQ,
Thanks for catching this!
We investigated the released toolkit and re-ran our experiments, and found the discrepancy comes from lm-eval’s solution extractor. It fails to parse answers formatted like "D. xxx" (where “xxx” is the option text), so those responses aren’t matched to “D” and get counted as incorrect. Our originally reported numbers used in-house scripts, and a mismatch crept in when we switched to lm-eval.
We’ve just opened a pr with a patch to handle the “D. xxx” format. Feel free to pull that and try again. Here are the updated results after applying the fix:
{
"mmlu_generative": {
"exact_match,get_response": 0.6989032901296112,
"exact_match_stderr,get_response": 0.003630581528573555,
"alias": "mmlu (generative)"
},
"humanities": {
"exact_match,get_response": 0.61211477151966,
"exact_match_stderr,get_response": 0.006601094995699926,
"alias": " - humanities"
},
"mmlu_formal_logic_generative": {
"alias": " - formal_logic",
"exact_match,get_response": 0.5793650793650794,
"exact_match_stderr,get_response": 0.04415438226743745
},
"mmlu_high_school_european_history_generative": {
"alias": " - high_school_european_history",
"exact_match,get_response": 0.8363636363636363,
"exact_match_stderr,get_response": 0.02888787239548796
},
"mmlu_high_school_us_history_generative": {
"alias": " - high_school_us_history",
"exact_match,get_response": 0.8970588235294118,
"exact_match_stderr,get_response": 0.021328337570804354
},
"mmlu_high_school_world_history_generative": {
"alias": " - high_school_world_history",
"exact_match,get_response": 0.8734177215189873,
"exact_match_stderr,get_response": 0.021644195727955177
},
"mmlu_international_law_generative": {
"alias": " - international_law",
"exact_match,get_response": 0.7933884297520661,
"exact_match_stderr,get_response": 0.03695980128098823
},
"mmlu_jurisprudence_generative": {
"alias": " - jurisprudence",
"exact_match,get_response": 0.8240740740740741,
"exact_match_stderr,get_response": 0.036809181416738807
},
"mmlu_logical_fallacies_generative": {
"alias": " - logical_fallacies",
"exact_match,get_response": 0.8220858895705522,
"exact_match_stderr,get_response": 0.03004735765580662
},
"mmlu_moral_disputes_generative": {
"alias": " - moral_disputes",
"exact_match,get_response": 0.7369942196531792,
"exact_match_stderr,get_response": 0.023703099525258165
},
"mmlu_moral_scenarios_generative": {
"alias": " - moral_scenarios",
"exact_match,get_response": 0.3675977653631285,
"exact_match_stderr,get_response": 0.016125543823552954
},
"mmlu_philosophy_generative": {
"alias": " - philosophy",
"exact_match,get_response": 0.6913183279742765,
"exact_match_stderr,get_response": 0.026236965881153266
},
"mmlu_prehistory_generative": {
"alias": " - prehistory",
"exact_match,get_response": 0.7746913580246914,
"exact_match_stderr,get_response": 0.023246202647819757
},
"mmlu_professional_law_generative": {
"alias": " - professional_law",
"exact_match,get_response": 0.49934810951760106,
"exact_match_stderr,get_response": 0.012770225252255556
},
"mmlu_world_religions_generative": {
"alias": " - world_religions",
"exact_match,get_response": 0.8421052631578947,
"exact_match_stderr,get_response": 0.027966785859160865
},
"other": {
"exact_match,get_response": 0.7479884132603798,
"exact_match_stderr,get_response": 0.007495765915062898,
"alias": " - other"
},
"mmlu_business_ethics_generative": {
"alias": " - business_ethics",
"exact_match,get_response": 0.8,
"exact_match_stderr,get_response": 0.04020151261036845
},
"mmlu_clinical_knowledge_generative": {
"alias": " - clinical_knowledge",
"exact_match,get_response": 0.7358490566037735,
"exact_match_stderr,get_response": 0.027134291628741713
},
"mmlu_college_medicine_generative": {
"alias": " - college_medicine",
"exact_match,get_response": 0.6936416184971098,
"exact_match_stderr,get_response": 0.03514942551267438
},
"mmlu_global_facts_generative": {
"alias": " - global_facts",
"exact_match,get_response": 0.42,
"exact_match_stderr,get_response": 0.04960449637488584
},
"mmlu_human_aging_generative": {
"alias": " - human_aging",
"exact_match,get_response": 0.7443946188340808,
"exact_match_stderr,get_response": 0.029275891003969927
},
"mmlu_management_generative": {
"alias": " - management",
"exact_match,get_response": 0.8252427184466019,
"exact_match_stderr,get_response": 0.037601780060266196
},
"mmlu_marketing_generative": {
"alias": " - marketing",
"exact_match,get_response": 0.8888888888888888,
"exact_match_stderr,get_response": 0.02058849131609236
},
"mmlu_medical_genetics_generative": {
"alias": " - medical_genetics",
"exact_match,get_response": 0.82,
"exact_match_stderr,get_response": 0.03861229196653694
},
"mmlu_miscellaneous_generative": {
"alias": " - miscellaneous",
"exact_match,get_response": 0.855683269476373,
"exact_match_stderr,get_response": 0.01256641750332095
},
"mmlu_nutrition_generative": {
"alias": " - nutrition",
"exact_match,get_response": 0.7875816993464052,
"exact_match_stderr,get_response": 0.02342037547829613
},
"mmlu_professional_accounting_generative": {
"alias": " - professional_accounting",
"exact_match,get_response": 0.5354609929078015,
"exact_match_stderr,get_response": 0.02975238965742705
},
"mmlu_professional_medicine_generative": {
"alias": " - professional_medicine",
"exact_match,get_response": 0.6948529411764706,
"exact_match_stderr,get_response": 0.027971541370170598
},
"mmlu_virology_generative": {
"alias": " - virology",
"exact_match,get_response": 0.572289156626506,
"exact_match_stderr,get_response": 0.03851597683718533
},
"social sciences": {
"exact_match,get_response": 0.8056548586285343,
"exact_match_stderr,get_response": 0.006956096886638929,
"alias": " - social sciences"
},
"mmlu_econometrics_generative": {
"alias": " - econometrics",
"exact_match,get_response": 0.5350877192982456,
"exact_match_stderr,get_response": 0.04692008381368909
},
"mmlu_high_school_geography_generative": {
"alias": " - high_school_geography",
"exact_match,get_response": 0.8787878787878788,
"exact_match_stderr,get_response": 0.023253157951942088
},
"mmlu_high_school_government_and_politics_generative": {
"alias": " - high_school_government_and_politics",
"exact_match,get_response": 0.9585492227979274,
"exact_match_stderr,get_response": 0.014385432857476442
},
"mmlu_high_school_macroeconomics_generative": {
"alias": " - high_school_macroeconomics",
"exact_match,get_response": 0.7487179487179487,
"exact_match_stderr,get_response": 0.021992016662370547
},
"mmlu_high_school_microeconomics_generative": {
"alias": " - high_school_microeconomics",
"exact_match,get_response": 0.8445378151260504,
"exact_match_stderr,get_response": 0.023536818625398897
},
"mmlu_high_school_psychology_generative": {
"alias": " - high_school_psychology",
"exact_match,get_response": 0.8935779816513761,
"exact_match_stderr,get_response": 0.013221554674594372
},
"mmlu_human_sexuality_generative": {
"alias": " - human_sexuality",
"exact_match,get_response": 0.8244274809160306,
"exact_match_stderr,get_response": 0.03336820338476074
},
"mmlu_professional_psychology_generative": {
"alias": " - professional_psychology",
"exact_match,get_response": 0.7352941176470589,
"exact_match_stderr,get_response": 0.017848089574913226
},
"mmlu_public_relations_generative": {
"alias": " - public_relations",
"exact_match,get_response": 0.7090909090909091,
"exact_match_stderr,get_response": 0.04350271442923243
},
"mmlu_security_studies_generative": {
"alias": " - security_studies",
"exact_match,get_response": 0.7551020408163265,
"exact_match_stderr,get_response": 0.02752963744017493
},
"mmlu_sociology_generative": {
"alias": " - sociology",
"exact_match,get_response": 0.8407960199004975,
"exact_match_stderr,get_response": 0.02587064676616913
},
"mmlu_us_foreign_policy_generative": {
"alias": " - us_foreign_policy",
"exact_match,get_response": 0.89,
"exact_match_stderr,get_response": 0.031446603773522035
},
"stem": {
"exact_match,get_response": 0.6758642562638757,
"exact_match_stderr,get_response": 0.007985119717590111,
"alias": " - stem"
},
"mmlu_abstract_algebra_generative": {
"alias": " - abstract_algebra",
"exact_match,get_response": 0.48,
"exact_match_stderr,get_response": 0.050211673156867795
},
"mmlu_anatomy_generative": {
"alias": " - anatomy",
"exact_match,get_response": 0.6222222222222222,
"exact_match_stderr,get_response": 0.04188307537595853
},
"mmlu_astronomy_generative": {
"alias": " - astronomy",
"exact_match,get_response": 0.8618421052631579,
"exact_match_stderr,get_response": 0.028081042939576552
},
"mmlu_college_biology_generative": {
"alias": " - college_biology",
"exact_match,get_response": 0.8402777777777778,
"exact_match_stderr,get_response": 0.030635578972093274
},
"mmlu_college_chemistry_generative": {
"alias": " - college_chemistry",
"exact_match,get_response": 0.56,
"exact_match_stderr,get_response": 0.04988876515698589
},
"mmlu_college_computer_science_generative": {
"alias": " - college_computer_science",
"exact_match,get_response": 0.69,
"exact_match_stderr,get_response": 0.04648231987117316
},
"mmlu_college_mathematics_generative": {
"alias": " - college_mathematics",
"exact_match,get_response": 0.45,
"exact_match_stderr,get_response": 0.05
},
"mmlu_college_physics_generative": {
"alias": " - college_physics",
"exact_match,get_response": 0.5392156862745098,
"exact_match_stderr,get_response": 0.049598599663841815
},
"mmlu_computer_security_generative": {
"alias": " - computer_security",
"exact_match,get_response": 0.81,
"exact_match_stderr,get_response": 0.039427724440366234
},
"mmlu_conceptual_physics_generative": {
"alias": " - conceptual_physics",
"exact_match,get_response": 0.8,
"exact_match_stderr,get_response": 0.0261488180184245
},
"mmlu_electrical_engineering_generative": {
"alias": " - electrical_engineering",
"exact_match,get_response": 0.6827586206896552,
"exact_match_stderr,get_response": 0.03878352372138621
},
"mmlu_elementary_mathematics_generative": {
"alias": " - elementary_mathematics",
"exact_match,get_response": 0.6481481481481481,
"exact_match_stderr,get_response": 0.02459497512892094
},
"mmlu_high_school_biology_generative": {
"alias": " - high_school_biology",
"exact_match,get_response": 0.896774193548387,
"exact_match_stderr,get_response": 0.017308381281034502
},
"mmlu_high_school_chemistry_generative": {
"alias": " - high_school_chemistry",
"exact_match,get_response": 0.6699507389162561,
"exact_match_stderr,get_response": 0.033085304262282574
},
"mmlu_high_school_computer_science_generative": {
"alias": " - high_school_computer_science",
"exact_match,get_response": 0.79,
"exact_match_stderr,get_response": 0.040936018074033256
},
"mmlu_high_school_mathematics_generative": {
"alias": " - high_school_mathematics",
"exact_match,get_response": 0.4740740740740741,
"exact_match_stderr,get_response": 0.03044452852881074
},
"mmlu_high_school_physics_generative": {
"alias": " - high_school_physics",
"exact_match,get_response": 0.5364238410596026,
"exact_match_stderr,get_response": 0.04071636065944216
},
"mmlu_high_school_statistics_generative": {
"alias": " - high_school_statistics",
"exact_match,get_response": 0.6898148148148148,
"exact_match_stderr,get_response": 0.03154696285656629
},
"mmlu_machine_learning_generative": {
"alias": " - machine_learning",
"exact_match,get_response": 0.5178571428571429,
"exact_match_stderr,get_response": 0.047427623612430116
}
}
@zhxieml Thank you very much for your response and the investigation results! I'm glad you identified the root of the issue and submitted a patch. I have simply retested the results on the mmlu_other_generative subset task, and the results are as follows:
| Tasks |Version| Filter |n-shot| Metric | |Value | |Stderr|
|-----------------------|------:|------------|-----:|-----------|---|-----:|---|-----:|
|business_ethics | 3|get_response| 4|exact_match|↑ |0.7900|± |0.0409|
|clinical_knowledge | 3|get_response| 4|exact_match|↑ |0.7321|± |0.0273|
|college_medicine | 3|get_response| 4|exact_match|↑ |0.6994|± |0.0350|
|global_facts | 3|get_response| 4|exact_match|↑ |0.4100|± |0.0494|
|human_aging | 3|get_response| 4|exact_match|↑ |0.7444|± |0.0293|
|management | 3|get_response| 4|exact_match|↑ |0.8252|± |0.0376|
|marketing | 3|get_response| 4|exact_match|↑ |0.8889|± |0.0206|
|medical_genetics | 3|get_response| 4|exact_match|↑ |0.8200|± |0.0386|
|miscellaneous | 3|get_response| 4|exact_match|↑ |0.8519|± |0.0127|
|nutrition | 3|get_response| 4|exact_match|↑ |0.7810|± |0.0237|
|professional_accounting| 3|get_response| 4|exact_match|↑ |0.5355|± |0.0298|
|professional_medicine | 3|get_response| 4|exact_match|↑ |0.6912|± |0.0281|
|virology | 3|get_response| 4|exact_match|↑ |0.5663|± |0.0386|
The results are similar to your test. The difference may come from different running settings.
Thanks again for your effort and support!
Glad to hear that it helps! Thanks again for raising the issue.