Hyperbolic Fine-tuning for Large Language Models

Menglin Yang, Aosong Feng, Bo Xiong, Jihong Liu, Irwin King, Rex Ying · DOI

Introduction

Existing Large Language Models (LLMs) are typically confined to Euclidean geometry, a "flat" space where the volume of a sphere grows polynomially with its radius. However, human language is inherently hierarchical: abstract concepts (like "fruit") act as parent nodes to specific instances (like "honeycrisp apple"). Hyperbolic space is a non-Euclidean geometry with negative curvature where volume grows exponentially, making it a natural fit for embedding tree-like structures with low distortion.

This paper introduces HypLoRA, a fine-tuning method that performs low-rank adaptation directly in hyperbolic space. By capturing these latent hierarchies, HypLoRA significantly boosts performance on complex arithmetic and commonsense reasoning tasks.

The Implicit Hyperbolicity of LLMs

The authors first conducted a geometric "audit" of popular LLMs such as LLaMA and Gemma, discovering that their embeddings are already implicitly hyperbolic. Using Gromov’s $\delta$-hyperbolicity measure, they proved that LLM embeddings are significantly more "tree-like" than a random distribution, even though they were trained in Euclidean space.

Token frequency distributions and their relationship with embedding norms in GSM8K and AQuA datasets.

A key insight is the relationship between token frequency and position in the embedding space. High-frequency function words (e.g., "the", "is") cluster near the origin, acting like the root of a tree. Conversely, low-frequency, specific terms (e.g., "apple", "380") have much larger norms, pushing them toward the "periphery" of the space. This hierarchical structure is consistent across various model architectures as shown in the statistical analysis of token groups.

Mean frequency and norm statistics for different token groups across various LLM architectures, showing the correlation between frequency and embedding norm.

HypLoRA: Methods and Technical Components

To exploit these properties, the authors propose HypLoRA (Hyperbolic Low-Rank Adaptation). Key technical components include:

  • Direct Lorentz Low-Rank Transformation (LLR): Standard hyperbolic neural networks often map data to a "tangent space" (a flat Euclidean approximation) to perform linear algebra. The authors identify a "cancellation effect" where mapping back and forth without intermediate manifold operations causes hyperbolic benefits to vanish. HypLoRA avoids this by performing transformations directly on the Lorentz (hyperboloid) manifold.
  • Space-Time Decomposition: In the Lorentz model, a point has one "time-like" dimension and several "space-like" dimensions. HypLoRA applies learnable $A$ and $B$ matrices to the space-like components while recomputing the time-like component to ensure the result stays on the hyperbolic manifold.
  • Curvature Tuning: The hyperbolic curvature ($K$) is treated as a tunable hyperparameter, optimized for different reasoning domains.

Mathematically, projecting into hyperbolic space and back introduces higher-order terms dependent on the $L_2$ norm of the input. This allows the model to develop a more refined sensitivity to token importance and inter-token relationships compared to standard LoRA.

Key Results and Performance

HypLoRA was evaluated across arithmetic reasoning (GSM8K, AQuA) and commonsense reasoning (BoolQ, HellaSwag, etc.) benchmarks. It consistently outperformed standard LoRA and the more recent DoRA (Weight-Decomposed Low-Rank Adaptation):

  • Arithmetic Gains: On Qwen2.5-7B, HypLoRA achieved an 88.3% micro-average accuracy, a +7.5% jump over standard LoRA (80.8%).
  • Commonsense Gains: For Gemma3-4B, HypLoRA reached an average accuracy of 82.5%, compared to 79.5% for LoRA.
  • Efficiency: Despite the complex geometry, HypLoRA maintains a similar parameter count to LoRA. It is also faster and more memory-efficient than DoRA during inference.

Conclusion and Future Work

HypLoRA demonstrates that explicitly leveraging hyperbolic geometry can unlock significant performance gains in LLMs by better representing the hierarchical nature of language. Future work may explore its benefits in other domains like code generation or multilingual translation, and investigate the exact training dynamics that produce implicit hyperbolic structures in Euclidean-trained models.

Summary updated

BibTeX
@inproceedings{yang2025hyperbolic,
  author = {Menglin Yang and Aosong Feng and Bo Xiong and Jihong 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