Hierarchical Mamba Meets Hyperbolic Geometry: A New Paradigm for Structured Language Embeddings

Sarang Patil, Ashish Parmanand Pandey, Ioannis Koutis, Mengjia Xu
5/25/2025
cs.CLcs.LG

Official code: BerryByte/HiM (1 star, last commit 2026-03-21).

Abstract

Selective state-space models excel at long-sequence modeling, but their capacity for language representation -- in complex hierarchical reasoning -- remains underexplored. Most large language models rely on \textit{flat} Euclidean embeddings, limiting their ability to capture latent hierarchies. To address this, we propose {\it Hierarchical Mamba (HiM)}, integrating efficient Mamba2 with hyperbolic geometry to learn hierarchy-aware language embeddings for deeper linguistic understanding. Mamba2-processed sequences are projected to the Poincaré ball or Lorentzian manifold with ``learnable'' curvature, optimized with a hyperbolic loss. Our HiM model facilitates the capture of relational distances across varying hierarchical levels, enabling effective long-range reasoning for tasks like mixed-hop prediction and multi-hop inference in hierarchical classification. Experimental results show both HiM variants effectively capture hierarchical relationships across four linguistic and medical datasets, surpassing Euclidean baselines, with HiM-Poincaré providing fine-grained distinctions with higher h-norms, while HiM-Lorentz offers more stable, compact, and hierarchy-preserving embeddings-favoring robustness. The source code is publicly available at https://github.com/BerryByte/HiM.

View on arXivView PDF

Code Implementations(1)

BerryByte/HiMOfficial100%
10Shell, PythonDec 31, 20257 months ago

Similar Papers

Cite this paper

@article{patil2025hierarchical,
  title  = {Hierarchical Mamba Meets Hyperbolic Geometry: A New Paradigm for Structured Language Embeddings},
  author = {Sarang Patil and Ashish Parmanand Pandey and Ioannis Koutis and Mengjia Xu},
  year   = {2025},
  eprint = {2505.18973},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.18973v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.18973.svg)](https://codeofpaper.com/paper/2505.18973)

Discussion