Interactive explorer β Compare tree-based (ultrametric LCA) vs vector-based (cosine similarity) search on 50 real estate properties
Ultrametric condition: d(A,C) β€ max(d(A,B), d(B,C)) for ALL triples. Vector embeddings (Euclidean/cosine) violate this when data has hierarchical structure. The ultrametric tree guarantees zero violations by construction.
Each leaf is a property. Vertical position = merge height (distance). Scroll to zoom, drag to pan, click a leaf to highlight its subtree.
Ordinary Metric (Euclidean / Vector / Cosine):
d(A,C) β€ d(A,B) + d(B,C) [Additive β standard triangle inequality]
β Smooth, continuous space. Points can be averaged.
β Used by all vector databases (Pinecone, Weaviate, Milvus, etc.)
Ultrametric (Non-Archimedean / Tree):
d(A,C) β€ max( d(A,B), d(B,C) ) [Strong triangle inequality]
β All triangles are isosceles with two equal longest sides.
β Every point in an open ball is its center.
β Balls are either disjoint or nested β never partially overlap.
β The space is totally disconnected (no continuous paths).
Tree Distance (LCA β Lowest Common Ancestor):
Given a rooted tree T with leaves L.
For leaves a,b β L, let lca(a,b) be their lowest common ancestor.
Then: d(a,b) = depth( lca(a,b) ) / max_depth
p-adic Numbers (The Canonical Ultrametric Field):
For prime p, the p-adic absolute value |x|β = p^{βordβ(x)}
defines an ultrametric: d(x,y) = |x β y|β
This underlies v-PuNNs and p-adic neural networks.
Key Theorem β Tree Equivalence:
Every finite ultrametric space is isometric to the leaf set
of a rooted tree with uniform edge lengths at each level.
Conversely, every such tree defines an ultrametric.
β Decision trees, hierarchical clusters, and taxonomies
all implicitly define ultrametrics.
| Approach | Representation | Retrieval | Geometry | Example |
|---|---|---|---|---|
| Pure Vector | Dense vectors in βα΅ | Brute-force / KD-tree | Euclidean | Early recommenders |
| Hybrid (Current Standard) | Dense vectors in βα΅ | HNSW / hierarchical softmax | Euclidean + Tree | Pinecone, Weaviate, Milvus |
| Hyperbolic Bridge | Vectors in βα΅ | Hyperbolic ANN | Hyperbolic (tree-native) | HMamba, PoincarΓ© |
| Pure Ultrametric | p-adic / tree codes | Tree traversal | Ultrametric | v-PuNNs, XGBoost |
The initial framing contained significant inaccuracies. Each is corrected here with academic and production evidence.
| # | Error Claim | Correction | Evidence |
|---|---|---|---|
| 1 | "We don't have SGD for trees at billion-leaf scale" | Alibaba's TDM/JTM trains tree indices with gradient-based joint optimization at billion-item scale on Taobao's production ad platform since 2018. | Zhu et al., KDD 2018 + NeurIPS 2019 |
| 2 | "You can't average a Colonial and a Mid-Century Modern" | Internal tree nodes function as learned blended representations. JTM explicitly introduces hierarchical user preference representation at interior nodes. | JTM paper, NeurIPS 2019 |
| 3 | "Vector embeddings won because they're differentiable" | Hierarchical softmax (since Word2Vec, 2013) and tree-based deep models are fully differentiable. The real barrier is GPU hardware optimization for dense matmul. | Mikolov et al. 2013; TDM/JTM |
| 4 | "Vector databases are purely linear/continuous" | All major vector DBs (Pinecone, Weaviate, Milvus, Qdrant, Chroma) use HNSW β a layered tree-like graph structure for ANN retrieval. | Malkov & Yashunin, TPAMI 2020 |
| 5 | "No smooth analogies β absolute trade-off" | Hyperbolic embeddings provide continuous analogical reasoning within tree geometry. Path-based composition also supports analogies. | Nickel & Kiela 2017; HMamba 2026 |
| 6 | "We haven't built this yet β future return to symbolic AI" | Ultrametric/tree AI is already deployed in production. The framing erases a decade of tree-based ML. | TDM/JTM, Meta HSNN, v-PuNNs, XGBoost |
| 7 | Missing the hyperbolic bridge entirely | Hyperbolic deep learning (2017βpresent) provides a continuous, differentiable geometry that natively embeds trees. | HMamba, AHMRec, PoincarΓ© embeddings |
| System | Organization | Scale | Status | Key Innovation |
|---|---|---|---|---|
| TDM | Alibaba (Taobao) | Billions of items | Production (2018) | Learned tree index + DNN, O(log N) |
| JTM | Alibaba (Taobao) | Billions of items | Production (2019) | Joint optimization of tree + neural model |
| HSNN | Meta | Production ads | Production (2024) | Tree-structured hierarchical softmax |
| v-PuNNs | Academic | 52K WordNet leaves | Research (2025) | Pure p-adic neurons, 99.96% accuracy |
| Ask QWAV | Open-source | 451 papers | Deployed | 20 p-adic principles on Workers |
| HNSW | Industry standard | All vector DBs | Production | Layered navigable small-world graphs |
| HMamba | Academic | E-commerce seq rec | Research (2026) | Hyperbolic state space model |
| XGBoost/LightGBM | Industry standard | Most deployed ML | Production | Implicit ultrametric classifiers |
| Hierarchical Softmax | Mikolov et al. | All of NLP | Production (2013) | Tree over vocabulary, O(log V) |
| Year | Paper | Venue | Citations |
|---|---|---|---|
| 2013 | Efficient Estimation of Word Representations (Hierarchical Softmax) | arXiv | 40,000+ |
| 2017 | PoincarΓ© Embeddings for Learning Hierarchical Representations | NeurIPS | 1,500+ |
| 2017 | Neural Embeddings of Graphs in Hyperbolic Space (HyperML) | arXiv | 500+ |
| 2018 | Learning Tree-based Deep Model for Recommender Systems (TDM) | KDD | 400+ |
| 2019 | Joint Optimization of Tree-based Index and Deep Model (JTM) | NeurIPS | 120+ |
| 2020 | Efficient and Robust ANN Search using HNSW Graphs | TPAMI | 1,800+ |
| 2024 | Hierarchical Structured Neural Network (Meta Ads) | arXiv | N/A |
| 2025 | v-PuNNs: van der Put Neural Networks for Ultrametric Learning | arXiv | N/A |
| 2026 | HMamba: Hyperbolic Mamba for Sequential Recommendation | ACM TOIS | 16 |