Score EgoLongQA by option text when the reply isn't a letter, instead of guessing
The story
EgoLongQA scoring compares a predicted letter against the gold letter, and the prompt asks
for exactly that: "Answer with ONLY the single letter of the correct option (A, B, C, or
D). Do not include any other text."
Models don't always comply, and run_generate_longqa.py writes the raw generation straight
through β pred["mcq_answer"] = response β so the file holds whatever the model actually
said. normalize_answer() bridges the gap with a fall-through ladder: each rung returns on
a match, so a rung only runs when everything above it missed.
The top five rungs recover a letter that is genuinely present. The bottom two don't β they
manufacture one. And the most common way a model ignores the instruction is to reply with
the option's wording, which in this benchmark almost always begins with the article
"a". So the ladder reads it as choice A:
| gold | model reply | scored as |
|---|---|---|
| C | A concrete bench on the left side of the path. |
A |
| B | A fenced playground with swings. |
A |
| C | A gray cup |
A |
Those are real rows from the annotations shipped in this repo. Across all 700, a submission
answering every question with the correct option's text scores 3.3% β and one
answering with a wrong option's text scores 3.9%. Being right and being wrong are
indistinguishable, so the manufactured letter isn't a lucky guess, it's noise.
The last rung guesses from the first character, with the same result: Definitely β D,Cooking eggs β C, Bread β B.
The fix is to read the option text β which is exact β and, when nothing identifies a
choice, score it incorrect rather than invent one.
The ladder, before and after
| # | rung | before | after |
|---|---|---|---|
| 1 | exact single letter β A, d |
β | unchanged |
| 2 | A. A: A) |
β | unchanged |
| 3 | (A) |
β | unchanged |
| 4 | Option A, Answer: B |
β | unchanged |
| 5 | ... is A. ... answer: B (end-anchored) |
β | unchanged |
| β | match the reply against mcq_options |
β | new |
| 6 | any standalone A-D β rescues **B**, "C", - A, I think D |
β | unchanged |
| 7 | first character if A-D β Definitely β D |
β | removed, returns "" |
Why the new rung goes at 5Β½ and not in place of 7. Rung 7 only runs when rung 6 found
nothing β but on option text rung 6 does find something, the leading article. It swallows
28.1% of correct-option-text replies before rung 7 ever sees them. Replacing rung 7 alone
recovers about 72%; inserting above rung 6 recovers all of it.
Why inserting there doesn't steal rung 6's work. match_option_text() returns ""
unless it finds a unique option match, and rung 6's cases never produce one β **B**
normalises to "b", I think D to "i think d", neither matches any option text, so both
fall through to rung 6 exactly as before.
match_option_text() lowercases and collapses non-alphanumerics on both sides, tries exact
equality, then unique containment, resolving ambiguity to the longest match β 6 questions
in the released annotations have one option text nested inside a longer sibling.normalize_answer() gains mcq_options as an optional second argument defaulting to "",
so any caller passing one argument behaves exactly as before.
Before / after
Fixed β replies quoting the option's wording:
| reply | before | after |
|---|---|---|
A concrete bench on the left side of the path. |
A |
C |
A fenced playground with swings. |
A |
B |
A gray cup |
A |
C |
the answer is a concrete bench... |
A |
C |
Fixed β prose that identifies nothing is no longer given a letter:
| reply | before | after |
|---|---|---|
Definitely |
D |
"" |
Cooking eggs |
C |
"" |
Bread |
B |
"" |
Unchanged β every letter format, including the decorated ones:
| reply | before | after |
|---|---|---|
C |
C |
C |
C. |
C |
C |
(C) |
C |
C |
Option C |
C |
C |
The answer is B. |
B |
B |
**B** |
B |
B |
"C" |
C |
C |
- A |
A |
A |
I think D |
D |
D |
Aggregate over all 700 released annotations, through evaluate_longqa():
| submission | before | after |
|---|---|---|
| answers with the correct option's text | 3.3% | 100.0% |
| answers with a wrong option's text | 3.9% | 0.0% |
Test plan
Existing suite β pytest tests/: 254 passed before, 266 passed after, with the same
20 pre-existing failures in both runs and no new ones. The 12 added tests are the difference.
Rung 6 is provably untouched. Old and new compared over 155,220 inputs β every string up
to length 3 over a 17-character alphabet of letters, spaces and punctuation (5,220) plus
150,000 generated strings β with no mcq_options supplied. 23,573 outputs differ, and
every one is a former first-character guess now returning "". Zero are cases where
rung 6 had fired.
Rungs 1-5 are untouched. 44 hand-written formats β bare letters in both cases, A. B:C) (D), Option A, Answer: C, Answer:\n\nB, The answer is A., **A** *B*__C__ 'D' "A", - B, 1. C, > D, `A`, A</s>, whitespace and newline padding,
and the unparseable ones β 0 changed.
Measured on shipped data, not invented strings. Every number above comes from the 700
released EgoLongQA annotations. All 700 rows carry mcq_options, all split into exactly 4
non-empty options, and the gold letter is present in the options on every row.
End-to-end through the CLI, not just the scoring function. Built a 700-rowpredictions.jsonl mixing ten reply formats (bare letter, A., (A), Option A,... is A., **A**, the option's text, unparseable prose, an "I am not sure" string, and
empty), shuffled so video_path pairing is exercised too, and ran:
python run_evaluation.py --task longqa --eval-only \
--golden <released annotations> --predictions preds.jsonl --output out.json
Exit 0 on both this branch and unmodified main, both writing out.json andout_summary.json. Comparing the two per-row outputs by reply format:
| reply format | n | before | after |
|---|---|---|---|
| bare letter | 70 | 22 | 22 |
A. |
70 | 16 | 16 |
(A) |
70 | 17 | 17 |
Option A |
70 | 10 | 10 |
... is A. |
70 | 16 | 16 |
**A** |
70 | 12 | 12 |
| empty / unparseable | 140 | 0 | 0 |
| option text, model picked correctly | 26 | 1 | 26 |
| option text, model picked wrongly | 44 | 2 | 0 |
| prose | 70 | accidental credit | 0 |
Every letter format scores identically. The only movements are the option-text rows being
resolved correctly and the accidental credit disappearing.
Added tests (TestMatchOptionText): option splitting; option text resolving to its
letter, including case-insensitive and the answer is ... variants; unmatched prose scoring
incorrect; longest-match winning when one option nests inside another; rung 6 still applying
when options are supplied; and mcq_options being optional.
One intentional test change
test_first_char_fallback asserted normalize_answer("Definitely") == "D" β that is rung 7,
which this change removes. It now asserts == "" and is renamedtest_prose_is_not_guessed_from_its_first_character. Flagging it here rather than leaving it
to be noticed in the diff.
Scope
Scores change only for submissions whose replies were previously being guessed at. Any
submission that answered with a letter, in any of the formats above, is unaffected.