advanced neural-retrieval 30 min read

How Many Dimensions Does Relevance Need? Sign-Rank and Margin Complexity

Rank says how many dimensions suffice to fit the scores; sign-rank says how many dimensions relevance actually needs to get the order right — far fewer for benign patterns, unboundedly many for combinatorial qrels, and the reason a single-vector embedding has a ceiling no amount of training removes

Overview & motivation

Dense retrieval left us with a clean upper bound. Stack the scores of every query against every document into a relevance matrix; a dd-dimensional dual encoder can realize any such matrix of rank at most dd, and below that rank the truncated SVD — Eckart–Young — is the best it can do. That theorem answers how many dimensions suffice to reproduce the scores. It is not the question a retrieval engineer actually has, which is sharper and more practical: how many dimensions does relevance need — not to match the real-valued scores, but to get the order right, to put every relevant document above every irrelevant one?

These are different questions, and the gap between them is the whole subject of this topic. Relevance is a sign pattern: for each query, a partition of the corpus into relevant and not. What a single-vector retriever must reproduce is that pattern of signs, and the smallest dimension in which a pattern of signs is linearly realizable is its sign-rank, not its rank. The two can be wildly different. We will see a relevance pattern of full rank nn whose sign-rank is 33 — most of the rank is wasted on magnitudes the ranking never uses — and, going the other way, patterns whose sign-rank is forced upward without bound, so that no fixed embedding dimension can represent them at all. The second kind is not a pathology: it is what combinatorial relevance looks like, the queries a real analyst asks, and it is the reason a single-vector embedding has a ceiling that no amount of training, data, or scale removes.

signed identity M (rank 4)0.000.200.40sign-rank = 3rank = 41none2none3456embedding dimension dachievable margin
rank of M
4
sign-rank of M
3
realizable at d = 3?
yes
achievable margin at d
0.3026

The signed identity — each query relevant to its own document and no other — has full rank 4, yet a rank-3 model reproduces every one of its signs: its sign-rank is 3. Below the sign-rank no correct realization exists (the margin is zero); at and above it the achievable margin is positive and grows with d — more dimensions buy a more robust separation. Rank counts directions in the scores; sign-rank counts the dimensions the relevance pattern needs, and here most of the rank is wasted on magnitudes the ranking never uses.

The first panel is the rank/sign-rank gap: a full-rank relevance pattern whose signs are reproduced by a model of much lower rank, with the achievable margin appearing only once the dimension clears the sign-rank. The second is a closed-form wall — Forster’s spectral lower bound forcing a Hadamard relevance pattern to need at least N\sqrt{N} dimensions. The third is the retrieval wall: the largest corpus whose all-pairs relevance pattern a dd-dimensional model can realize, even with perfect embeddings, growing only polynomially in dd.

Notation: relevance as a sign pattern

Fix mm queries and nn documents. A qrel matrix A{0,1}m×nA \in \{0,1\}^{m \times n} records relevance: Aij=1A_{ij} = 1 when document jj is relevant to query ii. Its signed form is M=2A1{1,+1}m×nM = 2A - \mathbf{1} \in \{-1, +1\}^{m \times n}, with +1+1 for relevant and 1-1 for not. A single-vector retriever realizes this pattern if it can place query embeddings xix_i and document embeddings yjy_j in some Rd\mathbb{R}^d so that, within each query’s row, every relevant document outscores every irrelevant one — equivalently, so that the score matrix B=XYB = X Y^\top has the right signs against a per-row threshold. Absorbing the threshold into an extra constant coordinate, the clean object is the sign-rank.

Definition 1 (Sign-rank (dimension complexity)).

For a sign matrix M{1,+1}m×nM \in \{-1, +1\}^{m \times n}, the sign-rank is

rank±(M)  =  min{rank(B)  :  BRm×n, sign(Bij)=Mij for all i,j}.\operatorname{rank}_\pm(M) \;=\; \min\big\{ \operatorname{rank}(B) \;:\; B \in \mathbb{R}^{m \times n},\ \operatorname{sign}(B_{ij}) = M_{ij}\ \text{for all } i,j \big\}.

It is the smallest inner dimension dd in which the pattern MM is linearly realizable as sign(XY)\operatorname{sign}(X Y^\top) with XRm×dX \in \mathbb{R}^{m \times d}, YRn×dY \in \mathbb{R}^{n \times d} — the dimension the relevance pattern needs, with the score magnitudes free.

