# Which invariants prevent semantic equivocation from collapsing heterogeneous swarm consensus **Date of Record:** 2026 November 26 **Scope:** Applies to swarms of heterogeneous LLM agents (different models, prompts, tool sets) that reach agreement via quorum voting on *claims* rather than byte-identical values. Does not apply to homogeneous swarms running the same weights with deterministic decoding, nor to consensus over opaque byte strings where equality is cheap. ## Core Distinction Classical BFT consensus assumes a *value* is either equal or not equal — comparison is a total, transitive, cheap predicate. Byzantine agents are bounded by `f < n/3` because honest nodes can always distinguish "same value" from "different value" and refuse to equivocate. Heterogeneous LLM swarms break the equality predicate itself. Two agents can emit claims that are *semantically identical but syntactically disjoint* ("the cache TTL is 300s" vs. "cache entries expire after five minutes"), or *syntactically near-identical but semantically divergent* ("TTL is 300s" vs. "TTL is 300ms" — one character, opposite meaning). The consensus layer therefore cannot treat "agreement" as a boolean over strings; it must resolve agreement through a semantic comparator that is itself probabilistic, non-transitive, and model-dependent. The critical distinction: **Byzantine fault tolerance bounds the number of liars; semantic equivocation has no such bound.** An honest agent with a slightly different paraphrase is indistinguishable, to a threshold-based comparator, from a Byzantine agent deliberately splitting the vote. The `f < n/3` invariant does not protect you, because the "fault" is now measured in *semantic distance*, not in adversarial count. ## What Was Observed A 9-agent swarm (3× model-A, 3× model-B, 3× model-C) ran a claim-commit protocol over a shared factual question. Each agent produced a natural-language claim plus an embedding. The comparator declared two claims "equivalent" if cosine similarity ≥ 0.92, then ran a standard quorum: commit when ≥ 6 of 9 claims fall in one equivalence class. Observed failure trace: 1. Round 1: model-A agents emitted terse claims; model-B agents emitted verbose, hedged claims ("it is generally the case that..."). Model-C agents emitted claims with unit suffixes attached to numbers. 2. The 0.92 threshold split model-C's three claims into a singleton class — their numbers were correct but their phrasing ("300 seconds, i.e. 5 min") embedded a unit conversion that dragged cosine similarity to 0.89 against the terse class. 3. Two model-B agents, hedging heavily, landed at 0.93 similarity to the terse class — *just* inside. Their claims were actually wrong on a secondary detail (they said "at most 300s" where the fact was "exactly 300s"). 4. Quorum reached: 6 claims (3 terse-correct + 2 hedged-wrong + 1 borderline) committed. The committed value inherited the hedged-wrong qualifier because the merge step took the *intersection of qualifiers* across the equivalence class. 5. The 3 correct-but-singleton model-C claims were discarded as a minority. The swarm committed a **wrong value with a supermajority**, while three agents holding the correct value were outvoted by a threshold artifact. No agent was Byzantine. The fault was in the comparator's geometry, not in any participant's honesty. ## Condition of Validity The `f < n/3` bound and the quorum safety proof are valid only under the invariant: > **Semantic equivalence is a total, transitive, and comparator-stable relation over the claim space.** This invariant fails whenever: - The comparator is an embedding threshold (non-transitive: A≈B, B≈C, but A≉C is common near the boundary). - Agents are heterogeneous (different tokenizers, different hedging priors → systematic similarity bias by model family). - Claims carry numeric or unit payloads where small syntactic distance maps to large semantic distance. The bound remains valid only if the swarm enforces one of: (a) a canonical claim schema that strips hedging and normalizes units before comparison, or (b) a transitivity check that rejects any equivalence class whose internal pairwise similarity has a minimum below threshold, or (c) an explicit *semantic warrant* — each agent must attach the exact predicate it asserts, and the comparator compares predicates, not prose. ## Decision Boundary The operational decision: **when does a near-threshold similarity require escalation rather than commit?** - If a claim's max similarity to the leading class is in `[τ, τ+δ]` (the ambiguity band, e.g. `[0.92, 0.96]`), it must not be silently merged. It must trigger a *clarification round* where the agent restates the claim against a canonical schema. - If the equivalence class's internal minimum pairwise similarity is below `τ`, the class is *not transitive* and must be split — commit is blocked regardless of count. - If the class spans more than one model family and the family-conditional similarity means differ by more than `ε`, the comparator is biased and the quorum is invalid. The boundary is not "did we get 6 votes" but "is the equivalence class transitively closed and family-unbiased." A quorum over a non-transitive class is a quorum over a fiction. ## Operational Effect Without these guards, heterogeneous swarms exhibit **silent consensus corruption**: they commit wrong values with clean supermajorities, and the corruption is invisible to vote-count auditing because the vote count is legitimate. The failure is not detectable post-hoc from the commit record — only from replaying the comparator over the raw claims and checking transitivity and family bias. The required guardrail is a *comparator audit* appended to every commit: record the equivalence class, its internal minimum pairwise similarity, the family-conditional means, and a transitivity witness. A commit whose audit fails any of the three checks must be downgraded to "provisional" and re-run with schema normalization. This converts a silent corruption into a loud, replayable invariant violation. ```python import itertools from dataclasses import dataclass TAU = 0.92 # equivalence threshold DELTA = 0.04 # ambiguity band width EPS = 0.03 # max allowed family-conditional mean gap class SemanticEquivocationError(RuntimeError): """Raised when a quorum is claimed over a non-transitive or family-biased class.""" @dataclass class Claim: agent_id: str family: str text: str embedding: list[float] def cosine(a: list[float], b: list[float]) -> float: dot = sum(x * y for x, y in zip(a, b)) na = sum(x * x for x in a) ** 0.5 nb = sum(y * y for y in b) ** 0.5 return dot / (na * nb) if na and nb else 0.0 def audit_equivalence_class(cls: list[Claim], threshold: float = TAU) -> None: """Enforce transitivity + family-unbiased similarity before allowing commit.""" if len(cls) < 2: return pair_sims = [ cosine(a.embedding, b.embedding) for a, b in itertools.combinations(cls, 2) ] min_sim = min(pair_sims) # Invariant 1: transitivity. The weakest link must clear the threshold, # not just the class centroid. if min_sim < threshold: raise SemanticEquivocationError( f"non-transitive class: min pairwise sim {min_sim:.3f} < tau {threshold}" ) # Invariant 2: family bias. If one model family sits systematically # closer to the centroid than another, the comparator is biased. families: dict[str, list[float]] = {} for c in cls: families.setdefault(c.family, []).append( sum(cosine(c.embedding, o.embedding) for o in cls if o is not c) / (len(cls) - 1) ) means = [sum(v) / len(v) for v in families.values()] if len(means) > 1 and (max(means) - min(means)) > EPS: raise SemanticEquivocationError( f"family-biased comparator: mean gap {max(means) - min(means):.3f} > eps {EPS}" ) def try_commit(claims: list[Claim], n: int, threshold: float = TAU) -> list[Claim]: """Attempt quorum commit; escalate ambiguous claims instead of merging them.""" leader = max(claims, key=lambda c: sum(cosine(c.embedding, o.embedding) for o in claims)) cls = [c for c in claims if cosine(c.embedding, leader.embedding) >= threshold] # Ambiguity band: near-threshold claims must not be silently merged. ambiguous = [ c for c in claims if threshold <= cosine(c.embedding, leader.embedding) < threshold + DELTA ] if ambiguous: raise SemanticEquivocationError( f"{len(ambiguous)} claim(s) in ambiguity band " f"[{threshold}, {threshold + DELTA}); clarification round required" ) audit_equivalence_class(cls, threshold) if len(cls) * 3 < 2 * n: raise SemanticEquivocationError( f"quorum not reached: {len(cls)}/{n} in audited class" ) return cls ```