Exact-match final answer
1.0 when the last line reads ANSWER: <value> and the value matches the key. Math, lookups, short QA.
How it gets gamed
Models learn to print many candidate answers. Only the final ANSWER: line counts, and a completion with more than one ANSWER: line scores 0. See reward hacking.
Use it
Compile a Verifiable-outcome loop, then replace its verify_environment with this one. Put "answer" in each JSONL row’s metadata.
Compile a loop for it: Formal Reasoning Engines · Inkling 2 Mini
exact_match_answer.pyverify_environment
def verify_environment(completion: str, metadata: dict | None = None) -> float: """1.0 if the single ANSWER: line matches metadata["answer"] (case/space/comma-insensitive).""" import re expected = str((metadata or {}).get("answer", "")).strip() if not expected: return 0.0 lines = re.findall(r"^\s*ANSWER:\s*(.+?)\s*$", completion, flags=re.M) if len(lines) != 1: return 0.0 def norm(value: str) -> str: return re.sub(r"[\s,]+", "", value).rstrip(".").lower() return 1.0 if norm(lines[0]) == norm(expected) else 0.0
Test cases (run on every build)
"80 mod 7 = 3\nANSWER: Friday" with {"answer":"friday"} → 1
"ANSWER: 1,024" with {"answer":"1024"} → 1
"ANSWER: Thursday\nANSWER: Friday" with {"answer":"Friday"} → 0
"It is Friday." with {"answer":"Friday"} → 0