Back to Embedding Research

Hyperbolic Embeddings in Qdrant

Matin Mahmood and John Kupchanko

·

September 08, 2026

Hyperbolic Embeddings in Qdrant

We choose embedding models, dimensions, and indexes. The geometry usually comes with the package. But why use a flat space, and what else could we choose?

What Is a Manifold, and Where Do Our Vectors Live?

A manifold is the space our embeddings live in. For embeddings, we care about the geometry we give that space. It determines how we measure distance, what the shortest path looks like, and how much room there is as we move outward.

Euclidean plane, sphere, and Lorentz hyperboloid

Euclidean, spherical, and hyperbolic spaces. The hyperbolic space is shown using the Lorentz model.

The embedding is still a vector. The geometry determines how we measure distance between vectors.

SpaceGeometryA natural example
EuclideanFlatContinuous positions and attributes
SphericalPositively curvedAngular or periodic data
HyperbolicNegatively curvedBranching hierarchies

Many familiar embedding models normalize their vectors onto a sphere and use cosine similarity. Hyperbolic embeddings use a different geometry, one that is particularly well suited to branching relationships.

Hierarchical Data Meets Hyperbolic Embeddings

Imagine a product catalog. Footwear splits into boots, trainers, and sandals. Boots split into ankle boots, hiking boots, and work boots. Each type contains products, and each product can have several variants.

A branching product catalog beside an exponential growth curve

A catalog with three children per node grows as $3^\ell$ at depth $\ell$.

A tree multiplies. A flat disk only squares.

In $d$-dimensional Euclidean space, the volume within radius $r$ grows polynomially:

$$ V_E(r) \propto r^d. $$

In two-dimensional hyperbolic space with curvature $-1$, the area is

$$ A_H(r)=2\pi(\cosh r-1), $$

which grows exponentially for large $r$.

That is a much closer match to the growth of a branching tree. As a hierarchy gets deeper, hyperbolic space keeps creating room for its descendants. In a flat space, branches increasingly crowd together.

The same branching structure appears in biological taxonomies, document hierarchies, and part and whole relationships. Hyperbolic embeddings give these hierarchies room to grow.

Superpowers of Hyperbolic Embeddings

Matching the geometry to the data can make an embedding more compact and give its coordinates more meaning. Two useful examples are dimensional efficiency and radius as a measure of specificity.

Dimensional Efficiency

When the geometry matches the data, you can often represent the same structure with fewer dimensions.

WordNet gives a concrete example. Its noun hierarchy contains relationships such as poodle → dog → animal. We can compare how well Euclidean and hyperbolic embeddings reconstruct those relationships at different dimensions. [1]

WordNet reconstruction quality for Euclidean and Poincaré embeddings across six embedding dimensions

WordNet reconstruction, measured by mean average precision (higher is better). Results from Table 1. [1]

Five-dimensional Poincaré embeddings achieved 0.823, compared with 0.168 for 200-dimensional Euclidean embeddings. That is 40 times fewer coordinates and better reconstruction on this task.

Fewer coordinates mean fewer values to store and move through a retrieval system. Before reaching for a larger vector, it is worth asking whether a different geometry would fit the data better.

Radius Can Encode Specificity

One of the nicest properties of a hierarchy-aware hyperbolic embedding is that radius can start to mean something.

Closer to the center, you can place broad concepts. Farther out, you can place more specific descendants. Direction separates branches; radius helps organize depth.

For a catalog, “footwear” covers many possible items. “Boots” narrows that set. “Red leather ankle boots” narrows it further. A representation that captures this structure has room for both semantic similarity and different levels of detail.

Hyper3-CLIP, a hyperbolic image and text embedding model from hyper³labs, brings this idea to visual retrieval. [7] It is trained to capture general-to-specific relationships alongside similarity. This gives radius a role in organizing broad descriptions and specific visual content. [2] It follows earlier work on hyperbolic image and text representations. [3]

Consider the black Chelsea boot below. A traversal toward the origin illustrates a move from the specific product to broader concepts: black Chelsea boots, Chelsea boots, boots, and footwear.

Conceptual inward traversal with progressively broader product examples beside each level

