When Form Changes but Logic Doesn't: Building Logic-invariant LLMs through Logical Structure
Organizations: Dartmouth College · Carnegie Mellon University · New York University
Abstract
Large language models (LLMs) have achieved strong performance across diverse reasoning tasks, yet it remains unclear whether this performance reflects an understanding of underlying logical structure or a reliance on shallow semantic cues. A key indicator of such understanding is whether models treat logically equivalent inputs consistently, producing the same predictions despite differences in expression. Through systematic evaluation on curated data, we show that even strong LLMs often fail this test: they do not consistently preserve predictions across logically equivalent inputs and generalize poorly to unseen logical forms. To address this limitation, we propose LoGIcal STructure-guided reasoning (LoGIST), a framework that guides LLM reasoning with explicit logical structure. LoGIST maps each input instance to a decision diagram, a directed acyclic graph that captures the underlying logical structure, and encodes this graph into a logical embedding that conditions the LLM's reasoning process. Across multiple training settings, LoGIST reduces inconsistency under logical equivalence and improves generalization to unseen logical forms, suggesting that logical invariance is a useful target for building more robust and generalizable logical reasoning in LLMs.
Figures & tables
| Model | Mixed |
|---|---|
| Gemini-2.5-flash-lite | 67.7 |
| Gemini-2.5-flash-lite(w.Prompt) | 70.4 |
| Qwen3-Next-80B | 66.9 |
| Qwen3-Next-80B(w.Prompt) | 66.1 |
| Methods | Mat.Impl. | Double Neg. | De Morgan | Mixed |
|---|---|---|---|---|
| SFT | 25.7% | 18.4% | 17.9% | 19.0% |
| SFT(LoGIST) | 20.1 % | 14.2 % | 13.1 % | 15.8 % |
| PPO | 31.5% | 29.7% | 32.0% | 30.6% |
| PPO(LoGIST) | 15.3 % | 15.9 % | 15.9 % | 13.9 % |
| GRPO | 38.1% | 32.5% | 34.7% | 37.1% |
| GRPO(LoGIST) | 19.9 % | 20.1 % | 22.4 % | 16.6 % |
| LLM | Methods | Synthetic | FOLIO | ProverQA | ||||
|---|---|---|---|---|---|---|---|---|
| Base | Mat.Impl. | Double Neg. | De Morgan | Mixed | ||||
| Llama3.1-8B-ins | + SFT | 0.683 | 0.588 | 0.625 | 0.631 | 0.635 | / | 0.598 |
| + SFT( LoGIST) | 0.693 | 0.604 | 0.650 | 0.647 | 0.651 | / | 0.638 | |
| + PPO | 0.710 | 0.614 | 0.621 | 0.590 | 0.618 | 0.606 | 0.568 | |
| + PPO( LoGIST) | 0.708 | 0.655 | 0.657 | 0.645 | 0.642 | 0.645 | 0.602 | |
| + GRPO | 0.702 | 0.608 | 0.612 | 0.600 | 0.627 | 0.621 | 0.626 | |
| Method | Base | M.I. | D.N. | D.M. | Mixed |
|---|---|---|---|---|---|
| SFT | 0.683 | 0.588 | 0.625 | 0.631 | 0.635 |
| SFT + Linear ROBDD | 0.674 | 0.594 | 0.642 | 0.615 | 0.639 |
| SFT + LoGIST | 0.693 | 0.604 | 0.650 | 0.647 | 0.651 |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Llama-3.1-8B-Ins | Qwen2.5-3B-Ins |
|---|---|---|
| w/o LoGIST | 58.20 (token/s) | 56.76 (token/s) |
| w/ LoGIST | 56.99 (token/s) | 55.70 (token/s) |
| Rule of Replacement | Tautology |
|---|---|
| Material implication | |
| Double negation intro | |
| De Morgan’s law 1 | |
| De Morgan’s law 2 |
| Method | Base | M.I. | D.N. | D.M. | Mixed |
|---|---|---|---|---|---|
| GRPO + LoGIST (Gold FOL) | 0.730 | 0.654 | 0.661 | 0.647 | 0.668 |
| GRPO + LoGIST (Constructed FOL) | 0.722 | 0.649 | 0.650 | 0.645 | 0.656 |
| Vanilla GRPO | 0.702 | 0.608 | 0.612 | 0.600 | 0.627 |
| Methods | Base | Mat.Impl. | Double Neg. | De Morgan | Mixed |
|---|---|---|---|---|---|
| w/ Contrastive | 0.655 | 0.604 | 0.607 | 0.598 | 0.620 |
| w/o Contrastive | 0.651 | 0.571 | 0.584 | 0.578 | 0.595 |
| GRPO Baseline | 0.645 | 0.570 | 0.577 | 0.572 | 0.590 |
LLM Reasoning
Large language model reasoning studies how models solve multi-step problems, verify intermediate steps, and use computation or tools reliably.
See all 931 papers