SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.14923 · NeurIPS · 2021

Modeling Heterogeneous Hierarchies with Relation-specific Hyperbolic Cones

Hongyu Ren, Jure Leskovec, Rex Ying, Yushi Bai

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2110.14923.json · badge: /api/ran/2110.14923.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
snap-stanford/ConE marked official in Papers with Code
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
EnergyFunction Ran
ran on a synthesized input · constructed an object; no result was computed
snap-stanford/ConE/codes/utils/energy_function.py
code served (permissive licence) · get_code("cf120f6a24cc78a6")
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 an instance of its own class, EnergyFunction: the run constructed the object and did not call it, so no result was computed. 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal Manifold class that implements the required interface
class MinimalManifold:
    def allocate_lt(self, size, dim, sparse):
        """Allocate a lookup table (embedding layer)"""
        return nn.Embedding(size, dim)
    
    def init_weights(self, lt):
        """Initialize weights of the lookup table"""
        nn.init.normal_(lt.weight, std=0.01)
    
    def normalize(self, e):
        """Normalize embeddings"""
        return torch.nn.functional.normalize(e, p=2, dim=1)
    
    def rgrad(self, p):
        """Riemannian gradient"""
        return p
    
    def expm(self, p):
        """Matrix exponential"""
        return p
    
    def logm(self, p):
        """Matrix logarithm"""
        return p
    
    def ptransp(self, p, x, y):
        """Parallel transport"""
        return p

# Create a minimal EnergyFunction subclass to implement the energy method
class ConcreteEnergyFunction(torch.nn.Module):
    def __init__(self, manifold, dim, size, sparse=False, **kwargs):
        super().__init__()
        self.manifold = manifold
        self.lt = manifold.allocate_lt(size, dim, sparse)
        self.nobjects = size
        self.manifold.init_weights(self.lt)

    def forward(self, inputs):
        e = self.lt(inputs)
        with torch.no_grad():
            e = self.manifold.normalize(e)
        o = e.narrow(1, 1, e.size(1) - 1)
        s = e.narrow(1, 0, 1).expand_as(o)
        return self.energy(s, o).squeeze(-1)

    def energy(self, s, o):
        """Compute energy between s and o"""
        return torch.sum(s * o, dim=1, keepdim=True)

    def optim_params(self):
        return [{'params': self.lt.parameters(), 'rgrad': self.manifold.rgrad, 'expm': self.manifold.expm, 'logm': self.manifold.logm, 'ptransp': self.manifold.ptransp}]

    def loss_function(self, inp, target, **kwargs):
        raise NotImplementedError

# Set up arguments
manifold = MinimalManifold()
dim = 4
size = 8
sparse = False

ARGS = {
    'manifold': manifold,
    'dim': dim,
    'size': size,
    'sparse': sparse
}
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 EnergyFunction — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EnergyFunction 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
EntailmentConeEnergyFunction Ran
ran on a synthesized input · constructed an object; no result was computed
snap-stanford/ConE/codes/utils/energy_function.py
code served (permissive licence) · get_code("d6bdad4b6beebc35")
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 an instance of its own class, EntailmentConeEnergyFunction: the run constructed the object and did not call it, so no result was computed. 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal Manifold class that satisfies the usage in the code
class MinimalManifold:
    def __init__(self):
        self.K = 0.5  # Must not be None for EntailmentConeEnergyFunction
    
    def allocate_lt(self, size, dim, sparse):
        """Allocate a lookup table (embedding layer)"""
        return nn.Embedding(size, dim)
    
    def init_weights(self, lt):
        """Initialize weights of the lookup table"""
        nn.init.normal_(lt.weight, std=0.1)
    
    def normalize(self, e):
        """Normalize embeddings"""
        return torch.nn.functional.normalize(e, p=2, dim=1)
    
    def angle_at_u(self, o, s):
        """Compute angle at u between o and s"""
        # Simple angle computation: cosine distance
        cos_sim = torch.nn.functional.cosine_similarity(o, s, dim=1, keepdim=True)
        angle = torch.acos(torch.clamp(cos_sim, -1.0, 1.0))
        return angle
    
    def half_aperture(self, o):
        """Compute half aperture cone angle"""
        # Return a small tensor matching the batch size
        return torch.full((o.size(0), 1), 0.2)
    
    def rgrad(self, x):
        """Riemannian gradient"""
        return x
    
    def expm(self, x):
        """Matrix exponential"""
        return torch.matrix_exp(x)
    
    def logm(self, x):
        """Matrix logarithm"""
        return torch.linalg.matrix_power(x, 1)
    
    def ptransp(self, x, y):
        """Parallel transport"""
        return x

# Instantiate the manifold
manifold = MinimalManifold()

# Define arguments for EntailmentConeEnergyFunction
ARGS = {
    'manifold': manifold,
    'dim': 4,
    'size': 8,
    'sparse': False,
    'margin': 0.1,
}
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 EntailmentConeEnergyFunction — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EntailmentConeEnergyFunction 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

Also present in other papers' code

Of 2 samples lifted from this paper's linked repositories, 2 carry a function identity and 0 do not. Of the 2 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 2 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.

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

Hierarchical relations are prevalent and indispensable for organizing human knowledge captured by a knowledge graph (KG). The key property of hierarchical relations is that they induce a partial ordering over the entities, which needs to be modeled in order to allow for hierarchical reasoning. However, current KG embeddings can model only a single global hierarchy (single global partial ordering) and fail to model multiple heterogeneous hierarchies that exist in a single KG. Here we present ConE (Cone Embedding), a KG embedding model that is able to simultaneously model multiple hierarchical as well as non-hierarchical relations in a knowledge graph. ConE embeds entities into hyperbolic cones and models relations as transformations between the cones. In particular, ConE uses cone containment constraints in different subspaces of the hyperbolic embedding space to capture multiple heterogeneous hierarchies. Experiments on standard knowledge graph benchmarks show that ConE obtains state-of-the-art performance on hierarchical reasoning tasks as well as knowledge graph completion task on hierarchical graphs. In particular, our approach yields new state-of-the-art Hits@1 of 45.3% on WN18RR and 16.1% on DDB14 (0.231 MRR). As for hierarchical reasoning task, our approach outperforms previous best results by an average of 20% across the three datasets.

For agents

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

get_harvested_code_for_paper("2110.14923")
get_code_for_paper("2110.14923")
have("2110.14923")

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

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

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

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

Connect an agent — have() is free.