SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.09328 · NeurIPS · 2022

TransTab: Learning Transferable Tabular Transformers Across Tables

Jimeng Sun, Zifeng Wang

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (7 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 1 failure 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.09328.json · badge: /api/ran/2205.09328.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
ryanwangzf/transtab marked official in Papers with Code
Papers with Code archive
9 ran · 2 no recorded run
FunctionStatusWhere it lives
TransTabCLSToken Ran
ran on a synthesized input · constructed an object; no result was computed
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("38d353ae87b1df76")
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 an instance of its own class, TransTabCLSToken: the run constructed the object and did not call it, so no result was computed. 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
from torch import nn
from torch import Tensor
import torch.nn.init as nn_init
import math

torch.manual_seed(0)

# The TransTabCLSToken class expects:
# - hidden_dim: int - the dimension of the hidden embeddings

ARGS = {
    'hidden_dim': 4
}
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 TransTabCLSToken — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransTabCLSToken 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
TransTabEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("248641db8bf9e6d3")
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 an instance of its own class, TransTabEncoder: the run constructed the object and did not call it, so no result was computed. 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 torch.nn.functional as F

torch.manual_seed(0)

ARGS = {
    'hidden_dim': 128,
    'num_layer': 2,
    'num_attention_head': 2,
    'hidden_dropout_prob': 0.1,
    'ffn_dim': 256,
    'activation': 'relu',
}
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 TransTabEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransTabEncoder 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
TransTabFeatureProcessor Ran
ran on a synthesized input · constructed an object; no result was computed
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("ef72c0a447db8dbe")
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 an instance of its own class, TransTabFeatureProcessor: the run constructed the object and did not call it, so no result was computed. 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
import math

torch.manual_seed(0)

# Build the smallest valid arguments for TransTabFeatureProcessor
ARGS = {
    'vocab_size': 100,
    'hidden_dim': 8,
    'hidden_dropout_prob': 0.1,
    'pad_token_id': 0,
    '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 TransTabFeatureProcessor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransTabFeatureProcessor 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
TransTabInputEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("e082d5818ce38db2")
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 an instance of its own class, TransTabInputEncoder: the run constructed the object and did not call it, so no result was computed. 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
from torch import nn
import pandas as pd

torch.manual_seed(0)

class MockFeatureExtractor(nn.Module):
    """Mock feature extractor that tokenizes input dataframe."""
    def __init__(self):
        super().__init__()
    
    def __call__(self, x):
        # Returns a dict of tokenized features
        # Simulates what a real tokenizer would return
        batch_size = len(x)
        return {
            'input_ids': torch.randint(0, 100, (batch_size, 8)),
            'attention_mask': torch.ones(batch_size, 8),
        }
    
    def load(self, path):
        pass


class MockFeatureProcessor(nn.Module):
    """Mock feature processor that generates embeddings from tokenized input."""
    def __init__(self, hidden_dim=4):
        super().__init__()
        self.hidden_dim = hidden_dim
        self.embedding = nn.Embedding(100, hidden_dim)
        self.linear = nn.Linear(hidden_dim, hidden_dim)
    
    def forward(self, input_ids, attention_mask):
        # Process tokenized features into embeddings
        embeds = self.embedding(input_ids)  # (batch_size, seq_len, hidden_dim)
        # Apply attention mask and aggregate
        masked_embeds = embeds * attention_mask.unsqueeze(-1)
        output = self.linear(masked_embeds.mean(dim=1))  # (batch_size, hidden_dim)
        return output


# Create mock objects
feature_extractor = MockFeatureExtractor()
feature_processor = MockFeatureProcessor(hidden_dim=4)

# Create ARGS dictionary with all required parameters
ARGS = {
    'feature_extractor': feature_extractor,
    'feature_processor': feature_processor,
    'device': 'cpu',
}
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 TransTabInputEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransTabInputEncoder 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
TransTabLinearClassifier Ran
ran on a synthesized input
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("4267538aa1610439")
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; 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
from torch import nn, Tensor

class TransTabLinearClassifier(nn.Module):

    def __init__(self, num_class, hidden_dim=128) -> None:
        super().__init__()
        if num_class <= 2:
            self.fc = nn.Linear(hidden_dim, 1)
        else:
            self.fc = nn.Linear(hidden_dim, num_class)
        self.norm = nn.LayerNorm(hidden_dim)

    def forward(self, x) -> Tensor:
        x = x[:, 0, :]
        x = self.norm(x)
        logits = self.fc(x)
        return logits


INIT_ARGS = {
    "num_class": 5,
    "hidden_dim": 64,
}

ARGS = {
    "x": torch.randn(2, 3, 64),
}

if __name__ == "__main__":
    model = TransTabLinearClassifier(**INIT_ARGS)
    output = model(**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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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)
TransTabNumEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("4feeac0368ae8f3f")
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 an instance of its own class, TransTabNumEmbedding: the run constructed the object and did not call it, so no result was computed. 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 math
from torch import nn
from torch import Tensor
import torch.nn.init as nn_init

torch.manual_seed(0)

# Build the model
hidden_dim = 4
model = nn.Module()

# Create sample tensors
batch_size = 2
num_numerical_cols = 3

# num_col_emb: (# numerical columns, emb_dim) - shape (3, 4)
num_col_emb = torch.randn(num_numerical_cols, hidden_dim)

# x_num_ts: (bs, emb_dim) - shape (2, 4)
x_num_ts = torch.randn(batch_size, hidden_dim)

# num_mask: (bs, # numerical columns) - shape (2, 3)
num_mask = torch.ones(batch_size, num_numerical_cols, dtype=torch.bool)

ARGS = {
    "hidden_dim": hidden_dim,
}
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 TransTabNumEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransTabNumEmbedding 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
TransTabTransformerLayer Ran
ran on a synthesized input · constructed an object; no result was computed
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("40da78df277bbc73")
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 an instance of its own class, TransTabTransformerLayer: the run constructed the object and did not call it, so no result was computed. 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 torch.nn.functional as F

torch.manual_seed(0)

ARGS = {
    'd_model': 8,
    'nhead': 2,
    'dim_feedforward': 16,
    'dropout': 0.1,
    'activation': F.relu,
    'layer_norm_eps': 1e-5,
    'batch_first': True,
    'norm_first': False,
    'device': None,
    'dtype': None,
    'use_layer_norm': True,
}
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 TransTabTransformerLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransTabTransformerLayer 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
TransTabWordEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("bc3b678332b01152")
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 an instance of its own class, TransTabWordEmbedding: the run constructed the object and did not call it, so no result was computed. 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
from torch import nn

torch.manual_seed(0)

ARGS = {
    "vocab_size": 100,
    "hidden_dim": 16,
    "padding_idx": 0,
    "hidden_dropout_prob": 0.1,
    "layer_norm_eps": 1e-05,
}
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 TransTabWordEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransTabWordEmbedding 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_activation_fn Ran
ran; our contract draft was wrong, not the code
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("5189f4bea3053264")
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 function. 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 torch.nn.functional as F

torch.manual_seed(0)

ARGS = {
    'activation': 'relu'
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
TransTabFeatureExtractor Not yet run
unverified (harvested, no recorded run)
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("dd77da7eb6ce33dc")
How it ran

no invocation recorded.

TransTabModel Not yet run
unverified (harvested, no recorded run)
ryanwangzf/transtab/transtab/modeling_transtab.py
code served (permissive licence) · get_code("b0592bb5e780d2d8")
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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 10 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
_get_activation_fn
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2505.05237 (2025-05)
Latte: Transfering LLMs' Latent-level Knowledge for Few-shot Tabular 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-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

Tabular data (or tables) are the most widely used data format in machine learning (ML). However, ML models often assume the table structure keeps fixed in training and testing. Before ML modeling, heavy data cleaning is required to merge disparate tables with different columns. This preprocessing often incurs significant data waste (e.g., removing unmatched columns and samples). How to learn ML models from multiple tables with partially overlapping columns? How to incrementally update ML models as more columns become available over time? Can we leverage model pretraining on multiple distinct tables? How to train an ML model which can predict on an unseen table ? To answer all those questions, we propose to relax fixed table structures by introducing a Transferable Tabular Transformer (TransTab) for tables. The goal of TransTab is to convert each sample (a row in the table) to a generalizable embedding vector, and then apply stacked transformers for feature encoding. One methodology insight is combining column description and table cells as the raw input to a gated transformer model. The other insight is to introduce supervised and self-supervised pretraining to improve model performance. We compare TransTab with multiple baseline methods on diverse benchmark datasets and five oncology clinical trial datasets. Overall, TransTab ranks 1.00, 1.00, 1.78 out of 12 methods in supervised learning, feature incremental learning, and transfer learning scenarios, respectively; and the proposed pretraining leads to 2.3% AUC lift on average over the supervised learning.

For agents

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

get_harvested_code_for_paper("2205.09328")
get_code_for_paper("2205.09328")
have("2205.09328")

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

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

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

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

Connect an agent — have() is free.