An interactive tour

A walk in hyperbolic space

Some data is shaped like a tree. Flat space is a poor home for it. Curved space isn't.

Start walking ↓

Everything here is draggable. Try the tree.

01 · Three kinds of space

Draw a triangle. Do its corners make a straight line?

Put the three corners side by side. In flat space they fill a straight line exactly. Elsewhere they don't. Drag the corners.

The three corners, side by side

02 · Trees don't fit flat

A tree gets wider at every level.

Every level has more nodes than the one before it. Flat space piles them up at the rim. Hyperbolic space keeps making room. Add levels. Hover a node. Drag the right disk.

Flat. The rim fills up. Leaves pile on top of each other.
Hyperbolic. Same tree, same spacing everywhere. Refocus to see.

03 · Position means something

The further out, the more specific.

Embed real categories and the hierarchy shows up as position: general ideas near the middle, specific ones toward the rim. Hover a node.

general
specific
Flat. Just a diagram. Where a point sits says nothing about how specific it is.
Hyperbolic. Distance from the center is how specific. Drag to refocus.

04 · Neighbors

Who counts as close?

Pick a node. Each space marks its ten closest points. Hyperbolic space picks family: parents, siblings, cousins. The flat picture picks whoever is drawn nearby. Click a node.

your pickclosest in flatclosest in hyperbolic
Flat. Blue rings hug the pick. Red rings, its real family, are scattered.
Hyperbolic. Red rings follow the branches. Blue rings are strangers.

05 · In practice

Same idea, different geometry.

Flat

Curvature
none
Room away from the center
grows slowly
Best for
Grids, everyday coordinates

Sphere

Curvature
bends inward
Room away from the center
runs out
Best for
Directions, cosine similarity

Hyperbolic

Curvature
bends outward
Room away from the center
keeps growing
Best for
Trees, taxonomies, hierarchies

Searching it in Qdrant

Near the rim, plain Euclidean search picks poor neighbors. So fetch candidates fast, then re-rank with the true hyperbolic distance.

1Store the point as an ordinary vector
→
2Prefetch candidates with HNSW
→
3Re-rank with the hyperbolic distance
# the true distance
d(u, v) = acosh( 1 + 2·‖u − v‖² / ((1 − ‖u‖²)(1 − ‖v‖²)) )
# no acosh in Qdrant's Formula Query, so rewrite it:
acosh(x) = ln( x + √(x² − 1) )