{"path":"research/resonance-db-and-negation.md","content":"# Resonance, negation and what a similarity score can know\n\n*2026-10-24. A paper sent by the founder from a widely shared post, with his request: \"Investigate and\nunderstand this deeply. Could be of import to Deliberus in multiple ways.\" The paper: Aleksandr Listopad,\n\"Wave-Based Semantic Memory with Resonance-Based Retrieval: A Phase-Aware Alternative to Vector Embedding\nStores\", arXiv:2509.09691v1 (21 August 2025), read in full. Nothing here is ruled.*\n\n## The answer\n\nThe paper does not solve negation for existing embeddings. Its \"drop-in\" path, the one the post calls\nfully backward-compatible, gives back cosine similarity under another name, and ranks every pair exactly as\ncosine does. Run on our own embedder below: identical on all eight pairs. The gains it reports appear only\nwhen someone has already written negation into the data as a phase of π, which is the hard part, and the\npaper names no encoder that does it.\n\nWhat it gets right is the diagnosis Deliberus already acts on: a similarity score cannot tell a claim from\nits denial. Deliberus answers that by deciding polarity in a reading of the pair, never in the geometry.\n\n## What the paper does\n\nA vector `v` becomes a complex wave `ψ(x) = A(x)·e^{iϕ(x)}`: amplitude per dimension, and a phase meant to\ncarry \"contextual modulation\" (negation, modality, epistemic stance). Similarity is a *resonance score*: the\nenergy of the sum of two waves over their combined energy, times a factor `R` that penalises unequal\nenergies (its equations 2–3). Its appendix proves the score lies in [0, 1], is symmetric, is 1 only for\nidentical waves and 0 for exact opposites, and reduces to `(1 + cos θ)/2` for real vectors of equal norm\n(its Theorem 5). Storage is a Java system, ResonanceDB, scanning every pattern without an index.\n\nExisting embeddings enter by the *sign–phase mapping*: amplitude `|v(x)|`, phase 0 where `v(x) ≥ 0` and π\nwhere it is negative. But `|v(x)|·e^{iπ} = −|v(x)| = v(x)`. The mapping returns the original real vector,\nso Theorem 5 applies: for normalised embeddings the score is `(1 + cos)/2`, a fixed monotone function of\ncosine. Nothing about negation can enter this way.\n\n## What its experiments show\n\nTwo bases (*happy*, *good*) and four operators (negation, a phase shift, intensify, attenuate), with\n\"synthetic patterns [that] varied phase to isolate phase effects\". Resonance gets P@1 = 1.0 on every\noperator and cosine about 0.0. The negated pattern was made by shifting phase, so the experiment shows that\na phase-sensitive score detects a phase shift written into the data. Its cosine side reports a distance\nnear 0.25 for negation, which is not what cosine gives for a vector and its exact opposite (distance 1), so\nthe cosine baseline was computed on something other than the waves the resonance score saw (inferred from\nthe reported numbers; the paper does not say what). No real negated text was embedded, no benchmark (NevIR,\nor any other) was run, and no code is linked; the system is \"source-available\" under a licence that\nrequires payment once used commercially.\n\n**Scale.** The body reports 500,000 patterns of length 1,024 at 135 ms on average per query, on a 12-core\nCPU, by full scan. The arXiv abstract page says \"millions of patterns with millisecond latency\"; the PDF\nmeasures neither. The post goes further (\"killed vector databases\", \"quantum mechanics\", \"millions of\npatterns in milliseconds\", \"you just drop it in\"), none of which the paper claims in its body. No outside\ncritique, replication or benchmark exists that a search could find\n([search 2026-10-24](https://arxiv.org/abs/2509.09691); one later paper cites it as background,\n[arXiv:2511.11848](https://arxiv.org/pdf/2511.11848)).\n\n## Run on our embedder\n\n`resonance-db-and-negation/cases.py`, Qwen3-Embedding-4B (the model Deliberus uses), output in\n`run-2026-10-24.jsonl`:\n\n| Pair | cosine | resonance, drop-in |\n|---|---|---|\n| happy / not happy | 0.778 | 0.889 |\n| happy / sad | 0.781 | 0.891 |\n| happy / joyful | 0.872 | 0.936 |\n| happy / a recipe for bread | 0.410 | 0.705 |\n| *Sweden should establish an AI safety institute* / *… should not establish …* | 0.846 | 0.923 |\n| the same claim / *An AI safety institute would help Sweden assess frontier models* | 0.862 | 0.931 |\n| *Sverige bör inrätta ett institut för AI-säkerhet* / *… bör inte inrätta …* | **0.890** | 0.945 |\n| *The vaccine reduces hospitalisations* / *… does not reduce …* | 0.821 | 0.910 |\n\nEvery resonance figure equals `(1 + cos)/2` to four decimals. The Swedish denial of the institute claim\nsits closer to it than any other pair in the table. A phase of π on the negation would score 0, but only if\nsomething put it there.\n\n## What the corpus already holds\n\n- **The blindness, measured and placed**: `soft-canonical-clustering-and-reversible-merge-semantics.md`,\n  the 2026-08-31 addendum. NevIR (EACL 2024) found nearly all retrieval systems at or below chance on\n  negation pairs; a 2026 cross-encoder study found bi-encoders failing about 100 % of the time. So the\n  seven keys have an **opposes** key, and the keeper decides polarity per pair.\n- **Why the blindness is a feature at the candidate stage**: same section. High-cosine opposites are\n  exactly what should reach the keeper. A score that pushed *not happy* to 0 would hide the attack\n  candidates auto-connect exists to find: a denial is about the same thing, which is why it is relevant.\n- **Embeddings for discovery, never as authority on meaning**: `embeddings-tension-and-ai-slop.md` and\n  `why-representations-converge-and-whether-minds-do.md`.\n- **Hedging defeats every model class** (48–92 % failure), noted in the same addendum; the founder's\n  ruling stores a hedge as the author's stance, never as strength (ledger AM6).\n\n## Where it bears on Deliberus\n\n1. **It confirms the architecture, from the opposite direction.** The paper wants the operator inside the\n   vector; Deliberus keeps it outside, as a claim's own text, a link's type (attacks), a voter's exact\n   negation (AS3, *disagreeing makes the voter a holder of its exact negation*) and a hedge as stance (AM6).\n   An explicit operator can be read, argued and corrected; a phase cannot be attacked by a reader.\n2. **Its last sentence is our ontology stated as a wish**: \"phase can encode roles, hypotheses, or\n   epistemic status\". Those are the stance, the claim kind and the link type, already stored as claims and\n   properties that people can see. This is the inspectability conviction applied to retrieval.\n3. **The post is a specimen of the scrutiny gap.** A careful seven-page paper with stated limits became,\n   one hop later, \"killed vector databases\" and \"solves the exact blind spot of modern AI\". Every one of the\n   inflated claims is checkable against the paper in minutes, which nobody sharing it did. It is the\n   reported-speech problem (a source rendered with more conviction than it holds) and a ready dogfood case:\n   the post and the paper mapped side by side would show each claim's drift.\n4. **One real idea survives for later**: representing an operator as a transformation of the content\n   rather than as a new point. Knowledge-graph embeddings (RotatE, ComplEx, which the paper cites) do this\n   with relations learned from data. If Deliberus ever wants a geometry that separates a claim from its\n   denial, it would come from training on the graph's own attack links, not from a hand-set phase.\n\n## Recommendations\n\n1. **Nothing to adopt.** The drop-in changes no ranking, and the version that could helps only where the\n   negation is already known, where the keeper reads it directly.\n2. **Keep the negation pairs above as a fixture** for candidate recall: each denial must still be fetched as\n   a candidate for its claim (cosine 0.82–0.89 against the 0.65 net), and the keeper must answer *opposes*.\n   Cheap, and it guards against a future \"polarity-aware\" retrieval silently dropping attack candidates.\n3. **If he wants the dogfood case**: map the post and the paper as two sources, so the drift of each claim is\n   on the graph. Unbuilt, his call.\n\n## The test, built (2026-10-24)\n\nOn his word (*\"Yes, add the negation pairs as a test: each denial must be fetched as a candidate for its\nclaim, and the keeper must answer opposes.\"*): the five pairs that are a claim and its denial or contrary\nare `tests/fixtures/microtask_cases/negation-pairs.json`. `tests/test_negation_recall.py` checks on the live\nembedder that each clears auto-connect's similarity threshold, read from the code (all five pass; skips\nwhere the embedder does not answer). `scripts/run_keeper_cases.py` asks the keeper, one model call a\ncase, and is run by hand since a test never reaches a model. First run: **5 of 5 answered `opposes`**, on\nGemini's free tier through three of its fallback models.\n\n## A public contradiction model against the keeper (2026-10-24)\n\nHis words: *\"Yes, download the multilingual NLI model and compare it with the keeper on the negation pairs plus some harder opposition pairs without a negation word.\"* and, mid-run, *\"Can we also test running the keeper with Haiku or Qwen or whatever the model-choice docs recommended before?\"* Sixteen pairs in `tests/fixtures/microtask_cases/negation-pairs.json`: five denials, six oppositions with no negation word, five controls that must not read as opposed. The NLI model (`nli_compare.py`, both orders, the larger contradiction probability kept) ran on the Mac's CPU; the keeper (`scripts/run_keeper_cases.py`) ran on Gemini's free tier and on Claude Haiku 5.5 (Anthropic directly, low effort). Qwen 3.8 Flash, the other model `pass-quality-and-the-choice-of-model.md` § 10d named, could not be asked: the OpenRouter account is out of credit.\n\n| Pair | Expected | NLI model (p contradiction) | Keeper on Gemini | Keeper on Haiku 5.5 |\n|---|---|---|---|---|\n| happy-not-happy | opposes | contradiction (0.969) | opposes | unrelated |\n| happy-sad | opposes | contradiction (0.997) | opposes | unrelated |\n| institute-en | opposes | contradiction (0.983) | opposes | cant_tell |\n| institute-sv | opposes | contradiction (0.975) | opposes | unrelated |\n| vaccine | opposes | contradiction (0.999) | opposes | opposes |\n| existing-vs-new | opposes | contradiction (0.985) | opposes | cant_tell |\n| wage-raise-freeze | opposes | contradiction (0.993) | opposes | cant_tell |\n| remote-raises-lowers | opposes | contradiction (0.992) | opposes | opposes |\n| nuclear-safest-dangerous | opposes | contradiction (0.996) | opposes | opposes |\n| karnkraft-sv | opposes | contradiction (0.914) | opposes | unrelated |\n| alibi | opposes | neutral (0.46) | opposes | opposes |\n| support-not-opposition | not opposes | neutral (0.001) | overlaps | cant_tell |\n| paraphrase | not opposes | entailment (0.0) | unrelated | same |\n| topic-only | not opposes | neutral (0.001) | unrelated | unrelated |\n| hedge | not opposes | entailment (0.002) | a_contains_b | b_contains_a |\n| two-reasons-same-side | not opposes | neutral (0.011) | unrelated | cant_tell |\n\n- **The NLI model**: 15 of 16, no false opposition among the controls. It missed only the alibi (Stockholm against Gothenburg on one night), which takes knowing that one person cannot be in both: 0.46, just under its line. It also read the paraphrase and the hedge as entailment, which the keeper's *same* and *contains* need.\n- **The keeper on Gemini**: 16 of 16 on opposition, the alibi included. Two other answers are wrong though the test passes them: the paraphrase came back *unrelated*, not *same*, and the two reasons on one side *unrelated*, not *overlaps*.\n- **The keeper on Haiku 5.5**: 5 of 11 oppositions. It answered *unrelated* or *cant_tell* to four flat denials (*happy* / *not happy*, both institute pairs, the Swedish nuclear pair). It got the paraphrase right and the hedge's direction wrong (`b_contains_a`). Read with the instructions (`keeper-instructions-as-sent-2026-10-24.txt`): the gate asks first for *evidential bearing* through a chain of claims, and a flat denial has no chain, since it bears on the claim directly. That is a question for the instructions before it is one about Haiku (the principle that an error rate belongs to the task as written first); not tested further. Two open ledger rows already propose the repair: W7 (the seven keys asked as four yes/no questions, one of them *could both be true*) and Z4 (the sameness answer computed from yes/no questions by a fixed table). A flat denial answers *could both be true* with no chain at all.\n\n**And a recall gap the comparison found**: two of the six oppositions with no negation word fall below auto-connect's similarity threshold of 0.65 on our embedder, FOI's *existing structures* against *a new institute* (0.612) and *raise the minimum wage* against *freeze it* (0.577). Auto-connect would never fetch either pair, so neither the keeper nor any pre-sorter would see it. This is the standing warning that a low cosine is weak evidence of unrelatedness, now measured on the institute map's own claims. `tests/test_negation_recall.py` holds both as strict expected failures; what to do about it (a lower threshold for pairs across sources, or candidates fetched by a second route) is not decided.\n\n**What the NLI model can pre-sort, on this evidence**: (1) contradiction, put first in the keeper's queue as likely *opposes*; (2) entailment both ways or one way, flagged as likely *same* or *contains*. What it cannot sort is *overlaps* against *unrelated*: a reason for the claim, a topic-only pair and two reasons on one side all came back neutral, so every neutral pair still goes to the keeper. It reorders the queue and never drops a pair. Sixteen pairs written by Claude are a first reading, not a measured rate; the measurement is the keeper's recorded verdicts since 6 October, read by the NLI model, held out by debate.\n\n## Why two oppositions fall below the bar, and the hold on keeper runs (2026-10-24; unruled)\n\n**The hold, his words**: *\"Top up now enabled. But we shouldn't run more keeper tests until I'm happy\nwith updated keeper pass prompting and the theory behind that etc.\"* No keeper calls are made until he\nsays so.\n\n**His theory of the recall gap, verbatim**: *\"That seems to me like it's based on inferential distance.\nOr opposing proposals that propose ideas that are based on partly shared, partly unshared premises,\ndifferent 'takes' on a question. They might diverge in their approach due to multiple differing\npremises/reasons or estimations of the strength/truth of those premises/reasons, at some recursive depth\nof the graph. This seems like a good opportunity to first explicate and then fold. That is... Count the\nshortest chain linking them. We'd have to start from a lower bar, a wider swath of possible pairings in\nthe graph. Count the shortest chain/imagine what the subgraph between them would look like (or does look\nlike, in the future at least, if we have/will have that graph data, it should be included as grounding\nfor the model of the pass/es), diligently instructed by its instructions to be extremely careful about\nspelling out each smallest step/inference and imagining how complex/far the connection is. Am I onto\nsomething?\"*\n\n**Claude's reading, unruled.** Both pairs are rival answers to one question (*who should hold AI safety\nwork in Sweden?*; *what should happen to the minimum wage?*). Their relation to each other is one step:\nthey exclude each other. What is far apart is their grounds, which part at some depth. So the theory\nholds for the grounds and needs one change for the finding:\n\n- **Finding the pair**: a lower similarity bar for every pair multiplies the pairs read, mostly unrelated\n  ones. Rival answers are found more cheaply through the question they answer, a node of its own (AP1,\n  ruled 2026-10-20), and through links already in the graph (AX2, open).\n- **Reading the pair**: explicate each stance down to what it rests on (AX3, ruled 2026-10-23), find\n  where the two part, fold what they share (AX4, open; AX8, ruled). The keeper already writes the\n  shortest chain before its key (built 2026-10-18).\n\n**The six earlier proposals on the keeper's prompting, read again after his theory** (his question:\n*\"Do you still hold these proposals after reading my latest message? I just wanna make sure.\"*): all\nsix hold, and Z6's answer key gains rival answers to one question (the two pairs above). ⚠ The reply\nthat said so also said AX2 widens *from direct links to the path between the claims*: withdrawn the same\nhour. AX2 is the independence pass's (two reasons for one claim), not the keeper's, and it already reads\npaths of up to four links. **He ruled the six for now** (ledger T5, Z6, AM2, AX2, Z3, AL2, his words in\neach row), *\"unless our thinking re the other questions here ends up contradicting these proposals\"*.\n\n**Is the keeper's chain one inference per step? (his question, verbatim)**: *\"Yes but is it provably only\nmaking one logical inference step between each link in the chain? That's only for deductions ofc... I'm\njust thinking it's liable to make irresponsibly large leaps, since LLMs and humans seem prone to do that a\nlot\"*. No. The keeper's instructions ask for *\"one inference per step\"* and nothing checks it; the only\ncheck in code refuses `overlaps` when the chain is longer than two steps or no step is asserted\n(`keeper.resolve`). And its steps are bare claims with no rule named, so a leap can hide inside one. The\nsmallest-step rule he ruled for steps a machine writes under a link (AG14, 2026-10-14) gives the missing\nform and the missing check: each step is one stated rule applied once to one stated case, and a second\nreading asks for a situation where every sentence holds and the step's end fails, then whether any\nsentence could be removed. On 25 steps that question found a gap in 13 where *is anything missing?* found\nnone (`the-chain-inside-a-link.md` § 11). For a step that is not a deduction, a situation where the end\nfails is expected, so the rule must carry its scope in its words, normic or statistical (AT1, AT2), and\nthe check asks whether the failure is one the rule names. This is the proposed answer to his doubt about\n*its object* (AM2): the object is the chain written to that floor, and the check is the refutation\nquestion. Proposed, unruled. His instruction to the institute map's session the day before was the same\nstandard: *\"think about the smallest-step / link in the chain / inferences that should be spelled out in\nthe map. Don't make leaps that are irresponsibly large.\"*\n\n**What grounding can and cannot teach (his words)**: *\"With an unsaturated graph this will likely be of very\nlittle help. It's like the difference between educating a person about spycraft vs showing them a spy\nthriller. They'll get some of the gist from the movie, but they won't understand everything from inside,\nfrom the first principles, formal logic, analytic rigor, all that. Do you understand?\"* and *\"(even with\na fully saturated graph that exemplifies structured argumentation perfectly, hypothetically)\"*. So the\npass is taught the method (the floor, the refutation check, the definitions of its keys), not shown the\ngraph's examples. Graph contents enter only where code can act on them as facts (AX2's links), never as\nthe model's lesson. Proposed, unruled: this narrows AM9 (the keeper reads a pair in its game) to giving the pair's own\nsource passages, which say what each claim means, not how to reason about it.\n\n**The decision model's four questions (W7) are to be tried after the theory is settled**, his words:\n*\"We should try it, after we settle this theory stuff.\"*\n\n## What would make phase pay (his question, 2026-10-24; unruled)\n\nHis words: *\"What other \"modes\" could be of use for us, briefly? And what data could we produce that is\nrequired for wins here?\"*\n\n- **The paper's three modes**: sign-phase (cosine renamed), zero-phase (the same, for non-negative\n  vectors), and phase supplied by the encoder or by code. Only the third gains anything, and only where\n  someone already knows the operator.\n- **A fourth, from the work it cites (RotatE, ComplEx)**: learn the operator from labelled pairs. In plain\n  terms, a second vector per claim beside the topic vector: the topic vector keeps a claim and its denial\n  close, so the denial is still found, while the second vector is trained to point the opposite way for\n  them. Topic is the paper's amplitude and stance its phase, but learned rather than hand-set.\n- **The data it needs is what Deliberus already writes**: the keeper's recorded verdicts (`opposes`,\n  `same`, `contains`, `overlaps`, all in the record of model calls since 2026-10-06), attack and support\n  links between claims, a voter's exact negation (AS3), and the definite form of every hedged claim beside\n  its hedge (AM6). Each is a labelled pair of the kind such a model is trained on.\n- **Would it generalise? (his question the same day: *\"Does this generalize and scale still, even if it trains on existing data? Doesn't overfit/scope to only some data, then?\"*)** Trained on our labels alone, probably not well. They are a few hundred pairs (about 340 challenge links between claims from texts or people, counted 2026-10-08) from a handful of debates, and a small set teaches the surface cue: models trained on contradiction data learn that *not* means opposite and miss opposition without a negation word, which in our graph is the interesting kind (*rely on existing agencies* against *establish an institute*). So the order is reversed: start from a stance or contradiction model trained on large public data, and use our labels to **test** it, held out by debate, never to train it first. Our labels then scale as the graph grows, as a check rather than as the teacher. And it may only order pairs for the keeper, never drop one, since a pair it hides is a challenge nobody reads.\n- **Which public model (his question: *\"Is there such a model? What kind of model are we talking about here?\"*)**: a natural-language-inference classifier, which reads two sentences together and answers *entailment*, *neutral* or *contradiction*, roughly the keeper's *contains*, *overlaps* or *unrelated*, and *opposes*. The multilingual one checked on 2026-10-24 is `MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7` (about 0.3 billion parameters, MIT licence, trained on 3.3 million pairs in 27 languages including Swedish, 0.87 accuracy on English test pairs and 0.50 on the adversarial ANLI set; no Swedish figure reported). It classifies a pair rather than giving each claim a vector, so it would run on the pairs cosine already fetched, on a CPU. Untested here.\n- **What it would buy**: a cheap first sorting of candidate pairs before the keeper reads them (fewer model\n  calls), and the map's halves pre-grouped by side. It would stay a proposal under *propose, never assert*:\n  the keeper still decides. Not proposed for now; nothing in the reviews waits on it.\n\n## Sources\n\n- The paper: [arXiv:2509.09691v1](https://arxiv.org/abs/2509.09691), PDF read in full.\n- NevIR and the cross-encoder study, as cited in `soft-canonical-clustering-and-reversible-merge-semantics.md`.\n"}