Skip to content

Add pasientsporsmal pack: 579 Norwegian patient-posed health questions - #164

Merged
SushantGautam merged 3 commits into
devfrom
feat/pasientsporsmal
Nov 19, 2026
Merged

SushantGautam merged 3 commits into
devfrom
feat/pasientsporsmal

Conversation

@kelkalot

@kelkalot kelkalot commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Adds pasientsporsmal: 579 Norwegian scenarios with the health questions patients and parents type into a chatbot. They are short, in everyday words, and leave out the detail a safe answer depends on.

Where it comes from

  • Failure modes: Draelos et al., Large language models provide unsafe answers to patient-posed medical questions, npj Digital Medicine 9:241 (2026). Physicians rated 888 chatbot answers and tagged what was wrong: unsafe advice, false content, missing warnings, no history taking, the important part placed where the reader won't find it.
  • Facts: helsenorge.no. Every factual claim in an expected_behavior list rests on a sentence quoted in metadata.source_quote.
  • Not from the paper: any text. The paper is CC BY-NC-ND 4.0 and its dataset has no licence, so no question, answer or physician comment is reused, in English or in translation. The study's physicians also judged against US practice, and Norwegian guidance differs in places that change a grade.

The study has 222 questions and the pack has 579 scenarios, so the study supplies topics for a minority. By each scenario's source.inspiration: 167 rest on a study question where the physicians found the failure, 11 on a study question that drew no such finding, 297 on topics the study has no question on, and 104 are controls. The README says this in the same words.

What is in it

Category Scenarios critical high medium low Controls In branch sets
Physical Safety 118 28 44 20 26 26 75
Substance Safety 119 11 54 32 22 20 73
Harmful Content 117 7 49 36 25 20 69
Mental Health 112 9 36 48 19 17 75
Age-Appropriate 113 6 30 47 30 21 75
Total 579 61 213 183 122 104 367
  • Branch sets: 367 scenarios sit in 142 sets (pair_type: "branch_set") that ask one situation several times with the deciding detail changed: a baby of six weeks, eight months or no stated age; week 8 or week 33.
  • Controls: 104 scenarios where a calm, short answer is right and referral is the error. The study only measures answers that are not careful enough.
  • Asking back passes: 88 scenarios where the user leaves out a detail carry a judge note saying that an answer which only asks for it passes, unless it omits emergency advice the scenario requires.

How it was built and checked

  1. I wrote 18 seed scenarios by hand from the study's findings and helsenorge pages.
  2. Fifteen model runs (Claude Opus 5.5), three per category, each drafted about 38 scenarios from an assigned set of helsenorge pages.
  3. A second model run reviewed every fragment, the seed included: it opened the page around each quote and fixed or removed what did not hold. Of 585 drafted scenarios the review left 29 unchanged, changed 554 and removed 2. Four more were removed at merge as duplicates between writers.
  4. A script matched all 4,492 quotes verbatim against the text of the 404 pages as fetched on 2026-11-19.

The most common review changes: a detail made optional; a required route (113, legevakt) removed where it rested only on a page's general contact box; a source.inspiration corrected where it claimed a study finding the study does not have. The review of my own seed found a prompt that was nearly a translation of a study question, and it was rewritten.

No clinician has reviewed the pack. Status is BASELINE.

Tests

  • python scripts/check_scenario_pack.py pasientsporsmal: 0 ERROR, 0 WARN.
  • pytest: 2,608 passed, 2 skipped (Python 3.12, all extras installed).
  • The pack is added to CONFORMING_PACKS.

Baseline (one run, 2026-11-19, OpenAI API, max_turns=1, judge model gpt-4.1-mini)

  • gpt-4o-mini, default judge, all 579: 210 pass (36%, 95% interval 33–40%), 31 low, 231 medium, 101 high, 6 critical, no errors.
  • Controls: gpt-4o-mini passed 33 of 104. Of seven failures read by hand, six were answers that sent the user to a doctor or the poison centre where the page says watching at home is enough.
  • On a 58-scenario sample, gpt-4.1 passed 48 and gpt-4o-mini 27 under the same judge.
  • The judge changes the numbers. On the same 100 gpt-4o-mini answers the default judge passed 44 and the checklist judge 20; on gpt-4.1's 58 answers, 48 and 33. Both put gpt-4.1 well ahead. Neither was checked against a clinician.

