SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.13789 · 2026

ENSEMBITS: an alphabet of protein conformational ensembles

Carlos Oliver, Kaiwen Shi

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 2 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 1 failure 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/2605.13789.json · badge: /api/ran/2605.13789.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
OliverLaboratory/Ensembits_release community
Papers with Code archive
6 ran · 3 no recorded run
FunctionStatusWhere it lives
SequenceEncoder Ran
ran on a synthesized input
OliverLaboratory/Ensembits_release/ensembits/tokenizer.py
code served (permissive licence) · get_code("9ebbd7779c8d7317")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 8) 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 torch.nn as nn

class SequenceEncoder(nn.Module):
    """Order-aware encoder; pair with ``permute_input=True`` to learn
    frame-order invariance from data. Not used by the shipped model
    (kept for API parity with the original codebase)."""

    def __init__(self, input_dim: int, num_prototypes: int, hidden_dim: int=128, latent_dim: int=64):
        super().__init__()
        self.num_prototypes = num_prototypes
        self.per_element_mlp = nn.Sequential(nn.Linear(input_dim, hidden_dim), nn.ReLU(), nn.Linear(hidden_dim, hidden_dim), nn.ReLU())
        self.projection = nn.Sequential(nn.Linear(num_prototypes * hidden_dim, hidden_dim), nn.ReLU(), nn.Linear(hidden_dim, latent_dim))

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        B = x.shape[0]
        h = self.per_element_mlp(x)
        flat = h.reshape(B, -1)
        return self.projection(flat)


INIT_ARGS = {
    'input_dim': 4,
    'num_prototypes': 3,
    'hidden_dim': 16,
    'latent_dim': 8,
}

ARGS = {
    'x': torch.randn(2, 3, 4),
}

