-
Notifications
You must be signed in to change notification settings - Fork 8
Course Exam Benchmark: Add Evaluation Infrastructure #61
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
Conversation
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.
Pull request overview
This pull request adds complete evaluation infrastructure for the courseexam benchmark, implementing a modernized data format and evaluation pipeline using the Inspect framework.
Key Changes:
- Implements evaluation infrastructure with task definition, dataset loading, custom metrics, and LLM-as-judge scoring for both ExactMatch and Freeform question types
- Migrates data format from flat structure with
instance_idto nested structure withinput/target/metadatafields following Inspect conventions - Updates test suite to validate the new data schema and adds automated dataset generation as part of test workflow
Reviewed changes
Copilot reviewed 14 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
courseexam/__init__.py |
Package initialization exposing main API |
courseexam/courseexam.py |
Main task definition with conditional solver for different question types |
courseexam/dataset.py |
Dataset loading with filtering by exam, type, and tags, plus reference material injection |
courseexam/metrics.py |
Custom metrics for points-based evaluation (accuracy, mean, totals) |
courseexam/scorer.py |
Hybrid scorer using exact match for multiple choice and LLM judge for freeform |
courseexam/prepare.py |
Data preparation script to convert markdown exams to JSONL format |
run_eval.py |
Convenience script for running evaluations with configurable parameters |
prepare_dataset.py |
Entry point script to prepare dataset from raw markdown files |
pyproject.toml |
Project configuration with dependencies and build settings |
tests/test_data_schema.py |
Updated schema validation tests for new data format |
data/raw/example_course_2024_midterm/exam.md |
Example exam updated with new format (choices field, answer as letter index) |
data/raw/example_course_2024_midterm/raft_basics.md |
New reference material file |
data/raw/6_1810_operating_system_engineering_fall_2024_final/exam.md |
Real exam updated with new format |
data/raw/6_1810_operating_system_engineering_fall_2024_final/mmap.md |
New reference material file |
README.md |
Comprehensive documentation updates covering evaluation, data format, and usage |
.github/workflows/test.yml |
CI updates for Python 3.10 and pyproject.toml-based installations |
Comments suppressed due to low confidence (8)
benchmarks/courseexam_bench/data/raw/6_1810_operating_system_engineering_fall_2024_final/exam.md:134
- The "choices" field contains ["A", "B", "C", "D"] instead of the actual option text. For consistency with the documented format (see example_course_2024_midterm/exam.md), this should contain the actual text of choices like ["an error because 'b' does not exist", "an error because the symlink was already visited", "an error because 'b' points to itself", "nothing because xv6 will panic"].
benchmarks/courseexam_bench/data/raw/6_1810_operating_system_engineering_fall_2024_final/exam.md:661 - The "choices" field contains ["A", "B", "C", "D"] instead of the actual option text. For consistency with the documented format, this should contain the actual text of the four choices presented in the question.
benchmarks/courseexam_bench/data/raw/6_1810_operating_system_engineering_fall_2024_final/exam.md:166 - The "choices" field contains ["A", "B", "C", "D", "E"] instead of the actual option text. For consistency with the documented format, this should contain the actual text of the five choices presented in the question.
benchmarks/courseexam_bench/data/raw/6_1810_operating_system_engineering_fall_2024_final/exam.md:288 - The "choices" field contains ["A", "B", "C", "D"] instead of the actual option text. For consistency with the documented format, this should contain the actual text of the four choices presented in the question.
benchmarks/courseexam_bench/data/raw/6_1810_operating_system_engineering_fall_2024_final/exam.md:368 - The "choices" field contains ["A", "B", "C", "D", "E"] instead of the actual option text. For consistency with the documented format, this should contain the actual text of the five choices presented in the question.
benchmarks/courseexam_bench/data/raw/6_1810_operating_system_engineering_fall_2024_final/exam.md:465 - The "choices" field contains ["A", "B", "C", "D", "E"] instead of the actual option text. For consistency with the documented format, this should contain the actual text of the five choices presented in the question.
benchmarks/courseexam_bench/data/raw/6_1810_operating_system_engineering_fall_2024_final/exam.md:46 - In the exam data, the "choices" field contains ["A", "B", "C", "D"] but these are just the option letters, not the actual choice content. According to the format in other questions like Question 1 of the example exam (lines 31-32), the choices should contain the actual text options like ["Running", "Ready", "Blocked", "Terminated"]. The current format is inconsistent with the documented structure.
benchmarks/courseexam_bench/data/raw/6_1810_operating_system_engineering_fall_2024_final/exam.md:96 - The same issue with "choices" exists here - it contains ["A", "B", "C", "D"] instead of the actual option text. For consistency with the documented format, this should be ["an inode number", "a block number", "file data", "a bitmap"].
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
61a0469 to
9df28a5
Compare
Signed-off-by: Tarek <tareknaser360@gmail.com>
9df28a5 to
440b165
Compare
Signed-off-by: Tarek <tareknaser360@gmail.com>
xuafeng
left a comment
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.
Overall is great. I left a few small comments. Thanks.
| B. 1 | ||
|
|
||
| C. 2 | ||
|
|
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.
Should I ignore all these exam data files?
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.
Yes I mostly just moved them to a new raw/ subfolder
|
|
||
| @solver | ||
| def conditional_solver() -> Solver: | ||
| mc_solver = multiple_choice() |
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.
do we know what's the concrete prompt this multiple_choice func sent to LLM?
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.
Yes we can view the full LLM query and response in the UI
|
|
||
|
|
||
| @solver | ||
| def conditional_solver() -> Solver: |
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.
I assume that we can implement any our own solver, right?
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.
Yeah. I actually started by implementing a custom solver before I realized this is more convenient
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.
|
|
||
|
|
||
| @scorer(metrics=[accuracy(), stderr(), mean()]) | ||
| def exam_scorer(judge_model: str = "openai/gpt-4o-mini") -> Scorer: |
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.
Maybe, we can have stronger judge model?
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 is just the default one. It's configurable through the CLI we expose
|
|
||
| from courseexam.courseexam import courseexam | ||
|
|
||
| # Configuration - modify these constants as needed |
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.
Should we move it to config file later?
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.
I think users will mainly interact with the benchmark through the CLI. I wrote this simple script as an alternative for more fine-grained control if needed.
We could also add a separate configuration file as a third way to run the benchmark but I don’t think it adds much value right now. What do you think?
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.
sure.
| - Explanation questions | ||
| - Multiple choice with partial credit (using custom rubric) | ||
|
|
||
| ## No Images/Figures Policy |
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.
I think many models, such as ones from openai, anthropic and google, already support multimodal (picture, txt). I am wondering why we need to change picture to text.
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.
Images put language models at a disadvantage and most of the models we benchmark (as of now) are language-only so for now I think questions that rely on images shouldn’t be included.
Later, when we support agents, we can decide how to handle image-based questions, either with clear flags or in a separate standalone benchmark.
What do you think?
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 model, gpt-4o, cluade-connet-4.5. I think they support image. please double check.
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.
they do yes. Do you think we should put questions with images' references in a separate benchmark?
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.
can we have some tag or label for these tasks? if the model support image, we test all. if not, we only run the ones without picture. They are all inside the system exam. But, with additional labels.
what do you think?
| @@ -0,0 +1,23 @@ | |||
| #!/usr/bin/env python3 | |||
|
|
|||
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.
Do you remember that we have some install.sh and run.sh script? the goal is to make us can easily deploy the repo on a new machine and quick test many benchmarks on both open-source model or our own trained models.
I am thinking that we will have many benchmarks in the future. How can we quickly test a bunch of benchmarks on a new model? Does the inspect already support it?
Maybe we still need some one-click scripts? Np urgent for this PR
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.
I’m not sure if inspect can run multiple benchmarks at once (as a single experiment with one log file) but we can definitely writer scripts to run inspect eval for each separate benchmark
Description
The PR adds infrastructure to run
courseexambenchmark evaluation using the updated data format