LGMT: A Tool for Testing the Logical Reasoning Reliability of LLMs
Organizations: School of Automation Science and Electrical Engineering, Beihang University Xueyuan Road, Haidian District, Beijing, 100191, China
Abstract
Large Language Models (LLMs) increasingly serve as reasoning components in modern software systems, yet a model that answers a logical query correctly can contradict itself when the same problem is restated in an equivalent form. Static benchmarks evaluate queries in isolation and therefore fail to expose such inconsistencies. To address this limitation, we present LGMT, an open-source tool that detects reasoning inconsistencies through metamorphic relations grounded in first-order logic. Given a source test case in premise-conclusion form, LGMT generates logically equivalent follow-up cases and checks whether the model's entailment predictions agree across the pair, without ground-truth labels. The tool provides 20 built-in metamorphic relations, supports custom ones verified by the Z3 theorem prover, and runs from a CLI or a web studio, including an offline mock mode requiring no API key. Across six widely used LLMs on a bundled benchmark of 3,091 metamorphic groups, LGMT reveals inconsistency rates ranging from 20.84% to 29.44%. LGMT is publicly available on GitHub at https://github.com/MaxwelsDonc/lgmt-tool, with a demonstration video at https://youtu.be/gou4opptu1U.
Figures & tables
| Model | Acc static | Acc cons | MVR | HDR |
|---|---|---|---|---|
| GPT-5.2 | 73.34% | 56.84% | 26.76% | 16.50% |
| Claude 4.5 Sonnet | 73.53% | 60.97% | 20.84% | 12.56% |
| Llama 3.3 70B | 65.38% | 52.38% | 25.43% | 13.01% |
| DeepSeek Chat | 69.91% | 55.65% | 24.72% | 14.27% |
| o4-mini | 69.36% | 56.20% | 22.06% | 13.17% |
| DeepSeek Reasoner | 72.44% | 56.71% | 29.44% | 15.72% |
Reasoning Consistency in Language Models
Reasoning consistency in language models measures whether conclusions and reasoning remain reliable across equivalent prompts, samples, steps, and contexts.
See all 122 papers