Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added support for PyTorch v2.2.
- Added ability to show logs from all ranks
- Added option for QKV clipping.
- Added basic_arithmetic downstream evaluation task

### Changed

Expand Down
22 changes: 22 additions & 0 deletions olmo/eval/downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,27 @@ def __init__(self, tokenizer, dataset_path="ai2_arc", dataset_name="ARC-Challeng
)


class BasicArithmetic(ArcEasy):
"""This is a basic arithmetic task follows the same prompt format as ArcEasy.
Example:
{"id": "q85_1d1d_max1d_plus",
"question": "Calculate 2 + 5 =",
"choices": {"text": ["8", "7", "6", "17"],
"label": ["A", "B", "C", "D"]},
"answerKey": "B", "type_tag": "easy"}

"""

metric_type = "acc"

def __init__(self, tokenizer, dataset_path="allenai/basic_arithmetic", dataset_name=None):
super().__init__(
tokenizer=tokenizer,
dataset_path=dataset_path,
dataset_name=dataset_name,
)


class COPA(ICLMultiChoiceTaskDataset):
"""Prompt: "PREMISE.strip()[:-1] because/therefore"
Req_loglikelihood('The pair of students came under scrutiny by the teacher because', ' the students both received excellent grades.'
Expand Down Expand Up @@ -1155,6 +1176,7 @@ def doc_to_domain_conditional(self, doc):
"sciq": SciQ,
"arc_easy": ArcEasy,
"arc_challenge": ArcChallenge,
"basic_arithmetic": BasicArithmetic,
"copa": COPA,
"rte": RTE,
"commitment_bank": CommitmentBank,
Expand Down