Skip to main navigation Skip to search Skip to main content

Improving LLM code reasoning via semantic equivalence self-play with formal verification

  • Poon Tsz Nok
  • , Antonio Valerio Miceli Barone

Research output: Chapter in Book/Report/Conference proceeding › Conference contribution

Abstract

We introduce a self-play framework for semantic equivalence in Haskell, utilizing formal verification to guide adversarial training between a generator and an evaluator. The framework leverages Liquid Haskell proofs for validating equivalence and execution-based counterexamples for inequivalence, organized via a difficulty-aware curriculum. To facilitate this, we release OpInstruct-HSx, a synthetic dataset of ≈ 28k validated Haskell programs. Empirical experiments show that our evaluator transfers effectively to downstream tasks, achieving up to 13.3pp accuracy gain on EquiBench and consistent gains on PySecDB. Ablation studies on the SEQ-SINQ regimes indicate that while inequivalence supervision provides data volume, equivalence proofs are uniquely responsible for the model’s reasoning capabilities. The entire training pipeline and dataset are publicly released on GitHub and Hugging Face respectively.
Original languageEnglish
Title of host publicationFindings of the Association for Computational Linguistics
Subtitle of host publicationACL 2026
EditorsMaria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
Place of PublicationKerrville, TX, USA
PublisherAssociation for Computational Linguistics
Pages32273-32292
Number of pages20
ISBN (Electronic)9798891763951
DOIs
Publication statusPublished - 1 Jul 2026
EventThe 64th Annual Meeting of the Association for Computational Linguistics - Grand Hyatt Manchester, San Diego, United States
Duration: 2 Jul 2026 → 7 Jul 2026
Conference number: 64
https://2026.aclweb.org/

Publication series

NameAnnual Meeting of the Association for Computational Linguistics
PublisherACL
ISSN (Print)0736-587X

Conference

ConferenceThe 64th Annual Meeting of the Association for Computational Linguistics
Abbreviated titleACL 2026
Country/TerritoryUnited States
CitySan Diego
Period2/07/26 → 7/07/26
Internet address

Fingerprint

Dive into the research topics of 'Improving LLM code reasoning via semantic equivalence self-play with formal verification'. Together they form a unique fingerprint.

Cite this