← All OpenAI & Gemini Vectorization Guides

OPTIMIZE 06 // ANISOTROPY & CORPUS MEAN-CENTERING

Fix Embedding Anisotropy & Narrow-Cone Cosine Collapse in Domain Corpora

On homogeneous legal, SEC 10-K, medical, or monorepo corpora, OpenAI text-embedding-3-large and Google gemini-embedding-001 pack every passage into a narrow anisotropic cone where completely unrelated chunks score 0.78 to 0.88 cosine similarity. Subtracting the corpus mean vector and projecting out dominant boilerplate directions restores angular separation, while Voxell Forge automates C_corpus dialect conditioning natively.

Diagnosing Narrow-Cone Collapse in Production

Sample 1,000 random, unrelated chunk pairs from your production vector table (ORDER BY random() LIMIT 2000) and inspect their cosine similarity distribution. On general web text, random pairs hover around 0.15 - 0.32. On specialized enterprise corpora (Delaware M&A agreements, Kubernetes YAML + Go monorepos, FDA 510(k) dockets, or SEC 10-K footnotes), text-embedding-3-large and gemini-embedding-001 routinely produce:

  • Random unrelated pair mean cosine: 0.76 - 0.84
  • True top-1 relevant match cosine: 0.85 - 0.89
  • Effective discriminative margin: < 0.05!

Three things break immediately when 90% of vector energy points along a single domain-boilerplate centroid $\mu_{\text{corpus}}$:

  1. Hard similarity cutoffs (WHERE 1 - (emb <=> q) > 0.78) admit thousands of irrelevant chunks or reject valid cross-terminology queries.
  2. 1-bit binary quantization (binary_quantize) collapses because every vector shares identical signs on the dominant coordinates, destroying Hamming selectivity.
  3. Boilerplate headers dominate signal: Shared disclaimers (“Forward-Looking Statements”, copyright headers) overpower 4-token numeric or identifier differences.

Runnable Fix: All-but-the-Top (Mu Subtraction + Top-$k$ PCA Projection)

Mu & Viswanath’s All-but-the-Top post-processing removes the corpus mean $\mu$ and projects out the top $k$ (k = 2..5) shared syntax/boilerplate principal components fitted once on a sample of 20,000 corpus vectors. Crucially, apply the exact same $(\mu, U_k)$ transform to both corpus chunks and incoming queries, followed by L2 normalization:

import numpy as np

class AnisotropyConditioner:
    """Zero-LLM post-processor for OpenAI / Gemini narrow-cone corpora."""

    def __init__(self, n_remove_components: int = 3):
        self.k = n_remove_components
        self.mu: np.ndarray | None = None      # shape (D,)
        self.top_pcs: np.ndarray | None = None # shape (k, D)

    def fit(self, sample_embeddings: np.ndarray) -> "AnisotropyConditioner":
        # sample_embeddings: (N, D) float32, unit-normalized
        x = sample_embeddings.astype(np.float64)
        self.mu = x.mean(axis=0)
        centered = x - self.mu
        # Economy SVD to extract top-k boilerplate directions
        _, _, vt = np.linalg.svd(centered, full_matrices=False)
        self.top_pcs = vt[: self.k]  # (k, D)
        return self

    def transform(self, embeddings: np.ndarray) -> np.ndarray:
        assert self.mu is not None and self.top_pcs is not None
        centered = embeddings.astype(np.float64) - self.mu
        # Subtract projection onto top-k boilerplate components: c - (c @ U^T) @ U
        proj = (centered @ self.top_pcs.T) @ self.top_pcs
        cleaned = (centered - proj).astype(np.float32)
        norms = np.linalg.norm(cleaned, axis=1, keepdims=True)
        return cleaned / np.maximum(norms, 1e-12)

Benchmark Impact on Specialized Enterprise Corpora (SEC 10-K + Monorepo)

Pipeline Configuration Unrelated Pair Cosine Mean Relevant vs Noise Margin 1-Bit Binary Recall@20 Stage-1 Dense nDCG@10
Raw text-embedding-3-large (3072d) 0.81 0.06 78.4% 0.582
Raw gemini-embedding-001 (3072d, RETRIEVAL_*) 0.79 0.08 81.1% 0.604
OpenAI 3-large + v - mu_corpus (k=3 All-but-Top) 0.04 0.41 95.6% 0.629
Voxell Forge Pro (2560d + native C_corpus) Zero-centered dialect space 0.49 99.04% Recall@20 (Play 1 AMQ) 0.6652 (0.8849 w/ Max)

Architectural Upgrade: Native C_corpus Without State-Sync Drift

