arXiv:2610.02444cs.CLOct 2026

Manuscript Offprint

arXiv:2610.02444

Counterexample Generation via Per-Theorem Symbolic Verifiers: When Imitation Hurts and Reinforcement Repairs

Omar Farouk Zouak, Houssam Eddine Boukhalfa, Soumaya Lakehal, Shiv Katiyar, Samia Nefti-Meziani

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

Abstract

Large language models often solve a theorem forward yet fail to disprove a closely related false one: a falsification gap that supervised fine-tuning does not close and can actively worsen. We frame counterexample generation as constrained witness emission against a deterministic per-theorem Python verifier, and release SYMCE, a corpus of 4,707 false undergraduate-algebra and real-analysis conjectures, each paired with executable verifiers. The verifier also serves as the reward function, making SYMCE a training environment. Training Qwen3-4B with SFT followed by GRPO under this oracle reveals an imitation trap: counterexample-only SFT collapses true-theorem recognition from 0.27 to 0.00, while RLVR with a sparse outcome-only reward repairs this and exceeds the base, to 0.66. The collapse replicates across four seeds and on Gemma-3-4B. Sparse and dense rewards yield statistically indistinguishable in-domain success yet diverge by 33 points on a held-out calibration probe, a dissociation we trace to the partial-credit term. Our 4B model outperforms every evaluated 7B open-weights math specialist, remains competitive with six frontier commercial APIs, and transfers under unchanged prompting to GSM8K, MATH-500 and MMLU-college-math. A human audit of 177 verifier decisions finds 97.7% accuracy. Code, data, verifier modules and annotations: https://github.com/ce-rlvr/SymCE.

1 Introduction

Large Language Models (LLMs) excel at forward mathematical derivation, but struggle significantly with inverse reasoning and generating counterexamples to false claims. Recent benchmarks demonstrate that even frontier models fail at falsification tasks they can easily forward-solve (Sinha et al., 2025; Li et al., 2025). Furthermore, standard imitation learning (SFT) often exacerbates this by inducing format-biases rather than true logical reasoning (Shao et al., 2025).

The natural fix is to train counterexample generation directly, but two obstacles have so far prevented this from becoming a primary objective. First, large-scale counterexample data is scarce: the only widely cited counterexample benchmark, COUNTERMATH, contains 1,216 problems, and its evaluation is mediated by an LLM judge. Second, supervised fine-tuning (SFT) on counterexamples appears insufficient. Counterexample-only training data contains, by construction, only false statements, and we show below that imitation-only training transfers this distribution shift into the policy: a model trained purely to emit counterexamples loses the ability to recognise true statements, and confidently fabricates witnesses on theorems that are in fact true.

We attack both obstacles together. We build SYMCE, a deterministic, large-scale counterexample environment, by hypothesis-dropping over 6,748 undergraduate-level theorems and generating, for each (theorem_id, dropped_hypothesis) pair, an independent Python verifier module that returns one boolean per remaining hypothesis and one for the negated conclusion. The pipeline retains 4,707 records. Evaluation is fully symbolic: the policy emits a one line Python expression, and the verifier returns a boolean tuple. Because the verifier runs in tens of milliseconds, the same substrate serves as the reward function during reinforcement learning, so SYMCE is a training environment and not only a benchmark.

We use this environment to train Qwen3-4B (Qwen Team, 2025) with SFT followed by GRPO under two reward shapes and to evaluate against five 7B open-weights math specialists, six commercial-API frontier models, and four external mathematics benchmarks. In doing so, we uncover

a pathology: imitation-only training on counterexamples collapses the policy’s ability to recognise true theorems, and only verifier-grounded RL with an outcome-only reward repairs it. Partial-credit dense rewards yield equal in-domain success but do not restore calibration; a dissociation that, to our knowledge, has not been previously isolated.

Contributions. We make four main contributions. (C1) The Imitation Trap Pathology. We isolate a calibration failure mode in counterexample-only supervised fine-tuning: Pass@1 on true theorems collapses from 0.27 to 0.00 under the training prompt style, because the policy learns the output form of a counterexample without the negated-conclusion constraint. The collapse reproduces in all four training seeds and on a second model family. (C2) Verifier-Grounded RLVR for Falsification. We demonstrate that Reinforcement Learning with Verifiable Rewards (RLVR), guided by a deterministic symbolic execution interface, repairs this pathology. Furthermore, we show that the partial-credit reward term that is the natural dense shaping for this task structure preserves logical calibration markedly worse than an outcome-only reward, and we identify the mechanism. (C3) Strong Empirical Performance & Transfer. Our Qwen3-4B RLVR model achieves 0.49±0.020.49 \pm 0.02 Pass@1 on in-domain falsification across four seeds, outperforming all evaluated 7B open-weights math specialists and remaining competitive with frontier APIs, while demonstrating strong zero-shot transfer to standard forward-math tasks (MATH-500, GSM8K). (C4) SYMCE: A Deterministic Falsification Environment. To enable this training, we introduce and release a programmatically verifiable corpus of 4,707 false algebraic conjectures with per-theorem executable verifiers, moving beyond the noisy LLM-as-a-judge paradigm.

References (39)