SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.15156 · NeurIPS · 2023

xTrimoGene: An Efficient and Scalable Representation Learner for Single-Cell RNA-Seq Data

Le Song, Jianzhu Ma, Xingyi Cheng, Jing Gong, Minsheng Hao, Xin Zeng, Chiming Liu, Xuegong Zhang, Taifeng Wang

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 0 have no contract verdict; 6 failures of our instrument; 1 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/2311.15156.json · badge: /api/ran/2311.15156.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
snap-stanford/GEARS canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
combine_res Ran
ran; our contract draft was wrong, not the code
snap-stanford/GEARS/gears/utils.py
code served (permissive licence) · get_code("51a33f08fae4f764")
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 numpy as np

# Create two result dictionaries with numpy arrays
# The function concatenates arrays from res_1 and res_2 by key
res_1 = {
    'loss': np.array([0.5, 0.3]),
    'accuracy': np.array([0.8, 0.85]),
    'embeddings': np.random.randn(2, 4)
}

res_2 = {
    'loss': np.array([0.4, 0.2]),
    'accuracy': np.array([0.9, 0.92]),
    'embeddings': np.random.randn(3, 4)
}

ARGS = {
    'res_1': res_1,
    'res_2': res_2
}
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 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
compute_metrics Ran
ran; our contract draft was wrong, not the code
snap-stanford/GEARS/gears/inference.py
code served (permissive licence) · get_code("d3e54ce67d34ed8f")
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 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

# Create a results dict with the structure expected by compute_metrics
np.random.seed(0)

# Define dimensions
n_samples = 8
n_features = 4

# Create sample data
pred = np.random.randn(n_samples, n_features)
truth = np.random.randn(n_samples, n_features)
pred_de = np.random.randn(n_samples, n_features)
truth_de = np.random.randn(n_samples, n_features)

# Create perturbation categories: mix of 'ctrl' and other perturbations
pert_cat = np.array(['ctrl', 'ctrl', 'pert_a', 'pert_a', 'pert_b', 'pert_b', 'pert_a', 'pert_b'])

results = {
    'pred': pred,
    'truth': truth,
    'pred_de': pred_de,
    'truth_de': truth_de,
    'pert_cat': pert_cat
}

