Hyperbolic Fine-Tuning for Large Language Models

Menglin Yang, Ram Samarth B B, Aosong Feng, Bo Xiong, Jiahong Liu, Irwin King, Rex Ying

TL;DR

Most Large Language Models (LLMs) represent language in "flat" Euclidean space, but language is inherently hierarchical and tree-like. HypLoRA is a novel fine-tuning method that operates in "curved" hyperbolic space, allowing models to better capture these complex relationships. This approach significantly boosts performance on arithmetic and commonsense reasoning tasks without increasing the parameter count.

Introduction: The Euclidean Bottleneck

In the world of LLMs, words (tokens) are typically represented as vectors in Euclidean space. While intuitive, Euclidean geometry has a fundamental limitation: it struggles to efficiently represent hierarchical structures. Think of a biological taxonomy; as you move from general concepts (like "animal") to specific instances (like "golden retriever"), the number of "leaves" grows exponentially. In flat space, these leaves eventually get crowded together, leading to "representation degeneration."

Hyperbolic space, characterized by negative curvature, is the natural home for trees. It expands exponentially as you move away from the origin, providing ample "room" for hierarchical data to breathe. While researchers have suspected LLMs might benefit from this, training a massive model in hyperbolic space from scratch is prohibitively expensive. The challenge addressed here is how to inject this beneficial "hyperbolic bias" into existing, pre-trained Euclidean LLMs during the fine-tuning phase.

Methodology: Uncovering Hyperbolic Geometry in LLMs

The authors first performed a geometric "check-up" on models like LLaMA and Gemma, uncovering two critical insights:

  1. The Power-Law/Norm Connection: Token frequencies follow a power-law distribution. High-frequency tokens (abstract words like "the" or "is") cluster near the origin with smaller embedding norms, while low-frequency, specific tokens (like "apple") are pushed to the periphery with larger norms. This is a hallmark of hyperbolic organization.
Token frequency and norm distributions for GSM8K and AQuA datasets.
Table showing the inverse relationship between token frequency and embedding norm across various LLMs.
  1. $\delta$-Hyperbolicity: Using formal metric space measurements, they proved that LLM embeddings are significantly more "tree-like" than they are "flat."

To exploit this inherent geometry, the researchers developed HypLoRA. Unlike standard LoRA, which adds a low-rank update in Euclidean space, HypLoRA performs the adaptation directly on a Lorentz manifold (a specific model of hyperbolic geometry).

A key technical contribution is the Direct Lorentz Low-Rank Transformation (LLR). Previous attempts at hyperbolic neural networks often mapped data to a "tangent space" (a flat approximation), performed a calculation, and mapped it back. The authors found that chaining these operations causes the maps to effectively cancel each other out, losing the geometric benefit. HypLoRA avoids this "cancellation effect" by keeping the transformation entirely on the curved manifold.

Experimental Setup

The researchers evaluated HypLoRA across a wide battery of reasoning benchmarks:

  • Arithmetic Reasoning: GSM8K (grade school math), AQuA (algebra), MAWPS, and SVAMP.
  • Commonsense Reasoning: A massive 170K-sample collection including BoolQ, PIQA, SIQA, HellaSwag, WinoGrande, ARC (Easy and Challenge), and OpenBookQA (OBQA).
  • Base Models: Testing was conducted on LLaMA-7B/13B, LLaMA3-8B, Gemma-7B, Gemma3-4B, and Qwen2.5-7B.

Key Insights and Results

  • Language is a Tree: The paper reinforces the idea that the "semantic space" of an LLM isn't just a cloud of points; it’s a hierarchy. High-frequency tokens act as the "roots," and specific knowledge forms the "branches."
  • Hyperbolic Space as a Regularizer: By forcing fine-tuning to happen in hyperbolic space, the model is naturally discouraged from "crowding" specific concepts together. This helps maintain the distinctness of numerically close but semantically different values (e.g., distinguishing between 380 and 400 in a math problem).
  • Performance Gains: HypLoRA consistently outperformed standard LoRA and the more recent DoRA (Weight-Decomposed Low-Rank Adaptation). On the Qwen2.5-7B model, HypLoRA achieved a +7.5% improvement in average accuracy over LoRA for arithmetic tasks, with a massive +9.3% jump on the challenging GSM8K dataset. Across eight commonsense tasks, HypLoRA provided a steady boost (e.g., improving Gemma3-4B from 79.5% to 82.5%).
  • Efficiency and Faithfulness: Despite the complex math, HypLoRA uses essentially the same amount of GPU memory as standard LoRA and is faster than DoRA during inference. Qualitatively, while standard LoRA often makes "arithmetic lapses," HypLoRA stays "faithful" to the sequence of operations due to better separation in the embedding space.

Limitations and Future Work

  • Domain Specificity: The study focused heavily on reasoning (math and commonsense). The benefits for other domains, like code generation or multilingual translation, still need validation.
  • Correlation vs. Causality: While the link between token frequency and embedding norm is strong, it remains correlational. Exactly why the training process produces this specific geometry is a target for future research.
  • Inference Overhead: While memory-efficient, the hyperbolic projections add a small amount of computational overhead during inference compared to "flat" LoRA, which might be a consideration for ultra-low-latency applications.

Summary updated

BibTeX
@inproceedings{yang2025hyperbolic,
  author = {Menglin Yang and Ram Samarth B B and Aosong Feng and Bo Xiong and Jiahong Liu and Irwin King and Rex Ying},
  title = {{Hyperbolic Fine-Tuning for Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=TkEdQv0bXB},
}
Figure