Anti-hallucination filter: overview Nov 26, 2026 · @Amirxon The Anti-hallucination filter is a deterministic gate that decides what an AI may say: every claim gets True, False or Unknown, together with the fact that decided it. The problem and what the filter does Language models state wrong things with the same confidence as right ones, and a retrieval step alone does not stop it: the model can still contradict the documents it was given. The filter sits between the model and the user. It checks each claim in an answer against a base of verified facts and returns one of three verdicts, with the fact that decided it. The same input always gives the same verdict, so every decision can be audited and replayed. Contextual Logic Contextual Logic scores every claim with one integer K, and the verdict follows from K alone. Verdict Condition on K Meaning True (T) K ≥ 1 supported by a verified fact Unknown (U) K = 0 the fact base says nothing False (F) K ≤ −1 contradicted or known false K is built from the classes of the sources behind a fact: official +3, internal +2, external +1, unverified 0, outdated −2, known false −3. A statement about itself never gains K (the singularity ban), so paradoxes such as "This statement is false." stay at Unknown instead of looping. How a claim is checked The filter has two layers. A language layer turns wording into structure (numbers, names, negation, paraphrase). A logic core then compares that structure with the fact base and decides T, U or F from K. Example with the fact "Refunds are available within 30 days of purchase": Page 1 of 3Anti-hallucination lter: overview Claim Verdict Why You can get a refund within 30 days. T restates the fact You can get a refund within 60 days. F the number contradicts the fact Do you ship to Mars? U no fact covers it This statement is false. U self-reference never gains K Strict mode is a second setting: a claim is confirmed only if it is a verified fact with words removed. A reworded claim then drops from T to U, while a contradicted claim stays F. Results: what each number measures Number What it measures 200,000 / 200,000 Random cases where the logic core matched a separate reference written only from the axioms. checks the implementation, not language understanding. It 0 false statements confirmed Strict mode on 123,868 distorted statements: 13 were admitted (12 true, 1 meaningless fragment), none false. 280 ms Full scan of 100,021 facts, median. about 92–93% Accuracy on the author's own closed Russian fact base. 51.3% Rules only on FEVER, an open-world benchmark (1,500 claims). 87.5% A pretrained language model alone on the same claims; the filter gates it and adds the audit trail. Limits and next steps The filter checks claims against your verified facts, not against the world, so it needs a curated fact base, and strict mode will confirm a wrong fact if it is in the base. The rulebased language layer is sensitive to wording and supports English and Russian only. Page 2 of 3Anti-hallucination lter: overview The next step is a stronger language layer: fine-tuning on FEVER and domain data, fresh test sets reviewed by people who did not write the rules, and pilots in real RAG applications. A 95%+ accuracy is the target for that step and has not been measured yet.