Shipping .npz mean/PCA artifacts across Python workers, Go API gateways, and background re-indexers introduces silent version skew: if a query service loads v1 of (mu, top_pcs) while an ingestion worker writes v2, recall craters overnight.

Voxell Forge runs zero-LLM C_corpus dialect conditioning natively inside the storage-coupled GPU pipeline, pairing 99.04% Recall@20 Stage-1 dense retrieval ($0.25/1M tokens on Pro; $0 forever on Turbo) with Stage-2 Max cross-encoder reranking (0.8849 nDCG@10, 75.93% Strict@1) from $199/mo annual. Verify on overlapping legal boilerplate right now:

curl -sS -X POST https://api.voxell.ai/api/v1/agent/bakeoff \
  -H "Content-Type: application/json" \
  -d '{
    "documents": [
      {"name": "note-12-debt.md", "text": "Pursuant to the Amended Credit Facility dated March 15, 2026, Senior Term Loan B bears SOFR + 275 bps maturing 2030."},
      {"name": "note-13-leases.md", "text": "Pursuant to the Amended Facility Agreement dated March 15, 2026, Marysville data center lease obligations use a 6.1% incremental borrowing rate."}
    ],
    "queries": ["What interest spread applies to Senior Term Loan B under the March 2026 credit facility?"]
  }'

Size your index in the Vector RAM & TCO Calculator, compare against Contextual Retrieval LLM Ingest Taxes, or open the Forge Console (v4.0 Pricing).

Frequently Asked Questions

Why do two completely unrelated legal or code chunks have 0.82 cosine similarity?

Pretrained transformer embeddings allocate dominant high-variance directions to shared domain syntax, boilerplate legalese, and token frequency statistics. Inside a specialized single-domain corpus, every vector shares a large common mean component mu_corpus, compressing pairwise cosines into a narrow [0.78, 0.94] band.

Does corpus mean-centering hurt binary quantization or cosine thresholds?

Mean-centering dramatically improves both! Shifting the centroid to the origin balances positive and negative coordinate signs (maximizing 1-bit binary quantization entropy in Guide 05) and spreads cosine similarity cleanly across [-0.30, +0.85] so abstention thresholds stop misfiring.

How does Voxell Forge C_corpus conditioning improve over offline PCA whitening?

Manual PCA whitening requires fitting and versioning external numpy matrices across ingestion and query microservices. Voxell Forge computes C_corpus zero-LLM dialect conditioning natively inside the GPU pipeline, lifting Stage-1 dense nDCG@10 to 0.6652 and Recall@20 to 99.04% ($0.25/1M on Pro).

AUTONOMOUS AGENT & DEVELOPER VERIFICATION // ZERO SIGNUP

Run a live keyless bake-off right now

Do not take a vendor table on faith. Run your own passages and queries against Voxell Forge (Pro 2560d + C_corpus zero-LLM ingest dialect conditioning + Max two-stage neural reranking) over REST or Zero-Install Remote Streamable HTTP MCP with zero API key.

1. REST Retrieval Bake-Off & Corpus X-Ray
curl -sS -X POST https://api.voxell.ai/api/v1/agent/bakeoff \
  -H "Content-Type: application/json" \
  -d '{
    "documents": [
      {"name": "policy-a.md", "text": "Standard subscriptions include a 30-day refund window."},
      {"name": "msa-b.md", "text": "Enterprise annual contracts carry a 14-day cancellation notice rule."}
    ],
    "queries": ["What is the standard subscription refund window?"]
  }'

curl -sS -X POST https://api.voxell.ai/api/v1/agent/xray \
  -H "Content-Type: application/json" \
  -d '{
    "documents": [
      {"name": "sla-2025.md", "text": "P1 response SLA is 4 hours."},
      {"name": "sla-2026.md", "text": "P1 response SLA is 15 minutes."}
    ]
  }'
2. Zero-Install Remote HTTP MCP (POST /mcp/try)
claude mcp add --transport http voxell-forge https://api.voxell.ai/mcp/try
# mcp.json: {"mcpServers":{"voxell-forge":{"url":"https://api.voxell.ai/mcp/try"}}}

curl -sS -X POST https://api.voxell.ai/mcp/try \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "forge_bakeoff_compare",
      "arguments": {
        "documents": [
          {"name": "vpc.md", "text": "Forge Local runs on 1x 24 GB GPU inside your Sovereign VPC with zero egress."}
        ],
        "queries": ["How many GPUs does Forge Local require?"]
      }
    }
  }'
# Tools exposed: forge_bakeoff_compare, forge_xray_audit