Skip to main content
QUICK REVIEW

[Paper Review] Learning to Disprove: Formal Counterexample Generation with Large Language Models

Zenan Li, Zhaoyu Li|arXiv (Cornell University)|Mar 19, 2026
Mathematics, Computing, and Information ProcessingComputer Science0 citations
TL;DR

The paper trains LLMs to generate formal counterexamples and proofs verified by Lean 4, using a symbolic mutation data-synthesis and a multi-reward expert-iteration framework, achieving substantial gains over baselines.

ABSTRACT

Mathematical reasoning demands two critical, complementary skills: constructing rigorous proofs for true statements and discovering counterexamples that disprove false ones. However, current AI efforts in mathematics focus almost exclusively on proof construction, often neglecting the equally important task of finding counterexamples. In this paper, we address this gap by fine-tuning large language models (LLMs) to reason about and generate counterexamples. We formalize this task as formal counterexample generation, which requires LLMs not only to propose candidate counterexamples but also to produce formal proofs that can be automatically verified in the Lean 4 theorem prover. To enable effective learning, we introduce a symbolic mutation strategy that synthesizes diverse training data by systematically extracting theorems and discarding selected hypotheses, thereby producing diverse counterexample instances. Together with curated datasets, this strategy enables a multi-reward expert iteration framework that substantially enhances both the effectiveness and efficiency of training LLMs for counterexample generation and theorem proving. Experiments on three newly collected benchmarks validate the advantages of our approach, showing that the mutation strategy and training framework yield significant performance gains.

Motivation & Objective

  • Motivate the need for counterexample generation in mathematical reasoning and formal verification.
  • Develop a data-synthesis pipeline to create diverse counterexample problems.
  • Propose a multi-reward training regime to improve both counterexample proposal and formal proof generation.
  • Fine-tune LLMs for counterexample search and autoformalization verification on Lean 4 benchmarks.

Proposed method

  • Formal counterexample generation framed as a two-stage task: informal counterexample proposal followed by formal proof verification in Lean 4.
  • Symbolic mutation (Lean 4 tactic mutate) to create mutated theorems by dropping hypotheses, yielding counterexample problems.
  • Multi-reward expert iteration: train two LLMs (one for counterexamples, one for proofs) with dual rewards from proving mutated theorems and proving dropped hypotheses.
  • Weighted supervised fine-tuning using rewards r_i = alpha * I(proof of mutated) + (1-alpha) * I(proof of dropped hypothesis).
  • Large-scale data synthesis producing ~575K counterexample problems from diverse seed sources (Mathlib, Leanworkbook, MiniF2F, PutnamBench).
  • Evaluation on three benchmarks including For-Counter and Veri-Formalize tasks showing improved pass@k rates and absolute problem solving counts.
Figure 1: Framework of counterexample training. In the data synthesis stage, the symbolic mutation drops the hypothesis of a provable theorem, creating new counterexample problems. In the subsequent expert stage, two rewards are introduced based on whether the generated counterexample can prove the
Figure 1: Framework of counterexample training. In the data synthesis stage, the symbolic mutation drops the hypothesis of a provable theorem, creating new counterexample problems. In the subsequent expert stage, two rewards are introduced based on whether the generated counterexample can prove the

Experimental results

Research questions

  • RQ1RQ1: Efficacy and efficiency of data mutation in generating counterexample problems.
  • RQ2RQ2: Efficacy and efficiency of multi-reward training versus single-reward training.
  • RQ3RQ3: Overall performance gains of the integrated framework on counterexample generation and formal verification tasks.

Key findings

  • Mutation-based data synthesis produced ~575K counterexample problems with mutation ratios 1.65–2.48 and average runtime 0.3–0.71 seconds per seed theorem.
  • Multi-reward training converges faster and achieves higher final pass@k metrics than single-reward training (pass@1: ~49% vs ~43%, pass@4: ~52% vs ~46%, pass@9: ~54% vs ~47%).
  • Fine-tuned model substantially outperforms state-of-the-art reasoning models on three benchmarks for counterexample generation (pass@1, pass@4, pass@9), including an absolute gain of 95, 69, and 63 more solved problems than the strongest baseline on the three benchmarks for pass@1.
  • The integrated workflow achieves superior performance across 1) counterexample identification, 2) verification of autoformalized results, and 3) verification of reasoning steps, with the authors reporting notable improvements over proprietary and open-source provers.
Figure 2: Task of formal counterexample generation. This task requires the LLM first to perform informal reasoning to identify a valid counterexample for the given problem, and then generate the corresponding formal proof, which is automatically verified by theorem provers (e.g., Lean 4).
Figure 2: Task of formal counterexample generation. This task requires the LLM first to perform informal reasoning to identify a valid counterexample for the given problem, and then generate the corresponding formal proof, which is automatically verified by theorem provers (e.g., Lean 4).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.