Explainable Reasoning Diagnosis for LLMs
Listen to the summary
Uses a voice available on your device
Audio options
On this page 5 sections
Related concepts 2 concepts
Key Takeaways
- SymDiag achieves a 70.7 F1 score, outperforming all baselines in faithfulness detection.
- The system consistently improves reasoning quality across multiple repair rounds faster than alternative methods.
- It works by localizing and attributing errors to either reasoning flaws or translation noise.
- The approach uses a gold standard dataset of 240 instances for rigorous evaluation.
Summary & Methodology Analysis
SymDiag addresses the lack of transparency in chain of thought reasoning by bridging the gap between natural language outputs and verifiable symbolic logic. The system functions by translating these reasoning chains into symbolic constraints to perform satisfiability and entailment checks. A core innovation is the Self-Auditor, which utilizes dual symbolic encodings to disentangle translation errors, occurring when the model fails to represent the premise correctly, from genuine reasoning errors, occurring when the logical deduction itself is faulty. This allows the system to distinguish between a failure in logic and a failure in linguistic representation. Once an error is localized, SymDiag provides evidence-grounded feedback to trigger a repair process. The system supports iterative improvement, where the feedback drives either local patches to the chain or full chain rewrites. This approach was evaluated using diverse models such as Llama-3.2-1B, GPTOSS-20B, and GPTOSS-120B, with performance scored by an NVIDIA reward model. The research uses manually verified datasets, including AR-LSAT for logical reasoning and GPQA for scientific reasoning, to ensure the diagnostic evidence is reliable and auditable by humans. A primary limitation is that SymDiag functions as an explainable diagnostic system rather than a drop-in replacement for existing reward models or verifiers. Furthermore, the system must navigate the inherent challenge where apparent logic violations are ambiguous and could stem from either reasoning defects or neural to symbolic translation noise. Despite these hurdles, it demonstrates superior faithfulness detection and more efficient repair cycles compared to existing baseline methods.
Interactive System Flowchart
Illustrative Implementation
A short sketch of the paper's core idea, not the authors' own code.
# Illustrative sketch (not from the paper)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# Placeholder symbolic solver (e.g., Z3) interface
from sympy import symbols, Eq, solve
def generate_cot(prompt, model_name="Llama-3.2-1B"):
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
inputs = tokenizer(prompt, return_tensors="pt")
# generate chain‑of‑thought
outputs = model.generate(**inputs, max_new_tokens=200)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
def translate_to_constraints(cot_text):
# Very naive translation: each numeric statement becomes an equation
# In practice this is a neural‑to‑symbolic encoder
constraints = []
for line in cot_text.split('\n'):
if "=" in line:
lhs, rhs = line.split("=")
var = symbols(lhs.strip())
expr = rhs.strip()
constraints.append(Eq(var, eval(expr)))
return constraints
def check_step_satisfiability(constraints):
# Perform step‑level SAT/entailment check
for i, c in enumerate(constraints):
try:
# solve up to current step
sol = solve(constraints[:i+1])
except Exception:
return i, "ReasoningError", c
return len(constraints)-1, "OK", None
def self_auditor(cot_text):
# Dual encoding consistency check to separate TranslationError
constraints = translate_to_constraints(cot_text)
step, err_type, witness = check_step_satisfiability(constraints)
if err_type == "ReasoningError":
return step, "ReasoningError", witness
# If translation produced contradictory constraints, flag TranslationError
# (placeholder logic)
return step, "OK", None
def diagnose_and_repair(prompt):
cot = generate_cot(prompt)
step, err, evidence = self_auditor(cot)
if err != "OK":
feedback = f"Error at step {step}: {err}. Provide missing premise or fix logic."
# Prompt model to rewrite the failing step
repaired = generate_cot(prompt + "\nFeedback: " + feedback)
return repaired
return cot
# Example usage (illustrative)
question = "If all A are B and all B are C, are all A C?"
print(diagnose_and_repair(question))// Illustrative sketch (not from the paper)
const { pipeline } = require('@xenova/transformers'); // placeholder for LLM inference
// Simple symbolic constraint representation
class Constraint {
constructor(lhs, rhs) { this.lhs = lhs; this.rhs = rhs; }
}
async function generateCoT(prompt, modelName = 'Llama-3.2-1B') {
const generator = await pipeline('text-generation', modelName);
const result = await generator(prompt, { max_new_tokens: 200 });
return result[0].generated_text;
}
function translateToConstraints(cotText) {
const constraints = [];
cotText.split('\n').forEach(line => {
if (line.includes('=')) {
const [lhs, rhs] = line.split('=');
constraints.push(new Constraint(lhs.trim(), rhs.trim()));
}
});
return constraints;
}
function checkSatisfiability(constraints) {
// Very naive check: ensure no contradictory assignments
const assignments = {};
for (let i = 0; i < constraints.length; i++) {
const { lhs, rhs } = constraints[i];
if (assignments[lhs] && assignments[lhs] !== rhs) {
return { step: i, error: 'ReasoningError', witness: constraints[i] };
}
assignments[lhs] = rhs;
}
return { step: constraints.length - 1, error: 'OK' };
}
function selfAuditor(cotText) {
const constraints = translateToConstraints(cotText);
const result = checkSatisfiability(constraints);
// Placeholder for translation‑error detection (e.g., inconsistent parsing)
return result;
}
async function diagnoseAndRepair(prompt) {
const cot = await generateCoT(prompt);
const { step, error, witness } = selfAuditor(cot);
if (error !== 'OK') {
const feedback = `Error at step ${step}: ${error}. Provide missing premise or fix logic.`;
const repaired = await generateCoT(`${prompt}\nFeedback: ${feedback}`);
return repaired;
}
return cot;
}
// Example usage (illustrative)
(async () => {
const question = 'If all A are B and all B are C, are all A C?';
const result = await diagnoseAndRepair(question);
console.log(result);
})();
Cross-Examination & FAQs
A deeper dive clarifying mechanics, constraints, and baseline evaluations.
Q1. What is the primary purpose of SymDiag?
SymDiag is a diagnostic system designed to localize, attribute, and repair reasoning failures in large language models.
Q2. Does SymDiag act as a new reward model for LLMs?
No, it is not a better verifier or reward model but an explainable system for diagnosing reasoning processes.
Q3. What kind of results does SymDiag provide?
It provides verifiable evidence, such as counterexamples and inconsistency witnesses, to explain why a reasoning chain failed.
Q4. What is the main challenge the paper identifies regarding verification?
A central challenge is that apparent logic violations can be caused by either genuine reasoning defects or noise generated during the translation from neural to symbolic form.
Q5. What datasets were used to validate the system?
The authors used the AR-LSAT dataset for logical reasoning, the GPQA dataset for scientific reasoning, and a gold set of 240 instances for human-audited evaluation.
Q6. How did SymDiag perform against existing baselines?
It achieved the best faithfulness detection performance across all datasets with an overall F1 score of 70.7.
Q7. Which specific LLM architectures were evaluated?
The study utilized Llama-3.2-1B, GPTOSS-20B, and GPTOSS-120B.
Q8. What role does the NVIDIA reward model play?
The NVIDIA reward model is used to score candidate solutions during the evaluation process.
Q9. How does the performance of SymDiag change over multiple repair rounds?
SymDiag consistently achieves faster and larger gains across repair rounds compared to all other baselines.