Skip to content

spike(s3,s4): prompt v2, second-pass checks and a verbatim safeguarding pass - #39

Open
billlyzhaoyh wants to merge 5 commits into
mainfrom
spike/notes-v2
Open

billlyzhaoyh wants to merge 5 commits into
mainfrom
spike/notes-v2

Conversation

@billlyzhaoyh

Copy link
Copy Markdown
Collaborator

Follow-ups to spikes S3 (citations) and S4 (safeguarding). They test the fixes both write-ups recommended, and two further ideas taken from current industry practice. Write-ups: docs/spikes/s3-citations.md (follow-ups 1–3) and docs/spikes/s4-safeguarding.md (v2 re-run and the verbatim-pass follow-up).

Only Qwen3.5-4B was run, with one llama-server at a time on 6 threads at low priority on the Mac. All prompts and measures were fixed before any result, except where marked "found after the fact".

Results

1. Prompt v2. It adds the recording date to the prompt, a rule to keep how often, how hard, who saw it and when, and raises the limit to 60 facts. The same blind judges labelled the old and new notes in the same batches.

  • S3: sentences the transcript doesn't support fell from 15.5% to 10.5%. Date errors fell from 25 to 7. Fact recall rose from 0.61 to 0.84. About 1 sentence in 10 is still unsupported: the wrong speaker, the wrong referent, a garbled detail.
  • S4: worse. 8 of 79 disclosures were softened, against 4 for the statutory prompt judged again. Prompt rules don't reach zero. (The difference is within chance: p ≈ 0.37.)

2. S3: a second check by the note model. It labels each sentence against its cited lines.

  • Precision 0.49–0.68 and recall 0.35–0.54, below the 70% bar.
  • It takes 2.3–4.8 s per sentence, which adds about 8 minutes to a 60-minute note on the Mac.

3. S3: cheaper checks.

  • Speaker rule (a named person who didn't speak the cited lines): precise but rarely fires, with 13 of its 20 flags being real errors.
  • Number rule: useful only while the dates were wrong.
  • MiniCheck-Flan-T5-Large (0.8B): fast, but precision only 0.17–0.29.
  • Conclusion: the reviewer checks each sentence against its cited lines; there is no automatic warning.

4. S4: a verbatim safeguarding pass. The model picks each disclosure's lines and the app quotes them. Scoring is automatic, with 3 samples per vignette.

  • As planned: no better alone. 87% of quotes kept every key detail, against 89% for the note. Softening becomes omission of the next answer.
  • Found after the fact: quote each disclosure as a run of lines underneath the paraphrased note. Then 0 of 237 disclosure samples lose a detail. This needs confirming on new vignettes before it counts towards the S4 gate.

What's in this PR

  • spikes/s3-citations/:
    • prompt v2, --fact-cap and recording dates (recorded) in the data;
    • mixed calibration judging (--calibrate);
    • check.py (the second check) and fastcheck.py (the rules and MiniCheck);
    • the v2 notes, verdicts and check results.
  • spikes/s4-safeguarding/:
    • prompt v2, --fact-cap and recorded;
    • round v2 judging, where old and new notes are judged together;
    • extract.py (the verbatim pass) and its results.
  • Docs: both write-ups and the S3/S4 rows of next-phase-spikes.md.
  • Unchanged: the app and engine. The earlier results (S3 run s3, S4 round r1) reproduce byte-for-byte from the committed data.

Caveats

  • All labels come from blind Claude judges. Judging the same notes again gave 98% the same label, which shows consistency, not accuracy. Measured human agreement is the main gap: 2 reviewers, all 79 disclosures and about 150 sentences.
  • The vignettes and transcripts are synthetic. They are typed text, not speech, and a practitioner hasn't reviewed them.
  • Unit tests: none. These are spike harnesses, as in S3 and S4.

…s checker

- S3 and S4 harnesses: a v2 prompt (S4's statutory framing plus rule 7: keep how often, how hard,
  who saw it and when), the recording date in the map prompt, and a configurable fact cap.
  Rule 7's examples appear in no S3 or S4 transcript.
- Every transcript and vignette gets a 'recorded' date chosen to contradict nothing it says (the
  care assessment's weekdays only fit 2025); the data checkers require it.
- S3: run-tagged packet ids, dated packets for new runs, --calibrate to judge another run's notes
  blind alongside, repo-relative packet paths (unchanged packets are left as judged), resume.
- S4: judging rounds (r1 as judged; v2 judges statutory and v2 together), conditions from the data.
- S3 check.py: the note model labels each sentence against its cited lines (plus the line before),
  one grammar-forced word; scored from the first token's log-probabilities.
- The first-run outputs reproduce unchanged from the committed data.
S4: 24 v2 notes (Qwen3.5-4B); round v2 judged them blind with the first run's statutory notes
(4 judges x 12). Statutory 4 softened, v2 8 softened, 0 refusals/drops/violations either way.
S3: 6 v2 notes; judged blind with the first run's Qwen3.5-4B notes (qwen3.5-4b@s3, 6 judges).
Not supported 15.5% -> 10.5%, date/year errors 25 -> 7, mean fact recall 0.61 -> 0.84.

This branch has not been deployed

No deployments
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