Specification Before Generation: A Pre-Registered, Five-Model Paired Evaluation of a Specification Frame for LLM-Generated Code in Money, Time, Idempotency, and Access Tasks
Summary
This paper evaluates a specification frame that improves LLM-generated code by reducing defects in critical areas like money arithmetic and access control, based on a pre-registered five-model study across finance, healthcare, and insurance tasks.
View Cached Full Text
Cached at: 09/30/26, 12:13 AM
Paper page - Specification Before Generation: A Pre-Registered, Five-Model Paired Evaluation of a Specification Frame for LLM-Generated Code in Money, Time, Idempotency, and Access Tasks
Source: https://huggingface.co/papers/2609.23270
Abstract
Codegeneratedbylargelanguagemodelspassessecuritychecksataratethathasbarelymovedinfouryears.Inregulatedbackends,thedefectclassesthatmattermostaremoneyarithmetic,timehandling,retrysafety,andaccesscontrol.Teamsanswerwithinstructionfiles,yetthelargestcontrolledstudyofinstructionfilestodatefoundnobenefit.Thispapertestsanarroweridea:generatedcodeimproveswhenthepromptcarriesaspecification,afixedpreamblestatingwhatmustbetrueoftheresult.Wepre-registeredhypotheses,refuters,analysiscode,andaone-shotgenerationrule,thenran50realisticbackendtasksfromfinance,healthcare,andinsurancepracticethroughfivefrontiermodelsfromfivevendorlineages,eachtasktwice:bare,andprecededbya267-wordfilledspecificationframe.NinedeterministicAST-basedcheckersscoredtheoutputs.TheBanditsecurityscanner,whichknowsnothingoftheframe,scoredthemindependently.Theframereduceddefectsinallfivemodels(meanreduction0.16to0.70findingspertask,everyHolm-adjustedsigntestsignificant,everybootstrapconfidenceintervalexcludingzero).Wherethearmsdiffered,theframearmwon95of100times.Itnevermadeanymodelworseinanydomain.Banditfound53medium-or-highissuesinthebarearmand11intheframearm,inthesamedirectionforeverymodel.Theeffectwaslargestwhereamodel’sunprompteddefaultswereweakest:theframesuppliesthedisciplineamodellacks.All500outputs,prompts,checkers,scoringcode,andthepre-registrationarepublishedwithaDOI,soanyteamcanre-derivetheresultwithouttrustingtheauthor.
View arXiv pageView PDFProject pageGitHubAdd to collection
Get this paper in your agent:
hf papers read 2609\.23270
Don’t have the latest CLI?curl \-LsSf https://hf\.co/cli/install\.sh \| bash
Models citing this paper0
No model linking this paper
Cite arxiv.org/abs/2609.23270 in a model README.md to link it from this page.
Datasets citing this paper1
#### sandeepdhuriauthor/delta-frame-validation-study
Spaces citing this paper0
No Space linking this paper
Cite arxiv.org/abs/2609.23270 in a Space README.md to link it from this page.
Collections including this paper0
No Collection including this paper
Add this paper to acollectionto link it from this page.
Similar Articles
My LLM kept implementing every method it found, so I added research and specification gates[D]
An LLM developer added research and specification gates to prevent the model from implementing every method it encounters, improving code generation quality.
Repairing LLM-Generated Specifications with Deterministic Diagnosis
该论文提出 DRAGO 框架,用确定性的形式化诊断替代无依据的 LLM 批评来修复 LLM 生成的形式化规范,在五个基准上将规范回归率从 11.8% 降至 1.3%,并显著提升答案准确率。
AuXSpec: Learning to Autoformalize Program Specifications via Executable Postconditions
AuXSpec introduces a Lean framework that pairs declarative postconditions with executable counterparts, enabling execution-based agreement as an RL reward for training specification-generation models. Models trained with this reward achieve up to 84.3% SpecGen pass@4, surpassing prior open-source SOTA and frontier models on the Verina benchmark.
Toward Safe LLM Agents: A Survey of Specification, Verification, and Enforcement
This survey paper reviews 38 studies on safe LLM agents, highlighting key challenges such as specification translation bottlenecks, incomplete safety guarantees from enforcement methods like runtime monitoring, and the verifier tax that impedes safe task completion.
No Resource, No Benchmarks, No Problem? Evaluating and Improving LLMs for Code Generation in No-Resource Languages
This paper tackles code generation for no-resource programming languages by building benchmarks and proposing a method that combines further pre-training with weight difference transfer to create specialized instruction-following models at reduced cost.