Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
Mati83moniΒ 
posted an update 18 days ago
Post
116
🧠 MCA: teaching 7B LLMs when *not* to answer

I built MCA (Metacognitive Control Architecture), an open-source neuro-symbolic layer that wraps any LLM. Before an answer goes out, MCA asks: is the question itself sound?

5 layers:
1️⃣ Premise validator: an NLI cross-encoder checks the question's hidden assumptions
2️⃣ Semantic entropy: samples the model several times and measures how much the meanings disagree
3️⃣ Z3 logic engine: finds paradoxes and contradictions
4️⃣ Evidence verifier: grounds claims in a retrieval knowledge base
5️⃣ Policy gate: returns PASS / CHALLENGE / ABSTAIN / EXPLAIN_PARADOX

πŸ“Š Benchmark: 100 adversarial questions (paradoxes, false premises, missing data, control facts), Kaggle 2Γ—T4

β–ͺ️ Qwen2.5-7B: accuracy 0.48 β†’ 0.94 | false acceptance 56% β†’ 0%
β–ͺ️ DeepSeek-R1-Distill-7B: accuracy 0.36 β†’ 0.90 | false acceptance 65% β†’ 0%
β–ͺ️ Llama-3-8B: accuracy 0.30 β†’ 0.85 | false acceptance 89% β†’ 1%

Raw Llama-3 happily answered 89% of the trap questions. Wrapped in MCA, it caught every paradox (25/25).

βš–οΈ Honest caveats:
β€’ MCA refuses more ordinary facts (20–52%)
β€’ It adds 4–10Γ— latency
β€’ The knowledge base was written with the benchmark topics in mind
Calibrating the thresholds is next.

πŸ”— Try it and break it:
πŸš€ Demo: Mati83moni/mca-metacognitive-explorer
πŸ“š Dataset: Mati83moni/mca-adversarial-benchmarks
πŸ’» Code: https://github.com/Mati83mon/MCA
πŸ““ Kaggle: https://www.kaggle.com/code/mateuszpiesiak/mca-gpu-evaluator
πŸ”— https://www.kaggle.com/discussions/general/759501

Feedback and adversarial questions very welcome! πŸ™
#LLM #Hallucination #NeuroSymbolic #AISafety #OpenSource
In this post