Skip to content
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

feat: 1049 add standard evaluation benchmarks to lfai evals #1078

Merged

Conversation

jalling97
Copy link
Contributor

@jalling97 jalling97 commented Sep 19, 2024

Description

Adds baseline generation evaluation benchmarks to provide a known point of comparison. These benchmarks can show us when models we have implemented are not performing how we expect them to (based on reported eval benchmarks) and to better understand the impact of specific quantizations on certain models.

BREAKING CHANGES

N/A

CHANGES

  • Refactors how evals get imported to make adding future evals easier
  • Adds the MMLU and HumanEval benchmarks to leapfrogai_evals
  • Adds a DeepEval compatible LLM class that relies on the LFAI API (not to be used as an LLM as a Judge)
  • Updates the evals README
  • Upgrades DeepEval to v1.3.0

Related Issue

Relates to #1049

Checklist before merging

@jalling97 jalling97 linked an issue Sep 19, 2024 that may be closed by this pull request
Copy link

netlify bot commented Sep 19, 2024

Deploy Preview for leapfrogai-docs canceled.

Name Link
🔨 Latest commit 69e725a
🔍 Latest deploy log https://app.netlify.com/sites/leapfrogai-docs/deploys/66f34b36cc1a040008f4dc12

@jalling97 jalling97 changed the title 1049 feat add standard evaluation benchmarks to lfai evals feat: 1049 add standard evaluation benchmarks to lfai evals Sep 19, 2024
@jalling97 jalling97 self-assigned this Sep 19, 2024
@jalling97 jalling97 added enhancement New feature or request python Pull requests that update Python code labels Sep 19, 2024
@jalling97 jalling97 marked this pull request as ready for review September 20, 2024 16:10
@jalling97 jalling97 requested a review from a team as a code owner September 20, 2024 16:10
@jalling97
Copy link
Contributor Author

MMLU on my desktop (synthia 7b)
This is the full benchmark, but by default we don't run the whole thing because it would take a long time for continuous testing.

NFO:root:MMLU overal score: 0.15970228601807548
INFO:root:MMLU Task scores:
                                    Task     Score
0          high_school_european_history  0.181818
1                       business_ethics  0.163636
2                    clinical_knowledge  0.139394
3                      medical_genetics  0.169697
4                high_school_us_history  0.139394
5                   high_school_physics  0.145455
6             high_school_world_history  0.151515
7                              virology  0.151515
8            high_school_microeconomics  0.139394
9                          econometrics  0.175758
10             college_computer_science  0.181818
11                  high_school_biology  0.163636
12                     abstract_algebra  0.133333
13              professional_accounting  0.157576
14                           philosophy  0.151515
15                professional_medicine  0.103030
16                            nutrition  0.181818
17                         global_facts  0.193939
18                     machine_learning  0.242424
19                     security_studies  0.224242
20                     public_relations  0.151515
21              professional_psychology  0.157576
22                           prehistory  0.096970
23                              anatomy  0.175758
24                      human_sexuality  0.145455
25                     college_medicine  0.151515
26  high_school_government_and_politics  0.163636
27                    college_chemistry  0.181818
28                    logical_fallacies  0.115152
29                high_school_geography  0.145455
30               elementary_mathematics  0.096970
31                          human_aging  0.181818
32                  college_mathematics  0.163636
33               high_school_psychology  0.157576
34                         formal_logic  0.163636
35               high_school_statistics  0.200000
36                    international_law  0.163636
37              high_school_mathematics  0.230303
38         high_school_computer_science  0.175758
39                   conceptual_physics  0.151515
40                        miscellaneous  0.151515
41                high_school_chemistry  0.127273
42                            marketing  0.133333
43                     professional_law  0.127273
44                           management  0.157576
45                      college_physics  0.127273
46                        jurisprudence  0.224242
47                      world_religions  0.139394
48                            sociology  0.121212
49                    us_foreign_policy  0.187879
50           high_school_macroeconomics  0.151515
51                    computer_security  0.169697
52                      moral_scenarios  0.193939
53                       moral_disputes  0.157576
54               electrical_engineering  0.115152
55                            astronomy  0.133333
56                      college_biology  0.224242
INFO:root:

Final Results:
INFO:root:MMLU: 0.15970228601807548
INFO:root:Eval Execution Runtime (seconds): 5002.170227050781

@jalling97
Copy link
Contributor Author

HumanEval on vllm on desktop:
100 tasks, 10 samples per task, pass@1

By default, we'll run 3 samples per task for 50 tasks to balance runtime.

