Proactive truncation, Row ordering and judge parsing for DATA contributed to EgoConv, EgoLongQA and EgoProactive
Fix three scoring bugs in run_evaluation.py
Three bugs in the grader, all affecting the metric the leaderboard ranks on, all silent —
a submission hits them with no error, warning, or visible symptom. Found by running this
repo's own code against the released val annotations; every number below is measured,
not estimated.
| # | Bug | Task | Worst case, before → after |
|---|---|---|---|
| A | Chunks a submission didn't answer are discarded instead of scored | EgoProactive | A 2-chunk constant submission needing no model: macro_f1 0.6928 → 0.0996, gmean_f1 0.6874 → 0.0930. It scored double the best honest baseline (0.3501); now it scores worst. |
| B | Predictions paired to golden by row position, not video_path |
all three | A perfect submission with reordered rows: LongQA 0.4957 → 1.0000, ConvQA BLEU 0.0356 → 1.0000, Proactive 0.5360 → 1.0000 |
| C | Judge score parser mishandles common replies | EgoConv | Judge replies **1.0** on every turn: llm_judge 0.0000 → 1.0000. Parse accuracy over 29 realistic replies: 15/29 → 29/29 |
Changes: run_evaluation.py and two test files. The other 12 files in starter_kit/
are untouched.
Tests: 20 failed, 196 passed → 20 failed, 247 passed. The 20 failures are
pre-existing on main and unrelated — the failure set is byte-identical before and
after (verified by diffing test names, not counts). 51 new tests.
Details, evidence and rejected alternatives for each bug are below.
Bug A — EgoProactive discards unanswered chunks (click to expand)
What's wrong
_score_proactive_session only scored the chunks a submission actually answered:
n = min(len(gold_answers), len(pred_answers))
skipped = abs(len(gold_answers) - len(pred_answers))
for j in range(n):
...
Gold chunks with no matching prediction went into a skipped counter and never entered
the confusion matrix. Omitting a chunk wasn't merely unpenalised — it was strictly
better than answering it, since a wrong answer produces an fp/fn while a missing one
produces nothing.
The other two tasks already handle this correctly: compute_bleu_scores iterates over
gold and awards 0.0 to an unanswered turn, and the ConvQA judge loop does the same.
EgoProactive was the only outlier.
A concrete example
Session 94e4220d406c1cca.mp4 from the released val split — six chunks, alternating:
gold: interrupt silent interrupt silent interrupt silent
pred: interrupt silent — nothing submitted for chunks 2..5 —
| before | after | |
|---|---|---|
| chunks scored | 2 of 6 | 6 of 6 |
| confusion matrix | tp=1 fp=0 tn=1 fn=0 | tp=1 fp=2 tn=1 fn=2 |
macro_f1 |
1.0000 | 0.3333 |
Answering one third of the session earned a flawless score.
Leaderboard impact (700 sessions, 9,935 chunks)
| submission | before macro / gmean | after macro / gmean | chunks scored |
|---|---|---|---|
| perfect, full length | 1.0000 / 1.0000 | 1.0000 / 1.0000 | 9935 → 9935 |
honest always-$interrupt$ |
0.3501 / 0.0000 | 0.3501 / 0.0000 | 9935 → 9935 |
honest always-$silent$ |
0.3157 / 0.0000 | 0.3157 / 0.0000 | 9935 → 9935 |
constant ["$interrupt$x", "$silent$"] |
0.6928 / 0.6874 | 0.0996 / 0.0930 | 1400 → 9935 |
| perfect, truncated to 50% | 1.0000 / 1.0000 | 0.4913 / 0.4893 | 4920 → 9935 |
The constant two-element list needs no model, discards 86% of the data, and also clearedgmean_f1 — the metric whose purpose is to catch degenerate strategies.
Fix
Iterate over gold; a chunk the submission didn't answer is scored against its gold label —
the direct analogue of compute_bleu_scores awarding 0.0 to a missing turn. Prediction
chunks beyond gold length are ignored. This restores monotonicity: omitting a chunk can
never improve a score.
Rejected alternative: treating a missing chunk as silent (what parse_tag coerces
empty output to). Measured, it does not fix the bug — the constant submission still
scores 0.4471 vs the best honest baseline's 0.3501, because unanswered gold-silent
chunks hand out free true negatives. Only scoring them as errors is monotone.
Bug B — predictions paired by row position instead of video_path (click to expand)
What's wrong
Two defects combined to make scoring order-dependent.
1. The matcher was gated behind a length mismatch, so it never ran.
if len(golden) != len(preds):
golden, preds = _filter_subset(golden, preds, "LongQA")
A valid submission is exactly 700 rows and golden is exactly 700, so this is never true
for a real submission — scoring fell through to zip(golden, preds). The matcher only ran
for a partial submission, the one case the leaderboard rejects. EgoProactive never called_filter_subset at all; it checked the session count, and len() says nothing about
order — 700 shuffled sessions still count to 700.
2. When it did run, it keyed on a field submissions don't carry.
key_field = "task" if is_convqa else "question"
key = (g.get("video_path"), g.get(key_field))
question / task are golden metadata, not required prediction fields. A spec-compliant
row has neither, so its key was (video_path, None) and matched nothing.
Impact
A perfect submission — every answer copied from the answer key — varied only by row order:
| row order | LongQA acc | ConvQA BLEU | Proactive macro F1 |
|---|---|---|---|
| golden order | 1.0000 → 1.0000 | 1.0000 → 1.0000 | 1.0000 → 1.0000 |
| shuffled | 0.4957 → 1.0000 | 0.0356 → 1.0000 | 0.5360 → 1.0000 |
sorted by video_path |
0.4957 → 1.0000 | 0.0328 → 1.0000 | 1.0000 → 1.0000 |
EgoLongQA was completely silent — no warning, no log line, no exception. Sorting output
by video_path is a natural thing to do, and it's harmless on EgoProactive (whose golden
file is already sorted) while halving the score on the other two (whose aren't). Row order
isn't mentioned in the starter kit README or the dataset card, and upload validation
compares submitted IDs as a set, so any permutation passes cleanly.
A spec-compliant partial submission (defect 2) didn't mis-score — it died:ValueError: zero predictions matched golden entries on both LongQA and ConvQA. Both now
score 1.0000.
Fix
Pair on video_path alone, unconditionally, inside the scorers.
_filter_subsetkeys onvideo_path, dropping thequestion/taskhalf.evaluate_longqa,evaluate_convqaandscore_proactiveeach pair their own input
via_pair_to_golden, so the guarantee holds however the module is called._run_longqa/_run_convqastill pair at the file boundary, where a missingvideo_pathis a malformed submission and should raise with a clear message.score_proactivekeeps its session-count check. Right count but wrong IDs is a broken
submission, not a subset, so it raises.
Pairing belongs to the scorer, not the CLI wrapper. An earlier revision of this PR
put it only in the _run_* functions, which are reached solely throughrun_evaluation.py --eval-only. Any harness that imports the module and callsevaluate_convqa(golden, preds, ...) directly sat below the fix and still paired by row
position. That is the normal way a downstream scorer consumes this code, so the fix
missed the case that matters most. Measured on the released val set with a perfect
submission whose rows were shuffled:
| direct call | main |
1st commit 598adf1 |
2nd commit a0bf90f |
|---|---|---|---|
evaluate_longqa |
0.5029 | 0.5029 | 1.0000 |
evaluate_convqa (BLEU) |
0.0352 | 0.0352 | 1.0000 |
score_proactive |
0.5506 | 1.0000 | 1.0000 |
Predictions carrying no video_path at all are still paired positionally — there is no
id to pair on, and that shape means a hand-built fixture or input the caller already
paired. A mixed batch warns, since rows without an id get dropped.
One deliberate semantic change: a short batch that does carry video_path is now
treated as a subset and scored, rather than raising a length error. That matches what
the CLI has always done for subset submissions. A short batch without ids still
raises.
Safe because video_path is a unique row identifier — verified, not assumed: 700/700
distinct, 0 missing, 0 duplicates in each of the three released val files._filter_subset now also raises if golden itself has a duplicate or missingvideo_path, since the shadowed rows would otherwise drop silently out of the denominator
and every submission would be scored over fewer rows than it answered.
There is deliberately no positional fallback for prediction files withoutvideo_path — such a file is rejected at upload anyway, so scoring it locally by position
would report a number the leaderboard can never reproduce.
Bug C — LLM-judge score parser mishandles common replies (click to expand)
What's wrong
text = text.strip().strip(".")
for token in text.split():
token = token.strip(".,;:")
val = float(token)
if val >= 0.75: return 1.0
elif val >= 0.25: return 0.5
else: return 0.0
- No upper bound — any number ≥ 0.75 anywhere returned 1.0, including a
5from
"Rating: 5 out of 5". - Takes the first numeric token, not the score — a digit in a preamble beats the
verdict after it. strip(".")runs on the whole string, removing a leading decimal point, so.5
became5and scored 1.0 instead of 0.5.
The prompt guardrails ("Reply with ONLY a single number", trailing Score:,max_tokens=10, temperature=0.0) make failure uncommon but can't prevent it, because the
common failure modes don't violate the instruction: **1.0** is only a single number.
max_tokens=10 also works against the parser — if the judge preambles, the cap truncates
before the score is emitted and defect 2 latches onto the preamble:
judge intends : "The answer mentions 3 correct facts. Score: 0.0"
truncated to : "The answer mentions 3 correct facts. Score:"
parsed as : 1.0 ← the "3" is used; the real score never arrived
Measured: 15/29 realistic replies parsed correctly → 29/29
| judge reply | should be | before | after |
|---|---|---|---|
**1.0** |
1.0 | 0.0 | 1.0 |
Score: **0.5** |
0.5 | 0.0 | 0.5 |
`1.0` |
1.0 | 0.0 | 1.0 |
[1.0] |
1.0 | 0.0 | 1.0 |
1.0/1.0 |
1.0 | 0.0 | 1.0 |
1,0 |
1.0 | 0.0 | 1.0 |
.5 |
0.5 | 1.0 | 0.5 |
The answer mentions 3 correct facts. Score: 0.0 |
0.0 | 1.0 | 0.0 |
…plus **0.5**, **0.0**, **Score: 1.0**, '0.5', "1.0", (0.5), 0.5/1.0 — same
shape. The errors run in two directions: markdown, quoting and bracketing (9 of 14)
systematically penalise the submitter — **1.0** means the judge said perfect and the
grader recorded wrong. A stray number ≥ 0.75 does the reverse.
Why this is severe rather than cosmetic
The failure is per-judge-style, not per-turn. At temperature=0.0 a model formats
consistently — if it bolds, it bolds all 4,415 turns:
| judge answers every turn with | llm_judge before |
after |
|---|---|---|
1.0 (plain) |
1.0000 | 1.0000 |
**1.0** |
0.0000 | 1.0000 |
`1.0` |
0.0000 | 1.0000 |
**0.5** |
0.0000 | 0.5000 |
A submission the judge rated perfect scores 0.0000 on the ranked metric and looks
exactly like a weak model.
Fix
_parse_judge_score keeps its float signature and gains a sibling,_parse_judge_score_detailed(text) -> tuple[float, bool], where the bool reports whether a
score was found. Parsing now prefers a labelled Score: value over preamble numbers,
rejects values outside 0–1, doesn't strip a leading decimal point, and tolerates markdown,
quotes, brackets, fractions and a decimal comma. The existing threshold mapping is
unchanged, so genuine verdicts score exactly as before.
Silent failures are now visible. The parser previously couldn't tell "the judge said
0.0" from "the parser gave up" — both returned a bare 0.0. Replies like Rating: 5 out of 5, correct, or an empty string are now flagged, each logged, with a run-level summary:
WARNING: 4415/4415 judge turns had no usable score (scored 0.0)
_VllmJudgeServer.score_turn returns (score, scored) so a failed request or unexpected
response shape counts the same way.
Testing (click to expand)
$ pip install -r requirements-dev.txt
$ pytest tests/
before this PR: 20 failed, 196 passed
after this PR: 20 failed, 254 passed
The 20 failures are pre-existing on main and unrelated to this PR — the failure set is
byte-identical before and after. For reference they are: 12 from a mock signature bug intests/test_run_generate_proactive.py (setup_gpus mocked as lambda **kwargs but called
with two positional args), 2 from TestE2ECLI invoking the CLI without --eval-only (so it
tries to generate and needs 8 GPUs), and 6 from torch not installed in this environment.
Happy to fix those in a follow-up — it's a one-word change plus two flags.
The 58 new tests cover:
- Bug A — unanswered gold chunks scored as errors with an exact confusion matrix; extra
prediction chunks ignored; truncating a perfect submission strictly lowers the score; a
short constant submission can't outscore an honest full-length baseline. - Bug B — pairing by
video_pathnot position; absentquestion/taskignored;
unknown and duplicate IDs dropped; duplicate or missing golden IDs raise; full-length
reordered submissions score 1.0 on all three tasks; a reordered submission with one wrong
answer attributes it to the rightvideo_path. - Bug B, direct calls — a dedicated
TestPairingHoldsOnDirectCallsclass asserts the
invariant forevaluate_longqa,evaluate_convqaandscore_proactiveinvoked
directly rather than through the CLI, since that is the interface a downstream scorer
uses. Also covers id-less input still pairing positionally, and a mixed batch warning. - Bug C — 19 realistic reply formats; 6 unparseable replies flagged; out-of-range
numbers rejected;_parse_judge_scorestill returns a plainfloat.
Two existing tests were updated because they encoded the old behaviour:test_length_mismatch_skips_extra_chunks asserted a truncated submission still scoresmacro_f1 == 1.0, and the longqa_preds_perfect / convqa_preds_perfect fixtures carried
no video_path, so they could only be scored positionally — which the real submission
format forbids.
Reproducing: import the functions from run_evaluation.py on main and on this branch,
run both against the released val JSONLs — build a perfect submission from the answer key,
then vary row order, completeness, or judge reply format and re-score.
Thanks for this — I re-scored all 134 live validation submissions against both main and this PR. Three change, all LongQA, all currently under-scored; ConvQA and EgoProactive are unaffected. No team's standing moves. So the fixes look correct and low-risk to merge.
One integration gap worth closing before this lands, on Bug B specifically.
_filter_subset is reached from _run_longqa, _run_convqa and _run_proactive, which are only entered through the run_evaluation.py --eval-only CLI. Any caller that imports the module and invokes evaluate_convqa(golden, preds, ...) directly sits below the pairing fix and still pairs by row position.
That isn't hypothetical: our scoring path does exactly that for ConvQA, so as written this PR fixes row-order pairing for LongQA and EgoProactive but not for ConvQA in practice.
Two ways to close it, your call:
- Move the
video_pathpairing down intoevaluate_convqa(and the otherevaluate_*/score_*entry points), so it holds regardless of how the module is called. Slightly more invasive, but the invariant then can't be bypassed. - Leave
_filter_subsetwhere it is and document that theevaluate_*functions expect pre-paired input. Cheaper, but it makes correctness a property of the caller.
I'd lean to (1), since "predictions are paired to golden by video_path" reads like a property of the scorer rather than of the CLI wrapper.
Worth knowing how I hit this: my first re-scoring harness called evaluate_longqa directly and reported zero difference between the two versions. A shuffled-rows control scored 0.37 under both, which is what exposed the wrong layer. Through the CLI the same input gives 0.37 on main and 0.7171 on this branch. Might be worth a test that asserts the pairing holds when the evaluate_* functions are called directly, since that's the interface a downstream scorer is most likely to use.
Update since review
Second commit [a0bf90f] closes @htranx 's point on Bug B: _filter_subset was only
reached through the _run_* CLI wrappers, so any caller importing the module and usingevaluate_convqa(...) / evaluate_longqa(...) directly sat below the fix and still
paired by row position. Pairing now happens inside the scorers via a shared_pair_to_golden helper (his option 1).
Perfect submission, rows shuffled, scorers called directly rather than through the CLI:
| direct call | main |
1st commit 598adf1 |
2nd commit a0bf90f |
|---|---|---|---|
evaluate_longqa |
0.5029 | 0.5029 | 1.0000 |
evaluate_convqa (BLEU) |
0.0352 | 0.0352 | 1.0000 |
score_proactive |
0.5506 | 1.0000 | 1.0000 |
All 3 tasks are now fixed from both CLI and direct import.
Tests went 247 → 254 with a new TestPairingHoldsOnDirectCalls class asserting the
invariant at the interface a downstream scorer actually uses.