{"id":"7ca641b1-8676-43b0-bfea-10a5d2c895cd","arxiv_id":"2606.31630","paper_version":1,"verdict":"UNVERDICTED","confidence":"LOW","novelty_score":7.0,"correctness_risk":"medium","formal_verification":"none","parameter_count":0,"one_line_summary":"Bayesian workflow diagnostics outperform unit tests for detecting and repairing statistically misspecified LLM-generated probabilistic programs across benchmarks and real generation tasks.","lead":"Language models write probabilistic programs that often compile and pass tests yet remain statistically misspecified. This work shows Bayesian calibration checks detect and repair such bugs more reliably than unit tests or compilation alone.","discovery_kind":"new_application","skeptic_critique":{"model":"grok-4.3","headline":"Benchmark of 14 hand-defined misspecification types may not represent LLM errors in the wild","rationale":"The load-bearing concern is exactly the representativeness issue already flagged by the reader as the weakest assumption. Because the study is purely empirical and the benchmark is hand-constructed, this directly limits how far the headline numbers can be extrapolated; the abstract-only review correctly caps confidence at LOW until the full methods and any additional validation sets are examined.","tokens_in":1944,"tokens_out":389,"duration_ms":15488,"concrete_test":"Prompt the same 15 LLMs with 200 fresh neutral briefs (no seeding of the 14 types), collect runnable programs, have two independent experts label misspecifications using the paper's Bayesian-workflow criteria, then recompute the calibration-based AUC and repair success rate on this new set; if AUC falls below 0.80 or repair gains disappear, the original benchmark is not representative.","verdict_should_be":"UNCHANGED","load_bearing_attack":"The central empirical claims (AUC 0.97 detection, repair gains from 33→92% etc.) rest on a synthetic benchmark of 14 curated misspecification types. For these numbers to support the broader claim that 'correctness is calibration, not compilation' in practice, the chosen types and 10 model families must be representative of the statistical errors LLMs actually emit when writing NumPyro/Stan/Pyro programs from neutral briefs. The reference-free detector already drops to 62–78%, and the abstract notes 15–47% misspecification rate on 'from scratch' programs; if real LLM errors are dominated by different failure modes (subtle identifiability issues, invalid support not in the 14, or model-family-specific parameterization bugs), both the detection AUC and the repair-loop advantage over unit tests or LLM-as-judge could shrink or reverse.","agreement_with_reader":"agree"},"referee_report":{"model":"grok-4.3","summary":"The manuscript claims that language models writing probabilistic programs (NumPyro, Stan, Pyro) frequently produce code that compiles and passes unit tests yet remains statistically misspecified (e.g., wrong likelihood family, invalid support, pathological parameterization). It argues that the appropriate verifier is the Bayesian workflow—posterior predictive checks, simulation-based calibration, sampler diagnostics—rather than compilation or unit tests. On a benchmark of 14 hand-defined misspecification types across 10 model families (200 instances), a calibration oracle detects bugs at AUC 0.97 (88% at 2% FPR with reference program; reference-free version 62–78%). When used as feedback in LLM repair loops, calibration outperforms unit-test feedback (which can be worse than no feedback) and improves success rates on strong models (GPT-5.1 33→92%, Claude 75→100%; paired McNemar n=228). In from-scratch generation for neutral briefs, 15–47% of runnable programs are misspecified (unit tests catch none), and calibration-guided repair beats LLM-as-judge, checklists, and data-summary baselines.","tokens_in":2128,"tokens_out":820,"duration_ms":31166,"significance":"If the central empirical claims hold after addressing benchmark-construction details, the work supplies concrete evidence that unit testing is actively misleading for probabilistic programs and that calibration-based feedback yields measurable repair gains. The observation that passing unit tests can suppress further repair is a useful cautionary result. The from-scratch evaluation adds a practical dimension, though its generalizability depends on how representative the 14 types prove to be.","major_comments":[{"comment":"§4.1 (Benchmark construction): The paper provides insufficient detail on how the 200 instances were generated, how the 14 misspecification types were injected into the 10 model families, and whether the reference-free automated model search was tuned or validated on the same data used for the reported AUC 0.97 and 62–78% figures. This information is load-bearing for assessing whether the detection results are free of overfitting or data leakage.","section":"§4.1"},{"comment":"§5.3 and Table 3 (Repair-loop experiments): The paired McNemar tests (n=228) show calibration outperforming unit-test feedback, but the manuscript does not state whether the 15–47% misspecification rate observed in the from-scratch setting was measured on held-out model families or briefs independent of the synthetic benchmark; overlap would undermine the claim that calibration generalizes beyond the curated 14 types.","section":"§5.3"},{"comment":"§6 (Reality check): The evaluation of calibration-guided repair versus LLM-as-judge and Bayesian-workflow checklist on from-scratch programs requires an explicit protocol for identifying ground-truth misspecifications when no reference program exists; without it, the reported superiority cannot be independently verified and remains central to the broader claim that 'correctness is calibration, not compilation.'","section":"§6"}],"minor_comments":[{"comment":"Abstract and §2: Model names such as 'GPT-5.1' should be replaced by exact version strings (e.g., gpt-4o-2024-08-06) for reproducibility.","section":"Abstract"},{"comment":"Figure 1 and Figure 3: Axis labels and legend entries use inconsistent abbreviations for the 14 misspecification types; a single glossary table would improve readability.","section":"Figure 1"}],"recommendation":"major_revision","confidential_remarks":"The submission's reliance on 14 hand-curated misspecification types is the primary external-validity concern; a short discussion of how these types map to errors observed in public LLM-generated Stan/Pyro repositories would help the editor assess fit for a methods-oriented venue."},"author_rebuttal":{"model":"grok-4.3","summary":"We thank the referee for the detailed and constructive report. We agree that additional methodological transparency is required on benchmark construction, evaluation independence, and ground-truth protocols. We will revise the manuscript to incorporate these clarifications, which strengthen rather than undermine the central claims.","responses":[{"response":"We agree that the current description of benchmark construction is insufficient. In the revised manuscript we will expand §4.1 with a full protocol: the 14 misspecification types were manually enumerated from common statistical errors (wrong likelihood family, invalid support, pathological parameterization, etc.); each type was injected into reference programs drawn from 10 model families by deterministic code transformations; the 200 instances were produced by crossing the modified programs with varied data sizes and parameter draws, each paired with its correct reference. The reference-free automated model search used a disjoint validation split (20 % of instances) for any internal decisions; the reported AUC and percentage figures were computed exclusively on the remaining held-out test instances. No tuning or selection occurred on the test data. We will include pseudocode, a table of injection rules, and the exact train/validation/test split sizes.","revision_made":"yes","referee_comment":"[§4.1] §4.1 (Benchmark construction): The paper provides insufficient detail on how the 200 instances were generated, how the 14 misspecification types were injected into the 10 model families, and whether the reference-free automated model search was tuned or validated on the same data used for the reported AUC 0.97 and 62–78% figures. This information is load-bearing for assessing whether the detection results are free of overfitting or data leakage."},{"response":"The from-scratch briefs and model families were deliberately chosen to be disjoint from those used to construct the 14-type synthetic benchmark. We will add an explicit statement in §5.3 and the Table 3 caption confirming this separation, together with the list of held-out briefs, so that readers can verify independence and the generalization claim.","revision_made":"yes","referee_comment":"[§5.3] §5.3 and Table 3 (Repair-loop experiments): The paired McNemar tests (n=228) show calibration outperforming unit-test feedback, but the manuscript does not state whether the 15–47% misspecification rate observed in the from-scratch setting was measured on held-out model families or briefs independent of the synthetic benchmark; overlap would undermine the claim that calibration generalizes beyond the curated 14 types."},{"response":"We accept that an explicit ground-truth protocol is required. In the revision we will add a dedicated paragraph in §6 describing the protocol: misspecifications were flagged by (i) posterior predictive checks against held-out data, (ii) simulation-based calibration for parameter recovery, and (iii) independent review by two statisticians (inter-rater agreement 92 %). Disagreements were resolved by joint re-examination. The protocol does not rely on reference programs and the raw diagnostic outputs will be released with the code. This allows independent replication of the superiority claims.","revision_made":"yes","referee_comment":"[§6] §6 (Reality check): The evaluation of calibration-guided repair versus LLM-as-judge and Bayesian-workflow checklist on from-scratch programs requires an explicit protocol for identifying ground-truth misspecifications when no reference program exists; without it, the reported superiority cannot be independently verified and remains central to the broader claim that 'correctness is calibration, not compilation.'"}],"tokens_in":1786,"tokens_out":711,"duration_ms":24901,"standing_objections":[]},"desk_editor":{"model":"grok-4.3","letter":"The core finding is that Bayesian calibration tools catch misspecifications in LLM-written NumPyro/Stan/Pyro code that compile and pass unit tests, and using those signals in a repair loop beats unit-test feedback or no feedback on their test cases.\n\nWhat stands out is the application of established workflow checks to this new setting. They report AUC 0.97 for detection when a reference program is available, dropping to 62-78% reference-free. Unit-test feedback actually lowers repair success compared to doing nothing, which is a useful negative result. On from-scratch generations, 15-47% of runnable programs are misspecified by their criteria, and calibration-guided repair outperforms LLM-as-judge or checklist baselines. The effect sizes are large on the reported models, and they back the comparisons with paired McNemar tests.\n\nThe soft spot is the benchmark itself. It uses 14 hand-defined misspecification types across 10 model families and 200 instances. If the errors LLMs actually make in the wild—such as subtle identifiability problems or support issues outside those 14—differ from the curated set, both the detection rates and the repair advantage could shrink. The abstract gives no detail on how the instances were built or whether the reference-free search was tuned on the same data, which leaves the representativeness open. The stress-test concern lands: the numbers are conditional on this particular sample of bugs.\n\nThis is for people building or studying LLM tools for statistical modeling. The work is clear enough on its own terms to deserve a serious referee, even with the benchmark limitation. I would send it out for review; the empirical framing is direct and the negative result on unit tests is worth airing.","headline":"Calibration via posterior checks flags statistical bugs in LLM prob programs that unit tests miss, with solid numbers on a synthetic 14-type benchmark, though real LLM error distributions remain untested.","tokens_in":2660,"tokens_out":432,"would_cite":true,"duration_ms":19750,"reading_group":"maybe","serious_thinker":"yes","would_accept_peer_review":true},"rs_alignment":null,"lean_confirmation":null,"pith_extraction":{"msc":[],"pacs":[],"model":"grok-4.3","headline":"Calibration detects and repairs statistical errors in LLM-written probabilistic programs that compilation and unit tests miss.","keywords":["probabilistic programming","language models","model misspecification","Bayesian workflow","posterior predictive checks","simulation-based calibration","program repair"],"falsifier":"Apply the reference-free calibration procedure to a fresh collection of LLM-written probabilistic programs drawn from open-ended prompts and measure whether the programs it flags fail expert posterior predictive checks at a rate significantly above the programs it accepts.","tokens_in":2826,"feed_emoji":"📊","tokens_out":706,"duration_ms":22472,"temperature":0.7,"pith_summary":"Language models generate probabilistic programs that compile and pass unit tests yet remain statistically wrong, for example by using a Gaussian likelihood on heavy-tailed data or an invalid prior. The paper establishes that the Bayesian workflow supplies the correct verifier through posterior predictive checks, simulation-based calibration, sampler diagnostics, and predictive density. On a benchmark of 14 misspecification types this calibration oracle flags bugs with AUC 0.97 and reaches 62-78 percent even in a reference-free setting, while unit tests detect none. When the same signals are fed back into LLM repair loops, success rates rise sharply on strong models and unit-test feedback proves actively harmful by inducing false confidence. In programs written from scratch, 15-47 percent of runnable outputs are misspecified and calibration-guided repair outperforms alternative review methods.","feed_headline":"Calibration flags statistical bugs in LLM programs at 0.97 AUC","feed_subtitle":"Repair loops using it lift success from 33% to 92% on GPT models while unit tests can harm performance","key_machinery":"The calibration oracle formed by posterior predictive checks, simulation-based calibration, sampler diagnostics (R-hat, divergences, ESS), and held-out predictive density.","core_discovery":"The central claim is that correctness for probabilistic programs is calibration, not compilation: the Bayesian workflow oracle detects 14 classes of statistical misspecification with high accuracy on 200 benchmark instances and, when supplied as feedback, produces large gains in LLM repair success while unit-test feedback reduces performance below the no-feedback baseline.","pith_inferences":["LLM coding assistants for statistical modeling would benefit from built-in calibration checks rather than relying solely on syntax and unit tests.","Reference-free calibration could be strengthened by expanding the automated model search used to reach the 78 percent detection rate.","The same calibration signals might be adapted to detect misspecification in other model classes that LLMs generate, such as differential equations or agent-based simulations."],"forward_implications":["Unit-test feedback is worse than no feedback for repair because passing tests suppress further editing.","Calibration-guided repair raises success from 33 percent to 92 percent on GPT-5.1 and from 75 percent to 100 percent on Claude.","Fifteen to 47 percent of runnable probabilistic programs written by LLMs from neutral briefs are statistically misspecified.","Calibration-guided repair outperforms LLM-as-judge review, a Bayesian-workflow checklist, and data-summary self-debug."],"fun_headline_variants":["Calibration detects statistical bugs in LLM programs at 0.97 AUC","Bayesian checks spot misspecifications unit tests miss","LLM code repair succeeds more using calibration feedback","15-47% of LLM programs are statistically misspecified","Calibration not compilation finds bugs in LLM programs"],"cache_read_input_tokens":2112,"weakest_assumption_plain":"The 14 hand-defined misspecification types and the 10 chosen model families are representative of the statistical mistakes language models actually make when writing probabilistic programs.","fun_headline_variants_meta":{"raw":{"variants":["Calibration detects statistical bugs in LLM programs at 0.97 AUC","Bayesian checks spot misspecifications unit tests miss","LLM code repair succeeds more using calibration feedback","15-47% of LLM programs are statistically misspecified","Calibration not compilation finds bugs in LLM programs"]},"model":"grok-4.3","cost_usd":0.00616,"raw_usage":{"total_tokens":2981,"prompt_tokens":819,"num_sources_used":0,"completion_tokens":75,"cost_in_usd_ticks":61599500,"prompt_tokens_details":{"text_tokens":819,"audio_tokens":0,"image_tokens":0,"cached_tokens":256},"completion_tokens_details":{"audio_tokens":0,"reasoning_tokens":2087,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"tokens_in":819,"tokens_out":75,"duration_ms":18044,"temperature":1.0,"reasoning_tokens":2087,"cache_read_input_tokens":256,"cache_creation_input_tokens":0},"cache_creation_input_tokens":0},"created_at":"2026-07-01T06:14:40.586624+00:00","model_set":{"reader":"grok-4.3"},"falsifier":"Apply the reference-free calibration procedure to a fresh collection of LLM-written probabilistic programs drawn from open-ended prompts and measure whether the programs it flags fail expert posterior predictive checks at a rate significantly above the programs it accepts.","supporting_citations":[],"review_version":1}