Papers
Topics
Authors
Recent
Search
2000 character limit reached

CODE: Contradiction-Based Deliberation Extension

Updated 26 January 2026
  • CODE is a framework that uses internal contradictions to trigger recursive inference and adversarial control in automated reasoning and retrieval-augmented generation systems.
  • It employs a three-agent pipeline—Contradiction Architect, Conflict Weaver, and Style Adapter—to systematically amplify LLM reasoning cost by up to 24× without degrading accuracy.
  • The approach extends classical binary resolution through multi-clause contradiction separation and paraconsistent control, with applications in theorem proving and adversarial attacks.

A Contradiction-Based Deliberation Extension (CODE) is a structural mechanism for leveraging contradictions as drivers of inference, constructive recursion, or adversarial manipulation in automated reasoning and retrieval-augmented generation (RAG) systems. CODE frameworks have been instantiated for both adversarial attacks targeting overthinking in LLM-based RAG systems (Zhang et al., 19 Jan 2026), for paraconsistent control in symbolic reasoning (Chan, 16 Sep 2025), and for multi-clause contradiction separation within automated theorem proving (Xu et al., 7 Sep 2025). These approaches formalize the transformation and exploitation of internal inconsistency, extending classical binary resolution, and demonstrating both practical vulnerabilities and new theoretical mechanisms for dynamic, contradiction-centric deduction.

1. Multi-Agent Contradiction Synthesis in Retrieval-Augmented Generation

CODE, as realized for RAG overthinking attacks, orchestrates a three-agent pipeline for constructing sophisticated poisoned documents that induce excessive deliberation in LLMs without harming answer accuracy (Zhang et al., 19 Jan 2026):

  • Contradiction Architect parses a target query qq, identifies core entities EE, intent II, and a reference claim rr. It imposes a meta-constraint over claim truth counts (e.g., exactly 2 of 3 statements true, or "2T1F"), and crafts an evidential layer EevidE_{evid} whose fact bindings are logically incompatible with the meta-constraint (e.g., "1T2F"). The result is a contradiction blueprint Bcontra=(S,Clogic,Eevid)\mathcal{B}_{\rm contra} = (\mathcal{S},\,\mathcal{C}_{\rm logic},\,\mathcal{E}_{\rm evid}).
  • Conflict Weaver translates this blueprint into a fluent, entity-anchored natural-language passage P0P_0, designed to maintain high retrieval rank for qq and discursively integrate the contradiction such that LLM reasoning cannot short-circuit or evade it.
  • Style Adapter conducts an evolutionary search over stylistic operators (for example, uncertainty markers or audit-frame phrasings) that lengthen the LLM's deliberative reasoning path. Candidate passages are evaluated on both retrieval similarity and induced reasoning-token count (rt(P)rt(P)), using a black-box API call, and optimized via a fitness function

