SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.17190 · 2026

How smoothing the affinity matrix affects neighborhood preservation in t-SNE

Shirin Mohebi, Jefrey Lijffijt

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/2608.17190.json · badge: /api/ran/2608.17190.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
aida-ugent/smooth_affinity_tsne canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
estimate_intrinsic_dim Ran
ran, honoured the contract we drafted
aida-ugent/smooth_affinity_tsne/openTSNE/affinity.py
code served (permissive licence) · get_code("59f64a426919994c")
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 numpy as np

# Create a small sample of neighbor distances
# Shape: (n_samples, k) where n_samples=5, k=4 (at least 2 neighbors required)
np.random.seed(0)
distances = np.sort(np.random.uniform(0.1, 2.0, size=(5, 4)), axis=1)

ARGS = {
    "distances": distances
}
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 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
jitter Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aida-ugent/smooth_affinity_tsne/openTSNE/initialization.py
code served (permissive licence) · get_code("57eb0722ae52ab9d")
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 2, dtype family float, shape (5, 3) 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

# Create a small test array with shape (5, 3)
# This represents 5 points in 3D space
x = np.array([
    [1.0, 2.0, 3.0],
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0],
    [7.0, 8.0, 9.0],
    [10.0, 11.0, 12.0]
])

ARGS = {
    "x": x,
    "inplace": False,
    "scale": 0.01,
    "random_state": 42
}
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 ndarray, ndim 2, dtype family float, shape (5, 3) — shape (5, 3) 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
load_adult Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aida-ugent/smooth_affinity_tsne/experiments/compare_affinity_variants.py
code served (permissive licence) · get_code("bde1f33b923c355d")
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
import numpy as np
from unittest.mock import Mock, patch

torch.manual_seed(0)

# Create mock for load_adult_data that returns dummy data
def mock_load_adult_data(max_rows, random_state):
    # Return small dummy X and y
    X = np.random.RandomState(random_state).randn(max_rows, 4)
    y = np.random.RandomState(random_state).randint(0, 2, max_rows)
    return X, y

# Patch the load_data module before calling load_adult
import sys
from unittest.mock import MagicMock

load_data_mock = MagicMock()
load_data_mock.load_adult_data = mock_load_adult_data
sys.modules['load_data'] = load_data_mock

ARGS = {
    'max_rows': 10,
    'random_state': 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
load_data, numpy, 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
load_mnist Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aida-ugent/smooth_affinity_tsne/experiments/compare_affinity_variants.py
code served (permissive licence) · get_code("e267fe6d285a5ca0")
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 unittest.mock import Mock, patch

# Create mock data that load_mnist_data would return
mock_X_pca = np.random.randn(100, 50).astype(np.float32)
mock_y = np.random.randint(0, 10, 100)
mock_extra = None

# Patch the load_mnist_data function to return our mock data
def mock_load_mnist_data(n_pca, random_state):
    return (mock_X_pca, mock_y, mock_extra)

# We need to patch before the function tries to import
import sys
from types import ModuleType

load_data_module = ModuleType('load_data')
load_data_module.load_mnist_data = mock_load_mnist_data
sys.modules['load_data'] = load_data_module

ARGS = {
    'subsample': 50,
    'random_state': 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
load_data, 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
load_mouse Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aida-ugent/smooth_affinity_tsne/experiments/compare_affinity_variants.py
code served (permissive licence) · get_code("14dcb94aec8d457d")
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 unittest.mock import Mock, patch
import tempfile
import os

# Create a mock load_mouse_data function that will be imported
def mock_load_mouse_data(pickle_path, data_dir=None, return_highdim=False):
    # Return dummy data: X_pca (2, 4), y (2,), and two None values
    X_pca = np.random.randn(10, 4).astype(np.float32)
    y = np.array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1], dtype=int)
    return X_pca, y, None, None

# Patch the load_data module before importing
import sys
from unittest.mock import MagicMock

load_data_mock = MagicMock()
load_data_mock.load_mouse_data = mock_load_mouse_data
sys.modules['load_data'] = load_data_mock

# Now define the arguments
ARGS = {
    "pickle_path": "dummy_path.pkl",
    "data_dir": "/tmp/data",
    "subsample": 5,
    "random_state": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
load_data, 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
random Ran
ran, honoured the contract we drafted
aida-ugent/smooth_affinity_tsne/openTSNE/initialization.py
code served (permissive licence) · get_code("321c8c3b648319f4")
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 2, dtype family float, shape (10, 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
from sklearn.utils import check_random_state

# Test with different parameter combinations
ARGS = {
    "n_samples": 10,
    "n_components": 2,
    "random_state": 42,
    "verbose": False,
}
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 ndarray, ndim 2, dtype family float, shape (10, 2) — shape (10, 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
rescale Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aida-ugent/smooth_affinity_tsne/openTSNE/initialization.py
code served (permissive licence) · get_code("926a223b1588a59c")
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 2, dtype family float, shape (4, 3) 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

# Create a small embedding array
# Shape: (4, 3) - 4 embeddings of dimension 3
x = np.random.randn(4, 3).astype(np.float32)

# Define ARGS dict with all parameters for rescale function
ARGS = {
    "x": x,
    "inplace": False,
    "target_std": 0.0001
}
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 2, dtype family float, shape (4, 3) — shape (4, 3) 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
summarise Ran
ran; our contract draft was wrong, not the code
aida-ugent/smooth_affinity_tsne/experiments/seed_variation.py
code served (permissive licence) · get_code("af695c8551b71ca5")
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 DataFrame. 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 os
import pandas as pd
import tempfile

# Create a temporary directory to simulate RESULTS_DIR
temp_dir = tempfile.mkdtemp()
results_dir = os.path.join(temp_dir, 'results')
os.makedirs(results_dir, exist_ok=True)

# Create a test CSV file with valid data
dataset_dir = os.path.join(results_dir, 'test_dataset')
experiment_dir = os.path.join(dataset_dir, 'test_experiment')
os.makedirs(experiment_dir, exist_ok=True)

csv_path = os.path.join(experiment_dir, 'results.csv')

# Create a DataFrame with required columns
data = {
    'seed': [1, 2, 3, 1, 2, 3],
    'perplexity': [10.0, 10.5, 10.2, 12.0, 12.1, 11.9],
    'gamma': [0.1, 0.1, 0.1, 0.2, 0.2, 0.2],
    'k': [5, 5, 5, 5, 5, 5],
    'method': ['a', 'a', 'a', 'b', 'b', 'b'],
    'rank': [10, 10, 10, 10, 10, 10],
    'accuracy': [0.85, 0.87, 0.86, 0.90, 0.91, 0.89],
    'loss': [0.45, 0.43, 0.44, 0.35, 0.34, 0.36],
}

df = pd.DataFrame(data)
df.to_csv(csv_path, index=False)

# Monkey-patch the RESULTS_DIR in the module
import sys
sys.modules['results_module'] = type(sys)('results_module')

ARGS = {
    'csv_path': csv_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
build_affinity Not yet run
unverified (harvested, no recorded run)
aida-ugent/smooth_affinity_tsne/experiments/smooth_tsne_opentsne_gamma.py
code served (permissive licence) · get_code("5385b534dde1e2b0")
How it ran

no invocation recorded.

run_tsne Not yet run
unverified (harvested, no recorded run)
aida-ugent/smooth_affinity_tsne/experiments/smooth_tsne_opentsne_gamma.py
code served (permissive licence) · get_code("fc865037816f6fd3")
How it ran

no invocation recorded.

run_tsne_from_joint Not yet run
unverified (harvested, no recorded run)
aida-ugent/smooth_affinity_tsne/experiments/smooth_tsne_opentsne_gamma.py
code served (permissive licence) · get_code("4dca6299d6d9a990")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 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
jitter 1 other paper
1 dated earlier
2206.01816 (2022-06)
FROM t-SNE TO UMAP WITH CONTRASTIVE LEARNING
rescale 1 other paper
1 dated earlier
2206.01816 (2022-06)
FROM t-SNE TO UMAP WITH CONTRASTIVE LEARNING

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-24.

Repositories linked to this paper

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

Abstract

Dimensionality reduction methods are instrumental to visualize high-dimensional data, and t-SNE stands as one of the most widely used methods due to its emphasis on local neighborhood preservation. A central component of t-SNE is the affinity matrix, which expresses pairwise similarities in the form of symmetrized probabilities, over which the optimization problem of t-SNE is defined. We study how the 'sharpness' of this probability distribution affects neighborhood preservation at different scales. We introduce a row-wise power transform controlled by a parameter γ that can smooth or sharpen each row of the affinity matrix while preserving sparsity and rank order. We show that this transform is equivalent to rescaling the Gaussian bandwidth and thus to changing the perplexity. However, as the sharpness of the probability distribution varies per point, a fixed γ leads to point-dependent effective perplexities, making it distinct from changing the global perplexity. Empirically, we find that sharpening improves preservation of the very nearest neighbors, while smoothing improves preservation of broader local neighborhoods, outperforming alternative affinity constructions including multiscale methods in the mid-local range.

For agents

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

get_harvested_code_for_paper("2608.17190")
get_code_for_paper("2608.17190")
have("2608.17190")

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

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

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

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

Connect an agent — have() is free.