NeuroProlog: Multi-Task Fine-Tuning for Neurosymbolic Mathematical Reasoning via the Cocktail Effect
Organizations: Electrical and Computer Engineering, Virginia Tech, Blacksburg, USA
Abstract
Large Language Models (LLMs) achieve strong performance on natural language tasks but remain unreliable in mathematical reasoning, frequently generating fluent yet logically inconsistent solutions. We present NeuroProlog, a neurosymbolic framework that ensures verifiable reasoning by compiling math word problems into executable Prolog programs with formal verification guarantees. We propose a multi-task Cocktail training strategy that jointly optimizes three synergistic objectives in a unified symbolic representation space: (i) mathematical formula-to-rule translation (KB), (ii) natural language-to-program synthesis (SOLVE), and (iii) program-answer alignment. This joint supervision enables positive transfer, where symbolic grounding in formula translation directly improves compositional reasoning capabilities. At inference, we introduce an execution-guided decoding pipeline with fine-grained error taxonomy that enables iterative program repair and quantifies model self-debugging capacity. Evaluation on GSM8K across multiple model scales demonstrates that cocktail training improves accuracy over single-task baselines, with statistically significant gains for most evaluated models. Error analysis reveals scale-associated differences in repair behavior: larger models exhibit more readily correctable errors, whereas smaller models show reduced syntactic errors but persistent semantic failures. These findings suggest that model capacity influences the acquisition of reliable symbolic reasoning and self-correction capabilities.
Figures & tables
| Dimension | PAL/PoT | GSM8K-P | LogicLM | LINC | Self-Dbg | Reflexion | ProSLM | Ours |
|---|---|---|---|---|---|---|---|---|
| KB grounding (train) | P | ✓ | ||||||
| Cross-task transfer | ✓ | |||||||
| 5-class error taxonomy | ✓ | |||||||
| Execution feedback | P | ✓ | ✓ | ✓ | ||||
| Scale-dependent analysis | ✓ |
| Model | Config | Acc. (%) | Exec. (%) | Initial Exec (%) | Corr. (%) | Avg Iter | Sig. |
|---|---|---|---|---|---|---|---|
| Large-Scale Code Model (32B) | |||||||
| Qwen2.5-Coder-32B | Base | 80.29 | 97.04 | 96.4 | 17.0 | 1.07 | — |
| Prolog FT | 85.14 | 99.24 | 98.7 | 41.2 | 1.02 | ||
| Cocktail FT | 85.52 | 99.32 | 90.7 | 92.7 | 1.11 | ||
| +4.85 | +2.20 | +2.3 | +24.2 | 0.05 | |||
| +5.23 | +2.28 | 5.7 | +75.7 | +0.04 | |||
| Model | Base | Cocktail FT | |
|---|---|---|---|
| Qwen2.5-Coder-32B | 40.17 | 42.68 | +2.51 |
| GPT-OSS-20B | 49.37 | 51.46 | +2.09 |
| Llama-3B-Instruct | 9.10 | 10.04 | +0.94 |
| Qwen3-8B | 30.96 | 21.34 |
| Model | Prolog FT | Cocktail FT | Acc. | Exec. |
|---|---|---|---|---|
| Qwen-32B | 85.14 | 85.52 | +0.38 | +0.08 |
| GPT-OSS-20B | 86.12 | 88.34 | +2.22 | +2.00 |
| Qwen3-8B | 63.15 | 64.51 | +1.36 | +1.14 |
| Llama-3B | 21.83 | 27.07 | +5.24 | +15.84 |
| Mean | 64.06 | 66.36 | +2.30 | +4.77 |
| Initial success(%) | Final accuracy(%) | ||
| Prolog FT | 98.7 | 85.14 | |
| Cocktail FT | 90.7 | 85.52 | |
| (KB) | +0.38 | — |
LLM Mathematical Reasoning
Large language model mathematical reasoning studies how AI systems solve, explain, verify, and generalize across mathematical problems and proofs.
See all 270 papersSymDiag: Explainable Diagnosis for LLM Reasoning via Neuro-Symbolic Verification
verification'' signals are not diagnostic: answer matching observes only the outcome, LLM-as-judge provides subjective and non-verifiable critiques, and scalar rewards (e.g., PRMs/RMs) offer little insight into where a multi-step derivation fails.We propose **SymDiag**, a neuro-symbolic framework that **reframes reasoning verification as structured failure diagnosis**. SymDiag translates natural-language CoT into symbolic constraints and performs step-level satisfiability/entailment checks to (i) localize failing steps and (ii) produce verifiable diagnostic evidence, including counterexamples, inconsistency witnesses, and missing-premise indicators. A central challenge is that apparent logic violations'' can be caused either by genuine reasoning defects or by neural-to-symbolic translation noise. SymDiag therefore incorporates a Self-Auditor that disentangles TranslationError from ReasoningError via dual symbolic encodings consistency checks, enabling robust diagnosis under partial observability. Across diverse mathematical, logical, scientific, and general reasoning benchmarks, SymDiag improves detection of unfaithful reasoning and provides substantially more effective feedback for multi-round reasoning repair than outcome-only verification and LLM-based judging, offering a principled foundation for trustworthy and scalable reasoning diagnosis.