Time every modality and ask which memory came back first
One stride over file order, truncated to the probe count, dropped the tail of the suite: a 300-probe sample held 128 code, 86 pdf, 36 screenshot, 26 image and 24 video queries and no conversation query at all, so every report built from it measured five of six modalities. The budget is now split by suite weight with a floor of one probe per modality, and a test pins that the frozen sample covers all six. The set's question type rides along on each query, and a second metric asks the question recall@10 cannot: when the answer lives in several dated memories, did the newest come back first? A knowledge-update question scores 1.000 on recall while the ranking still leads with the value the speaker has since replaced, and that is the failure the next task is meant to fix.
This commit is contained in:
1 parent
246dae949c
commit
a6a1ef05f0
6 files changed
+265
-15
No files matched your search
+18
-1
@@ -8,7 +8,7 @@ behaviour instead of recall, and never mixed into the recall denominator.
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
from collections.abc import Sequence
|
||||
from collections.abc import Mapping, Sequence
|
||||
from dataclasses import dataclass
|
||||
|
||||
Z_TWO_SIDED_95 = 1.959963984540054
|
||||
@@ -89,6 +89,23 @@ def chance_recall_at_k(gold: int, corpus_size: int, k: int) -> float:
|
||||
return min(1.0, k / corpus_size)
|
||||
|
||||
|
||||
def newest_gold_first(ranked: Sequence[str], gold: set[str], times: Mapping[str, str]) -> bool | None:
|
||||
"""For a question answered by several memories, did the newest one come back first?
|
||||
|
||||
recall@10 counts any gold memory, which hides a knowledge-update failure: the older value is
|
||||
still a memory, it is just no longer the answer. None when the question has fewer than two
|
||||
dated gold memories or the ranking returned none of them.
|
||||
"""
|
||||
dated = [source for source in gold if source in times]
|
||||
if len(dated) < 2:
|
||||
return None
|
||||
newest = max(dated, key=lambda source: times[source])
|
||||
found = [source for source in ranked if source in gold]
|
||||
if not found:
|
||||
return None
|
||||
return found[0] == newest
|
||||
|
||||
|
||||
def score_query(
|
||||
query_id: str,
|
||||
ranked: Sequence[str],
|
||||
|
||||
Reference in new issue
Block a user