INFO:root:HumanEval overall score: 0.98
INFO:root:HumanEval failed task count: 2
INFO:root:HumanEval task scores:
 {'HAS_CLOSE_ELEMENTS': 1.0, 'SEPARATE_PAREN_GROUPS': 1.0, 'TRUNCATE_NUMBER': 1.0, 'BELOW_ZERO': 1.0, 'MEAN_ABSOLUTE_DEVIATION': 1.0, 'INTERSPERSE': 1.0, 'PARSE_NESTED_PARENS': 1.0, 'FILTER_BY_SUBSTRING': 1.0, 'SUM_PRODUCT': 1.0, 'ROLLING_MAX': 1.0, 'MAKE_PALINDROME': 1.0, 'STRING_XOR': 1.0, 'LONGEST': 1.0, 'GREATEST_COMMON_DIVISOR': 1.0, 'ALL_PREFIXES': 1.0, 'STRING_SEQUENCE': 1.0, 'COUNT_DISTINCT_CHARACTERS': 0.0, 'PARSE_MUSIC': 1.0, 'HOW_MANY_TIMES': 1.0, 'SORT_NUMBERS': 1.0, 'FIND_CLOSEST_ELEMENTS': 1.0, 'RESCALE_TO_UNIT': 1.0, 'FILTER_INTEGERS': 0.0, 'STRLEN': 1.0, 'LARGEST_DIVISOR': 1.0, 'FACTORIZE': 1.0, 'REMOVE_DUPLICATES': 1.0, 'FLIP_CASE': 1.0, 'CONCATENATE': 1.0, 'FILTER_BY_PREFIX': 1.0, 'GET_POSITIVE': 1.0, 'IS_PRIME': 1.0, 'FIND_ZERO': 1.0, 'SORT_THIRD': 1.0, 'UNIQUE': 1.0, 'MAX_ELEMENT': 1.0, 'FIZZ_BUZZ': 1.0, 'SORT_EVEN': 1.0, 'DECODE_CYCLIC': 1.0, 'PRIME_FIB': 1.0, 'TRIPLES_SUM_TO_ZERO': 1.0, 'CAR_RACE_COLLISION': 1.0, 'INCR_LIST': 1.0, 'PAIRS_SUM_TO_ZERO': 1.0, 'CHANGE_BASE': 1.0, 'TRIANGLE_AREA': 1.0, 'FIB4': 1.0, 'MEDIAN': 1.0, 'IS_PALINDROME': 1.0, 'MODP': 1.0, 'DECODE_SHIFT': 1.0, 'REMOVE_VOWELS': 1.0, 'BELOW_THRESHOLD': 1.0, 'ADD': 1.0, 'SAME_CHARS': 1.0, 'FIB': 1.0, 'CORRECT_BRACKETING': 1.0, 'MONOTONIC': 1.0, 'COMMON': 1.0, 'LARGEST_PRIME_FACTOR': 1.0, 'SUM_TO_N': 1.0, 'DERIVATIVE': 1.0, 'FIBFIB': 1.0, 'VOWELS_COUNT': 1.0, 'CIRCULAR_SHIFT': 1.0, 'DIGITSUM': 1.0, 'FRUIT_DISTRIBUTION': 1.0, 'PLUCK': 1.0, 'SEARCH': 1.0, 'STRANGE_SORT_LIST': 1.0, 'WILL_IT_FLY': 1.0, 'SMALLEST_CHANGE': 1.0, 'TOTAL_MATCH': 1.0, 'IS_MULTIPLY_PRIME': 1.0, 'IS_SIMPLE_POWER': 1.0, 'IS_CUBE': 1.0, 'HEX_KEY': 1.0, 'DECIMAL_TO_BINARY': 1.0, 'IS_HAPPY': 1.0, 'NUMERICAL_LETTER_GRADE': 1.0, 'PRIME_LENGTH': 1.0, 'STARTS_ONE_ENDS': 1.0, 'SOLVE': 1.0, 'ANTI_SHUFFLE': 1.0, 'GET_ROW': 1.0, 'SORT_ARRAY': 1.0, 'ENCRYPT': 1.0, 'NEXT_SMALLEST': 1.0, 'IS_BORED': 1.0, 'ANY_INT': 1.0, 'ENCODE': 1.0, 'SKJKASDKD': 1.0, 'CHECK_DICT_CASE': 1.0, 'COUNT_UP_TO': 1.0, 'MULTIPLY': 1.0, 'COUNT_UPPER': 1.0, 'CLOSEST_INTEGER': 1.0, 'MAKE_A_PILE': 1.0, 'WORDS_STRING': 1.0, 'CHOOSE_NUM': 1.0}
INFO:root:

Final Results:
INFO:root:HumanEval: 0.98
INFO:root:Eval Execution Runtime (seconds): 2927.682594060898

@jalling97
Copy link
Contributor Author

With these new changes under default settings, the whole evaluation suite should take about 30 minutes to run.

@jalling97
Copy link
Contributor Author

Most recent results run on default settings

Final Results:
INFO:root:Average Needle in a Haystack (NIAH) Retrieval: 1.0
INFO:root:Average Needle in a Haystack (NIAH) Response: 1.0
INFO:root:Average Correctness (GEval): 0.81
INFO:root:Average Answer Relevancy: 0.9616666666666666
INFO:root:Average Annotation Relevancy: 0.92
INFO:root:MMLU: 0.695959595959596
INFO:root:HumanEval: 0.96
INFO:root:Eval Execution Runtime (seconds): 1961.5159051418304

Copy link
Contributor

@justinthelaw justinthelaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the refactor - thank you!

@jalling97 jalling97 merged commit 8e68b8b into main Sep 25, 2024
26 checks passed
@jalling97 jalling97 deleted the 1049-feat-add-standard-evaluation-benchmarks-to-lfai-evals branch September 25, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add Standard Evaluation Benchmarks to LFAI Evals
3 participants