SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.11438 · NAACL · 2022

Contrastive Representation Learning for Cross-Document Coreference Resolution of Events and Entities

Benjamin Hsu, Graham Horwood

arXiv · PDF · Open in the Atlas

Code that ran

10 of 18 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 10 have no contract verdict; 0 failures of our instrument; 8 no recorded run), measured 2026-11-23; 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/2205.11438.json · badge: /api/ran/2205.11438.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
scikit-optimize/scikit-optimize canonical (classifier label)
classifier basis not recorded on the link
10 ran · 8 no recorded run
FunctionStatusWhere it lives
bench1 Ran
ran on a synthesized input
scikit-optimize/scikit-optimize/skopt/benchmarks.py
code served (permissive licence) · get_code("6799965d3c7276cf")
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 0, dtype family float, shape () 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
import numpy as np

torch.manual_seed(0)

# The function takes a single parameter 'x' and accesses x[0] ** 2
# x needs to be indexable (list, tuple, or tensor)
# x[0] should be a numeric value that supports exponentiation

x = torch.tensor([5.0, 3.0])

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () 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
bench1_with_time Ran
ran on a synthesized input
scikit-optimize/scikit-optimize/skopt/benchmarks.py
code served (permissive licence) · get_code("7d3e1c49590a5d98")
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 torch

torch.manual_seed(0)

# The function takes x[0] and squares it, then returns a tuple
# x appears to be indexable (likely a list or tuple)
# x[0] should be a tensor that supports ** operator
x_tensor = torch.randn(2, 4)
x = [x_tensor]

ARGS = {
    "x": x
}
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 — 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
bench2 Ran
ran on a synthesized input
scikit-optimize/scikit-optimize/skopt/benchmarks.py
code served (permissive licence) · get_code("8bf1b101b85aaf05")
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 float, ndim 0, dtype family float, shape () 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
import numpy as np

torch.manual_seed(0)

# The function bench2 takes a single parameter x
# It accesses x[0], so x must be indexable (list, tuple, or tensor)
# It performs arithmetic operations on x[0]
# The function expects x to be a sequence-like object with at least one element

x = [2.5]  # A simple list with one float value

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () 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
eval_callbacks Ran
ran on a synthesized input
scikit-optimize/scikit-optimize/skopt/utils.py
code served (permissive licence) · get_code("552219cacfd6eb03")
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 bool, ndim 0, dtype family float, shape () 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
from scipy.optimize import OptimizeResult

torch.manual_seed(0)

# Create simple callback functions
def callback_1(result):
    """Callback that returns None (no decision)"""
    return None

def callback_2(result):
    """Callback that returns False (continue optimizing)"""
    return False

def callback_3(result):
    """Callback that returns True (stop optimizing)"""
    return True

# Create an OptimizeResult object
opt_result = OptimizeResult(
    x=torch.tensor([1.0, 2.0, 3.0, 4.0]),
    success=True,
    message="Optimization completed",
    nfev=100
)

