The Tree-Haar Multi-Resolution Domain Manifold
Research Team
The domain detection manifold uses a mathematical insight more commonly found in statistical physics. The Haar-like wavelet basis of Gavish, Nadler, and Coifman (2010, ICML 2010) decomposes a linguistic tree (paragraph, sentence, token) into multi-resolution components without discarding structural information the way mean-pooling does.
At each transformer layer, hidden states for a corpus of English Wikipedia articles are organised into a tree of tokens within sentences within paragraphs. The Tree-Haar transform applies orthogonal wavelet decomposition at each branching point, yielding five representation kinds per layer. Each kind is aggregated into a meta-Gaussian summary across calibration paragraphs. The full manifold across 28 layers is 140 Gaussian distributions (5 kinds times 28 layers).
A generated text is scored by its Mahalanobis distance from the calibration mean along each representation kind, aggregated as the mean of log p-values across selected kinds. This signal cleanly separates out-of-domain text from in-domain calibration text, robust across model architectures.
The binary area under the receiver operating characteristic curve (AUROC) is 1.000 on all three vendors (Qwen 2.5 7B Instruct, Llama 3.1 8B Instruct, Gemma 2 9B Instruct) on a 41-entry benchmark (21 Constitution entries versus 20 Wikipedia entries). This is perfect binary separation. The inner product between p-value vectors of Wikipedia and Constitution paragraphs is near zero, confirming orthogonal drift signatures.
The representation-kind informativeness sweep showed that domain signal concentrates in early layers (0 through 3 for Qwen and Llama, 20 through 37 for Gemma). These layers are disjoint from the mid-layer factuality-informative bands used by the hallucination probe. Domain drift and factuality drift are separate signals in separate layer groups, confirming a two-signal architecture.
Comparing the complete Tree-Haar manifold against a single-scale baseline (one Mahalanobis distance per layer) shows the value of multi-resolution structure. On Llama the single-scale reaches AUROC 0.926 while Tree-Haar reaches 1.000, a gain of 0.074. On Qwen single-scale is at 0.993 and Tree-Haar closes the gap to 1.000. The multi-resolution decomposition carries structural information that a single per-layer Mahalanobis leaves on the table.
