Add LooGLE long-context generation tasks#3929
Open
zbl1998-sdjn wants to merge 1 commit into
Open
Conversation
Add the three free-text generation sub-tasks of LooGLE (shortdep_qa, longdep_qa, summarization) under a `loogle` tag, scored with ROUGE and needing no judge model, mirroring how LongBench is integrated. Data loads from the MIT-licensed bigai-nlco/LooGLE dataset; prompts are reproduced from the benchmark and ROUGE is re-implemented with the standard library so no extra dependency is required. The cloze sub-task (entity fill-in) is left for a follow-up.
There was a problem hiding this comment.
Pull request overview
Adds support for the three free-text generation LooGLE (ACL 2024) subtasks to the evaluation harness, exposing them as individual tasks and collectively via the loogle tag. The integration includes YAML task configs and a dependency-free ROUGE implementation used for scoring.
Changes:
- Added three new LooGLE task configs (
shortdep_qa,longdep_qa,summarization) under a sharedloogletag. - Implemented a standard-library ROUGE-1/2/L scorer used by all three tasks.
- Added task-specific documentation in
lm_eval/tasks/loogle/README.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lm_eval/tasks/loogle/utils.py | Adds ROUGE scoring utilities and process_results for LooGLE generation tasks. |
| lm_eval/tasks/loogle/README.md | Documents the benchmark, tasks, and metric implementation choices. |
| lm_eval/tasks/loogle/loogle_shortdep_qa.yaml | Defines the Short-dependency QA generation task config and metrics. |
| lm_eval/tasks/loogle/loogle_longdep_qa.yaml | Defines the Long-dependency QA generation task config and metrics. |
| lm_eval/tasks/loogle/loogle_summarization.yaml | Defines the summarization generation task config and metrics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+19
to
+28
| import string | ||
| from collections import Counter | ||
|
|
||
|
|
||
| _PUNCT = str.maketrans("", "", string.punctuation) | ||
|
|
||
|
|
||
| def _tokens(text: str) -> list[str]: | ||
| """Lowercase, drop punctuation, split on whitespace.""" | ||
| return text.lower().translate(_PUNCT).split() |
| return _f_measure(lcs, len(pred), len(gold)) | ||
|
|
||
|
|
||
| def process_results(doc: dict, results: list[str]) -> dict: |
| dataset_name: summarization | ||
| test_split: test | ||
| output_type: generate_until | ||
| doc_to_text: "Please generate a summary of the below paper. \n{{context}}\n Summarization:" |
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.
What
Adds the three free-text generation sub-tasks of LooGLE (ACL 2024) as new tasks under a
loogletag:loogle_shortdep_qa,loogle_longdep_qa,loogle_summarization— run them all with--tasks loogle.They are scored with ROUGE and need no judge model, mirroring how LongBench is integrated. The
shortdep_clozesub-task (entity fill-in, scored by exact/partial entity match) is left for a follow-up.Notes for reviewers
bigai-nlco/LooGLE), which is MIT-licensed and stored as JSONL (no loading script), so it works withdatasets >= 4directly.utils.pyusing only the standard library (LCS for ROUGE-L, n-gram overlap for ROUGE-1/2), so the task needs no extra dependency. The LooGLE paper additionally reports the recall variant alongside BLEU / METEOR / BERTScore and a GPT-4 judge; only the dependency-free n-gram metric is included here. Prompts andmax_gen_toksare reproduced from the benchmark'sconfig/task2prompt.json/config/task2maxlen.json.loogletag rather than a group (a group config trips thenew_tasksCI's duplicate check when a group and its members are all new in one PR).Verification
pytest tests/test_tasks.py— 42 passed for the three new tasks (download, doc_to_text, build_all_requests, construct_requests, …).ruff check/ruff formatclean.Task Validity Checklist
lm_eval/tasks/looglewith a README describing each sub-task and the metric.