# Define arguments
ARGS = {
    "callbacks": [callback_1, callback_2, callback_3],
    "result": opt_result
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () 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
gaussian_lcb Ran
ran on a synthesized input
scikit-optimize/scikit-optimize/skopt/acquisition.py
code served (permissive licence) · get_code("123afe48fa3f8873")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np
import warnings

class MockGaussianModel:
    """Mock model that implements predict with return_std, return_mean_grad, return_std_grad"""
    
    def predict(self, X, return_std=False, return_mean_grad=False, return_std_grad=False):
        n_samples = X.shape[0]
        
        # Return mean predictions
        mu = np.random.randn(n_samples)
        
        if return_std and return_mean_grad and return_std_grad:
            # Return all four components
            std = np.abs(np.random.randn(n_samples)) + 0.1
            mu_grad = np.random.randn(n_samples, X.shape[1])
            std_grad = np.random.randn(n_samples, X.shape[1])
            return mu, std, mu_grad, std_grad
        elif return_std:
            # Return only mean and std
            std = np.abs(np.random.randn(n_samples)) + 0.1
            return mu, std
        else:
            return mu


# Create test data
np.random.seed(0)
X = np.random.randn(2, 4).astype(np.float64)
model = MockGaussianModel()

ARGS = {
    'X': X,
    'model': model,
    'kappa': 1.96,
    'return_grad': False
}
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 ndarray, ndim 1, dtype family float, shape (2,) — shape (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
gaussian_pi Ran
ran on a synthesized input
scikit-optimize/scikit-optimize/skopt/acquisition.py
code served (permissive licence) · get_code("7b4529908c5f58d2")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np
import torch
import torch.nn as nn
from scipy.stats import norm

torch.manual_seed(0)

class SimpleGaussianModel(nn.Module):
    """A minimal model that implements predict with return_std capability."""
    
    def __init__(self, n_features=4):
        super().__init__()
        self.linear = nn.Linear(n_features, 1)
        self.log_std = nn.Parameter(torch.tensor([0.5]))
    
    def predict(self, X, return_std=False, return_mean_grad=False, return_std_grad=False):
        """
        Predict mean and optionally std and gradients.
        
        X should be array-like convertible to numpy array.
        """
        # Convert to numpy if needed
        if isinstance(X, torch.Tensor):
            X_np = X.cpu().detach().numpy()
        else:
            X_np = np.asarray(X)
        
        # Convert to tensor for forward pass
        X_tensor = torch.from_numpy(X_np).float()
        
        # Compute mean prediction
        with torch.no_grad():
            mu_tensor = self.linear(X_tensor).squeeze(-1)
            mu = mu_tensor.numpy()
        
        if return_std:
            std = np.exp(self.log_std.item()) * np.ones_like(mu)
        
        # Handle gradient returns
        if return_mean_grad or return_std_grad:
            X_tensor.requires_grad_(True)
            mu_tensor = self.linear(X_tensor).squeeze(-1)
            
            # Compute gradients with respect to input
            mu_sum = mu_tensor.sum()
            mu_sum.backward()
            
            mu_grad = X_tensor.grad.numpy()
            std_grad = np.zeros_like(mu_grad)
            
            if return_mean_grad and return_std_grad:
                return mu, std, mu_grad, std_grad
            elif return_mean_grad:
                return mu, mu_grad
            else:
                return mu, std_grad
        
        if return_std:
            return mu, std
        
        return mu

# Create model instance
model = SimpleGaussianModel(n_features=4)

# Create sample input X: (n_samples=2, n_features=4)
X = np.random.randn(2, 4).astype(np.float32)

# Define all arguments
ARGS = {
    'X': X,
    'model': model,
    'y_opt': 0.0,
    'xi': 0.01,
    'return_grad': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (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
human_readable_data_quantity Ran
ran on a synthesized input
scikit-optimize/scikit-optimize/build_tools/circle/list_versions.py
code served (permissive licence) · get_code("98bcf21a07213d6d")
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 str. 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 numpy as np

# Analyze the function:
# - quantity: a numeric value (int or float) representing bytes
# - multiple: an int, defaults to 1024, used as divisor
# The function formats quantity as a human-readable data size string

ARGS = {
    'quantity': 1024,
    'multiple': 1024
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
nop Ran
ran on a synthesized input
scikit-optimize/scikit-optimize/benchmarks/bench_ml.py
code served (permissive licence) · get_code("c322520a5f53ad2a")
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)

ARGS = {
    "x": torch.randn(2, 4)
}
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
pow10map Ran
ran on a synthesized input
scikit-optimize/scikit-optimize/benchmarks/bench_ml.py
code served (permissive licence) · get_code("21701054359bc635")
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 1, dtype family float, shape (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
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# def pow10map(x):
#     return 10.0 ** x
# 
# This function takes a single parameter 'x' and returns 10.0 raised to the power of x.
# The parameter can be a scalar, numpy array, or torch tensor.

# Create a small tensor for testing
x = torch.tensor([0.0, 1.0, -1.0, 0.5], dtype=torch.float32)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (4,) — shape (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
pow2intmap Ran
ran on a synthesized input
scikit-optimize/scikit-optimize/benchmarks/bench_ml.py
code served (permissive licence) · get_code("413c04ac1a43d5d4")
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 int, ndim 0, dtype family int, shape () 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
import numpy as np

torch.manual_seed(0)

ARGS = {
    'x': 3.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () 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
check_callback Not yet run
unverified (harvested, no recorded run)
scikit-optimize/scikit-optimize/skopt/callbacks.py
code served (permissive licence) · get_code("dc5229f9d87215d1")
How it ran

no invocation recorded.

create_result Not yet run
unverified (harvested, no recorded run)
scikit-optimize/scikit-optimize/skopt/utils.py
code served (permissive licence) · get_code("2efc71ee61c6a7ec")
How it ran

no invocation recorded.

gaussian_acquisition_1D Not yet run
unverified (harvested, no recorded run)
scikit-optimize/scikit-optimize/skopt/acquisition.py
code served (permissive licence) · get_code("513bcf8d78cf334b")
How it ran

no invocation recorded.

get_pdf_size Not yet run
unverified (harvested, no recorded run)
scikit-optimize/scikit-optimize/build_tools/circle/list_versions.py
code served (permissive licence) · get_code("44743407f81a6a01")
How it ran

no invocation recorded.

json_urlread Not yet run
unverified (harvested, no recorded run)
scikit-optimize/scikit-optimize/build_tools/circle/list_versions.py
code served (permissive licence) · get_code("fd1984e62acc9e3e")
How it ran

no invocation recorded.

load Not yet run
unverified (harvested, no recorded run)
scikit-optimize/scikit-optimize/skopt/utils.py
code served (permissive licence) · get_code("509b6b1b4af14d19")
How it ran

no invocation recorded.

partial_dependence Not yet run
unverified (harvested, no recorded run)
scikit-optimize/scikit-optimize/skopt/plots.py
code served (permissive licence) · get_code("2ca1f69eb2fa2acd")
How it ran

no invocation recorded.

plot_gaussian_process Not yet run
unverified (harvested, no recorded run)
scikit-optimize/scikit-optimize/skopt/plots.py
code served (permissive licence) · get_code("05859060675d2c81")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 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 18 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-23.

Repositories linked to this paper

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

Abstract

Identifying related entities and events within and across documents is fundamental to natural language understanding. We present an approach to entity and event coreference resolution utilizing contrastive representation learning. Earlier state-of-the-art methods have formulated this problem as a binary classification problem and leveraged large transformers in a cross-encoder architecture to achieve their results. For large collections of documents and corresponding set of n mentions, the necessity of performing n 2 transformer computations in these earlier approaches can be computationally intensive. We show that it is possible to reduce this burden by applying contrastive learning techniques that only require n transformer computations at inference time. Our method achieves state-of-the-art results on a number of key metrics on the ECB+ corpus and is competitive on others.

For agents

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

get_harvested_code_for_paper("2205.11438")
get_code_for_paper("2205.11438")
have("2205.11438")

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

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

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

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

Connect an agent — have() is free.