if __name__ == '__main__':
    encoder = SequenceEncoder(**INIT_ARGS)
    output = encoder(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 8) — shape (2, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SetDecoder Ran
ran on a synthesized input
OliverLaboratory/Ensembits_release/ensembits/tokenizer.py
code served (permissive licence) · get_code("9912f3a756f8cd6f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 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 torch
import torch.nn as nn

class SetDecoder(nn.Module):
    """MLP decoder: latent → (B, P, D) reconstructed descriptor vectors."""

    def __init__(self, latent_dim: int, output_dim: int, num_states: int, hidden_dim: int=128, n_layers: int=1):
        super().__init__()
        self.num_states = num_states
        self.output_dim = output_dim
        layers: list[nn.Module] = [nn.Linear(latent_dim, hidden_dim), nn.GELU()]
        for _ in range(n_layers - 1):
            layers += [nn.Linear(hidden_dim, hidden_dim), nn.GELU()]
        layers.append(nn.Linear(hidden_dim, num_states * output_dim))
        self.mlp = nn.Sequential(*layers)
        self.n_layers = n_layers

    def forward(self, q: torch.Tensor) -> torch.Tensor:
        flat = self.mlp(q)
        return flat.view(-1, self.num_states, self.output_dim)


INIT_ARGS = {
    'latent_dim': 4,
    'output_dim': 3,
    'num_states': 5,
    'hidden_dim': 8,
    'n_layers': 2,
}

ARGS = {
    'q': torch.randn(2, 4),
}

if __name__ == '__main__':
    model = SetDecoder(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: (2, {INIT_ARGS['num_states']}, {INIT_ARGS['output_dim']})")
    assert output.shape == (2, INIT_ARGS['num_states'], INIT_ARGS['output_dim'])
    print("Test passed!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 5, 3) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SetTransformerEncoder Ran
ran on a synthesized input
OliverLaboratory/Ensembits_release/ensembits/tokenizer.py
code served (permissive licence) · get_code("8cc7e5afe7bf5be3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 8) 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 torch.nn as nn

class SetTransformerEncoder(nn.Module):
    """Permutation-invariant encoder (PerceiverIO-style).

    One cross-attention layer (learnable queries attend to the P
    conformation embeddings) followed by ``n_layers`` self-attention +
    FFN blocks operating on the queries. Output is a (B, latent_dim)
    latent.
    """

    def __init__(self, input_dim: int, hidden_dim: int=128, latent_dim: int=64, n_queries: int=4, n_heads: int=4, n_layers: int=1):
        super().__init__()
        self.per_element_mlp = nn.Sequential(nn.Linear(input_dim, hidden_dim), nn.ReLU(), nn.Linear(hidden_dim, hidden_dim))
        self.queries = nn.Parameter(torch.randn(n_queries, hidden_dim) * 0.02)
        self.cross_attn = nn.MultiheadAttention(embed_dim=hidden_dim, num_heads=n_heads, batch_first=True)
        self.cross_norm = nn.LayerNorm(hidden_dim)
        self.blocks = nn.ModuleList([nn.ModuleDict(dict(attn=nn.MultiheadAttention(embed_dim=hidden_dim, num_heads=n_heads, batch_first=True), norm1=nn.LayerNorm(hidden_dim), ffn=nn.Sequential(nn.Linear(hidden_dim, hidden_dim * 2), nn.GELU(), nn.Linear(hidden_dim * 2, hidden_dim)), norm2=nn.LayerNorm(hidden_dim))) for _ in range(n_layers)])
        self.projection = nn.Linear(n_queries * hidden_dim, latent_dim)
        self.n_queries = n_queries
        self.n_layers = n_layers

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        B = x.shape[0]
        h = self.per_element_mlp(x)
        q = self.queries.unsqueeze(0).expand(B, -1, -1)
        q2, _ = self.cross_attn(q, h, h)
        q = self.cross_norm(q + q2)
        for blk in self.blocks:
            q2, _ = blk['attn'](q, q, q)
            q = blk['norm1'](q + q2)
            q = blk['norm2'](q + blk['ffn'](q))
        flat = q.reshape(B, self.n_queries * q.shape[-1])
        return self.projection(flat)


INIT_ARGS = {
    'input_dim': 4,
    'hidden_dim': 16,
    'latent_dim': 8,
    'n_queries': 3,
    'n_heads': 2,
    'n_layers': 2,
}

ARGS = {
    'x': torch.randn(2, 5, 4),
}

if __name__ == '__main__':
    model = SetTransformerEncoder(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: (2, 8)")
    assert output.shape == (2, 8), f"Shape mismatch: {output.shape} != (2, 8)"
    print("Success!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 8) — shape (2, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
_build_perms Ran
ran, honoured the contract we drafted
OliverLaboratory/Ensembits_release/ensembits/tokenizer.py
code served (permissive licence) · get_code("42ecd4a2f332e343")
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) and returned Tensor, ndim 2, dtype family int, shape (6, 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
from itertools import permutations

torch.manual_seed(0)

# The function _build_perms takes a single parameter P (an integer)
# and generates all permutations of range(P) as a tensor
# P should be a small positive integer

P = 3

ARGS = {
    "P": P
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 int, shape (6, 3) — shape (6, 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
_init_orthogonal_basis Ran
ran, honoured the contract we drafted
OliverLaboratory/Ensembits_release/ensembits/tokenizer.py
code served (permissive licence) · get_code("bf8dc35deb832492")
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) and returned Tensor, ndim 2, dtype family float, shape (3, 5) 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 = {
    "num_codes": 3,
    "basis_dim": 5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 (3, 5) — shape (3, 5) 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
_permute_frames Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
OliverLaboratory/Ensembits_release/ensembits/tokenizer.py
code served (permissive licence) · get_code("b80c7461a3e4e62c")
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) and returned Tensor, ndim 3, dtype family float, shape (2, 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 torch

torch.manual_seed(0)

# The function expects a tensor x with shape (B, P, *)
# where B is batch size, P is number of frames, and * is any remaining dimensions
# It performs random permutation along the P axis independently per sample

x = torch.randn(2, 4, 3)  # B=2, P=4, feature_dim=3

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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, 4, 3) — shape (2, 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
RVQVAETokenizer Not yet run
unverified (harvested, no recorded run)
OliverLaboratory/Ensembits_release/ensembits/tokenizer.py
code served (permissive licence) · get_code("d188fd59dc9f07f4")
How it ran

no invocation recorded.

VectorQuantizer Not yet run
unverified (harvested, no recorded run)
OliverLaboratory/Ensembits_release/ensembits/tokenizer.py
code served (permissive licence) · get_code("49fdbdbba8440b92")
How it ran

no invocation recorded.

hungarian_loss Not yet run
unverified (harvested, no recorded run)
OliverLaboratory/Ensembits_release/ensembits/tokenizer.py
code served (permissive licence) · get_code("2128f8e4ea6b8171")
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-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

Protein structure tokenizers (PSTs) are workhorses in protein language modeling, function prediction, and evolutionary analysis. However, existing PSTs only capture local geometry of static structures, and miss the correlated motions and alternative conformational states revealed by protein ensembles. Here we introduce ENSEMBITS, the first tokenizer of protein conformational ensembles. ENSEMBITS address challenges inherent to tokenizing dynamics: deriving informative geometric descriptors across conformations, permutation-invariance encoding of variable-size ensembles, and conquering sparsity in dynamics data. Trained with a Residual VQ-VAE using a frame distillation objective on a large molecular dynamics corpus, ENSEMBITS outperforms all related methods on RMSF prediction, and is the strongest standalone structural tokenizer on an token-conditioned ANOVA test on per-residue motion amplitude. ENSEMBITS further matches or exceeds static tokenizers on EC, GO, binding site/affinity prediction, and zero-shot mutation-effect prediction despite using far less pretraining data. Notably, the distillation objective enables ENSEMBITS to predict dynamics token from one single predicted structure, which alleviates dynamics data sparsity. As the field moves from static structure prediction toward ensemble generation, ENSEMBITS offer the discrete vocabulary needed to bring dynamics into protein language modeling and design. Our codes can be found at: https://github.com/OliverLaboratory/Ensembits_release. beyond proteins [Liu et al., 2025a]. Each step has unlocked downstream possibilities: 3Di tokens drive Foldseek's billion-fold speedup in structural search [van Kempen et al., 2022]; ESM3's joint sequence-structure-function vocabulary enables generative design [Lin et al., 2023b]; and discrete structural tokens have been used as drop-in inputs for function prediction, remote homology detection, and inverse folding [Heinzinger et al., 2023, Liu et al., 2025b, 2024]. A more expressive alphabet lets downstream models reason about a richer slice of protein biology. Access to rich dynamics data is growing rapidly. Large-scale MD repositories such as mdCATH [Mirarchi et al., 2024], ATLAS [Vander Meersche et al., 2023], and MISATO [Siebenmorgen et al., 2024] now provide thousands of all-atom trajectories spanning diverse fold space, replicas, and temperatures, offering an unprecedented supervisory signal for learning dynamical priors directly from physics. Concurrently, the next generation of protein structure prediction is focusing on ensemble prediction: BioEmu [Lewis et al., 2025] emulates equilibrium ensembles at scale, AFsample2 [Kalakoti and Wallner, 2024] perturbs AlphaFold's MSA [Jumper et al., 2021] and dropouts to sample alternative conformations, and methods such as AlphaFlow,ESMDiff, and Distributional Graphormer [Jing et al., 2024, Lu et al., 2025, Zheng et al., 2024] recast structure prediction as a generative problem over conformational distributions. Together, these advances mean that ensemble data will not remain the bottleneck for long; instead, the bottleneck will shift to representation. Efforts to represent the high-dimensional ensemble data digestable by transformer architectures have recently begun. Portal et al. [Portal et al., 2026] and the [Guo et al., 2025] show enhanced function prediction through graph-based representations using distograms from Boltz2 Passaro et al. [2025] and MD-derived residue correlations respectively. PETIMOT [Lombard et al., 2025] represents motions at the residue level by encoding the principal angles of backbone motion and is able to reconstruct some dynamic signatures from sequence. ProtProfileMD [Lüth et al., 2026] encodes distributions of structural states as histograms built on 3Di tokens [van Kempen et al., 2022] (thus not a tokenizer) to enhance language models, but doing so over an alphabet trained on static structure forfeits joint modeling of correlated motion across residues. While these methods encode various dynamical features, none have yet described a full dynamics-aware token alphabet that jointly compresses local correlated motion patterns into a discrete vocabulary. We propose ENSEMBITS, the first tokenizer of protein conformational ensembles. ENSEMBITS maps an unordered set of structural frames (protein conformers) to a discrete token through three coupled design choices: (i) SE(3)-invariant descriptors computed across frames whose neighbour identities are themselves frame-dependent, so contact formation and breakage along the trajectory enter the descriptors directly; (ii) a permutation-invariant set encoder so that variable-size ensembles map deterministically to a single latent regardless of frame order; and (iii) a single-frame-to-token distillation objective that pulls the embedding of a sub-sampled ensemble-down to a single frametoward that of the full ensemble, enabling the tokenizer to be queried at test time even when only a static structure is available. The result is a residual-VQ codebook over local dynamical motifs that can be plugged into any downstream PLM in place of, or alongside, existing static structural tokens. Our contributions are: • Formulation, model, and training pipeline. We formulate ensemble tokenization as a multiset-to-token compression problem, design SE(3)-invariant descriptors of protein frames, and train an end-to-end tokenizer of protein dynamics. • Single-frame-to-token distillation (SFTD). We devise a training objective that aligns sub-ensemble embeddings with their full-ensemble counterparts, letting one tokenizer serve both full/partial trajectories and single static frames at inference time. • Empirical validation across dynamics, function, and mutation. We empirically validate that ENSEMBITS leads RMSF prediction, dominates ANOVA tests on token-dynamics correlation, and matches or exceeds existing static structural tokenizers on EC, GO, bindingsite prediction, and zero-shot mutation-effect prediction with far less pretraining data.

For agents

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

get_harvested_code_for_paper("2605.13789")
get_code_for_paper("2605.13789")
have("2605.13789")

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

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

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

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

Connect an agent — have() is free.