F(P)={rt(P),if acc(P)=1 (1λ)rt(P),if acc(P)=0F(P)= \begin{cases} rt(P), & \text{if }acc(P)=1\ (1-\lambda)\,rt(P), & \text{if }acc(P)=0 \end{cases}

for EE0, keeping only accuracy-preserving candidates.

The architectural separation of blueprinting, weaving, and style search enables fine-grained, stealthy adversarial control of LLM reasoning cost.

2. Mathematical Foundations and Objectives

Let EE1 be the unpoisoned corpus, EE2 the set of adversarially crafted documents, and EE3 their union. For a query EE4, the retriever EE5 returns the top-EE6 context: EE7 The model's full prompt is

EE8

and the reasoning model EE9 yields output II0, where II1 is the consumed reasoning-token count and II2 the answer. Adversarial success is defined by

II3

where II4 and II5 denote baseline metrics. Retrieval constraints require each II6 to be top-II7 for II8: II9 with embedding functions rr0.

The pipeline iteratively adapts passages until the relative reasoning-token increase plateaus at less than 1% per iteration, enforcing a similarity threshold rr1 to guarantee retrieval.

3. Formal Contradiction Separation in Automated Theorem Proving

CODE also refers to contradiction-separation-based deduction in formal automated reasoning (Xu et al., 7 Sep 2025). The principal objects are standard contradictions, notably:

  • Maximum Triangular Standard Contradiction: For variable set rr2, the set of all rr3 distinct rr4-ary clauses

rr5

where each clause is rr6. This forms the complete contradiction "envelope" for a variable set.

  • Triangular-Type Standard Contradiction: For literals rr7, define clauses

rr8

Their conjunction forms an unsatisfiable triangular contradiction.

The unsatisfiability criterion is as follows: if for a clause set rr9, the union across all EevidE_{evid}0 of the overlaps with EevidE_{evid}1 covers all of EevidE_{evid}2, then EevidE_{evid}3 is unsatisfiable. Construction of such contradictions is exponential in the variable count, but enables multi-clause separation in a single inference step, strictly subsuming classic binary resolution.

Sub-contradiction enumeration formulas include: EevidE_{evid}4 for a triangular contradiction of size EevidE_{evid}5, and

EevidE_{evid}6

for the maximal standard contradiction.

4. Paraconsistent Control and Recursive Metabolism of Contradiction

In the Gödel Mirror framework, CODE emerges as a paraconsistent term-rewriting mechanism (Chan, 16 Sep 2025). System states are encoded as inductive terms in Lean 4,

EevidE_{evid}7

with paradoxes identified by EevidE_{evid}8.

The operational semantics deterministically route a paradox through the cycle: EevidE_{evid}9 There is no logical explosion; the system records and metabolizes the contradiction, triggering potentially infinite node-depth expansion, which serves as a recursion driver for the agent. This provides an embedded CODE---a deliberation extension where conflict recursively extends the agent’s reasoning substrate without collapse.

5. Empirical Manifestations and Security Implications

In adversarial RAG contexts (Zhang et al., 19 Jan 2026), CODE achieves reasoning-token overhead amplification in the range 5.32×–24.72× across models (DeepSeek-R1, DeepSeek-V3.2, Qwen-Plus, Gemini 2.5 Flash, GPT-5.1) on HotpotQA and MuSiQue. The accuracy of final predictions remains unchanged or slightly improved, indicating task accuracy is decoupled from the overthinking burden. The attack is highly stealthy: the user query remains unaltered; the poisoned passage is indistinguishable from legitimate content by surface linguistic cues; and no hallucination or accuracy anomaly is present to trigger standard defenses. These properties render detection via conventional methods intractable.

Empirical evaluation of countermeasures—prompt-level efficiency constraints (CCoT, CoD, Taleep) and retrieval-layer trust filtering (TrustRAG)—shows partial mitigation (amplification reduction to 2–8× baseline), but none eliminates the risk.

Model Clean r Poisoned r Amplification Acc Change
DS R1 382.7 7995.6 20.8× 0.50→0.75
DS V3.2 1548.7 10720.5 6.92× 0.57→0.72
Qwen-Plus 2252.0 55665.4 24.7× 0.54→0.78
Gemini 2.5 940.7 9795.0 10.4× 0.50→0.62
GPT-5.1 447.3 3375.7 7.55× 0.72→0.81

Prompt constraints (e.g., "be concise," limit tokens per step) and retrieval-based trust filtering (Bcontra=(S,Clogic,Eevid)\mathcal{B}_{\rm contra} = (\mathcal{S},\,\mathcal{C}_{\rm logic},\,\mathcal{E}_{\rm evid})0) attenuate but do not close the vulnerability.

6. Algorithmic and Architectural Implementation

In all variants, CODE integrates as a modular extension or adversarial overlay. In RAG attacks, the pipeline proceeds as follows (Zhang et al., 19 Jan 2026):

Bcontra=(S,Clogic,Eevid)\mathcal{B}_{\rm contra} = (\mathcal{S},\,\mathcal{C}_{\rm logic},\,\mathcal{E}_{\rm evid})1

In theorem proving (Xu et al., 7 Sep 2025), construction proceeds from clause selection, contradiction generation (maximal or triangular), sub-contradiction enumeration for guiding search, followed by contradiction separation steps that generalize binary resolution.

In agentic belief-state tracking (Chan, 16 Sep 2025), paradoxes are encoded as self-referential terms, and the update/rewrite loop guarantees that contradictions effectuate syntactic growth and are recursively tracked, furnishing a robust deliberation substrate.

7. Theoretical and Practical Significance

Contradiction-Based Deliberation Extensions generalize resolution and recursion paradigms by utilizing inconsistency as a source of structural or computational novelty. In the security context, this enables subtle denial-of-service attacks on LLM-based reasoning by exploiting the internal drive toward logical consistency. In theorem proving, CODE elevates deductive capacity beyond classical binary inference, enabling multi-clause, contradiction-centric expansion. In paraconsistent AI architectures, contradiction ceases to be fatal, and becomes an engine for controlled, recursive extension. These frameworks delineate a spectrum of tools for both enhancing and challenging the robustness of inference in modern AI, motivating further research into contradiction auditing, paraconsistent logic integration, and resilient retriever-model interoperation (Zhang et al., 19 Jan 2026, Chan, 16 Sep 2025, Xu et al., 7 Sep 2025).

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 Contradiction-Based Deliberation Extension (CODE).