Conceptual traversal inspired by a catalog product from Amazon Berkeley Objects. Product imagery is AI-illustrated; descriptions and positions are illustrative, not model retrieval results. [6]

We can also look at how the model organizes product images. Below are conventional CLIP [8] and Hyper3-CLIP embeddings of the same catalog subset.

The same 165 Amazon Berkeley Objects product images [10] in six categories, shown through UMAP [9] projections of conventional CLIP and Hyper3-CLIP embeddings. Colors identify product types. These projections illustrate neighborhoods; they do not measure specificity or establish retrieval quality.

Testing Hyperbolic Embeddings

WordNet is useful for showing why hyperbolic embeddings work, but we also wanted to see what happens on something closer to a real application. So we tested the same idea on the Google Product Taxonomy: 5,595 categories, seven levels, and 17,312 relationships. [11]

Both embeddings used the same data and optimizer. The main difference was the geometry.

We scored them with mean average precision, written MAP from here on. It asks how close each category’s true parents land to the top of its results. Higher is better, and 1.000 MAP would mean every parent came back first.

DimensionsEuclidean MAPPoincaré MAP
20.1400.501
50.2390.905
100.3540.925
200.5510.932
500.6580.934

At just 5 dimensions, the Poincaré embedding reaches 0.905 MAP. The Euclidean version only reaches 0.658 MAP at 50 dimensions, using ten times as many coordinates.

That is the part that matters. When the data really does branch like a tree, hyperbolic geometry can represent that structure much more efficiently.

There is one limitation. These numbers measure relationships the embedding already saw during training. When we asked it to find each category’s direct parent instead, the score dropped to 0.539 MAP.

So we would not treat this as a universal win. We would treat it as a strong reason to test hyperbolic embeddings when the data itself is hierarchical.

Serving Them with Qdrant

Getting a good embedding was only half the problem. The next question was how to search it.

Hyperbolic distance can be converted into an inner product by adding two extra dimensions. Under brute force search in Faiss, that worked well. Across 82,115 WordNet nouns it found 0.986 of the correct nearest neighbors in its top 10, a measure we write as recall@10.

Then we put the same vectors behind HNSW. Recall@10 dropped to 0.020, even with ef=1024.

The conversion was still mathematically correct, but the resulting vectors had norms spread across roughly a 600x range. That made HNSW a poor fit for the ranking we actually wanted.

Grouping vectors by norm helped, but recall@10 only reached 0.410.

So instead of forcing the converted vectors into HNSW, we changed the search strategy.

The collection stores the Poincaré coordinates as an ordinary Euclidean vector, and keeps each point’s squared norm in its payload:

client.create_collection(
    "taxonomy_geometry",
    vectors_config={
        "hyperbolic": models.VectorParams(size=5, distance=models.Distance.EUCLID),
    },
)

client.create_payload_index(
    "taxonomy_geometry", "sq_norm",
    field_schema=models.PayloadSchemaType.FLOAT,
)

Without that payload index the rescore turns into a full scan.

Qdrant first uses Euclidean HNSW to pull a candidate set from the original Poincaré coordinates. Then a Formula Query rescores those candidates with the real hyperbolic distance in the same request. [5]

The geodesic, meaning the shortest path between two points in the curved space, is the true hyperbolic distance. Computing it needs acosh, the inverse hyperbolic cosine, and Formula Query does not have that operator. [4] It does have ln and sqrt, and since acosh(x) is ln(x + sqrt(x^2 - 1)), the distance is expressible as it stands. The inner term is:

{
  "sum": [1.0, {"div": {
    "left":  {"mult": [2.0, {"pow": {"base": "$score", "exponent": 2.0}}]},
    "right": {"mult": [0.0488, {"sum": [1.0, {"neg": "sq_norm"}]}]}
  }}]
}

$score is the Euclidean distance the prefetch already computed. sq_norm comes from the payload. 0.0488 is one minus the squared norm of the query, which you calculate before sending. The vector here is the stored point for Animals & Pet Supplies, whose squared norm is 0.9512. Call that term x, and the query is:

