CORTEXA
← Browse
arxivcs.LG2026-06-30

Calibration, Not Compilation: Detecting and Repairing Misspecified Probabilistic Programs Written by Language Models

Jian Xu, Delu Zeng, John Paisley, Qibin Zhao

Language models increasingly write probabilistic programs (in NumPyro, Stan, or Pyro), but a program that compiles, runs, and passes every unit test can still be \emph{statistically} wrong -- a Gaussian likelihood for heavy-tailed data, a Poisson for over-dispersed counts, an invalid prior support, or a pathological parameterization. The right verifier is therefore not a test suite but the Bayesian workflow itself: posterior predictive checks, simulation-based calibration, sampler diagnostics ($\hat R$, divergences, ESS), and held-out predictive density. We study this calibration oracle along three axes. \textbf{Detection:} on a benchmark of $14$ misspecification types across $10$ model families ($200$ instances), it flags the bug with AUC $0.97$ ($88\%$ at $2\%$ FPR \emph{when handed the correct reference program, an upper bound}) -- and a fully \emph{reference-free} version that uses no correct program reaches $62$--$78\%$ (the upper figure from a small automated model search), versus $0\%$ for a unit-test oracle. \textbf{Repair:} used as feedback in an LLM repair loop across fifteen models, calibration significantly outperforms unit-test feedback -- which is itself \emph{significantly worse than no feedback at all}, a passing test inducing false confidence that suppresses repair -- and improves over no feedback on strong-but-unsaturated models (GPT-5.1 $33{\to}92\%$, Claude $75{\to}100\%$; paired McNemar, $n{=}228$). \textbf{Reality:} on programs LLMs write from scratch for neutral briefs, $15$--$47\%$ of runnable ones are statistically misspecified (unit tests catch none), and calibration-guided repair significantly beats LLM-as-judge review, a Bayesian-workflow checklist, and data-summary self-debug. Across all three, the lesson is the same: for probabilistic programs, correctness is calibration, not compilation.

View free PDFSource page

Related papers

arxivcs.AIcs.LGstat.ML2026-07-10

ConfidenceBench: Evaluating Confidence Calibration in Large Language Models

Matthew ffrench-Constant, Daniel Yang, Xinmeng Huang, Sanyam Kapoor

Large language models (LLMs) are increasingly deployed in settings where fluent but incorrect answers can be costly. In these settings, accuracy alone is insufficient: models must also know when they are likely to be wrong. We present ConfidenceBench, a calibration benchmark that…

View free PDFSource page
arxivcs.SEcs.CRcs.LG2026-06-30

An Empirical Study of Security Calibration in Large Language Models for Code

Mohammed Latif Siddiq, Md. Nafiu Rahman, Joanna C. S. Santos

Large Language Models (LLMs) are rapidly transforming software development, yet their use in security-critical contexts raises a key question: do models know when their generated code is insecure? This property, known as calibration, measures whether a model's confidence aligns w…

View free PDFSource page
arxivcs.CLcs.AIcs.HCcs.LG2026-07-10

A small language model detects behavioural faithfulness gaps that frontier judges and human raters miss

Kwan Soo Shin, In Seok Kang, Yunkyung Min, Munho Lee

Whether a language model behaves as it claims is a judgement on which independent human raters cannot agree (Fleiss kappa = 0.074). We show that a small, purpose-built instrument does better. A linear read-out of the frozen representation of a from-scratch 146-million-parameter a…

View free PDFSource page
arxivcs.CLcs.LG2026-07-11

Hallucination Detection in Large Language Models Using Diversion Decoding

Basel Abdeen, S M Tahmid Siddiqui, Meah Tahmeed Ahmed, Anoop Singhal, Latifur Khan, Punya Parag Modi, et al.

Large language models (LLMs) have emerged as a powerful tool for retrieving knowledge through seamless, human-like interactions. Despite their advanced text generation capabilities, LLMs exhibit hallucination tendencies, where they generate factually incorrect statements and fabr…

View free PDFSource page
arxivcs.LG2026-07-05

On the effectiveness of reward functions in reinforcement learning for confidence calibration of large language models

Chee Heng Tan, Zhuoyi Lin, Mehul Motani, Wee Sun Lee

In this paper, we consider the setting where large language models (LLMs) are trained using reinforcement learning (RL) to simultaneously improve reasoning accuracy and verbalize its confidence. Our reward scheme uses two functions for rewarding confidence verbalized by the LLM:…

View free PDFSource page
arxivcs.SDcs.AIcs.CLcs.LG2026-06-26

LoRA-Tuned Large Language Models for Dementia Detection via Multi-View Speech-Derived Features

Jonghyeon Park, Olivier Jiyoun Jung, Myungwoo Oh

Early detection of dementia enables timely intervention, and reflecting cognitive impairment, spontaneous speech offers a non-invasive screening modality. Conventional approaches often focus on a single representational dimension -- such as acoustic descriptors, pause modeling, a…

View free PDFSource page