TRANSMISSION // 2611.27895v1

Testing AI coding agents on branching clinical rules

Source published

A Brazilian autism-screening benchmark compares two Gemma 4 models on synthetic rules, finding higher task solve rates for the larger model but no evidence of clinical readiness.

AI-generated conceptual illustration for Testing AI coding agents on branching clinical rules
AI-generated conceptual illustration; not documentary evidence.

Clinical software can produce plausible answers even when its code mishandles a threshold, missing response or referral. TEA-Bench-BR tests whether coding agents can turn detailed Portuguese-language rules into working code—and whether hidden tests catch mistakes that visible tests miss.

When plausible code makes the wrong call

Software that implements clinical rules has to do more than run. A screening tool may need to reverse-score answers, handle missing data, apply age limits and send some cases to a second stage. A small error can change the result without causing a crash. The paper introducing TEA-Bench-BR asks whether coding agents can translate such branching specifications into code that passes demanding tests.

The benchmark models Brazil’s early autism-screening pathway, known as TEA. Its instruments are fictitious: they were designed to resemble the structure of real questionnaires without reproducing protected instruments. Tasks also cover a multi-professional referral process and exporting results in FHIR R4, a standard for exchanging health information, using Brazilian RNDS profiles. The specifications are in Portuguese.

A benchmark built to catch quiet errors

The author created a generator that varies task details such as score cut-offs, reverse-scored items, age ranges and follow-up rules. The resulting benchmark contains 144 tasks and 6,798 hidden test cases. Each task also has visible examples and tests, but passing those alone does not count as success: an agent must pass every hidden case for a task to be marked solved.

To check whether those hidden tests were strong enough, the author introduced small, deliberate variations in the reference code—mutations representing likely mistakes, such as using the wrong threshold operator or mishandling missing answers. The hidden tests caught all 1,955 non-equivalent mutants in the original benchmark. This supports the claim that the tests cover those targeted error types; it cannot show that they would catch every possible bug.

The study tested two quantized versions of Gemma 4, a 12-billion-parameter model and a 31-billion-parameter model. The agent could inspect task files, write code, run tests and finish, with limits on steps and tokens. Researchers also compared Portuguese specifications with English versions, examined errors that could miss referrals, and tested whether a model’s errors on modified PHQ-9 tasks seemed to follow the familiar instrument’s original rules.

Larger model, higher solve rates

On the first task level, which covers scoring a single instrument, the 12B model solved 38.0% of tasks; the 31B solved 77.8%. The gap was sharper in the more complex referral-and-FHIR level: the smaller model solved none, while the larger solved 78.7%. The 31B passed 99.0%, 99.5% and 99.3% of hidden cases at levels 1, 2 and 3, respectively. Passing many individual cases is not the same as implementing every task correctly: only 47.2% of level-3 tasks were solved in all three attempts.

The larger model’s remaining level-3 failures were mostly in decision-making and input validation, rather than FHIR export. For example, it sometimes failed to check that a facility identifier contained seven digits. The smaller model struggled more as conditional rules accumulated and sometimes produced code that did not run. It also made more mistakes involving strict input types: the benchmark treated a Boolean value such as True as different from the integer 1.

The safety analysis counted cases where the reference indicated risk or referral but the agent’s code indicated none. For the 12B, this happened in 10.10% of positive hidden cases; for the 31B, it was 0.02%. These are benchmark-specific error rates, not estimates of how often deployed clinical software would miss referrals.

Language results were not uniform. The 31B solved fewer level-3 tasks when specifications were in English than in Portuguese: 57.4% versus 78.7%. The 12B showed a different pattern. The authors point to a specific validation check that appeared less often in the larger model’s English-run code, but the comparison does not establish a general rule about which language is easier for coding agents.

In the contamination probe, the researchers kept the PHQ-9 name and item order while changing scoring rules. None of the comparable errors on these altered tasks followed the original PHQ-9 rules. That is evidence against this particular kind of memory-driven mistake in this test—not proof that the models are free of training-data contamination.

What the study can—and cannot—say

TEA-Bench-BR measures whether code follows its written specification. Its fictitious instruments have not been clinically validated, and the paper explicitly says the benchmark must not be used to screen children. It uses no real patient data. Results concern Gemma 4 in a particular harness and setup, with three attempts per task and no fixed sampling seed; they do not establish how other models or real-world systems would perform.

The work is an arXiv preprint, so the supplied source does not establish that it has undergone peer review. The benchmark, generator and results are reported as available through Kaggle, offering a route for others to inspect and test the work. Even so, its central lesson is about evaluation: visible tests can be reassuring while hidden edge cases still expose errors. For systems implementing clinical rules, tests need to probe the branches where a plausible output could be wrong.

Reviewed cross-references

These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.

  • A Proposed Way to Secure Coding-Agent Benchmarks

    Supporting evidence: Both preprints illustrate limits of benchmark testing, but with different evidence: TEA-Bench-BR reports hidden tests killing all 1,955 non-equivalent mutants generated for its tasks, while the SplitBench study reports that native graders accepted 230 of 429 adversarial attempts and SplitBench accepted none; many attempts exploited weaknesses in the tasks’ own tests. These results support the bounded point that test adequacy matters, not that the benchmarks use equivalent safeguards or that attacks passed SplitBench. The comparison is limited to the reported cases and campaigns in selected excerpts.

    Model review: · openai-codex/gpt-6-luna

    Evidence and provenance

    Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.

    • 2611.27895v1 — Original paper

      Excerpt reference: static/papers/2611.27895v1.md:156-231
      Basis: Paper text
      Source SHA-256: b4f131ab69d4fc577576fb478096a3337ae9a2623786b04e53780a404e3ac9f8

    • 2611.27860v1 — Original paper

      Excerpt reference: static/papers/2611.27860v1.md:1192-1284
      Basis: Paper text
      Source SHA-256: 64b163ae3caf83a3a818e44bb51d56d87148388809b975a303d0ce7ae3f47172

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.