Probing BERT in Hyperbolic Spaces

Boli Chen, Yao Fu, Guangwei Xu, Pengjun Xie, Chuanqi Tan, Mosha Chen, Liping Jing

TL;DR

Standard methods for "probing" BERT—extracting the linguistic knowledge hidden in its embeddings—usually assume that language data lives in a flat, Euclidean world. This paper introduces the Poincaré probe, which uses hyperbolic geometry to show that BERT’s internal representations of syntax and sentiment are actually highly hierarchical. By moving to a space that "expands" exponentially, researchers found that BERT encodes complex grammar and fine-grained emotions much more clearly than previously thought.

The Flat Space Problem

Large language models like BERT are notoriously opaque "black boxes." To understand what they learn, researchers use probes: simple mathematical models designed to extract specific linguistic features (like part-of-speech tags or dependency trees) from the model's internal layers.

However, most traditional probes rely on Euclidean distance (the standard "straight-line" distance we use in daily life). The problem is that language is fundamentally hierarchical. Think of a sentence as a branching tree of grammatical dependencies. Mathematically, Euclidean space is "too small" to fit large, branching trees without crowding the nodes together at the edges.

Hyperbolic space, which has constant negative curvature, grows exponentially as you move away from the center. This makes it a natural geometric home for tree-like structures. The authors ask a compelling question: If we use a hyperbolic probe, can we better reveal the "hidden" hierarchies BERT has already discovered?

Comparison of Euclidean and Poincaré trees alongside syntax and sentiment embeddings.

Enter the Poincaré Probe

To test this, the authors introduce the Poincaré probe, named after the Poincaré ball model of hyperbolic geometry. The probe operates across two primary linguistic domains:

  1. Syntactic Probing: The researchers project BERT embeddings into a hyperbolic subspace. They then attempt to recover the "distance" between words in a dependency tree (how many hops exist between words) and the "depth" of a word (how far it is from the root of the sentence).
  2. Sentiment Probing: Extending the idea to semantics, they define two "meta-embeddings" at the top of a hierarchy: one for absolute Positivity and one for absolute Negativity. Words are positioned in the Poincaré ball based on their sentiment intensity. For instance, a strong word like "awesome" sits closer to the [POS] root than a milder word like "good."
  3. Mathematical Framework: To make this work, the probe uses specialized hyperbolic operations—such as Möbius addition and Möbius matrix-vector multiplication—to transform the embeddings while strictly respecting the curvature of the space.

Key Insights and Results

By evaluating the probe on the Penn Treebank (for syntax) and the Movie Review dataset (for sentiment), the authors uncovered several fascinating insights about how BERT organizes language:

  • Hyperbolic Advantage in Depth: The Poincaré probe significantly outperforms Euclidean probes on longer sentences and deeper trees. This suggests that as syntactic complexity increases, BERT’s internal "logic" becomes increasingly non-Euclidean. In syntactic recovery, the Poincaré probe achieved higher Unlabeled Attachment Scores (UUAS) and depth correlations. For example, on BERT-Large (layer 16), the Poincaré probe hit a depth correlation of 0.89 compared to the Euclidean 0.88, with the performance gap widening significantly on complex sentences.
  • Sentiment as Geometry: BERT doesn't just view sentiment as a binary positive/negative label. It organizes words in a fine-grained hierarchy where "excellent" is geometrically deeper and closer to the absolute positive root than "good." Using this geometric approach, the Poincaré probe achieved 84.5% accuracy on movie review classification, outperforming Euclidean probes (79.1%).
  • Contextual Shifting: Through "lexically-controlled contextualization" (e.g., changing "This is a good movie" to "This is not a good movie"), the authors visualized how BERT physically moves word embeddings across the Poincaré ball to reflect real-time changes in meaning.
  • The "Sensitivity" Desideratum: A good probe shouldn't be a powerful model that learns the task from scratch; it should be a restricted lens that is sensitive to what is already encoded in the embeddings. The Poincaré probe proved to be far more sensitive to the underlying syntax than its Euclidean counterparts.

Limitations and Future Work

While groundbreaking, the approach has limitations. To visualize high-dimensional hyperbolic data in 2D figures, the authors used Principal Component Analysis (PCA), which inevitably introduces some geometric distortion.

Additionally, the current probe uses a fixed curvature (optimal results occurred at a curvature of -1). Future work could explore adaptive curvature, where the probe dynamically learns the "roundness" of the subspace for different linguistic tasks. Ultimately, this research suggests that hyperbolic tools could be used not just to probe existing models like BERT, but to design entirely new, natively hyperbolic language architectures in the future.

Summary updated

BibTeX
@inproceedings{chen2021probing,
  author = {Boli Chen and Yao Fu and Guangwei Xu and Pengjun Xie and Chuanqi Tan and Mosha Chen and Liping Jing},
  title = {{Probing BERT in Hyperbolic Spaces}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure