SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.00089 · ICML · 2025

Protein Structure Tokenization: Benchmarking and New Recipe

Xinyu Yuan, Zichen Wang, Huzefa Rangwala, Marcus Collins

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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; 1 failure of our instrument; 2 no recorded run), measured 2026-11-23; 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/2503.00089.json · badge: /api/ran/2503.00089.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
katarinayuan/structtokenbench canonical (classifier label)
classifier basis not recorded on the link
8 ran · 2 no recorded run
FunctionStatusWhere it lives
batched_gather Ran
ran on a synthesized input
katarinayuan/structtokenbench/src/vqvae_model.py
code served (permissive licence) · get_code("ac939bc0a0113658")
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, 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 torch

torch.manual_seed(0)

# Create a small tensor with distinct dimensions for batching
# Shape: (batch_dim=2, feature_dim=4, seq_len=3)
data = torch.randn(2, 4, 3)

# Create indices tensor for gathering along a dimension
# Shape must be compatible with batched gathering
inds = torch.tensor([[0, 2], [1, 1]])

# Parameters for the function
dim = 1  # Dimension to gather along (not a batch dimension)
no_batch_dims = 1  # First dimension is batch

ARGS = {
    "data": data,
    "inds": inds,
    "dim": dim,
    "no_batch_dims": no_batch_dims,
}
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, 3) — shape (2, 2, 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
calculate_multiclass_clf_metric Ran
ran on a synthesized input
katarinayuan/structtokenbench/src/util.py
code served (permissive licence) · get_code("bc2286f6f71a2a26")
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

torch.manual_seed(0)

# Create small multiclass classification tensors
# logits: batch_size=2, num_classes=4
logits = torch.randn(2, 4)

# targets: batch_size=2, class indices from 0 to 3
targets = torch.tensor([0, 2], dtype=torch.long)

ARGS = {
    'logits': logits,
    'targets': targets
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sklearn, torch, torchmetrics — 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
get_tokenizer_device Ran
ran on a synthesized input
katarinayuan/structtokenbench/src/data_module.py
code served (permissive licence) · get_code("17da71765fb0cdf2")
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 device. 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

torch.manual_seed(0)

ARGS = {
    'tokenizer_device': 'cpu'
}
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 device — a device output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a device 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
node_gather Ran
ran on a synthesized input
katarinayuan/structtokenbench/src/vqvae_model.py
code served (permissive licence) · get_code("65c9e7a4b8a02ce8")
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, 3, 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)

# s is a torch.Tensor that gets unsqueezed at -3
# After unsqueeze(-3), it should have shape suitable for batched_gather
# Let's say s has shape (batch=2, features=4)
s = torch.randn(2, 4)

# edges is a torch.Tensor used as indices in batched_gather
# It's used to index along dimension -2 after s is unsqueezed
# unsqueeze(-3) on (2, 4) gives (2, 1, 4)
# We need edges to index into the first dimension (batch dimension)
# edges should have shape that broadcasts properly
# Let's make edges shape (2, 3) to select 3 nodes per batch element
edges = torch.randint(0, 2, (2, 3))

ARGS = {
    "s": s,
    "edges": edges,
}
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, 3, 4) — shape (2, 3, 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
parse_PDB Ran
ran on a synthesized input
katarinayuan/structtokenbench/src/baselines/protein_mpnn_utils.py
code served (permissive licence) · get_code("ad6b51206d2729dc")
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 list, 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 numpy as np
import tempfile
import os

# Create a mock parse_fn that simulates PDB parsing
def mock_parse_fn(biounit, atoms=None, chain=None):
    """
    Mock parsing function that returns xyz coordinates, sequence, and residue indices.
    Returns a string (error indicator) for chains that don't exist.
    """
    # Only return data for chains A and B
    if chain not in ['A', 'B']:
        return "Chain not found", "", None
    
    # For chain A, return some data
    if chain == 'A':
        # xyz shape: (num_residues, num_atoms, 3)
        # For this mock, we have 5 residues and atoms specified
        num_residues = 5
        num_atoms = len(atoms) if atoms else 4
        xyz = np.random.randn(num_residues, num_atoms, 3).astype(np.float32)
        seq = "ACDEF"
        ridx = np.array([1, 2, 3, 4, 5])
        return xyz, seq, ridx
    
    # For chain B, return different data
    if chain == 'B':
        num_residues = 3
        num_atoms = len(atoms) if atoms else 4
        xyz = np.random.randn(num_residues, num_atoms, 3).astype(np.float32)
        seq = "GHI"
        ridx = np.array([1, 2, 3])
        return xyz, seq, ridx

# Create a temporary PDB file path (won't actually be read in this mock)
temp_pdb_path = "/tmp/mock_protein.pdb"

ARGS = {
    'path_to_pdb': temp_pdb_path,
    'input_chain_list': ['A', 'B'],
    'ca_only': False,
    'parse_fn': mock_parse_fn
}
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 list, ndim 1, dtype family float — a list 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
parse_PDB_biounits Ran
ran on a synthesized input
katarinayuan/structtokenbench/src/baselines/protein_mpnn_utils.py
code served (permissive licence) · get_code("eb6322985d026288")
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
import tempfile
import os

# Create a minimal valid PDB file
pdb_content = """ATOM      1  N   ALA A   1       0.000   0.000   0.000  1.00  0.00           N
ATOM      2  CA  ALA A   1       1.458   0.000   0.000  1.00  0.00           C
ATOM      3  C   ALA A   1       2.009   1.390   0.000  1.00  0.00           C
ATOM      4  N   GLY A   2       3.000   1.500   0.800  1.00  0.00           N
ATOM      5  CA  GLY A   2       3.700   2.750   0.900  1.00  0.00           C
ATOM      6  C   GLY A   2       4.200   3.200   2.300  1.00  0.00           C
END
"""

# Create a temporary PDB file
temp_pdb = tempfile.NamedTemporaryFile(mode='w', suffix='.pdb', delete=False)
temp_pdb.write(pdb_content)
temp_pdb.close()
pdb_path = temp_pdb.name

try:
    ARGS = {
        'pdb_path': pdb_path,
        'atoms': ['N', 'CA', 'C'],
        'chain': None
    }
finally:
    # Clean up will happen after execution
    pass
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
parse_fasta Ran
ran; our contract draft was wrong, not the code
katarinayuan/structtokenbench/src/baselines/protein_mpnn_utils.py
code served (permissive licence) · get_code("cc287b7f78ecb5e5")
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 tempfile
import os
import numpy as np

# Create a temporary FASTA file
temp_dir = tempfile.mkdtemp()
fasta_file = os.path.join(temp_dir, "test.fasta")

with open(fasta_file, 'w') as f:
    f.write(">sequence1\n")
    f.write("ACGTACGT\n")
    f.write(">sequence2\n")
    f.write("TGCATGCA\n")
    f.write(">sequence3\n")
    f.write("AAGGCCTT\n")

ARGS = {
    'filename': fasta_file,
    'limit': -1,
    'omit': []
}
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, 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
three_to_one Ran
ran on a synthesized input
katarinayuan/structtokenbench/src/baselines/protein_mpnn_cif_parser.py
code served (permissive licence) · get_code("a35e139460afb244")
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

alpha_1 = list('ARNDCQEGHILKMFPSTWYV-')

alpha_3 = ['ALA', 'ARG', 'ASN', 'ASP', 'CYS', 'GLN', 'GLU', 'GLY', 'HIS', 'ILE', 'LEU', 'LYS', 'MET', 'PHE', 'PRO', 'SER', 'THR', 'TRP', 'TYR', 'VAL', 'GAP']

three_to_one_mapping = dict(zip(alpha_3, alpha_1))

def three_to_one(x: str) -> str:
    return three_to_one_mapping[x] if x in three_to_one_mapping else 'X'

ARGS = {
    'x': 'ALA'
}
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 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
calculate_binary_clf_metric Not yet run
unverified (harvested, no recorded run)
katarinayuan/structtokenbench/src/util.py
code served (permissive licence) · get_code("497d53eb6d9adbaf")
How it ran

no invocation recorded.

calculate_regression_metric Not yet run
unverified (harvested, no recorded run)
katarinayuan/structtokenbench/src/util.py
code served (permissive licence) · get_code("0e76d1d950c3cfd5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 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
parse_fasta 2 other papers
2 dated earlier
2401.06151 (2024-01)
Towards Joint Sequence-Structure Generation of Nucleic Acid and Protein Complexes with SE(3)-Discrete Diffusion
2412.20888 (2024-12)
Navigating Chemical-Linguistic Sharing Space with Heterogeneous Molecular Encoding

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

Recent years have witnessed a surge in the development of protein structural tokenization methods, which chunk protein 3D structures into discrete or continuous representations. Structure tokenization enables the direct application of powerful techniques like language modeling for protein structures, and large multimodal models to integrate structures with protein sequences and functional texts. Despite the progress, the capabilities and limitations of these methods remain poorly understood due to the lack of a unified evaluation framework. We first introduce Struct-TokenBench, a framework that comprehensively evaluates the quality and efficiency of structure tokenizers, focusing on fine-grained local substructures rather than global structures, as typical in existing benchmarks. Our evaluations reveal that no single model dominates all benchmarking perspectives. Observations of codebook underutilization led us to develop AminoAseed, a simple yet effective strategy that enhances codebook gradient updates and optimally balances codebook size and dimension for improved tokenizer utilization and quality. Compared to the leading VQ-VAE model ESM3, our method achieves an average of 6.31% performance improvement across 24 supervised tasks, with sensitivity and utilization rates increased by 12.83% and 124.03%, respectively. Source code and model weights are available at https://github.com/ KatarinaYuan/StructTokenBench.

For agents

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

get_harvested_code_for_paper("2503.00089")
get_code_for_paper("2503.00089")
have("2503.00089")

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

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

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

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

Connect an agent — have() is free.