Throughout, M2\|M\|_2 is the spectral norm (largest singular value) and rank(M)\operatorname{rank}(M) the ordinary rank. The contrast in one line: rank constrains the matrix of scores; sign-rank constrains only their signs, so it is never larger than the rank — a matrix realizes its own signs at d=rank(M)d = \operatorname{rank}(M) — and is usually strictly smaller.

Movement 1 — rank is the wrong complexity ⇒ sign-rank

The cleanest way to see that rank and sign-rank are different measures is a single pattern on which they disagree maximally.

Theorem 1 (The signed identity: full rank, sign-rank three).

Let M=2InJn{1,+1}n×nM = 2 I_n - J_n \in \{-1,+1\}^{n \times n} be the signed identity: +1+1 on the diagonal, 1-1 off it. Then for every n3n \ge 3, rank(M)=n\operatorname{rank}(M) = n while rank±(M)3\operatorname{rank}_\pm(M) \le 3. The relevance pattern “each query’s own document, and no other” therefore needs only three dimensions, however many documents there are.

Proof (Proof).

Rank. JnJ_n, the all-ones matrix, has eigenvalues nn (once) and 00 (with multiplicity n1n-1), so M=2InJnM = 2 I_n - J_n has eigenvalues 2n2 - n (once) and 22 (with multiplicity n1n-1). For n3n \ge 3 both values are nonzero, so all nn eigenvalues are nonzero and rank(M)=n\operatorname{rank}(M) = n.

Sign-rank. We exhibit a rank-33 realization geometrically. Place the nn queries at points p1,,pnR2p_1, \dots, p_n \in \mathbb{R}^2 in strictly convex position — the vertices of a regular nn-gon. Each pjp_j is then a vertex of the convex hull, so there is a line j\ell_j with pjp_j strictly on its positive side and every other pip_i strictly on its negative side; write j\ell_j as {z:aj,z+bj=0}\{z : \langle a_j, z\rangle + b_j = 0\} with aj,pi+bj>0    i=j\langle a_j, p_i\rangle + b_j > 0 \iff i = j. Lift each query to xi=(pi,1)R3x_i = (p_i, 1) \in \mathbb{R}^3 and each document to yj=(aj,bj)R3y_j = (a_j, b_j) \in \mathbb{R}^3. Then

(XY)ij  =  xi,yj  =  aj,pi+bj,(X Y^\top)_{ij} \;=\; \langle x_i, y_j\rangle \;=\; \langle a_j, p_i\rangle + b_j,

which is positive exactly when i=ji = j and negative otherwise — precisely sign(XY)=M\operatorname{sign}(X Y^\top) = M. Since XRn×3X \in \mathbb{R}^{n \times 3} and YRn×3Y \in \mathbb{R}^{n \times 3}, the realizing matrix has rank at most 33, so rank±(M)3\operatorname{rank}_\pm(M) \le 3. \blacksquare

The proof is the whole intuition. Rank counts independent directions in the scores; sign-rank counts the dimensions the geometry needs to separate each point from the rest, and nn points in convex position separate with a two-dimensional picture plus one affine coordinate. The notebook confirms it numerically: for the 4×44 \times 4 signed identity it finds an explicit rank-33 matrix matching all sixteen signs and fails to find any rank-22 one (the sign-rank is in fact exactly 33, a classical value we cite rather than belabor). The laboratory’s first panel shows the same gap as a margin: the pattern is unrealizable below three dimensions — the achievable margin is zero — and at d=3d = 3 a positive margin appears, widening as dd grows.

This already overturns the reflex that “more relevance structure means more dimensions.” A relevance matrix can be full rank and yet, as a pattern, demand only a constant dimension. The sign-rank, not the rank, is the honest answer to how many dimensions relevance needs — and the rest of the topic is about when that answer is small, when it is provably large, and what it means for retrieval.

Movement 2 — a closed-form lower bound: Forster on Hadamard

The signed identity is the easy direction: a pattern that looks expensive but is cheap. The hard and more consequential direction is a pattern that is genuinely expensive — one whose sign-rank we can lower-bound by a closed form, with no optimization and no guessing. The tool is a spectral inequality of Forster.

