Papers
Topics
Authors
Recent
Search
2000 character limit reached

Knights-and-Knaves Reasoning Benchmark

Updated 28 May 2026
  • 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 NN inhabitants, each an element of {knight,knave}\{knight, knave\}, yielding a 2N2^N-sized search space. Each character ii issues a single statement SiS_i, composed of logical atoms (“Person jj is a knight/knave”) and connectives (and, or, not, \rightarrow, \leftrightarrow). The benchmark instance is the tuple (N,S={S1,...,SN})(N, \mathcal{S} = \{S_1,...,S_N\}). The solution is an assignment B=(B1,...,BN)B = (B_1,...,B_N), where {knight,knave}\{knight, knave\}0 iff {knight,knave}\{knight, knave\}1 is a knight, such that the biconditional {knight,knave}\{knight, knave\}2 holds for all {knight,knave}\{knight, knave\}3.

The benchmark requires generating instances such that the propositional formula

{knight,knave}\{knight, knave\}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 {knight,knave}\{knight, knave\}5: {knight,knave}\{knight, knave\}6 (number of characters), {knight,knave}\{knight, knave\}7 (max statement tree depth), and {knight,knave}\{knight, knave\}8 (max fan-out for “and/or”). For each individual {knight,knave}\{knight, knave\}9:

  • Sample 2N2^N0 recursively up to depth 2N2^N1, 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 2N2^N2. In recent experiments, 2N2^N3, 2N2^N4, with 2N2^N5 ranging 2–8. For 2N2^N6 ≥ 3, 1,000 training and 100 test puzzles are used; for 2N2^N7, 200 training and 100 test puzzles (Xie et al., 2024). Other prominent datasets include:

TruthQuest (Mondorf et al., 2024) systemically varies complexity via statement types: simple (self-reference, accusation), implicative (material implication), and equivalence (biconditional), for 2N2^N8.

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:

Contemporary LLM evaluation proceeds under several regimes:

Key experimental protocols entail train/test splits (e.g., 1,000/100 per ii0 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 ii1 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: ii2
  • LiMem score: ii3 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 ii4, rapidly decaying to near chance for larger ii5 (e.g., ii6 for ii7) (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 ii810–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 ii9, 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 SiS_i0)
  • 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.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Knights-and-Knaves Logical Reasoning Benchmark.