SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.01023 · NeurIPS · 2024

Learning Structured Representations with Hyperbolic Embeddings

Han Zhao, Makoto Yamada, Aditya Sinha, Siqi Zeng

arXiv · PDF · Open in the Atlas

Code that ran

12 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 12 failures of our instrument; 3 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2412.01023.json · badge: /api/ran/2412.01023.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
uiuctml/HypStructure canonical (classifier label)
classifier basis: census
12 ran · 3 no recorded run
FunctionStatusWhere it lives
busemann Ran
ran; our contract draft was wrong, not the code
uiuctml/HypStructure/geom/horo.py
pointer only (licence: MIT); the stored copy get_code serves, from HazyResearch/HoroPCA, is pointer only (licence: NONE) · get_code("28baecbc84c248a8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from HazyResearch/HoroPCA, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

circle_intersection Ran
ran; our contract draft was wrong, not the code
uiuctml/HypStructure/geom/horo.py
code served (permissive licence) · get_code("3108ccfe785c00d0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 2, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function circle_intersection expects:
# c1, c2: tensors of shape (..., d) where d=2 (asserted in the function)
# r1, r2: tensors of shape (...)

# Create small tensors with batch size 2 and dimension 2
c1 = torch.randn(2, 2)  # shape (2, 2)
c2 = torch.randn(2, 2)  # shape (2, 2)
r1 = torch.randn(2).abs() + 0.5  # shape (2,), positive radii
r2 = torch.randn(2).abs() + 0.5  # shape (2,), positive radii

ARGS = {
    "c1": c1,
    "c2": c2,
    "r1": r1,
    "r2": r2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 2, 2) — shape (2, 2, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
circle_intersection_ Ran
ran; our contract draft was wrong, not the code
uiuctml/HypStructure/geom/horo.py
pointer only (licence: MIT); the stored copy get_code serves, from HazyResearch/HoroPCA, is pointer only (licence: NONE) · get_code("1faaa541998d4b4c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from HazyResearch/HoroPCA, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

euc_reflection Ran
ran; our contract draft was wrong, not the code
uiuctml/HypStructure/geom/euclidean.py
code served (permissive licence) · get_code("7d2a17cffeebbaee")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# x: a tensor that will be reflected
# The function uses: torch.sum(x * a, dim=-1, keepdim=True)
# So x should be a tensor with batch and feature dimensions
x = torch.randn(2, 4)

# a: a tensor representing the axis of reflection
# The function uses: torch.sum(x * a, dim=-1, keepdim=True)
#                    torch.sum(a ** 2, dim=-1, keepdim=True)
#                    xTa * a / norm_a_sq
# So a should be a tensor with the same last dimension as x
a = torch.randn(2, 4)

ARGS = {
    "x": x,
    "a": a,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
exp_unit_tangents Ran
ran; our contract draft was wrong, not the code
uiuctml/HypStructure/geom/hyperboloid.py
pointer only (licence: MIT); the stored copy get_code serves, from HazyResearch/HoroPCA, is pointer only (licence: NONE) · get_code("caad5cf1736c5c6b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from HazyResearch/HoroPCA, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

from_poincare Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
uiuctml/HypStructure/geom/hyperboloid.py
pointer only (licence: MIT); the stored copy get_code serves, from HazyResearch/HoroPCA, is pointer only (licence: NONE) · get_code("a4880a4d1201ee27")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from HazyResearch/HoroPCA, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_scores Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
uiuctml/HypStructure/utils.py
code served (permissive licence) · get_code("cf06b847b490e55a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small feature matrices
# ftrain: training features (n_train x feature_dim)
ftrain = np.random.randn(10, 4).astype(np.float32)

# ftest: test features (n_test x feature_dim)
ftest = np.random.randn(5, 4).astype(np.float32)

# food: out-of-distribution features (n_ood x feature_dim)
food = np.random.randn(3, 4).astype(np.float32)

# labelstrain: cluster labels for training data (n_train,)
# For single cluster case (clusters=1), this can be all zeros
labelstrain_single = np.zeros(10, dtype=np.int32)

# For multi-cluster case (clusters>1), assign different labels
labelstrain_multi = np.array([0, 0, 0, 0, 0, 1, 1, 1, 1, 1], dtype=np.int32)

# Test with single cluster
ARGS = {
    'ftrain': ftrain,
    'ftest': ftest,
    'food': food,
    'labelstrain': labelstrain_single,
    'clusters': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_scores_multi_cluster Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
uiuctml/HypStructure/utils.py
code served (permissive licence) · get_code("1c82b403bc72b7cd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small sample data
# ftrain: training features, shape (n_train_samples, feature_dim)
# We'll create data for 2 clusters
ftrain = np.random.randn(8, 4).astype(np.float32)

# ftest: test features, shape (n_test_samples, feature_dim)
ftest = np.random.randn(3, 4).astype(np.float32)

# food: out-of-distribution features, shape (n_ood_samples, feature_dim)
food = np.random.randn(5, 4).astype(np.float32)

# ypred: cluster assignments for training samples, shape (n_train_samples,)
# Should have values indicating cluster membership (e.g., 0, 1, 2, ...)
ypred = np.array([0, 0, 0, 0, 1, 1, 1, 1], dtype=np.int32)

ARGS = {
    "ftrain": ftrain,
    "ftest": ftest,
    "food": food,
    "ypred": ypred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_scores_one_cluster Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
uiuctml/HypStructure/utils.py
code served (permissive licence) · get_code("1f89c4ce7d2cf497")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from sklearn.covariance import ledoit_wolf

# Set random seed for reproducibility
np.random.seed(0)

# Create small feature arrays
# ftrain: training features (N_train x D)
ftrain = np.random.randn(5, 4).astype(np.float32)

# ftest: test features (N_test x D)
ftest = np.random.randn(3, 4).astype(np.float32)

# food: out-of-distribution features (N_ood x D)
food = np.random.randn(2, 4).astype(np.float32)

# shrunkcov: boolean flag for using Ledoit-Wolf covariance estimator
shrunkcov = False

ARGS = {
    'ftrain': ftrain,
    'ftest': ftest,
    'food': food,
    'shrunkcov': shrunkcov
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
init_optim_schedule Ran
ran; our contract draft was wrong, not the code
uiuctml/HypStructure/param.py
code served (permissive licence) · get_code("ae70f23184939b33")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.optim import SGD
from torch.optim.lr_scheduler import StepLR

torch.manual_seed(0)

# Define a minimal model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create model instance
model = MinimalModel()

# Create a minimal train_loader (list of (x, y) tuples)
train_loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
]

# Create params dict with optimizer and scheduler settings
params = {
    'optimizer': {
        'lr': 0.01,
        'momentum': 0.9,
    },
    'scheduler': {
        'step_size': 2,
        'gamma': 0.1,
    }
}

# Test with exp_name starting with 'ERM' to trigger scheduler creation
exp_name = 'ERM_experiment'

# init_optimizer can be None or an existing optimizer
init_optimizer = None

ARGS = {
    'model': model,
    'params': params,
    'train_loader': train_loader,
    'exp_name': exp_name,
    'init_optimizer': init_optimizer,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_params Ran
ran; our contract draft was wrong, not the code
uiuctml/HypStructure/param.py
code served (permissive licence) · get_code("8cf34e6994805544")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import os
import tempfile

# Create a temporary directory structure with the required hyperparameters.json file
temp_dir = tempfile.mkdtemp()
dataset_name = "test_dataset"
dataset_dir = os.path.join(temp_dir, dataset_name.lower())
os.makedirs(dataset_dir, exist_ok=True)

# Create a hyperparameters.json file with the expected structure
hyperparams = {
    "experiment_1": {
        "epochs": 10,
        "optimizer": "adam",
        "lr_decay_rate": 0.95,
        "scheduler": "step"
    },
    "experiment_2": {
        "epochs": 20,
        "optimizer": "sgd",
        "lr_decay_rate": 0.9
    }
}

hyperparams_path = os.path.join(dataset_dir, "hyperparameters.json")
with open(hyperparams_path, 'w') as f:
    json.dump(hyperparams, f)

# Change to the temporary directory so the relative path works
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    "dataset_name": "test_dataset",
    "exp_name": "experiment_1"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
orthonormal Ran
ran; our contract draft was wrong, not the code
uiuctml/HypStructure/geom/euclidean.py
pointer only (licence: MIT); the stored copy get_code serves, from HazyResearch/HoroPCA, is pointer only (licence: NONE) · get_code("7ae021ffa7f0e179")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from HazyResearch/HoroPCA, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

init_model Not yet run
unverified (harvested, no recorded run)
uiuctml/HypStructure/model.py
code served (permissive licence) · get_code("168504328c1cde29")
How it ran

no invocation recorded.

load_coarse_map Not yet run
unverified (harvested, no recorded run)
uiuctml/HypStructure/main_evaluate.py
code served (permissive licence) · get_code("0d2e3df5a353b824")
How it ran

no invocation recorded.

reflect Not yet run
unverified (harvested, no recorded run)
uiuctml/HypStructure/geom/euclidean.py
code served (permissive licence) · get_code("f1e92194323ca315")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_scores_multi_cluster 2 other papers
2 dated earlier
2103.12051 (2021-03)
SSD: A Unified Framework for Self-Supervised Outlier Detection
2310.02821 (2023-10)
Improving Vision Anomaly Detection with the Guidance of Language Modality
busemann 1 other paper
1 dated earlier
2106.03306 (2021-06)
HoroPCA: Hyperbolic Dimensionality Reduction via Horospherical Projections
circle_intersection_ 1 other paper
1 dated earlier
2106.03306 (2021-06)
HoroPCA: Hyperbolic Dimensionality Reduction via Horospherical Projections
exp_unit_tangents
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2106.03306 (2021-06)
HoroPCA: Hyperbolic Dimensionality Reduction via Horospherical Projections
from_poincare 1 other paper
1 dated earlier
2106.03306 (2021-06)
HoroPCA: Hyperbolic Dimensionality Reduction via Horospherical Projections
orthonormal 1 other paper
1 dated earlier
2106.03306 (2021-06)
HoroPCA: Hyperbolic Dimensionality Reduction via Horospherical Projections

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

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

Abstract

Most real-world datasets consist of a natural hierarchy between classes or an inherent label structure that is either already available or can be constructed cheaply. However, most existing representation learning methods ignore this hierarchy, treating labels as permutation invariant. Recent work [104] proposes using this structured information explicitly, but the use of Euclidean distance may distort the underlying semantic context [8]. In this work, motivated by the advantage of hyperbolic spaces in modeling hierarchical relationships, we propose a novel approach HypStructure: a Hyperbolic Structured regularization approach to accurately embed the label hierarchy into the learned representations. HypStructure is a simple-yet-effective regularizer that consists of a hyperbolic tree-based representation loss along with a centering loss. It can be combined with any standard task loss to learn hierarchy-informed features. Extensive experiments on several large-scale vision benchmarks demonstrate the efficacy of HypStructure in reducing distortion and boosting generalization performance, especially under low-dimensional scenarios. For a better understanding of structured representation, we perform an eigenvalue analysis that links the representation geometry to improved Out-of-Distribution (OOD) detection performance seen empirically. The code is available at https://github.com/uiuctml/HypStructure.

For agents

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

get_harvested_code_for_paper("2412.01023")
get_code_for_paper("2412.01023")
have("2412.01023")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2412.01023.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2412.01023.svg)](https://syntology.ai/paper/2412.01023)

Connect an agent — have() is free.