File size: 1,164 Bytes
5c6c7a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Render the recorded Bool-Bench `bench` user-message template.

No model calls, credentials, or model-specific chat formatting are included.
"""

BENCH_INSTRUCTIONS = {'question': 'Read the passage. Answer the question using only the passage: true (yes), false (no), or unknown if the passage does not contain enough information to decide. Do not use outside knowledge, even if you know the answer.', 'statement': 'Read the passage. Using only the passage, is the statement true, false, or unknown (the passage neither supports nor contradicts it)? Do not use outside knowledge.'}

CLAIM_HEADING = {'question': '## Question:', 'statement': '## Statement:'}

ANSWER_FORMAT = 'Answer with exactly one word - true, false, or unknown.'

def format_prompt(row):
    """Preserve the complete passage and claim, including supplied ShARC context."""
    form = row["form"]
    if form not in BENCH_INSTRUCTIONS:
        raise ValueError("form must be 'question' or 'statement'")
    return (
        f"{BENCH_INSTRUCTIONS[form]}\n\n"
        f"## Passage:\n{row['passage']}\n\n"
        f"{CLAIM_HEADING[form]}\n{row['question']}\n\n"
        f"{ANSWER_FORMAT}\n"
    )