Add LEXam legal exam benchmark to Swiss legal evals#1243
Open
JoelNiklaus wants to merge 1 commit into
Open
Conversation
Adds LEXam (https://huggingface.co/datasets/LEXam-Benchmark/LEXam) tasks: - lexam_oq:{en,de}: open-ended legal exam questions scored with an LLM-as-judge (JudgeLEXamOQ, default openai/gpt-4o-2024-11-20 via LiteLLM). - lexam_mcq_{4,8,16,32}{,_idk}:{en,de}: letter-based MCQ scorer using IndicesExtractionConfig with a ###X### / \boxed{X} / "Final answer: X" fallback regex. Choices are shuffled deterministically (seed 42). - Optional "I don't know" calibration: when with_idk=True, an extra letter slot is reserved for IDK and the metric reports trad_score, idk_score (+1/0/-1), idk_freq, and extract_fail; otherwise it reports acc and extract_fail. Adds 18 tasks to TASKS_TABLE (2 OQ x 2 langs and 4 choice-counts x 2 langs x {plain, IDK}). Co-authored-by: Cursor <cursoragent@cursor.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add LEXam legal exam benchmark to Swiss legal evals
Problem
The Swiss legal evals module only covers translation and headnote-summarization tasks. There is no support for LEXam (ICLR 2026), a benchmark of 340 Swiss / EU / international law exams that ships both open-ended questions graded by legal experts and multiple-choice questions with 4, 8, 16, or 32 answer choices.
Solution
Adds LEXam to
lighteval.tasks.multilingual.tasks.swiss_legal:lexam_oq:{en,de}): LLM-as-judge scorer (JudgeLEXamOQ) that compares free-form legal answers against expert reference answers and extracts a[[0.0, 1.0]]correctness score. Defaults toopenai/gpt-4o-2024-11-20via LiteLLM and follows the20250324judging rubric from the upstream LEXam repo.lexam_mcq_{4,8,16,32}{,_idk}:{en,de}): letter-based extractive scorer (LEXamMCQExtractive) usingIndicesExtractionConfig("NativeLetters")with a small fallback regex for the###X###/\boxed{X}/Final answer: Xconventions used in the prompt template. Choices are shuffled deterministically (seed 42).with_idk=True, an extra letter is appended asI don't knowand the prompt rewards calibration via +1/0/-1 scoring. The metric then reportstrad_score,idk_score,idk_freq, andextract_fail; withwith_idk=Falseit reportsaccandextract_fail.This produces 18 new tasks in
TASKS_TABLE: 2 OQ × 2 langs and 4 choice-counts × 2 langs × {plain, IDK}.Prompts are adapted from:
Testing
TASKS_TABLE(total grows from 93 to 111).LEXam-Benchmark/LEXamconfirmed: language filter yields 619 / 1655 EN MCQs and 2105 / 2541 DE open questions; the stringifiedchoicesfield is parsed viaast.literal_eval.LEXamMCQExtractivereturns the expected values on###X###,\boxed{X}, wrong answers, IDK selections, and unparseable outputs (both modes).ruff checkandruff format --checkpass on all changed files.