Theorem 2 (Forster's spectral lower bound (cited)).

For every sign matrix M{1,+1}m×nM \in \{-1, +1\}^{m \times n},

rank±(M)    mnM2.\operatorname{rank}_\pm(M) \;\ge\; \frac{\sqrt{m\,n}}{\|M\|_2}.

A small spectral norm forces a large sign-rank: a pattern whose energy is spread evenly across all singular directions cannot be realized in few dimensions.

Forster’s theorem is proved by a balancing argument — every sign matrix admits a realization whose query and document points are in near-isotropic position, and isotropy plus the unit-modulus entries bound the spectral norm from below in terms of the dimension. The argument is delicate and we cite it. What we do prove is its sharpest consequence, on the matrix that saturates it.

Theorem 3 (Hadamard patterns need √N dimensions).

Let H{1,+1}N×NH \in \{-1, +1\}^{N \times N} be a Hadamard matrix (orthogonal rows, HH=NIH H^\top = N I). Then H2=N\|H\|_2 = \sqrt{N} and therefore

rank±(H)    NNN  =  N.\operatorname{rank}_\pm(H) \;\ge\; \frac{\sqrt{N \cdot N}}{\sqrt{N}} \;=\; \sqrt{N}.

A relevance pattern shaped like HH provably needs at least N\sqrt{N} dimensions, with no appeal to optimization.

Proof (Proof).

The rows of HH are orthogonal and each has squared norm NN, so HH=NINH H^\top = N I_N. Hence every eigenvalue of HHH H^\top equals NN, every singular value of HH equals N\sqrt{N}, and in particular H2=N\|H\|_2 = \sqrt{N}. Substituting m=n=Nm = n = N and H2=N\|H\|_2 = \sqrt{N} into Forster’s bound gives rank±(H)N/N=N\operatorname{rank}_\pm(H) \ge N / \sqrt{N} = \sqrt{N}. \blacksquare

This is the first genuinely negative result of the curriculum’s expressivity track: an explicit family of relevance patterns whose required dimension grows without bound, N\sqrt{N} at NN documents, provably, in closed form. The laboratory’s second panel walks the Sylvester–Hadamard matrices N=2,4,8,16N = 2, 4, 8, 16 and shows the bound N\sqrt{N} rising; the notebook corroborates it from the other side, failing to realize H16H_{16} in three dimensions when the bound says four are required. Where the signed identity showed sign-rank far below the rank, Hadamard shows it can be a hard floor — and crucially, a floor we can certify without solving an intractable problem.

Eckart–Young is the wrong norm

It is worth saying precisely why DPR’s rank story does not already answer this. The truncated SVD is optimal for the Frobenius norm: Md=argminrankBdMBFM_d = \arg\min_{\operatorname{rank} B \le d} \|M - B\|_F. But Frobenius error weights large-magnitude entries, and a relevance pattern cares only about signs against a per-row threshold. A rank-dd approximation can have small Frobenius error and still flip the signs of the small entries that decide a close ranking; conversely the signs can be entirely correct at a rank where the Frobenius error is still large. The notebook makes this concrete on the signed identity: the Frobenius-optimal rank-33 truncation does not reproduce every sign, while a rank-33 realization built for the signs does. Approximating in rank and realizing a sign pattern are different objectives, and the SVD solves the first. This is the load-bearing reason sign-rank, not rank, is the relevant complexity — and it is rigorFlag territory, because the “rank d\le d” framing we inherited is exposition, not the tight measure.

Movement 3 — margin complexity: the dimension for a usable gap

Sign-rank is honest but austere: it asks only that the signs come out right, allowing scores to sit arbitrarily close to the threshold. A retriever trained by a contrastive (soft-margin) loss does not get to live on that knife edge — it needs a gap, a margin by which relevant beats irrelevant, or noise and finite samples will flip the order. The capacity measure that respects this is the margin complexity.

Definition 2 (Margin complexity).

For a realization sign(XY)=M\operatorname{sign}(X Y^\top) = M, its margin is minijMijxi,yj/(xiyj)\min_{ij} M_{ij}\langle x_i, y_j\rangle / (\|x_i\|\,\|y_j\|), the smallest normalized gap by which any entry has the correct sign. Writing m(M)\mathrm{m}(M) for the largest margin over all realizations in any dimension, the margin complexity is mc(M)=1/m(M)\mathrm{mc}(M) = 1/\mathrm{m}(M).

Margin complexity and sign-rank are close relatives but not the same number. Linial, Mendelson, Schechtman, and Shraibman tie them together through the γ2\gamma_2 norm — a quantity with a semidefinite-programming characterization, hence computable, unlike sign-rank itself — by the inequalities mc(M)γ2(M)\mathrm{mc}(M) \le \gamma_2(M) and rank±(M)O(mc(M)2logN)\operatorname{rank}_\pm(M) \le O(\mathrm{mc}(M)^2 \log N). The direction that matters for retrieval is the second read backward: a large margin (small mc\mathrm{mc}) forces a small sign-rank, but a small sign-rank does not promise a usable margin — a pattern can be realizable in few dimensions only by hugging the threshold. For a model that must generalize from finite data, margin complexity is therefore the more faithful measure of how many dimensions relevance needs, and it is never smaller than the sign-rank story suggests.

The laboratory’s first panel shows exactly this shape on the signed identity: zero margin below the sign-rank (no correct realization exists), then a positive margin at d=3d = 3 that grows as dd increases. More dimensions do not just make the pattern realizable; they make it robustly so. We report the achievable margins found by projected gradient — an honest lower bound on the best margin at each dimension — and leave the exact γ2\gamma_2 value as the semidefinite program it is, described but not solved.

Movement 4 — the retrieval theorem and the free-embedding wall

The abstract story becomes a statement about retrieval through a recent result of Weller, Boratko, Naim, and Lee — the LIMIT paper — which pins the embedding dimension a qrel matrix demands directly to its sign-rank.

Theorem 4 (The qrel dimension is the sign-rank (cited)).

For a binary qrel matrix A{0,1}m×nA \in \{0,1\}^{m \times n}, let d(A)d^\star(A) be the smallest embedding dimension in which a single-vector model can rank, within every query’s row, all relevant documents above all irrelevant ones. Then

rank±(2A1)1    d(A)    rank±(2A1).\operatorname{rank}_\pm(2A - \mathbf{1}) - 1 \;\le\; d^\star(A) \;\le\; \operatorname{rank}_\pm(2A - \mathbf{1}).

The minimum embedding dimension of a relevance pattern is its sign-rank, up to one.

The sandwich turns every sign-rank fact into a retrieval fact. Forster’s Hadamard bound becomes: a qrel whose signed form is Hadamard cannot be realized below N\sqrt{N} dimensions, period. And it lets us measure the wall on a concrete construction. Take the all-pairs qrel: nn documents, one query for every unordered pair {i,j}\{i,j\}, relevant to exactly documents ii and jj. This is the densest top-22 pattern, and the experiment that isolates the architecture from every confound is to optimize the embeddings freely — drop the encoder, drop the training data, let XX and YY be unconstrained parameters fit directly to the qrel — and find the largest document count a given dimension can realize.

Proposition 1 (The free-embedding wall (measured)).

Let the critical nn at dimension dd be the largest nn whose all-pairs qrel is realizable by free embeddings in Rd\mathbb{R}^d. The notebook measures it growing slowly with dd — on its grid, 4,4,6,12,164, 4, 6, 12, 16 at d=2,3,4,5,6d = 2, 3, 4, 5, 6 — and confirms that beyond the critical nn the best achievable row-order accuracy drops below one. Even with perfect, freely optimized embeddings, each dimension admits only a bounded combinatorial corpus.

This is the practical face of the sign-rank ceiling. The all-pairs pattern over many documents has a sign-rank that climbs faster than any fixed dd can follow, so at a chosen embedding dimension there is always a corpus size past which some combination of relevant documents is simply unrepresentable — not poorly trained, unrepresentable. The LIMIT authors extrapolate the same growth to the dimensions production systems use and find the critical corpus, even for an idealized embedder, lands well below web scale. The wall is real, it is best-case, and it is the property of a single vector per document; we return to the escape below.

The communication-complexity bridge

One last reframing explains why the limit is fundamental rather than an artifact of how we fit embeddings. Sign-rank is not only a geometric quantity — it is an information quantity. Paturi and Simon proved that the unbounded-error randomized communication complexity of a sign matrix MM — the number of bits two parties, holding the row and the column respectively, must exchange to decide MijM_{ij} with any advantage over a coin flip — equals log2rank±(M)\log_2 \operatorname{rank}_\pm(M) up to an additive constant. The embedding dimension a relevance pattern needs is, up to a logarithm, the number of bits its relevance decision contains. A pattern that needs many dimensions needs them because its relevance is genuinely information-rich, not because the optimizer was weak — which is why no amount of training removes the wall.

Proposition 2 (What the laboratory measures).

The three panels run on deterministic synthetic setups, not a trained transformer. Panel A is the signed identity, its rank and a found rank-33 realization, with the achievable margin by dimension. Panel B is the Sylvester–Hadamard family with H2=N\|H\|_2 = \sqrt{N} and the Forster bound N\sqrt{N}, both closed form. Panel C is the free-embedding critical-nn curve on the all-pairs construction, with the finance flip beside it. Every measured number — the realization, the margins, the critical-nn values, the flip — is owned by the companion notebook and mirrored here to the decimal; the laboratory recomputes only closed forms, the Forster bound N\sqrt{N} and the all-pairs query count (n2)\binom{n}{2}.

Finance case study

Honest accounting

The dimension lower bound is the deepest impossibility result in the dense-retrieval track, and it points directly at the architectures that route around it. Late interaction replaces a single pooled vector with a token-level comparison, lifting the relevance matrix out of the sign-rank bound proved here — the explicit escape, and the next topic in this track. Cross-encoders, which DPR kept invoking as the rank-free counterpoint, pay a quadratic cost to fuse query and document and so are not factorizations at all. And the evaluation track measures where the wall bites: the metrics that follow are how you detect, on real qrels, that a single embedding has run out of dimensions.

Connections

  • DPR proved the upper bound this topic completes: a d-dimensional dual encoder realizes exactly the relevance matrices of rank at most d, with the truncated SVD the best approximation below that rank. That bound says how many dimensions SUFFICE for the real-valued scores; this topic supplies the tight LOWER bound — the sign-rank and margin complexity of how many dimensions the relevance PATTERN needs — and reuses DPR's finance matrix and its byte-for-byte in-batch loss anchor, so the two topics are the two halves of the dual encoder's expressivity story dense-retrieval-dual-encoders
  • PCA reads Eckart-Young as the optimal low-rank approximation of a data matrix in Frobenius norm; this topic shows that exactly that norm is the wrong one for a relevance pattern, since a sign/threshold pattern can have a small Frobenius error while still flipping the order, so the truncated SVD that is optimal for PCA is not optimal for getting relevance signs right — the same theorem, now exhibited as a mismatch pca-dimensionality-reduction
  • MIPS hardness is a lower bound on the COST of exact inner-product search given the vectors; this topic is a lower bound on the DIMENSION of the vectors themselves, so the two are the curriculum's two impossibility results for single-vector retrieval — one says exact search cannot be made truly sublinear, the other says a fixed dimension cannot represent every relevance pattern, and both are reasons production retrieval approximates and combines architectures mips-hardness-and-sublinearity-limits
  • InfoNCE is a soft-margin objective, so the quantity it actually optimizes is not the bare sign pattern but the margin with which queries separate their relevant documents; margin complexity, the robust cousin of sign-rank developed here, is therefore the capacity measure most faithful to a contrastively trained encoder, making this topic the expressivity counterpart to InfoNCE's training story infonce-contrastive-objective
  • late interaction is the architectural escape from the single-vector ceiling this topic proves: replacing one pooled dot product with a token-level MaxSim over many vectors per document lifts the relevance matrix out of the sign-rank bound that limits a single embedding, so the wall proved here is precisely the motivation for the multi-vector architecture that follows late-interaction-learned-sparse

References & Further Reading

  • paper On the Theoretical Limitations of Embedding-Based Retrieval — Weller, Boratko, Naim & Lee (2025) The LIMIT result: the minimum embedding dimension to realize a binary qrel matrix equals the sign-rank of its signed form up to one, and even free, perfectly optimized embeddings hit a polynomial wall in the all-pairs construction; the source of the retrieval-specific framing and the LIMIT dataset, accepted at ICLR 2026
  • paper A linear lower bound on the unbounded error probabilistic communication complexity — Forster (2002) Forster's spectral lower bound on sign-rank, sign-rank(M) >= sqrt(mn) / ||M||, the first linear lower bound on unbounded-error communication complexity; the closed-form lower bound this topic proves for Hadamard patterns; the DOI resolves to the Journal of Computer and System Sciences 65(4)
  • paper Probabilistic communication complexity — Paturi & Simon (1986) The identity that the unbounded-error randomized communication complexity of a sign matrix equals log of its sign-rank up to an additive constant, the bridge that recasts the embedding-dimension lower bound as a communication lower bound; the DOI resolves to the Journal of Computer and System Sciences 33(1)
  • paper Complexity measures of sign matrices — Linial, Mendelson, Schechtman & Shraibman (2007) Margin complexity, the gamma_2 norm and its semidefinite characterization, and the inequality chain relating margin complexity to sign-rank with a logarithmic slack; the source for the margin-complexity movement; the DOI resolves to Combinatorica 27(4)
  • paper Sign rank versus VC dimension — Alon, Moran & Yehudayoff (2017) The separation between sign-rank and VC dimension — sign matrices of bounded VC dimension whose sign-rank is nonetheless large — the precise statement of why a low-complexity concept class can still demand a high embedding dimension, cited for the sign-rank versus VC-dimension connection
  • paper The sign-rank of AC^0 — Razborov & Sherstov (2010) The first exponential sign-rank lower bound for an explicit (AC^0) sign matrix, the constructive frontier behind the rigor flag that most sign-rank lower bounds are existential; the DOI resolves to the SIAM Journal on Computing 39(5)