CLAILGPLApr 18

Improving LLM Code Reasoning via Semantic Equivalence Self-Play with Formal Verification

arXiv:2604.1701087.0h-index: 4
AI Analysis

This work addresses the problem of improving LLM reasoning for code equivalence, particularly for Haskell, with potential benefits for program verification tasks.

The authors introduce a self-play framework using formal verification in Haskell to improve LLM code reasoning, achieving up to 13.3 percentage points accuracy gain on EquiBench and consistent gains on PySecDB.

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 \textbf{OpInstruct-HSx}, a synthetic dataset of $\approx$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.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes