HidSpec: Evaluating Large Language Models on Constraint-Program Repair under Hidden Environment Contracts
Chinese original title: HidSpec:隐藏环境契约下的大语言模型约束程序修复评测 This record contains the Chinese-language original (v15) and its English translation (v7). The English version includes a translation-source statement and a Chinese-English terminology glossary. If English wording or terminology is unclear, readers may consult the corresponding Chinese manuscript. Research status: This is an interim research draft (preprint), intended for learning, scholarly exchange, and research reference. It has not been peer reviewed or formally accepted by an academic journal or conference. The reported observations and results are limited to the settings described in the manuscript. H1–H6 are hypotheses for future research. Abstract We introduce HidSpec, a benchmark for repairing constraint programs when the environment enforces undocumented rules. It traces queries and individual revisions to expose Enigmatic Black-Box Disarray (EBBD) behaviors that final repair scores can conceal, namely uninformative repeated queries, conflicts with known feedback, and revision regressions. We adapt 48 combinatorial problems from DCP-Bench-Open into tasks in which models choose candidate solutions, query their feasibility, and revise the program. Our adapted CodeARC protocol tests inferred functions on a finite set of input-output cases, and our adapted CanItEdit protocol evaluates code edits with a test suite. HidSpec checks complete feasible-set equivalence over the finite output domain of each fixed input, identifying both invalid solutions accepted and valid solutions rejected. Optimization tasks also require matching objective directions and optimal sets. Comparing successive versions against feedback already available to the model pinpoints edits that break previously correct judgments. Five language models attempted each task once with at most 20 responses and 40 queries. Strict repair rates ranged from 6.25% to 77.08%. Of 15 HidSpec programs by deepseek-flash (High) that passed a spot check of up to ten outputs, full verification found five that accepted invalid solutions. In an exploratory comparison under different feedback and revision protocols, this model contradicted known feedback on a larger share of eligible HidSpec tasks (16/35) than on adapted CodeARC (3/22) or CanItEdit (1/10). Edits that broke a previously correct judgment on a known case occurred on 4/20, 0/17, and 0/7 eligible tasks, respectively. On a HidSpec investment task that ultimately passed, replay traced the temporary rejection of three feasible portfolios to a redundant budget check, yielding concrete tests for future revisions. 中文摘要 本文提出 HidSpec,评测大语言模型在题面遗漏环境约束时的程序修复能力,重点是发现并定位最终得分掩盖的"迷箱失序"(Enigmatic Black-Box Disarray, EBBD)行为,即无增量重复查询、已知反馈冲突与修订回退。我们将 DCP-Bench-Open 中的 48 道组合问题改为交互式修复任务,模型自行选择候选方案、查询其可行性,并根据反馈修改程序。本文采用的 CodeARC 改版用有限的输入输出用例检验模型归纳的函数,CanItEdit 改版用测试套件验收按指令编辑的代码。HidSpec 则在原题固定输入的有限域内双向核对完整可行解集,找出被误放的违规方案或被误拒的合法方案,优化题还核对优化方向与最优解集。将各版程序与当时已获得的反馈逐一核对,还能定位哪次修改破坏了先前正确的判断。在每题最多 20 次响应、40 条查询的条件下,五个模型各对每题作答一次,严格修复率为 6.25% 至 77.08%。在 deepseek-flash(High)的 HidSpec 提交中,每题至多抽查 10 个输出时有 15 份程序通过,完整核验发现其中 5 份仍会放行违规方案。在反馈方式与修订预算各异的三组探索性评测中,同一模型在 HidSpec 上更常提交违背已知反馈的程序。按各项可评估题目计,出现此类冲突的任务比例在 HidSpec、CodeARC 改版和 CanItEdit 改版上分别为 16/35、3/22 和 1/10。已知案例在相邻版本中由对变错的任务比例分别为 4/20、0/17 和 0/7。其中一道 HidSpec 投资预算题最终通过验收,回放却将三份合法方案一度被误拒的原因定位到一条多余的预算检查,为检验后续修订能否保留正确行为提供了具体测试。 Research materials: HidSpec public repository. Materials, versions, known issues, and applicable licenses are documented in the repository.
Authors
- Bohejun Su
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-03
- DOI
- https://doi.org/10.5281/zenodo.24768438
- Primary Topic
- Software Testing and Debugging Techniques
- Type
- preprint