The Natural Geometry of Code: Hyperbolic Representation Learning for Program Reasoning
Weilin Zhou
摘要
State-of-the-art models for code representation, such as GraphCodeBERT, embed the hierarchical structure of source code into Euclidean space. This approach can lead to significant representation distortion, especially when embedding deep or highly branched hierarchies,limiting the models' ability to capture deep program semantics. We argue that the natural geometry for code is hyperbolic, as its exponential volume growth perfectly matches the tree-like structure of a code's Abstract Syntax Tree (AST), enabling low-distortion hierarchical embeddings. We introduce HypeCodeNet, a geometric deep learning framework that operates natively in hyperbolic space. Formulated in the numerically stable Lorentz model, its manifold-aware components include a hyperbolic embedding layer, a tangent space message-passing mechanism, and a geodesic-based attention module. On code clone detection, code completion, and link prediction, HypeCodeNet significantly outperforms existing Euclidean models, especially on tasks requiring deep structural understanding. Our work suggests that hyperbolic geometry offers a geometrically sound foundation for code representation, establishing hyperbolic geometry as a key to unlocking the structured semantics of code.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
它引用的顶会 Paper6
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 被引用 1,224 次
- Hyperbolic Neural Networks++Ryohei Shimizu, Yusuke Mukuta, Tatsuya HaradaICLR 2021 · 被引用 791 次
- Learning and Evaluating Contextual Embedding of Source CodeAditya Kanade, Petros Maniatis, Gogul Balakrishnan, Kensen ShiICML 2020 · 被引用 438 次
- Mixed-curvature Variational AutoencodersOndrej Skopek, Octavian-Eugen Ganea, Gary BécigneulICLR 2020 · 被引用 122 次
- Hyperbolic Representation Learning: Revisiting and AdvancingMenglin Yang, Min Zhou, Rex Ying, Yankai Chen 等ICML 2023 · 被引用 41 次
相关 Paper
- Lorentzian Graph Convolutional NetworksYiding Zhang, Xiao Wang, Chuan Shi, Nian Liu 等WWW 2021 · 被引用 119 次
- Fully Hyperbolic Neural NetworksWeize Chen, Xu Han, Yankai Lin, Hexu Zhao 等ACL 2022
- Discrete-time Temporal Network Embedding via Implicit Hierarchical Learning in Hyperbolic SpaceMenglin Yang, Min Zhou, Marcus Kalander, Zengfeng Huang 等KDD 2021 · 被引用 101 次
- Hypformer: Exploring Efficient Transformer Fully in Hyperbolic SpaceMenglin Yang, Harshit Verma, Delvin Ce Zhang, Jiahong Liu 等KDD 2024 · 被引用 14 次
- Hyperbolic Dataset DistillationWenyuan Li, Guang Li, Keisuke Maeda, Takahiro Ogawa 等NeurIPS 2025 · 被引用 17 次
