Knights-and-Knaves Reasoning Benchmark
- Knights-and-Knaves Logical Reasoning Benchmark is a dataset framework featuring puzzles with agents that always tell the truth or lie, designed to enforce a unique solution.
- It employs formal logic encoding and dynamic puzzle generation, challenging both symbolic model-checking systems and large language models under varied complexity.
- Empirical analyses reveal that LLMs often trade off between memorization and true reasoning, with metrics like LiMem quantifying performance under perturbations.
Knights-and-Knaves Logical Reasoning Benchmark
A Knights-and-Knaves Logical Reasoning Benchmark is a class of formal and natural-language datasets used to assess the reasoning ability of humans and machines when confronted with combinatorial puzzles involving agents who always tell the truth (knights) or always lie (knaves). Such puzzles require models to resolve the truth status of each agent based strictly on a set of logically entangled public statements, with a unique solution enforceable by propositional or first-order logic encoding. Knights-and-knaves benchmarks have been established as canonical tests for symbolic model-checking, natural language inference, and—recently—LLM reasoning and their propensity to memorize training data versus achieving robust generalization.
1. Formal Foundation and Problem Specification
Knights-and-knaves puzzles are defined over inhabitants, each an element of , yielding a -sized search space. Each character issues a single statement , composed of logical atoms (“Person is a knight/knave”) and connectives (and, or, not, , ). The benchmark instance is the tuple . The solution is an assignment , where 0 iff 1 is a knight, such that the biconditional 2 holds for all 3.
The benchmark requires generating instances such that the propositional formula
4
is satisfied by exactly one assignment, enforcing uniqueness. Some variants extend the agent roster to include “Normals” (truth-indeterminate), requiring “exactly-one-role” constraints per agent (Rakshit et al., 2023).
2. Dataset Construction and Generative Methodologies
A canonical methodology, as formalized by Xie et al. (Xie et al., 2024), specifies instances dynamically via the triple 5: 6 (number of characters), 7 (max statement tree depth), and 8 (max fan-out for “and/or”). For each individual 9:
- Sample 0 recursively up to depth 1, choosing randomly among logical connectives and leaf atoms.
- Prune trivial/self-referential statements.
- Validate by brute-force search that the system yields a unique solution; otherwise, reject.
Difficulty is controlled by increasing 2. In recent experiments, 3, 4, with 5 ranging 2–8. For 6 ≥ 3, 1,000 training and 100 test puzzles are used; for 7, 200 training and 100 test puzzles (Xie et al., 2024). Other prominent datasets include:
- 382 hand-collected natural language puzzles (Groza et al., 2021)
- 2,400 synthetic propositional puzzles with complexity gradations (Mondorf et al., 2024)
- 450 puzzles (300 determinate, 150 ambiguous) for NLI, each paired with atomic entailment/contradiction questions (Szomiu et al., 2021)
TruthQuest (Mondorf et al., 2024) systemically varies complexity via statement types: simple (self-reference, accusation), implicative (material implication), and equivalence (biconditional), for 8.
3. Modeling Approaches and Experimental Protocols
Early systems encode each inhabitant and role as separate propositional (or first-order) variables, strictly formulating the mutual-exclusivity and role/utterance dependencies as logic clauses. Automated methods include:
- Brute-force model-checking using Python DSLs and full enumeration for 94 (Rakshit et al., 2023)
- FOL translation (using custom CFG/NER/coref pipelines) followed by model search in Mace4 (Groza et al., 2021)
- Proof-theoretic evaluation (Prover9) for entailment labeling (Szomiu et al., 2021)
Contemporary LLM evaluation proceeds under several regimes:
- Zero- or few-shot instruction prompting.
- Chain-of-thought (CoT) prompting.
- Supervised fine-tuning (Direct FT: supervision on assignment; CoT FT: supervision on stepwise trace+assignment) (Xie et al., 2024).
- Reinforcement learning with verifiable rewards (RLVR) and motivation-enhanced setups (MeRF), where explicit scoring rules are injected into the prompt (Zhang et al., 23 Jun 2025).
Key experimental protocols entail train/test splits (e.g., 1,000/100 per 0 in (Xie et al., 2024)), held-out generalization, and distribution shift via synthetic perturbations at both mathematical (altering statements) and linguistic (renaming, statement order, role inversion) levels.
4. Evaluation Metrics and Diagnostic Tools
Benchmarks use stringent accuracy: an instance is scored correct iff all 1 roles are assigned correctly. For more granular NLI settings, each “Who is a knight?” query is labeled as entailment, contradiction, or unknown (“ambiguous”) using automated theorem provers (Szomiu et al., 2021).
Perturbation-based memorization quantification is central in recent work (Xie et al., 2024):
- Consistency Ratio: 2
- LiMem score: 3 A high LiMem under minimal perturbation indicates pattern memorization rather than reasoning.
Further, per-sample analysis predicts “memorized” vs. “reasoned” decisions using both puzzle-derived features (TF-IDF, token count) and model internal activations.
5. Empirical Findings and Error Taxonomies
Off-the-shelf LLMs, including Llama and GPT variants, rarely exceed 70% accuracy for 4, rapidly decaying to near chance for larger 5 (e.g., 6 for 7) (Xie et al., 2024, Mondorf et al., 2024). Fine-tuning enables near-perfect interpolation but high LiMem scores, indicating that generalization is only partial until explicitly probed (Xie et al., 2024). Motivation-enhanced RL (MeRF) on K&K offers 810–15 percentage point gains over RLVR baselines, provided the model is sufficiently large (Zhang et al., 23 Jun 2025).
Error analyses (using TruthQuest (Mondorf et al., 2024)) expose distinctive LLM failure patterns, including:
- Confusing truth vs. lies (TL)
- Assuming statements are true without checking (TS)
- Misinterpreting logical operators (LO)
- False reproduction, unjustified conclusions, and unfaithfulness to deduction
CoT generally aids smaller 9, but sensitivity to problem depth and operator complexity persists across architectures.
6. Probing Internal Representations and Robustness
Statement verification probing reveals that fine-tuned LLMs can reliably encode support for atomic truth judgments internally, achieving >95% accuracy in layerwise probes (vs. <80% pre-finetuning) (Xie et al., 2024). Logistic classifiers over hidden states yield AUCs of 0.63–0.79 for “memorized” vs. “reasoned” instances, demonstrating explicit encodability of reasoning mode in activations.
Systematic “wrong-answer” or corrupted CoT fine-tuning confirms partial constraint learning even in misaligned supervision, though convergence is slower for highly corrupted signals (Xie et al., 2024).
7. Theoretical and Practical Implications
A principal conclusion is the demonstration that high LLM performance on logic benchmarks may result from superficial memorization unless explicitly stress-tested with perturbation and out-of-distribution settings (Xie et al., 2024). Perturbation-based diagnostic metrics (e.g., LiMem) provide practical, quantitative audits for reasoning versus rote learning.
Recommendations for benchmark and system design include:
- Dynamic on-the-fly puzzle generation with controllable complexity (parameterized by 0)
- Integrated structural and linguistic perturbations during evaluation
- Incorporation of memorization-based metrics
- Exploration of more sophisticated in-context learning and neuro-symbolic architectures capable of explicit hypothetical (“suppositional”) reasoning (Mondorf et al., 2024)
Recent advances, such as MeRF’s in-context injection of the ground truth reward, highlight the potential for prompt-based reward alignment, but expose limitations—such as inability to generalize motivational scaffolding to small models and performance degradation under misaligned motivation (Zhang et al., 23 Jun 2025). Both symbolic and neural approaches benefit from interface with theorem-proving infrastructure for both data generation and verification (Groza et al., 2021, Szomiu et al., 2021).
The Knights-and-Knaves Logical Reasoning Benchmark thus serves as both a crucible for studying the boundaries of neural deductive behavior and a driver for the development of metrics and methodology that precisely distinguish pattern-matching from genuine reasoning.