Skip to content

Commit bceb4fe

Browse files
Alex-Hunterzclaude
andcommitted
fix: QA prompt + judge fixes for locomo score improvement
- instr 3: exhaustive list enumeration, honour full question scope - instr 4: preserve relative date phrasing + add absolute in parens - instr 5: milestone event priority for significant-event questions - instr 9: strict person attribution — verify name before using fact - instr 10 (new): match answer length to question scope - judge: relative=absolute date equivalence rule + arithmetic check - judge: add missing abstention phrase variants (any/no information) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bc9ae37 commit bceb4fe

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

benchmarks/locomo/locomo_judge.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@
2929
ABSTENTION_PHRASES = (
3030
"i don't have that information",
3131
"i do not have that information",
32+
"i don't have any information",
33+
"i do not have any information",
3234
"i don't have enough information",
3335
"i do not have enough information",
3436
"i cannot answer",
3537
"i can't answer",
3638
"cannot answer this",
3739
"not enough information",
40+
"no information in the provided context",
3841
"information not available",
3942
"i don't know",
4043
"i do not know",
@@ -69,6 +72,10 @@
6972
- For date answers, accept equivalent formats. These are always CORRECT:
7073
"2023-10-21" = "21 October 2023" = "October 21, 2023"
7174
"2022-11-10" = "10 November 2022" = "November 10, 2022"
75+
- Absolute dates that equal a relative expression are CORRECT. Verify the arithmetic before marking wrong:
76+
"July 14, 2023" = "The Friday before 15 July 2023" (July 14 is a Friday)
77+
"11 August 2023" = "The Friday before 14 August 2023" (August 11 is a Friday)
78+
A model that gives the computed absolute date when the expected uses relative phrasing is CORRECT, not wrong.
7279
- Extra correct details do not make an answer wrong.
7380
7481
JSON schema:

vektori/qa/generator.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,24 @@ async def generate(self, prompt: str, max_tokens: int | None = None) -> str:
2626
INSTRUCTIONS:
2727
1. Use only the provided context. Logical inference and reasoning from context facts is expected and correct — this is NOT guessing. Do not introduce facts that have no support in any context item.
2828
2. First, silently find every fact, episode, synthesis, or transcript line that directly relates to the question. Do not print this evidence list.
29-
3. For counting, frequency, list, "all", "total", or aggregation questions:
30-
- Consider every relevant item across all sessions, not just the first match.
31-
- Deduplicate only if the context clearly describes the same item more than once.
32-
- Return the complete set or total. A compact calculation is allowed when it helps.
29+
3. For counting, frequency, list, "all", "total", aggregation, or "both X and Y" questions:
30+
- Do not stop after the first match. Search every session, fact, episode, and synthesis before composing the answer.
31+
- Honour the full scope of the question: "family and friends" means both; "events" means all events, not just the most prominent one.
32+
- If you find N items, verify there are no more before finalising. Return the complete set as a concise list.
33+
- Deduplicate only when the context clearly describes the same event more than once.
3334
4. For date, time, order, recency, or "when" questions:
34-
- Use exact absolute dates from the context whenever available.
35-
- Do not answer with relative time words like "yesterday", "today", "last week", or "recently" when an absolute date is available.
35+
- If the context uses a relative expression to describe when something happened (e.g. "last Friday", "the week before 27 June", "two weekends before"), preserve that relative phrasing and also include the computed absolute date in parentheses: e.g. "the week before 27 June 2023 (approx. 19–25 June 2023)".
36+
- For direct date facts stated as absolute dates, use the absolute date.
3637
- If the context includes a temporal note, use it to resolve relative wording.
3738
5. For changed or updated information:
3839
- Prefer the most recent value when later context overrides earlier context.
3940
- Mention older values only if the question asks for history or change over time.
41+
- When the question asks for "the significant event", "what happened during [period]", or uses a superlative: enumerate all events in that window, then return the most notable one. Milestone events (relationships, major decisions, achievements) take priority over routine events (appointments, errands) unless the question implies otherwise.
4042
6. Copy critical names, dates, places, titles, quantities, and field names exactly from the context. Do not blur them into a generic paraphrase.
4143
7. If the context contains any relevant evidence, commit to the most supported answer — even if it requires reasoning. Reserve "I don't have that information" strictly for when the context has zero relevant facts about the subject. Committing to a reasoned answer is preferred over abstaining.
4244
8. For answers expressed as "N days/weeks/months before/after DATE": use the temporal note in the context to compute the actual calendar date and give it as an absolute date (e.g. "18 May 2023"). Do not echo the anchor date as the answer.
43-
9. If the context contains facts about multiple named people, only use facts about the person the question asks about. Facts labeled "User" or "Assistant" refer to the primary conversation participant — if other facts establish that person's name (e.g. "User's name is Caroline"), treat "User" facts as belonging to that person.
45+
9. If the context contains facts about multiple named people, only use facts where the subject explicitly matches the person the question asks about. Before giving your answer, verify: does the fact literally name the person the question is asking about? If a fact says "James did X" and the question asks what John did — that fact is not usable as an answer about John. Do not infer attribution. Facts labeled "User" or "Assistant" refer to the primary conversation participant — if other facts establish that person's name (e.g. "User's name is Caroline"), treat "User" facts as belonging to that person.
46+
10. Match answer length to question scope. If the question asks for one item, name, date, or fact — give only that. Do not add explanatory sentences, history, or extra context unless the question explicitly asks for reasoning or detail. Extra correct sentences create noise that can obscure the core answer.
4447
4548
ANSWER:
4649
"""

0 commit comments

Comments
 (0)