arXiv:2611.07073cs.AINov 2026

Manuscript Offprint

arXiv:2611.07073

When Verification Is Not Agreement: Cross-Agent LLM-to-Dafny Formalization

Priyanath Maji

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

A verified Dafny postcondition certifies that a formula holds, but it does not guarantee that the result was reached through genuine independent reasoning. We introduce a cross-agent formalization protocol where a Specifier model translates clinical trial criteria into a Dafny predicate, and an Implementer model writes an operational method checked against it. A same-model control establishes that even with no capability gap, independent re-extraction from identical text agrees only 59.3% of the time. Evaluating four model configurations on 96 clinical trial documents, we find that agreement is highly sensitive to how model capability is allocated across the two roles: the GPT-4.1-nano/GPT-4.1-mini configuration achieves 53.0% agreement when the stronger model is the Implementer, but only 14.3% when the roles are reversed. The strongest tested configuration, GPT-5.6-luna/GPT-5.4-mini, improves agreement to 34.4% but remains below the same-model baseline and is dominated by direct contradiction (42.7%). We also detect a critical verification artifact in which a weaker Implementer satisfies the post-condition by invoking the Specifier's predicate directly; after structural auditing, corrected agreement falls from 14.3% to 13.2%. Our results show that verification success alone is insufficient evidence of independent cross-agent agreement, and that model capability does not guarantee agreement when formalizing the same source independently.

1 Introduction

A verified Dafny [1] ensures clause establishes that the postcondition holds under the verifier's assumptions. It does not tell you why it holds, or whether the two artifacts being checked against each other were produced through genuinely independent reasoning. A common pattern in neuro-symbolic pipelines pairs a Specifier agent, which produces a formal specification, with an Implementer agent, whose code is checked against that specification by a verifier. But verification success in this pattern is only meaningful evidence of agreement if the two agents' artifacts were actually derived independently. If both agents are shown the same pre-resolved facts before they begin, or if one agent can shortcut its own reasoning by referencing the other's output, verification succeeds trivially, and certifies nothing about independent agreement.

We study this distinction directly in a domain involving numeric eligibility criteria extracted from clinical trial text, chosen specifically because it admits a clean way to test it without requiring human-annotated gold labels. We first confirm, empirically, that the naive implementation of this pattern is vulnerable to exactly the failure it is not supposed to permit. When a Specifier and an Implementer are given an identical, already-parsed list of extracted facts, verification succeeds on the first attempt in 50 of 52 documents, and the mutation-adequacy guard [2, 3] catches all synthetic mutants with zero escapes. This is not evidence the pipeline works; it is evidence the two agents were never in a position to disagree. We then redesign the protocol so that each agent reads the raw

NeurIPS 2026 Workshop on AI for Verifiable Coding.

source text independently, sharing only the structural signature necessary for Dafny to type-check the Implementer's method against the Specifier's predicate, never the Specifier's actual thresholds. Genuine agreement must now be earned, and disagreement is diagnosable into distinct, interpretable failure modes, all without requiring human-annotated gold labels.

Two results emerge from applying this protocol across four Specifier/Implementer model configurations on 96 clinical trial documents from the Chia corpus [4]. First, a same-model control shows that independent re-extraction from identical text agrees only 59.3% of the time even with no capability gap, establishing that formalization agreement is a genuinely nontrivial task before any capability asymmetry is introduced. Second, agreement is highly sensitive to how model capability is allocated across the two roles. With GPT-4.1-nano and GPT-4.1-mini, agreement reaches 53.0% when the stronger model serves as the Implementer, but only 14.3% when the roles are reversed. The strongest tested configuration, GPT-5.6-luna/GPT-5.4-mini, achieves 34.4% agreement but remains well below the same-model baseline and exhibits a qualitatively different failure profile dominated by direct contradiction. These results indicate that model capability alone does not guarantee agreement when independently formalizing the same source.

Finally, structural auditing exposes a concrete limitation of verification as an independence test. In the configuration with the weaker Implementer, one case classified as agreement was satisfied by invoking the Specifier's predicate directly rather than reconstructing the logic independently. After removing this shortcut, corrected agreement falls from 14.3% to 13.2%. This artifact would have passed the Dafny postcondition while violating the intended independence of the two-agent protocol, demonstrating that verification success alone cannot distinguish genuine reconstruction from a structurally dependent implementation.

Recent work has explored integrating formal verification into LLM-based code generation, including consistency checking between generated code and formal annotations, as well as verification-guided program synthesis and agent safety [5, 6, 7]. However, successful verification does not necessarily establish that independently generated formalizations agree on the meaning of the original natural-language requirements.

Contributions. We first provide a cross-agent evaluation protocol in which two models independently formalize the same source text, with their artifacts connected through a shared Dafny contract. This configuration allows genuine agreement, coverage gaps, and direct contradictions to be distinguished mechanically from the two agents' independently derived atom sets without requiring human-annotated gold labels. Second, we present empirical evidence via a same-model control that independent-formalization agreement is substantially below 100% even absent any capability gap, establishing the baseline against which capability and role allocation must be interpreted. Third, we demonstrate that agreement is highly sensitive to how model capability is allocated across the Specifier and Implementer roles, where reversing roles produces a large change in agreement while the strongest tested configuration remains below the same-model baseline and exhibits a contradiction-dominated failure signature. Finally, we surface a concrete, structurally audited case of verification succeeding without genuine independent reconstruction, where an Implementer invokes the Specifier's predicate directly to satisfy Dafny's postcondition, demonstrating why verification success alone is insufficient to establish cross-agent agreement.