|
1 | | -# peerBench |
2 | 1 |
|
3 | | -peerBench framework implementation in TypeScript |
4 | 2 |
|
5 | | -## Quickstart |
6 | 3 |
|
7 | | -Clone the repository and install dependencies (we assume that you already installed a working [Node.js dev](https://nodejs.org/en) environment): |
| 4 | +# The problem: |
8 | 5 |
|
9 | | -```shell |
10 | | -npm i # or "yarn install" based on your preference |
11 | | -``` |
| 6 | +Public benchmark test data sets make AI model performance comparable. But this creates an incentivization for closed source models to cheat the benchmarks by training on test data or creating heuristics that overfit the benchmark test dataset ..... |
12 | 7 |
|
13 | | -peerBench works in three phase; |
| 8 | +# Our solution: |
14 | 9 |
|
15 | | -- Prompt |
16 | | -- Score |
17 | | -- Aggregate |
| 10 | +A network of independent experts validating models continuously with newly generated private test data and scoring that can be publicly audited. |
18 | 11 |
|
19 | | -Before you start, you need to create a `.env` file. You can use the the example one: |
| 12 | +# Addressing Industry Wide Overfitting of AI Models |
20 | 13 |
|
21 | | -```sh |
22 | | -cp .env.example .env |
23 | | -``` |
| 14 | +Another very important piece of context in accelerating AI innovation is **Model Overfitting plaguing the AI industry**. |
24 | 15 |
|
25 | | -Then fill out the variables with your values. |
| 16 | +Public benchmark test data sets make AI model performance comparable. But this creates an incentivization for closed source models in particular to game the benchmarks by creating heuristics for them or overfitting their training data to include solutions to the known testsets. |
26 | 17 |
|
27 | | -> You can generate a private with the following command: |
28 | | -> |
29 | | -> ```shell |
30 | | -> node -e "import('viem/accounts').then(({ generatePrivateKey, privateKeyToAccount }) => > { const pk = generatePrivateKey(); const acc = privateKeyToAccount(pk); console.log('Address:', acc.address); console.log('Private Key:', pk); });" |
31 | | -> ``` |
| 18 | +For open source models **Dynabench**[^45] tries to solve the problem of overfitting on test datasets with a community of humans **intentionally creating new test data designed to be hard for models**. But Dynabench only works with open source models. Additionally Dynabench has not seen significant adoption even after being managed by mlCommons. We believe this lack of traction is due to a lack of incentives for evaluators or AI model owners to participate. |
32 | 19 |
|
33 | | -### Prompt |
| 20 | +Requiring recency of test data is another approach taken by LiveBench[^48] but it is primarily focused on the problem of LLM's accidentally including test data as part of training. A malictious actor can still overfit liveBench within days of the test data being released. And as they are a single entity they can be covertly bribed to give out the test data to one AI provider before the release. But the idea of releasing new test data continously is something we agree with and will also push for in our standard. |
34 | 21 |
|
35 | | -In prompt phase, peerBench sends the prompts/tasks/questions from the given tasks to the LLM models. Collects the responses and saves them to the local file system: |
| 22 | +**Centralized private test data evaluation** is another approach that has been attempted to resolve the problem of AI companies gaming benchmark results. One currently active private evaluator is the SEAL LLM Leaderboards[^46] by Scale.ai[^47]. However, this lacks the transparency and audibility to be fully trustworthy and widely used as a standard. |
36 | 23 |
|
37 | | -```shell |
38 | | -./peerbench prompt -c config.example.json |
39 | | -``` |
| 24 | +**Decentralised systems are strongly positioned to solve** all of those issues thanks to providing proper incentivization to all parties involved while leveraging blockchains' decentralisation and transparency. **Private datasets** still can be a fundamental **part of the validation strategy**. |
40 | 25 |
|
41 | | -`-c` points to the configuration file that is going to be used for prompting process. An example is shown below: |
| 26 | +# Test Data Quality Control Process |
42 | 27 |
|
43 | | -```jsonc |
44 | | -{ |
45 | | - // Path of the task files |
46 | | - "tasks": ["./data/tasks/mmlu-pro/mmlu-pro.parquet"], |
| 28 | +# Become a Validator |
47 | 29 |
|
48 | | - // Models that the task files will be prompted to |
49 | | - // Format is: <provider name>:<model owner name>/<model name> |
50 | | - // Supported providers: |
51 | | - // - openrouter.ai |
52 | | - "models": [ |
53 | | - "openrouter.ai:openai/chatgpt-4o-latest", |
54 | | - "openrouter.ai:google/gemini-2.0-flash-001", |
55 | | - "openrouter.ai:google/gemini-2.0-flash-lite-001", |
56 | | - "openrouter.ai:meta-llama/llama-4-scout", |
57 | | - "openrouter.ai:meta-llama/llama-4-maverick", |
58 | | - "openrouter.ai:mistralai/mistral-small-3.1-24b-instruct" |
59 | | - ] |
60 | | -} |
61 | | -``` |
| 30 | +# Get Your Model Benchmarked |
62 | 31 |
|
63 | | -If you want, you can also pass the maximum prompt to be executed: |
| 32 | +[^45]: Link: https://arxiv.org/abs/2104.14337 |
64 | 33 |
|
65 | | -```shell |
66 | | -./peerbench prompt -c config.example.json -m 10 |
67 | | -``` |
| 34 | +[^46]: Link: https://scale.com/leaderboard |
68 | 35 |
|
69 | | -That means only first 10 prompt from the given task files will be executed over the models and rest will be ignored. |
| 36 | +[^47]: Link: https://scale.com/ |
70 | 37 |
|
71 | | -Once the command is done, the collected responses will be available at |
72 | | - |
73 | | -``` |
74 | | -data/output/<task name>/<validator id>/<model owner>/<model name>/responses-<task name>-<timestamp>.json |
75 | | -``` |
76 | | - |
77 | | -### Score |
78 | | - |
79 | | -To score your responses you need to run the following command: |
80 | | - |
81 | | -```shell |
82 | | -./peerbench score --task <task name> |
83 | | -``` |
84 | | - |
85 | | -For `<task name>` part, you need to pass the name of the task that you've run. You can generate the scores for only one task at a time. If you've used one of the known task formats, the `task name` would be one of these: |
86 | | - |
87 | | -- `mmlu-pro` (whole task) |
88 | | -- `mmlu-pro-<category name(s)>` (e.g `mmlu-pro-history`, `mmlu-pro-history-engineering`) |
89 | | -- `bigbench` (whole task) |
90 | | -- `bigbench-<task name>` (e.g `bigbench-social_iqa`) |
91 | | - |
92 | | -Otherwise it will be set to the task file name without extension (e.g `my-task` for `my-task.json`) |
93 | | - |
94 | | -### Aggregation |
95 | | - |
96 | | -To see the aggregated results, you can use the aggregate command (aliased as `agg`): |
97 | | - |
98 | | -You can also use a config file for aggregation, similar to the prompt and score commands: |
99 | | - |
100 | | -```shell |
101 | | -./peerbench agg -c config.example.json |
102 | | -``` |
103 | | - |
104 | | -The aggregate command now provides several enhanced features: |
105 | | - |
106 | | -1. **Config File Support**: Use `-c` to specify a config file with tasks and models |
107 | | -2. **Per-Task Analysis**: When multiple tasks are in the config, it generates individual reports for each task |
108 | | -3. **Combined Analysis**: Always provides a combined analysis of all tasks |
109 | | -4. **Automatic File Output**: Results are automatically saved to JSON files (no need to specify `-o`) |
110 | | -5. **Output Directory**: All files are saved to `data/output/aggregates/` directory |
111 | | - |
112 | | -When using a config file with multiple tasks, the command will: |
113 | | -- Generate and display a results table for each individual task |
114 | | -- Generate and display a combined results table for all tasks |
115 | | -- Save separate result files for each task and the combined analysis |
116 | | - |
117 | | -Output files follow this naming pattern: |
118 | | -``` |
119 | | -data/output/aggregates/results-<task-name>-<timestamp>.json # Individual task results |
120 | | -data/output/aggregates/results-combined-<timestamp>.json # Combined results |
121 | | -``` |
122 | | - |
123 | | -### Data Standardization |
124 | | - |
125 | | -The framework provides a data standardization tool that allows you to convert between different question schemas. Currently, it supports conversion between `mmlu-pro` and `medqa` formats. |
126 | | - |
127 | | -```shell |
128 | | -./peerbench std --source <source-file> [--from <schema>] --to <schema> [--output <output-file>] |
129 | | -``` |
130 | | - |
131 | | -Options: |
132 | | -- `--source` (required): Source file with data to be standardized |
133 | | -- `--from` (optional): Source schema type (mmlu-pro or medqa, default: auto-detect) |
134 | | -- `--to` (required): Target schema type (mmlu-pro or medqa, default: medqa) |
135 | | -- `--output` (optional): Output file path (default: derived from source filename) |
136 | | - |
137 | | -#### Example |
138 | | - |
139 | | -Convert from MMLU-Pro format to MedQA format: |
140 | | - |
141 | | -```shell |
142 | | -./peerbench std --source data/tasks/mmlu-pro/history_samples.json --to medqa |
143 | | -``` |
144 | | - |
145 | | -Convert from MedQA format to MMLU-Pro format: |
146 | | - |
147 | | -```shell |
148 | | -./peerbench std --source data/tasks/medqa/samples.jsonl --from medqa --to mmlu-pro --output data/tasks/mmlu-pro/converted.json |
149 | | -``` |
150 | | - |
151 | | -#### Schema Examples |
152 | | - |
153 | | -MMLU-Pro Format: |
154 | | -```json |
155 | | -{ |
156 | | - "question": "Australian and America megafauna were probably wiped out by:", |
157 | | - "options": [ |
158 | | - "natural disasters such as volcanic eruptions or earthquakes.", |
159 | | - "both humans and environmental changes.", |
160 | | - "the spread of invasive plant species which altered their habitat.", |
161 | | - "a sudden drastic climate change due to global warming.", |
162 | | - "humans who carried diseases over the land bridge.", |
163 | | - "humans.", |
164 | | - "diseases transmitted by other animal species.", |
165 | | - "a comet or asteroid impact.", |
166 | | - "environmental changes.", |
167 | | - "competition with other animal species." |
168 | | - ], |
169 | | - "answer": "B", |
170 | | - "answer_index": 1, |
171 | | - "cot_content": "", |
172 | | - "category": "history", |
173 | | - "src": "ori_mmlu-prehistory", |
174 | | - "question_id": 4676, |
175 | | - "other": { |
176 | | - "hash_full_question": "4d53be6330395aeab823bdb8a02e14f7b6edfbc0f5b0dbe2233f53271c346581", |
177 | | - "hash_first_sentence": "4d53be6330395aeab823bdb8a02e14f7b6edfbc0f5b0dbe2233f53271c346581", |
178 | | - "hash_first_question_sentence": "4d53be6330395aeab823bdb8a02e14f7b6edfbc0f5b0dbe2233f53271c346581", |
179 | | - "hash_last_sentence": "4d53be6330395aeab823bdb8a02e14f7b6edfbc0f5b0dbe2233f53271c346581", |
180 | | - "preSTDsrcFileName": "mmlu-pro_test.onlyhistory-first20.jsonl", |
181 | | - "preSTDsrcCID": "bafkreib4kvac3h6tn5ipllbup55asmq63ls33fse3jm2u2ftgfxssywwju" |
182 | | - } |
183 | | -} |
184 | | -``` |
185 | | - |
186 | | -MedQA Format: |
187 | | -```json |
188 | | -{ |
189 | | - "question": "Australian and America megafauna were probably wiped out by:", |
190 | | - "options": { |
191 | | - "A": "natural disasters such as volcanic eruptions or earthquakes.", |
192 | | - "B": "both humans and environmental changes.", |
193 | | - "C": "the spread of invasive plant species which altered their habitat.", |
194 | | - "D": "a sudden drastic climate change due to global warming.", |
195 | | - "E": "humans who carried diseases over the land bridge.", |
196 | | - "F": "humans.", |
197 | | - "G": "diseases transmitted by other animal species.", |
198 | | - "H": "a comet or asteroid impact.", |
199 | | - "I": "environmental changes.", |
200 | | - "J": "competition with other animal species." |
201 | | - }, |
202 | | - "answer_idx": "B", |
203 | | - "answer": "both humans and environmental changes.", |
204 | | - "meta_info": "", |
205 | | - "other": { |
206 | | - "hash_full_question": "4d53be6330395aeab823bdb8a02e14f7b6edfbc0f5b0dbe2233f53271c346581", |
207 | | - "hash_first_sentence": "4d53be6330395aeab823bdb8a02e14f7b6edfbc0f5b0dbe2233f53271c346581", |
208 | | - "hash_first_question_sentence": "4d53be6330395aeab823bdb8a02e14f7b6edfbc0f5b0dbe2233f53271c346581", |
209 | | - "hash_last_sentence": "4d53be6330395aeab823bdb8a02e14f7b6edfbc0f5b0dbe2233f53271c346581", |
210 | | - "mmlu-pro__question_id": 4676, |
211 | | - "mmlu-pro__answer_index": 1, |
212 | | - "mmlu-pro__cot_content": "", |
213 | | - "mmlu-pro__category": "history", |
214 | | - "mmlu-pro__src": "ori_mmlu-prehistory", |
215 | | - "preSTDsrcFileName": "mmlu-pro_test.onlyhistory-first20.jsonl", |
216 | | - "preSTDsrcCID": "bafkreib4kvac3h6tn5ipllbup55asmq63ls33fse3jm2u2ftgfxssywwju" |
217 | | - } |
218 | | -} |
219 | | -``` |
220 | | - |
221 | | -The standardization feature also handles: |
222 | | -- Both JSON and JSONL file formats |
223 | | -- Automatic schema detection |
224 | | -- Generation of content hashes for question matching |
225 | | -- Assignment of UUIDs for tracking |
226 | | -- Preservation of source information |
| 38 | +[^48]: Link: https://livebench.ai/#/ |
0 commit comments