Skip to content

spike(s3): citations and faithfulness — cites valid, contradictions ~1 in 7, no cheap flag works - #33

Merged
billlyzhaoyh merged 8 commits into
mainfrom
spike/s3-citations
Nov 25, 2026
Merged

billlyzhaoyh merged 8 commits into
mainfrom
spike/s3-citations

Conversation

@billlyzhaoyh

Copy link
Copy Markdown
Collaborator

Spike S3 from docs/spikes/next-phase-spikes.md: can a small local model cite transcript time spans for every note sentence, and how often does it state things that were never said? Write-up: docs/spikes/s3-citations.md.

Verdict: no-go as specified, with a clear way forward

Pass criterion Result
≥ 95% of sentences carry a valid citation Borderline. 100% cite real lines (1 bad cite in 1,415). The cited lines alone fully support 67–72% of sentences, and fully or partly support 94–97%.
Zero fabrications or contradictions go unflagged Fail, unless every sentence is flagged.
Flag precision ≥ 70% Fail. 0.22 at best, for both lexical overlap and NLI.

What the errors are:

  • Fabrication is rare: 2 of 1,099 sentences.
  • Contradiction is common: about 1 sentence in 7 (114 contradictions, 40 over-inferences). The main kinds:
    • Dates and years, about a third. The transcripts never state the year, so both models fill in 2023 or 2024.
    • Misread figures: "twenty-seven [thousand]" became "£27 per hour".
    • Wrong speaker.
    • Dropped hedges.
  • The traps we wrote were mostly avoided: 4 of 232 were hit.

Recommendations:

  1. Put the recording date and the participants in the prompt.
  2. Make every sentence one click from its cited lines, shown with the line before them, instead of an automatic "unsupported" flag.
  3. If an automatic check is wanted, spike a second-pass LLM check.

Neither finalist is clearly better here; S4 decides.

What's in this PR

spikes/s3-citations/, a harness built on S2's:

  • timestamped line rendering, and cites mapped to {start, end} spans;
  • 4 new trap-dense synthetic transcripts;
  • sentence-level blind judge packets and instructions;
  • flag.py, the lexical and NLI flag evaluation.

Results for both finalists × 6 transcripts:

  • raw map output, notes and span notes;
  • 16 packets, 16 verdicts and the model key;
  • NLI scores.

Docs: docs/spikes/s3-citations.md, plus the S3 row in next-phase-spikes.md.

Caveats

  • Judging was blind Claude judges, as in S2. A light human spot-check (3 sentences, all agreed) found the labels broadly sound. That is not a measured agreement rate.
  • S2's 30-facts-per-call schema limit was hit by 29 of 40 map calls. That costs recall, so it should be raised before re-measuring.
  • Mac only; quality only. The machine was heavily loaded, so no timings were taken.

…vel packets and flag eval

Copied from spikes/s2-llm-notes and adapted: time-stamped transcript lines, span-shaped
note output, map cap 3072, sentence-level blind packets, lexical + NLI flag evaluation.
Four new fictional transcripts (test set) with >=3 traps of every kind and omission facts;
S2's two transcripts kept as the tuning set.
…es, blind sentence packets

Sectioned notes (map cap 3072, 8 threads, CPU only, seed 42, temp 0.2) for qwen3-4b and
qwen3.5-4b on the 2 tuning + 4 test transcripts: raw JSONL with every map call's output,
notes and span-shaped notes, per-sentence lexical support and cite checks, NLI
(cross-encoder/nli-deberta-v3-small) scores, and 16 blind judge packets with _key.json.
- Read and write every harness file as UTF-8 (Windows Python otherwise uses the locale's code page,
  turning £ into £ before it reaches the model).
- os.getloadavg() does not exist on Windows; log the load inside the try so the server is always stopped.
- Refuse to start when the port is already taken, and check the launched llama-server is still alive once
  /health answers, so output from another server is never recorded under this model's name.
Codex review of PR #33.
- collect and flag.py eval stop if a verdict misses a sentence or fact, uses an unknown label, cites_support
  value or trap id, or belongs to a sentence whose text or cites changed since its packet was written
  (_key.json now fingerprints each sentence). Re-running packets moves the verdict of a changed packet
  aside to <id>.verdict.stale.json. The committed verdicts pass all of this unchanged.
- Fact recall is computed over the transcript's checklist, not over whatever ids the judge returned.
- A sentence may hit several traps: the verdict's trap field takes a list (single ids still accepted).
- out_of_part_cites is null, not 0, when a note can't be matched to its map calls; only a note's latest
  attempt in the run JSONL is used.
- flag.py eval: citation validity and the lexical flag use every judged sentence; NLI and combined flags
  need full NLI coverage (NLI rows now carry the sentence fingerprint). Thresholds are chosen on exact
  metrics, not ones rounded to 3 places.
- Lexical support is 0 with no valid cite even when the sentence has no content words; the median is the
  true median.
- stamp_data --check checks every line's own interval and applies the test-set rules from run.TEST.

Regenerated outputs: two lexical medians move in the third decimal (housing 0.385 -> 0.38, planning
0.545 -> 0.542 for Qwen3-4B); the verdicts file now has traps lists. Labels, fact recall and the chosen
flag thresholds are unchanged.
…example

Codex review of PR #33.
- 1 in 7 sentences is unsupported; 1 in 10 contradicts the transcript (114 of 1,099), not 1 in 7.
- The plan's citation criterion is that the span exists and supports the sentence. Lines exist for 100%,
  but cited lines fully support only 67% (test) / 72% (tuning): Fail, not Borderline.
- The 2024 year error accounts for 17 of the 28 contradictions in Qwen3.5-4B's legal-interview note
  (no note had 19).
- The transcripts do mention the year in passing; the recording date is what's never given.
- Confounds: 2 of 1,099 note items hold two sentences; judges could record one trap per sentence.
@billlyzhaoyh
billlyzhaoyh merged commit f3c2a56 into main Nov 25, 2026
@billlyzhaoyh
billlyzhaoyh deleted the spike/s3-citations branch November 26, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant