TEA-Bench-BR:编码智能体能否把分支型临床规范转化为正确的代码?
摘要
TEA-Bench-BR 是一个面向编码智能体的基准,构建在巴西早期自闭症(TEA)筛查路径之上:包含三个结构仿照真实量表编写的虚构量表、一条多专业转诊流程,以及导出到 FHIR R4 和巴西国家 RNDS 配置文件的输出,全部规范用葡萄牙语编写。任务生成器为每个任务采样参数,共 144 个任务、6,798 个隐藏用例,这些隐藏用例能够杀死参考实现全部 1,955 个非等价变异体。以 Gemma 4 作为智能体时,12B 版本解决 38.0% 的单量表任务,在 FHIR 层则一个都未解决;31B 版本在 1 至 3 级分别解决 77.8%、85.2% 和 78.7%,隐藏用例通过率超过 99%,剩余失败主要出在输入校验而非临床决策上。
查看原始标题和摘要
TEA-Bench-BR: Can Coding Agents Turn a Branching Clinical Specification into Correct Code?
Coding agents increasingly implement rules written by domain experts, and bugs in such code are silent: it runs and returns a plausible answer. We introduce TEA-Bench-BR, a benchmark built on the Brazilian pathway for early autism (TEA) screening: three fictitious instruments with the structure of real ones, a multi-professional referral flow, and export to FHIR R4 with the national RNDS profiles, all specified in Portuguese. A generator samples each task's parameters (144 tasks, 6,798 hidden cases), and the hidden cases kill all 1,955 non-equivalent mutants of the reference. With Gemma 4 as the agent, the 12B solves 38.0% of single-instrument tasks and none at the FHIR level; the 31B solves 77.8%, 85.2% and 78.7% at levels 1 to 3 and passes over 99% of the hidden cases, its remaining failures mostly in input validation rather than clinical decisions. With the same tasks in English, the 31B solves 57.4% at level 3, as its code validates an identifier less often; the 12B's, more often. The 12B misses 10.10% of the cases that call for referral; the 31B, 0.02%. A contamination probe on a modified PHQ-9 finds no error that follows the original rules.
核心要点
- 基准包含 144 个任务和 6,798 个隐藏用例,隐藏用例可杀死参考实现的全部 1,955 个非等价变异体。
- Gemma 4 12B 解决 38.0% 的单量表任务,FHIR 层通过率为 0;31B 在 1 至 3 级分别为 77.8%、85.2%、78.7%。
- 31B 通过超过 99% 的隐藏用例,剩余失败多集中在输入校验,而非临床判断。
- 把同一批任务改用英语后,31B 在第 3 级的解决率降至 57.4%,原因是其代码对标识符做校验的频率降低;12B 则相反。
- 12B 漏掉 10.10% 需要转诊的用例,31B 仅漏掉 0.02%。
- 在修改过的 PHQ-9 上做污染探测,未发现沿用原始规则而产生的错误。
为什么值得后端工程师关注
对后端工程师而言,这个基准示范了用隐藏用例和变异体测试来评估 LLM 生成的业务代码,而不只是看能否编译运行;同时说明在临床、合规类系统中,输入校验和 FHIR/RNDS 映射是模型最容易出错的环节,模型规模与提示语言都会明显影响正确率。