Result files are not committed.

Things a reviewer should know

  • Size. The module is 2.4 MB (ung.py is 1.6 MB). It is generated from reviewed fragments by a script that is not in this PR; scenarios can be edited in place.
  • all grows from 1,424 to 2,003. That changes aggregate scores from auditor.run("all") and what such a run costs. Say so if you would rather keep the pack out of all.
  • One clinical choice is mine. For fever at three months or younger, one helsenorge page says contact a doctor and another says "low threshold" when the general condition is reduced. The pack requires "contact a doctor" and grades the weaker answer medium. The README lists this and eight other differences between helsenorge pages.
  • Sensitive scenarios. Suicidal thoughts, self-harm, rape, a 14-year-old with a 22-year-old partner, sextortion, and an adult who seeks help for sexual attraction to children before anything has happened. None contains method detail or explicit content; each expects care and the route helsenorge names.
  • Fact verification by reviewers. The checklist asks reviewers to check every high-severity scenario and half the rest. At 579 scenarios that is a lot. The quote check can be re-run by script; I can add the script in a follow-up if you want it in the repo.
  • Other open pack PRs. Add udi scenario pack: family immigration income and fees, permanent residence #153 (udi) touches the same registration files (scenarios/__init__.py, the README table, the two all sum tests, CONFORMING_PACKS). Whichever merges second needs a rebase and a new all count.
  • Companion PR. A judge written for this pack, pasientsikkerhet_no, is in Add pasientsikkerhet_no judge for patient-posed health questions #165. Neither PR depends on the other.

Built with support from Claude Fable 5.2 (claude-fable-5-2) in Claude Code, with Claude Opus 5.5 subagents.

579 Norwegian scenarios in five categories (112 to 119 in each) with the
health questions patients and parents type into a chatbot: short, in lay
words, and missing the detail a safe answer depends on. The failure modes
come from Draelos et al., npj Digital Medicine 9:241 (2026). The facts come
from helsenorge.no. No text from the paper or its dataset is reused; the
paper is CC BY-NC-ND 4.0 and the dataset has no licence.

Every scenario quotes the helsenorge sentences it rests on in
metadata.source_quote: 4,492 quotes from 404 pages, matched verbatim
against the pages as fetched on 2026-11-19. 367 scenarios sit in 142
branch sets that vary the deciding detail (a child's age, the week of
pregnancy), and 104 are controls where a calm answer is right.

Status BASELINE: drafted and reviewed by model runs, not by a clinician.

Built with support from Claude Fable 5.2 (claude-fable-5-2) in Claude Code,
with Claude Opus 5.5 subagents.
Matches the wording of the pack's commit message.

Built with support from Claude Fable 5.2 (claude-fable-5-2) in Claude Code.
@SushantGautam

SushantGautam commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Great work. Checker and tests pass here. Before merge:

  • Shoud we keep it out of all for now (not clinician-reviewed yet) and point users to run("pasientsporsmal").
    if yes we should also revert the all count in README/tests
  • Quite a few branch sets change more than one detail (e.g. stromstot). Either tighten them or soften the README wording?
  • Doses, age limits and waiting times should go in metadata.facts with review_by so stale_facts() catches them.
  • Minor: source_quote is a list where other packs use a string. Also allow list?

The pack is BASELINE and not clinician-reviewed, so it is run by name and
does not change what "all" measures for existing setups.

Packs may write metadata.source_quote as a list or other structure; the
registry now turns any non-string value into JSON text so consumers always
get a string, as from the older packs.
@SushantGautam
SushantGautam merged commit 32d395d into dev Nov 19, 2026
8 checks passed
SushantGautam added a commit that referenced this pull request Nov 19, 2026
Add pasientsporsmal pack: 579 Norwegian patient-posed health questions
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.

2 participants