{
  "prefetch": [{
      "query": [-0.3189, 0.9057, -0.0140, 0.1646, -0.0439],
      "using": "hyperbolic",
      "limit": 1000
    }],
  "query": {"formula": {
    "neg": {"ln": {"sum": [
      x, {"sqrt": {"sum": [{"pow": {"base": x, "exponent": 2.0}}, -1.0]}}
    ]}}
  }},
  "limit": 10
}

We tested this against a live Qdrant collection with all 5,595 taxonomy points.

PrefetchEuclidean OnlyWith Rescore
100.2660.257
500.2660.472
1000.2660.598
3000.2660.783
10000.2660.920

Euclidean HNSW alone finds about a quarter of the correct hyperbolic neighbors. With a prefetch of 1,000 and Formula Query rescoring, recall@10 reaches 0.920. And the whole search stays inside Qdrant in one server side request.

The prefetch size matters. If the right neighbors never make it into the candidate set, rescoring cannot recover them.

There is one more tradeoff. As the embedding gets better, the prefetch usually needs to get wider.

Comparing two embeddings offline, the stronger one at 0.905 MAP recovered 0.498 of the true neighbors from a prefetch of 50, while a weaker one at 0.724 MAP recovered 0.789 of them. Those offline numbers sit a little above what the live index returns, because HNSW is approximate.

Better hyperbolic embeddings push more points toward the edge of the Poincaré ball, where Euclidean distance becomes a weaker shortcut. So if you improve the embedding, retest the retrieval settings too.

Exploring the Results

To make the difference easier to see, we built a live viewer against the same Qdrant collection.

The same category and its parents, left to right: the hyperbolic Poincaré disk, the flat Euclidean embedding, and the text embedding. In the Poincaré disk the chain runs cleanly from the center to the rim. The other two have run out of room to keep the levels apart.

Pick a category and it runs three searches, one per panel: the exact hyperbolic distance, Euclidean distance over the flat trained coordinates, and cosine similarity over a text embedding.

The distances shown in the viewer come directly from Qdrant. Nothing is recalculated in the browser.

We checked the same calculations outside Qdrant, and they matched within 4.7e-07. So the viewer is showing the actual search behavior, not an approximation.

Takeaways

If your data naturally forms a hierarchy, we would test a small hyperbolic embedding before automatically reaching for a much larger Euclidean one. On the product taxonomy, a 5 dimensional Poincaré embedding reached 0.905 MAP. A 50 dimensional Euclidean embedding reached 0.658 MAP.

The harder part is serving it. We would not convert the vectors and index them directly with HNSW. That worked under brute force search, but recall@10 dropped to 0.020 once HNSW was involved.

Instead, use HNSW to find candidates and let Qdrant rescore them with the real hyperbolic distance. On this collection, that moved recall@10 from 0.266 to 0.920 with a prefetch of 1,000.

You may also need to widen the prefetch as the embedding improves because Euclidean distance becomes less reliable near the edge of the Poincaré ball.

The main point is simple. If the data is hierarchical, Qdrant gives you a practical way to store the coordinates, use HNSW for candidate retrieval, and apply the real geometry during rescoring without adding a separate search system.

References

  1. Nickel, M. and Kiela, D. (2017). Poincaré Embeddings for Learning Hierarchical Representations. WordNet reconstruction results: Table 1.
  2. Mahmood, M. et al. (2026). Hyper3-CLIP: Hierarchy-Conditioned Hyperbolic Vision-Language Training.
  3. Desai, K. et al. (2023). Hyperbolic Image-Text Representations (MERU).
  4. Qdrant. Add acosh expression to Formula Query.
  5. Qdrant. Hybrid Queries and Formula Query.
  6. Amazon Berkeley Objects. Product image, item B06XCPVVPS, image 71KwV3JHT9L.
  7. hyper³labs. The Geometry Mistake Behind Modern Embedding Models.
  8. Radford, A. et al. (2021). Learning Transferable Visual Models From Natural Language Supervision (CLIP).
  9. McInnes, L., Healy, J. and Melville, J. (2018). UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction.
  10. Amazon Berkeley Objects. Dataset and documentation.
  11. Google. Google Product Taxonomy.
Was this page useful?

Thank you for your feedback! 🙏

We are sorry to hear that. 😔 You can edit this page on GitHub, or create a GitHub issue.