Visualizing GPT-2 Vocabulary in a Hyperbolic Ball

Limp-Contest-7309 · reddit · 2026-07-19

This is a visualization project that places the **32,070 token embeddings of GPT-2-small** into hyperbolic space (Poincaré ball). It requires no training, purely using the raw token embeddings for geometric layout. The author explains that the similarity structure of a vocabulary resembles a forest rather than a flat graph. Hyperbolic space is naturally better at accommodating such tree-like structures because the space expands exponentially with distance. The web app is mobile-friendly, allowing users to drag, rotate, zoom, search for tokens, and explore along proximity lines. The post also shares some interesting observations: - The dense inner layers are mostly isolated tokens that lack "mutual nearest neighbors." - You can search for "dog" and follow the connections to find "cats," or walk through the days of the week starting from "Monday." - In this structure, "Trump" is solely connected to "Ivanka." The entire project consists of a single HTML file and runs entirely on the client side.

Related event: Interactive Tool Visualizes GPT-2 Token Embeddings(4 posts)→

Original post →

More from Research

Research channel →