SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.04010 · NeurIPS · 2025

Hyperbolic Fine-Tuning for Large Language Models

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

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 21 functions out of this paper's own repositories and ran 14 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
marlin-codes/HypLLM canonical 11 of 18
marlin-codes/hyplora canonical 3 of 3
FunctionStatusWhere it lives
compute_token_frequencies Ran marlin-codes/hyplora/utils/token_frequency_distribution.py
pointer only (licence: NONE) · get_code("9b3f4eb40a06e33e")
create_dir Ran marlin-codes/hyplora/utils/token_frequency_distribution.py
pointer only (licence: NONE) · get_code("2ac7050b0ae37227")
generate_prompt Ran marlin-codes/HypLLM/finetune_gemma.py
pointer only (licence: NONE) · get_code("efa052b7627685a8")
generate_prompt Ran marlin-codes/HypLLM/finetune_gemma7b.py
pointer only (licence: NONE) · get_code("855c98801d59aba9")
generate_prompt Ran marlin-codes/HypLLM/finetune_llama3.py
pointer only (licence: NONE) · get_code("129a49595d6cd469")
generate_prompt Ran marlin-codes/HypLLM/finetune_qwen.py
pointer only (licence: NONE) · get_code("10b11110fd400897")
generate_prompt_gemma Ran marlin-codes/HypLLM/commonsense_evaluate.py
pointer only (licence: NONE) · get_code("db94af6846fc86ac")
generate_prompt_gemma Ran marlin-codes/HypLLM/commonsense_evaluate_gemma.py
pointer only (licence: NONE) · get_code("0f6cd6a20020ddc7")
generate_prompt_legacy Ran marlin-codes/HypLLM/commonsense_evaluate.py
pointer only (licence: NONE) · get_code("349264d7e81ea7aa")
generate_prompt_llama Ran marlin-codes/HypLLM/commonsense_evaluate_gemma.py
pointer only (licence: NONE) · get_code("bfb00dffb905f6c9")
generate_prompt_qwen Ran marlin-codes/HypLLM/commonsense_evaluate.py
pointer only (licence: NONE) · get_code("108402de33a9b9f9")
load_data Ran marlin-codes/HypLLM/commonsense_evaluate_qwen.py
pointer only (licence: NONE) · get_code("56a9466ff35b35bb")
load_data Ran marlin-codes/HypLLM/evaluate.py
pointer only (licence: NONE) · get_code("9986725c1f5dc7bd")
mkdirs Ran marlin-codes/hyplora/utils/token_frequency_distribution.py
pointer only (licence: NONE) · get_code("edf7c9e239eadabf")
main Not yet run marlin-codes/HypLLM/commonsense_evaluate_gemma.py
pointer only (licence: NONE) · get_code("27ce6e249f9b1a82")
main Not yet run marlin-codes/HypLLM/commonsense_evaluate_qwen.py
pointer only (licence: NONE) · get_code("e563b8e4282a0c32")
main Not yet run marlin-codes/HypLLM/evaluate.py
pointer only (licence: NONE) · get_code("11971b0db65e9e75")
train Not yet run marlin-codes/HypLLM/finetune_gemma.py
pointer only (licence: NONE) · get_code("89be12b59a6331d6")
train Not yet run marlin-codes/HypLLM/finetune_gemma7b.py
pointer only (licence: NONE) · get_code("265773714d80dabf")
train Not yet run marlin-codes/HypLLM/finetune_llama3.py
pointer only (licence: NONE) · get_code("fbba0cdd6457bbf4")
train Not yet run marlin-codes/HypLLM/finetune_qwen.py
pointer only (licence: NONE) · get_code("1200fafec7c5e3d1")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large language models (LLMs) have demonstrated remarkable performance across various tasks. However, it remains an open question whether the default Euclidean space is the most suitable choice for LLMs. In this study, we investigate the geometric characteristics of LLMs, focusing specifically on tokens and their embeddings. Our findings reveal that token frequency follows a power-law distribution, where high-frequency tokens (e.g., "the," "that") constitute the minority, while low-frequency tokens (e.g., "apple," "dog") constitute the majority. Furthermore, high-frequency tokens cluster near the origin, whereas low-frequency tokens are positioned farther away in the embedding space. Additionally, token embeddings exhibit hyperbolic characteristics, indicating a latent tree-like structure within the embedding space. Motivated by these observations, we propose HypLoRA, an efficient fine-tuning approach that operates in hyperbolic space to exploit these underlying hierarchical structures better. HypLoRA performs low-rank adaptation directly in hyperbolic space, thereby preserving hyperbolic modeling capabilities throughout the fine-tuning process. Extensive experiments across various base models and reasoning benchmarks, specifically arithmetic and commonsense reasoning tasks, demonstrate that HypLoRA substantially improves LLM performance.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2410.04010")
get_code_for_paper("2410.04010")
have("2410.04010")

Connect an agent — have() is free.