Skip to content

Add LooGLE long-context generation tasks#3929

Open
zbl1998-sdjn wants to merge 1 commit into
EleutherAI:mainfrom
zbl1998-sdjn:feat/loogle-tasks
Open

Add LooGLE long-context generation tasks#3929
zbl1998-sdjn wants to merge 1 commit into
EleutherAI:mainfrom
zbl1998-sdjn:feat/loogle-tasks

Conversation

@zbl1998-sdjn

Copy link
Copy Markdown

What

Adds the three free-text generation sub-tasks of LooGLE (ACL 2024) as new tasks under a loogle tag:

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_cloze sub-task (entity fill-in, scored by exact/partial entity match) is left for a follow-up.

Notes for reviewers

  • Data / licensing. Loads from the Hugging Face hub (bigai-nlco/LooGLE), which is MIT-licensed and stored as JSONL (no loading script), so it works with datasets >= 4 directly.
  • Metric. ROUGE-1/2/L (F-measure) is re-implemented in utils.py using 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 and max_gen_toks are reproduced from the benchmark's config/task2prompt.json / config/task2maxlen.json.
  • Tag, not a group. The three tasks share a loogle tag rather than a group (a group config trips the new_tasks CI's duplicate check when a group and its members are all new in one PR).

Verification

  • pytest tests/test_tasks.py42 passed for the three new tasks (download, doc_to_text, build_all_requests, construct_requests, …).
  • ruff check / ruff format clean.
  • ROUGE spot-checked against the real data (identical → 1.0, disjoint → 0.0, partial in between).

Task Validity Checklist

  • Is the task an existing benchmark in the literature?
    • Have you referenced the original paper that introduced the task?
    • If yes, does the original paper provide a reference implementation? If so, have you checked against the reference implementation and documented how to run such a test?
  • New subfolder lm_eval/tasks/loogle with a README describing each sub-task and the metric.

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.
Copilot AI review requested due to automatic review settings July 12, 2026 22:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 shared loogle tag.
  • 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:"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants