SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.07477 · 2022

Manifold Characteristics That Predict Downstream Task Performance

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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 7 have no contract verdict; 0 failures of our instrument; 2 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/2205.07477.json · badge: /api/ran/2205.07477.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
bytefuse/representation-manifold-quality-metric canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
CifarResNet18 Ran
ran on a synthesized input
bytefuse/representation-manifold-quality-metric/src/models.py
code served (permissive licence) · get_code("94af383ec267689f")
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 ResNet. 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)

ARGS = {
    "embedding_dim": 16,
    "hidden_dim": 32,
    "logits": True,
    "number_classes": 10,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
calculate_centroid_distances_metrics Ran
ran on a synthesized input
bytefuse/representation-manifold-quality-metric/src/metrics.py
code served (permissive licence) · get_code("3fe98353141c24d9")
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 2, 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 pandas as pd

torch.manual_seed(0)

# Analyze the function:
# - points: gets converted to tensor, normalized, reshaped to (number_of_alterations, -1, embedding_dim)
# - number_of_alterations: used in reshape, should be an int
# - p: used in F.normalize and torch.cdist, should be an int or float
# - embedding_dim: used in reshape, should be an int

# For reshape to work: len(points) must equal number_of_alterations * (len(points) // number_of_alterations) * embedding_dim
# Let's say:
# - number_of_alterations = 3 (number of different versions)
# - embedding_dim = 4 (embedding dimension)
# - So we need 3 * k * 4 points total, where k is the number of points per alteration
# Let's use k = 5, so total points = 3 * 5 * 4 = 60 (a flat list that reshapes to (3, 5, 4))

number_of_alterations = 3
embedding_dim = 4
points_per_alteration = 5
total_points = number_of_alterations * points_per_alteration * embedding_dim

# Create points as a list of lists (will be converted to tensor)
points = [[i * 0.1 + j * 0.01 for j in range(embedding_dim)] for i in range(total_points)]

# p for distance metric (2 for Euclidean)
p = 2

ARGS = {
    "points": points,
    "number_of_alterations": number_of_alterations,
    "p": p,
    "embedding_dim": embedding_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, 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
calculate_pointwise_distances_metrics Ran
ran on a synthesized input
bytefuse/representation-manifold-quality-metric/src/metrics.py
code served (permissive licence) · get_code("47ede95b96e39a52")
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
import pandas as pd

torch.manual_seed(0)

# Analyzing the function:
# - points: needs to be array-like, will be converted to tensor and normalized
# - number_of_alterations: int, used to reshape points
# - p: int/float, norm parameter for cdist and normalize
# - embedding_dim: int, used to reshape points
#
# The function reshapes points as:
#   points.shape[0] // number_of_alterations, -1, embedding_dim
# So points.shape[0] must be divisible by number_of_alterations
#
# After reshape, it processes distance matrices and expects 2D output from cdist
# Let's construct: points with shape (12, 4) where 12 // 3 = 4, reshape to (4, 3, 4)
# This gives us number_of_alterations=3 alterations per base point

number_of_alterations = 3
embedding_dim = 4
num_base_points = 4
total_points = num_base_points * number_of_alterations

# Create points as a 2D array: shape (12, 4)
points = np.random.randn(total_points, embedding_dim).astype(np.float32)

ARGS = {
    "points": points,
    "number_of_alterations": number_of_alterations,
    "p": 2,
    "embedding_dim": embedding_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, 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
flatten_dict Ran
ran on a synthesized input
bytefuse/representation-manifold-quality-metric/src/utils.py
code served (permissive licence) · get_code("ab7cb2f6ec7f6e67")
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 torch
import torch.nn as nn
from collections.abc import MutableMapping

torch.manual_seed(0)

# Create a nested dictionary to test the flatten_dict function
test_dict = {
    'level1_a': 1,
    'level1_b': {
        'level2_a': 2,
        'level2_b': {
            'level3_a': 3,
            'level3_b': 4
        }
    },
    'level1_c': 'test_value'
}

ARGS = {
    'd': test_dict,
    'parent_key': '',
    'sep': '.'
}
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 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
quick_fine_tune Ran
ran on a synthesized input
bytefuse/representation-manifold-quality-metric/apply_vector_search.py
code served (permissive licence) · get_code("f4989573d59e7b36")
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 SimpleEncoder. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 small encoder model
class SimpleEncoder(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

encoder = SimpleEncoder(input_dim=3, output_dim=4)

embedding_dim = 4

# Create a simple transform function
def transform(images):
    return images

# Create a small dataloader (list of batches with images and labels)
batch_size = 2
num_batches = 2
dataloader = []
for _ in range(num_batches):
    images = torch.randn(batch_size, 3)
    labels = torch.randint(0, 100, (batch_size,))
    dataloader.append((images, labels))

n_classes = 100

ARGS = {
    'encoder': encoder,
    'embedding_dim': embedding_dim,
    'dataloader': dataloader,
    'transform': transform,
    'n_classes': n_classes
}
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 SimpleEncoder — a SimpleEncoder output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleEncoder 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
return_fgsm_contrastive_attack_images Ran
ran on a synthesized input
bytefuse/representation-manifold-quality-metric/src/attacks.py
code served (permissive licence) · get_code("495bd3a5caf4e261")
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 4, dtype family float, shape (2, 3, 4, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.nn as nn

torch.manual_seed(0)

# Define a simple model that takes images and returns embeddings
class SimpleEmbeddingModel(nn.Module):
    def __init__(self, embedding_dim=8):
        super().__init__()
        self.conv = nn.Conv2d(3, 16, kernel_size=3, padding=1)
        self.pool = nn.AdaptiveAvgPool2d(1)
        self.fc = nn.Linear(16, embedding_dim)
    
    def forward(self, x):
        x = self.conv(x)
        x = self.pool(x)
        x = x.view(x.size(0), -1)
        x = self.fc(x)
        return x

# Define a simple contrastive loss function
class ContrastiveLoss(nn.Module):
    def forward(self, ref_emb, query_emb):
        # Simple L2 distance loss
        loss = torch.nn.functional.mse_loss(ref_emb, query_emb)
        return loss

# Define simple transform functions
class SimpleTransform:
    def __call__(self, x):
        # Normalize or add small perturbation
        return torch.clamp(x, min=0, max=1)

# Create instances
model = SimpleEmbeddingModel(embedding_dim=8)
loss_fn = ContrastiveLoss()
val_transform = SimpleTransform()
transform = SimpleTransform()

# Create sample images (batch_size=2, channels=3, height=4, width=4)
images = torch.rand(2, 3, 4, 4)

ARGS = {
    'images': images,
    'model': model,
    'loss_fn': loss_fn,
    'val_transform': val_transform,
    'transform': transform,
    'iterations': 1,
    'device': 'cpu',
    'epsilon': 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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 4) — shape (2, 3, 4, 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
return_fgsm_supervised_attack_images Ran
ran on a synthesized input
bytefuse/representation-manifold-quality-metric/src/attacks.py
code served (permissive licence) · get_code("ffdae627a660a343")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.nn as nn

torch.manual_seed(0)

# Define a simple model that matches the function's usage
class SimpleModel(nn.Module):
    def __init__(self, input_dim=4, embedding_dim=8, output_dim=2):
        super().__init__()
        self.fc1 = nn.Linear(input_dim, embedding_dim)
        self.fc2 = nn.Linear(embedding_dim, output_dim)
    
    def forward(self, x):
        embeddings = self.fc1(x)
        logits = self.fc2(embeddings)
        return embeddings, logits

# Define a simple model for require_logits=False case
class SimpleEmbeddingModel(nn.Module):
    def __init__(self, input_dim=4, embedding_dim=8):
        super().__init__()
        self.fc = nn.Linear(input_dim, embedding_dim)
    
    def forward(self, x):
        return self.fc(x)

# Define a loss function for supervised setting
class SupervisedLoss(nn.Module):
    def forward(self, embeddings, labels_or_logits, labels=None):
        if labels is None:
            # Case where logits are passed as second arg
            logits = labels_or_logits
            return nn.functional.cross_entropy(logits, labels_or_logits)
        else:
            # Case where embeddings and logits passed
            logits = labels_or_logits
            return nn.functional.cross_entropy(logits, labels)

class SimpleLoss(nn.Module):
    def forward(self, embeddings, labels):
        # Simple MSE loss for embeddings vs labels
        target = torch.zeros(embeddings.shape[0], embeddings.shape[1])
        return nn.functional.mse_loss(embeddings, target)

# Define a simple transform
class SimpleTransform:
    def __call__(self, x):
        return x

# Create minimal tensors
batch_size = 2
input_dim = 4
num_classes = 3

images = torch.randn(batch_size, input_dim)
labels = torch.randint(0, num_classes, (batch_size,))

# Create model
model = SimpleEmbeddingModel(input_dim=input_dim, embedding_dim=8)

# Create loss function
loss_fn = SimpleLoss()

# Create transform
final_transform = SimpleTransform()

ARGS = {
    'images': images,
    'labels': labels,
    'model': model,
    'loss_fn': loss_fn,
    'final_transform': final_transform,
    'iterations': 1,
    'require_logits': False,
    'device': 'cpu',
    'epsilon': 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 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
plot_batch_of_images Not yet run
unverified (harvested, no recorded run)
bytefuse/representation-manifold-quality-metric/src/utils.py
code served (permissive licence) · get_code("12f524933b94fef1")
How it ran

no invocation recorded.

return_distances_label_wise Not yet run
unverified (harvested, no recorded run)
bytefuse/representation-manifold-quality-metric/src/metrics.py
code served (permissive licence) · get_code("f5c4d946ceca7d0f")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

Pretraining methods are typically compared by evaluating the accuracy of linear classifiers, transfer learning performance, or visually inspecting the representation manifold's (RM) lower-dimensional projections. We show that the differences between methods can be understood more clearly by investigating the RM directly, which allows for a more detailed comparison. To this end, we propose a framework and new metric to measure and compare different RMs. We also investigate and report on the RM characteristics for various pretraining methods. These characteristics are measured by applying sequentially larger local alterations to the input data, using white noise injections and Projected Gradient Descent (PGD) adversarial attacks, and then tracking each datapoint. We calculate the total distance moved for each datapoint and the relative change in distance between successive alterations. We show that self-supervised methods learn an RM where alterations lead to large but constant size changes, indicating a smoother RM than fully supervised methods. We then combine these measurements into one metric, the Representation Manifold Quality Metric (RMQM), where larger values indicate larger and less variable step sizes, and show that RMQM correlates positively with performance on downstream tasks.

For agents

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

get_harvested_code_for_paper("2205.07477")
get_code_for_paper("2205.07477")
have("2205.07477")

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

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

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

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

Connect an agent — have() is free.