Retrieval-augmented generation (RAG), where a language model answers using passages fetched from a knowledge base, increasingly comes with a cheap "gate" in front of it. The gate is a fast test that decides whether a query is covered by the knowledge base at all, so the generator is not forced to answer from irrelevant context. The lightest gates work by projecting embeddings down to a dozen or so dimensions and accepting a query if it lands within some radius of the knowledge-base documents. That rule quietly assumes the in-domain region is round. This proposal argues that the assumption breaks in a predictable place. Queries that are in scope but phrased in different words from the documents, such as a layperson asking about "getting a ticket for no helmet" against a corpus of legal fine schedules, do not land near document centroids. They land displaced along a few within-topic directions. A round gate rejects them first, which means it fails exactly the users that dense retrieval was meant to serve.
The proposal is to shape each gate region to where the queries actually fall. Each knowledge-base topic is modeled as a low-rank-plus-noise ellipsoid in the reduced space: a few long axes plus a small round remainder. The long axes and their lengths are estimated not from the documents but from synthetic pseudo-queries generated for those documents. The claim to test is specific. Under spherical gates, false rejections of in-domain queries concentrate on queries with little or no word overlap with their answer document. A query-calibrated anisotropic gate removes most of that concentration at the same out-of-domain rejection rate and the same microsecond latency. Neither anisotropy fitted on documents alone nor query calibration with round regions should be enough by itself.
Where the gap is
Knowing When Not to Answer motivates this work. It compresses knowledge-base embeddings with principal component analysis (PCA) to fewer than 15 dimensions and compares an isotropic ε-ball rule, an axis-aligned ε-rectangle, Gaussian mixtures, and SVMs as out-of-domain detectors. It reports 17–26 μs latency against roughly 3.2×10⁶ μs for a GPT-4o judge. It does not ask which in-domain queries the gates wrongly reject, and every geometric model in it is fitted to document embeddings. The size of the population at risk comes from WikiQA, which found that 20.3% of correct answer sentences share no content word with the Bing query. The same paper shows that the best answer-triggering F1 (deciding whether any answer exists) is only about 31.6%, so "is this covered?" remains unsolved even before any lexical gap is considered.
The clustering literature supplies the method and sets its limits. Learning the k in k-means shows that criteria assuming round clusters over-split elongated ones; X-means found more than 170 clusters where 80 existed. Its G-means fix, which runs a one-dimensional Anderson-Darling normality test along each candidate split direction, is the procedure we reuse to choose the number of topic regions. Achieving Optimal Clustering in Gaussian Mixture Models with Anisotropic Covariance Structures gives the hard-EM assignment rule with per-cluster Mahalanobis distance plus a log-determinant term. It also warns that guarantees need many more samples than squared dimensions and that estimated covariances become ill-conditioned when clusters are nearly flat. That warning is why we restrict the covariance to low rank plus an isotropic remainder rather than leaving it fully free. Representing Sentences as Low-Rank Subspaces found that a sentence's word vectors span roughly a rank-3 to rank-5 subspace. That result makes it plausible that rephrasings of one need move along a few directions rather than scattering in all of them, but the paper studied only symmetric sentence-to-sentence similarity.
Two other lines of work set constraints. Refining Dimensions for Cross-lingual Topic Models shows that the dominant SVD axes of multilingual embeddings can encode language rather than topic, and that t-test-based removal of those axes helps clustering. The analogous risk here is that the PCA axes kept by variance retention encode document style rather than meaning, so query-side variation is lost before the gate ever sees it. HypRAG attributes some mismatch to hierarchical "crowding" in flat space and fixes it with a hyperbolic encoder. We keep the encoder fixed and change only the gate, so the two approaches are complementary. Our gate could later sit on top of a hyperbolic embedding.
Core mechanism
Take a fixed embedding model and a knowledge base. For each document, generate several pseudo-queries using the synthetic-query view popularized by MINDER, deliberately prompting for lay paraphrases. Project documents and pseudo-queries jointly into a reduced space of $p \le 15$ dimensions. The axes are chosen to maximize pseudo-query variance within topics, not document variance.
Cluster the documents into topics with G-means. For each topic $k$, fit a center $\mu_k$ and a covariance $\Sigma_k = W_k W_k^\top + \sigma_k^2 I$ to that topic's pseudo-queries, where $W_k$ is $p \times r$ with small rank $r$ (we expect 2–4) and $\sigma_k^2$ is the isotropic remainder. This is the probabilistic-PCA form. Because $\Sigma_k$ has few free parameters, it stays well conditioned with a few hundred pseudo-queries per topic. A query $q$ receives the coverage score
$$s(q) = \min_k \left[ (q-\mu_k)^\top \Sigma_k^{-1} (q-\mu_k) + \log\det \Sigma_k \right],$$
which is the heterogeneous assignment rule of the Adjusted Lloyd algorithm used as a distance. The gate accepts the query if $s(q)$ falls below a threshold. The threshold is set so that a fixed fraction of held-out out-of-domain queries is rejected.
Scoring costs $K$ rank-$r$ updates in 15 dimensions, so latency should stay in the tens of microseconds reported for the baseline gates.
Research Program
The first stage is diagnostic and stands as a result even if the method fails. Stratify in-domain test queries by content-word overlap with their gold document into zero, low, and high overlap buckets, following WikiQA's notion of content-word overlap. Then measure each existing gate's false-rejection rate per bucket at matched out-of-domain rejection. The prediction is a steep gradient for the ε-ball rule.
The second stage tests the geometric hypothesis directly. For each topic, compare the principal directions of document scatter with those of pseudo-query scatter and with those of real lexical-gap queries. Report principal angles between these subspaces, using the Grassmannian machinery of Mu et al. If real lexical-gap queries are displaced along directions shared with pseudo-queries but not with documents, the mechanism holds. If their displacement is isotropic, a round gate with a larger radius is the correct model and the proposal is wrong.
The third stage builds and ablates the gate.
Baselines
The naive reference point is no gate: every query is accepted. This fixes the hallucination exposure that any gate must reduce, and it has zero false rejections by construction.
The first real competitor is the centroid ε-ball and ε-rectangle from Knowing When Not to Answer. We rerun it on the same embedding model, the same PCA dimensions (both their variance-retention and t-test selections), and the same out-of-domain query sets. It is the incumbent the proposal claims to fix. The file contains no reported AUROC or false-rejection figures for these detectors on VIRA or Substance Use (no reported result found on Lacuna for detection accuracy). We therefore reproduce them, and the only quoted figure is the 17–26 μs latency, which our gate must match within a factor of two.
The strongest existing competitor is the full-covariance Gaussian mixture from the same paper, fitted on document embeddings. It is already anisotropic, so if it closes the lexical-gap bucket the main claim reduces to a diagnostic finding. We give it an equal tuning budget: the number of components is chosen by BIC and by G-means, and covariance shrinkage is swept over the same grid.
A one-class SVM in the same space is the strongest nonparametric competitor.
Two ablations isolate the key ingredients. The first is a document-fitted low-rank gate, which keeps the anisotropic form but drops query calibration. The second is a query-calibrated spherical gate, which uses pseudo-queries to set per-topic radii but keeps the regions round. Beating the baselines means a lower false-rejection rate in the zero-overlap bucket at 95% out-of-domain rejection, with a confidence interval from bootstrap over queries that excludes the best baseline, and no loss in the high-overlap bucket.
Why not just…?
Why not just use the full-covariance mixture that already exists? It is the real threat. Full covariances in 15 dimensions need about 120 parameters per topic, which is affordable, so conditioning is not an automatic argument against them. Our bet is that the decisive difference lies in what the model is fitted to, not in its shape. Documents and queries vary along different directions, and a document-fitted ellipsoid points the wrong way. The ablation that fits our low-rank form on documents and compares it with the full-covariance mixture fitted on pseudo-queries settles which ingredient matters. If the pseudo-query-fitted full-covariance mixture matches ours, we report query calibration as the contribution and drop the low-rank claim.
Why not just rewrite the query first? RaFe trains small query rewriters from reranker feedback and reports 2–3% QA accuracy gains. Rewriting colloquial queries toward document language could move them inside a round gate. It costs a generation step, however, which breaks the microsecond budget, and it may also rewrite out-of-domain queries into plausible in-domain ones, which would raise false acceptance. We run a RaFe-style rewriter followed by the ε-ball gate, and report both error types and latency. If it dominates on both errors, the gate geometry is not the bottleneck.
Why not just widen the ball, or fine-tune the encoder? A wider radius trades away out-of-domain rejection. Reporting full rejection-versus-acceptance curves and AUROC per overlap bucket shows directly whether any radius matches the anisotropic gate. Fine-tuning the encoder on pseudo-query pairs is a heavier intervention that changes retrieval as well. We include it as a ceiling with the round gate on top, to check whether the geometric fix captures most of the benefit without retraining.
Proposed Experiments
The primary testbeds are the COVID-19 vaccine (VIRA) and Substance Use knowledge bases with the out-of-domain query protocol of Knowing When Not to Answer, stratified by lexical overlap as described above. The second testbed is WikiQA, framed as gating per Wikipedia page. The zero-overlap 20.3% of questions form the stress bucket, and answer-triggering F1 is reported against the roughly 31.6% best figure in WikiQA, recognizing that our gate operates at page level rather than sentence level. A legal testbed built on the Vietnamese traffic law corpus from Pham et al. adds a jargon-heavy domain where lay queries are the norm.
The metrics are AUROC, false-rejection rate at 95% out-of-domain rejection broken down by overlap bucket, end-to-end hallucination rate of a fixed generator on accepted queries, and per-query latency.
Three results would be decisive. First, the false-rejection gradient across overlap buckets must exist for the ε-ball gate; if it does not, the problem is not real. Second, the principal-angle analysis must show that real lexical-gap queries align with the pseudo-query subspace rather than the document subspace. Third, the query-calibrated anisotropic gate must flatten the gradient while both single-ingredient ablations fail to. Pseudo-queries are generated by a model that may share biases with the evaluation, so query calibration must also be checked against human-written queries. For that check, WikiQA's real Bing questions serve as the held-out test of whether synthetic calibration transfers to genuine user phrasing.
References
- Knowing When Not to Answer: Lightweight KB-Aligned OOD Detection for Safe RAG
- WikiQA: A Challenge Dataset for Open-Domain Question Answering
- Learning the k in k-means
- Achieving Optimal Clustering in Gaussian Mixture Models with Anisotropic Covariance Structures
- Representing Sentences as Low-Rank Subspaces
- Refining Dimensions for Improving Clustering-based Cross-lingual Topic Models
- HypRAG: Hyperbolic Dense Retrieval for Retrieval Augmented Generation
- Multiview Identifiers Enhanced Generative Retrieval
- RaFe: Ranking Feedback Improves Query Rewriting for RAG
- Ontology-Based Solution for Building an Intelligent Searching System on Traffic Law Documents