ARGS = {
    'results': results
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
evaluate Ran
ran; our contract draft was wrong, not the code
snap-stanford/GEARS/gears/inference.py
code served (permissive licence) · get_code("2064dcd76d82f44e")
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
import numpy as np

torch.manual_seed(0)

# Define a minimal batch class with required attributes
class Batch:
    def __init__(self, y, pert, de_idx):
        self.y = y
        self.pert = pert
        self.de_idx = de_idx
    
    def to(self, device):
        self.y = self.y.to(device)
        return self

# Define a minimal model that returns predictions and optionally uncertainty
class MinimalModel(nn.Module):
    def __init__(self, input_size=4, output_size=3, with_uncertainty=False):
        super().__init__()
        self.linear = nn.Linear(input_size, output_size)
        self.with_uncertainty = with_uncertainty
        if with_uncertainty:
            self.uncertainty_head = nn.Linear(input_size, output_size)
    
    def forward(self, batch):
        # Treat batch.y as input for simplicity
        pred = self.linear(batch.y)
        if self.with_uncertainty:
            unc = self.uncertainty_head(batch.y)
            return pred, unc
        return pred

# Create a minimal data loader (list of batches)
def create_loader(num_batches=2, batch_size=2, output_size=3):
    loader = []
    for _ in range(num_batches):
        y = torch.randn(batch_size, 4)
        pert = ['pert_A', 'pert_B']
        # de_idx should contain indices for each sample in the batch
        de_idx = [torch.tensor([0, 1]), torch.tensor([1, 2])]
        batch = Batch(y=y, pert=pert, de_idx=de_idx)
        loader.append(batch)
    return loader

# Test with uncertainty=True
model_with_unc = MinimalModel(input_size=4, output_size=3, with_uncertainty=True)
loader_with_unc = create_loader(num_batches=2, batch_size=2, output_size=3)

# Test with uncertainty=False
model_without_unc = MinimalModel(input_size=4, output_size=3, with_uncertainty=False)
loader_without_unc = create_loader(num_batches=2, batch_size=2, output_size=3)

device = 'cpu'

ARGS = {
    'loader': loader_with_unc,
    'model': model_with_unc,
    'uncertainty': True,
    'device': device
}
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 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
non_zero_analysis Ran
ran; our contract draft was wrong, not the code
snap-stanford/GEARS/gears/inference.py
code served (permissive licence) · get_code("e3fa63bd954be915")
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 numpy as np
from scipy.sparse import csr_matrix
import pandas as pd

# Create a minimal mock AnnData-like object
class MockAnnData:
    def __init__(self):
        n_obs = 10
        n_vars = 30
        
        # Create X as sparse matrix
        X_dense = np.random.randn(n_obs, n_vars)
        self.X = csr_matrix(X_dense)
        
        # Create obs DataFrame with condition and condition_name
        conditions = ['ctrl', 'ctrl', 'pert1', 'pert1', 'pert1', 'pert2', 'pert2', 'pert2', 'pert2', 'pert2']
        condition_names = ['control', 'control', 'perturbation_1', 'perturbation_1', 'perturbation_1', 
                          'perturbation_2', 'perturbation_2', 'perturbation_2', 'perturbation_2', 'perturbation_2']
        self.obs = pd.DataFrame({
            'condition': conditions,
            'condition_name': condition_names
        })
        
        # Create var DataFrame with gene names
        gene_ids = [f'ENSG{i:05d}' for i in range(n_vars)]
        gene_names = [f'GENE_{i}' for i in range(n_vars)]
        self.var = pd.DataFrame({
            'gene_name': gene_names
        }, index=gene_ids)
        
        # Create uns with top_non_zero_de_20
        self.uns = {
            'top_non_zero_de_20': {
                'control': [f'ENSG{i:05d}' for i in range(20)],
                'perturbation_1': [f'ENSG{i:05d}' for i in range(20)],
                'perturbation_2': [f'ENSG{i:05d}' for i in range(20)]
            }
        }

# Create test_res dictionary
adata = MockAnnData()

n_samples = 10
n_genes = 30

test_res = {
    'pert_cat': np.array(['ctrl', 'ctrl', 'pert1', 'pert1', 'pert1', 'pert2', 'pert2', 'pert2', 'pert2', 'pert2']),
    'pred': np.random.randn(n_samples, n_genes),
    'truth': np.random.randn(n_samples, n_genes)
}

ARGS = {
    'adata': adata,
    'test_res': test_res
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, scipy, sklearn — 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
parse_combo_pert Ran
ran; our contract draft was wrong, not the code
snap-stanford/GEARS/gears/utils.py
code served (permissive licence) · get_code("982e00668dfdca54")
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 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 torch

def parse_combo_pert(i):
    return (i.split('+')[0], i.split('+')[1])

torch.manual_seed(0)

ARGS = {
    'i': 'first+second'
}
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, ndim 1, 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
parse_single_pert Ran
ran; our contract draft was wrong, not the code
snap-stanford/GEARS/gears/utils.py
code served (permissive licence) · get_code("260f8964a1c60216")
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

def parse_single_pert(i):
    a = i.split('+')[0]
    b = i.split('+')[1]
    if a == 'ctrl':
        pert = b
    else:
        pert = a
    return pert

# The function takes a single string parameter 'i' that contains a '+' delimiter
# It splits on '+' and extracts perturbation info based on the first part
ARGS = {
    'i': 'ctrl+treatment_A'
}
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
get_dropout_non_zero_genes Not yet run
unverified (harvested, no recorded run)
snap-stanford/GEARS/gears/data_utils.py
code served (permissive licence) · get_code("8e3b7853aca0addb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 6 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 6 later) and 1 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
combine_res 1 other paper
1 later
2510.07964 (2025-10)
PRESCRIBE: Predicting Single-Cell Responses with Bayesian Estimation
compute_metrics 1 other paper
1 later
2510.07964 (2025-10)
PRESCRIBE: Predicting Single-Cell Responses with Bayesian Estimation
evaluate 1 other paper
1 later
2510.07964 (2025-10)
PRESCRIBE: Predicting Single-Cell Responses with Bayesian Estimation
get_dropout_non_zero_genes 1 other paper
1 later
2510.07964 (2025-10)
PRESCRIBE: Predicting Single-Cell Responses with Bayesian Estimation
parse_combo_pert 1 other paper
1 later
2510.07964 (2025-10)
PRESCRIBE: Predicting Single-Cell Responses with Bayesian Estimation
parse_single_pert 1 other paper
1 later
2510.07964 (2025-10)
PRESCRIBE: Predicting Single-Cell Responses with Bayesian Estimation

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

Advances in high-throughput sequencing technology have led to significant progress in measuring gene expressions at the single-cell level. The amount of publicly available single-cell RNA-seq (scRNA-seq) data is already surpassing 50M records for humans with each record measuring 20,000 genes. This highlights the need for unsupervised representation learning to fully ingest these data, yet classical transformer architectures are prohibitive to train on such data in terms of both computation and memory. To address this challenge, we propose a novel asymmetric encoder-decoder transformer for scRNA-seq data, called xTrimoGene α (or xTrimoGene for short) 4 , which leverages the sparse characteristic of the data to scale up the pre-training. This scalable design of xTrimoGene reduces FLOPs by one to two orders of magnitude compared to classical transformers while maintaining high accuracy, enabling us to train the largest transformer models over the largest scRNA-seq dataset today. Our experiments also show that the performance of xTrimoGene improves as we scale up the model sizes, and it also leads to SOTA performance over various downstream tasks, such as cell type annotation, perturb-seq effect prediction, and drug combination prediction. xTrimoGene model is now available for use as a service via the following link: https://api.biomap.com/xTrimoGene/apply * Equal contribution. Mingsheng Hao conducted this work during his internship at BioMap.

For agents

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

get_harvested_code_for_paper("2311.15156")
get_code_for_paper("2311.15156")
have("2311.15156")

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

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

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

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

Connect an agent — have() is free.