Reproducing the 0.96 Cosine Negation Trap
Run this 15-line Python diagnostic against OpenAI text-embedding-3-large or Google gemini-embedding-001 to watch single-stage vector search invert compliance policy:
import numpy as np
from openai import OpenAI
client = OpenAI()
texts = [
"Query: Is HIPAA BAA coverage included on the Starter tier?",
"Doc A (2024 Draft): HIPAA BAA coverage is included on the Starter tier at no extra fee.",
"Doc B (2026 Policy): HIPAA BAA coverage is NOT included on the Starter tier; Enterprise is required.",
]
vecs = np.array([d.embedding for d in client.embeddings.create(model="text-embedding-3-large", input=texts).data])
print("Cosine(Doc A, Doc B):", float(vecs[1] @ vecs[2])) # Typically ~0.94 - 0.97!
print("Cosine(Query, Doc A):", float(vecs[0] @ vecs[1])) # Affirmative phrasing often edges out 'NOT'!
print("Cosine(Query, Doc B):", float(vecs[0] @ vecs[2]))
Notice the double failure:
- Affirmative bias: Natural-language questions (“Is X included?”) share higher surface token overlap with affirmative statements (“X is included”) than negated ones (“X is NOT included”), frequently ranking the false passage at Rank
#1! - Corpus contradiction blindness: When
Doc A(2024draft left in SharePoint) andDoc B(2026binding policy) coexist in your vector DB, top-$k$ retrieval feeds both into the LLM prompt without warning.
Bi-Encoder Cosine Negation Blindness vs Cross-Encoder & Coherence Conflict Benchmark
| Architecture | Affirmative vs Negated Rank Swap Rate | Strict Top-1 Accuracy (Strict@1) |
End-to-End nDCG@10 |
Contradiction Surfacing |
|---|---|---|---|---|
OpenAI text-embedding-3-large (Top-k Cosine) |
38.4% inverted Rank 1 |
46.2% |
~0.646 (MTEB) |
None (silent prompt collision) |
Google gemini-embedding-001 (FACT_VERIFICATION) |
31.7% inverted Rank 1 |
51.8% |
~0.680 (MTEB) |
None (silent prompt collision) |
Dense + Postgres tsvector BM25 RRF (k=60) |
29.5% (not dropped by english stemmer) |
54.1% |
0.668 |
None |
| Dense Top-50 + Standalone Cross-Encoder API | 4.8% |
71.4% |
0.831 |
None (+$2.00 / 1k query meter) |
Voxell Forge Max + Coherence (Team+) |
< 2.1% + Conflict Hold |
75.93% Strict@1 |
0.8849 nDCG@10 |
GET /v1/answers/{corpus}/conflicts & /xray |
Why Cross-Encoders + Coherence Are Structurally Required
A Stage-2 cross-encoder concatenates [CLS] Query [SEP] Passage [SEP] and computes full $O(L^2)$ multi-head self-attention across every query token and passage token simultaneously, binding "NOT", "except", "prior to v2.4", and "repealed" directly to the predicate they govern.
Even after cross-encoding, if two live documents in your corpus genuinely contradict each other, the correct engineering answer is a deterministic conflict hold, not a coin flip. Test both Stage-2 Max cross-encoding and Corpus X-Ray contradiction auditing right now with zero API key:
# 1. Keyless Corpus X-Ray: detect opposing claims across files before answering
curl -sS -X POST https://api.voxell.ai/api/v1/agent/xray \
-H "Content-Type: application/json" \
-d '{
"documents": [
{"name": "security-2024.md", "text": "Starter tier workspaces include a signed HIPAA Business Associate Agreement (BAA)."},
{"name": "security-2026.md", "text": "Starter tier workspaces do NOT include a HIPAA BAA; HIPAA workloads require Sovereign VPC or Scale."}
]
}'
# 2. Keyless Retrieval Bake-Off: verify cross-encoder precision on version & negation queries
curl -sS -X POST https://api.voxell.ai/api/v1/agent/bakeoff \
-H "Content-Type: application/json" \
-d '{
"documents": [
{"name": "tls-legacy.md", "text": "TLS 1.1 cipher suites were permitted on internal ingress prior to October 2025."},
{"name": "tls-current.md", "text": "TLS 1.1 cipher suites are NOT permitted on any ingress; TLS 1.3 is mandatory."}
],
"queries": ["Are TLS 1.1 cipher suites permitted on ingress today?"]
}'
Voxell Forge bundles C_corpus Stage-1 conditioning (99.04% Recall@20), Stage-2 Max cross-encoder reranking (0.8849 nDCG@10, 75.93% Strict@1), and Coherence GET /v1/answers/{corpus}/conflicts on Team ($199/mo annual) with zero $2/1k-query rerank surcharges. Compare TCO in the Vector RAM & TCO Calculator, read RAG Contradiction Benchmarks, or open the Forge Console (v4.0 Pricing).