SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.00855 · 2021

SurvTRACE: Transformers for Survival Analysis with Competing Events

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; 2 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 2 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/2110.00855.json · badge: /api/ran/2110.00855.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/SurvTRACE canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
find_pruneable_heads_and_indices Ran
ran; our contract draft was wrong, not the code
RyanWangZf/SurvTRACE/survtrace/modeling_bert.py
code served (permissive licence) · get_code("26b7e24933ef7cd5")
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

torch.manual_seed(0)

# Define the arguments for find_pruneable_heads_and_indices
ARGS = {
    "heads": [1, 3, 5],
    "n_heads": 8,
    "head_size": 4,
    "already_pruned_heads": {0, 2}
}
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 — 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
log_softplus Ran
ran on a synthesized input
RyanWangZf/SurvTRACE/survtrace/losses.py
code served (permissive licence) · get_code("7bbb3a687909c072")
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. 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.functional as F

torch.manual_seed(0)

# Create a small tensor with values both above and below the threshold
input_tensor = torch.randn(2, 4)

ARGS = {
    "input": input_tensor,
    "threshold": -15.0
}
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
nll_logistic_hazard Ran
ran on a synthesized input
RyanWangZf/SurvTRACE/survtrace/losses.py
code served (permissive licence) · get_code("573be5614841b77d")
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 0, dtype family float, shape () 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.functional as F

torch.manual_seed(0)

# Create small tensors for testing nll_logistic_hazard
batch_size = 2
num_time_steps = 5
phi_dim = 6  # Must be > max(idx_durations)

# phi: shape (batch_size, num_time_steps) - estimates in (-inf, inf)
phi = torch.randn(batch_size, phi_dim)

# idx_durations: shape (batch_size,) - event times as indices, must be < phi.shape[1]
idx_durations = torch.tensor([1, 3])

# events: shape (batch_size,) - binary indicator (0 or 1)
events = torch.tensor([1.0, 0.0])

# reduction: one of 'none', 'mean', 'sum'
reduction = 'mean'

ARGS = {
    'phi': phi,
    'idx_durations': idx_durations,
    'events': events,
    'reduction': reduction
}
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 0, dtype family float, shape () — shape () 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
pad_col Ran
ran on a synthesized input
RyanWangZf/SurvTRACE/survtrace/train_utils.py
code served (permissive licence) · get_code("cb7ad332526f21ca")
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, 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)

# Create a small 2-D tensor (batch_size=2, feature_dim=4)
input_tensor = torch.randn(2, 4)

# Define ARGS dict with all parameters
ARGS = {
    'input': input_tensor,
    'val': 0,
    'where': 'end'
}
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, 5) — shape (2, 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
prune_linear_layer Ran
ran; our contract draft was wrong, not the code
RyanWangZf/SurvTRACE/survtrace/modeling_bert.py
code served (permissive licence) · get_code("5366c196cf596807")
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 Linear. 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)

# Create a linear layer to prune
# Input features: 3, Output features: 4
layer = nn.Linear(in_features=3, out_features=4, bias=True)

# Create indices to keep - we'll keep indices 0 and 2 from dimension 0 (output)
# This means we're keeping 2 out of 4 output neurons
index = torch.LongTensor([0, 2])

# Dimension to prune along (0 = output dimension, 1 = input dimension)
dim = 0

ARGS = {
    "layer": layer,
    "index": index,
    "dim": 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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
warmup_constant Ran
ran, honoured the contract we drafted
RyanWangZf/SurvTRACE/survtrace/train_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from Yueeeeeeee/Self-Supervised-QA, is pointer only (licence: NONE) · get_code("e7d542062316094a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Yueeeeeeee/Self-Supervised-QA, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

warmup_cosine Ran
ran, honoured the contract we drafted
RyanWangZf/SurvTRACE/survtrace/train_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from sejong-rcv/TAME, is pointer only (licence: NONE) · get_code("20b3d25ba1b796e5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sejong-rcv/TAME, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

apply_chunking_to_forward Not yet run
unverified (harvested, no recorded run)
RyanWangZf/SurvTRACE/survtrace/modeling_bert.py
code served (permissive licence) · get_code("ab31c7a534e00c4f")
How it ran

no invocation recorded.

nll_pc_hazard_loss Not yet run
unverified (harvested, no recorded run)
RyanWangZf/SurvTRACE/survtrace/losses.py
code served (permissive licence) · get_code("4ea08d15da7a3c15")
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, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 4 later) and 5 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
warmup_constant 28 other papers
13 dated earlier, 12 later, 3 same year, order not determinable
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1903.09588 (2019-03)
Utilizing BERT for Aspect-Based Sentiment Analysis via Constructing Auxiliary Sentence
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
and 25 more not named here
find_pruneable_heads_and_indices 11 other papers
4 dated earlier, 6 later, 1 same year, order not determinable
2004.10964 (2020-04)
Don't Stop Pretraining: Adapt Language Models to Domains and Tasks
2021.emnlp-main.154 (2021 (year only))
Reconstruction Attack on Instance Encoding for Language Understanding
2104.08066 (2021-04)
Effect of Visual Extensions on Natural Language Understanding in Vision-and-Language Models
and 8 more not named here
warmup_cosine 8 other papers
8 later
2203.07111 (2022-03)
Disentangled Representation Learning for Text-Video Retrieval
2211.09623 (2022-11)
Cross-Modal Adapter for Vision-Language Retrieval
2301.00184 (2023-01)
Cap4Video: What Can Auxiliary Captions Do for Text-Video Retrieval?
and 5 more not named here
prune_linear_layer 4 other papers
1 dated earlier, 3 later
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
2023.acl-long.264 (2023 (year only))
Towards Robust Low-Resource Fine-Tuning with Multi-View Compressed Representations
2402.13040 (2024-02)
Text-Guided Molecule Generation with Diffusion Language Model
and 1 more not named here

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

In medicine, survival analysis studies the time duration to events of interest such as mortality. One major challenge is how to deal with multiple competing events (e.g., multiple disease diagnoses). In this work, we propose a transformer-based model that does not make the assumption for the underlying survival distribution and is capable of handling competing events, namely SurvTRACE. We account for the implicit \emph{confounders} in the observational setting in multi-events scenarios, which causes selection bias as the predicted survival probability is influenced by irrelevant factors. To sufficiently utilize the survival data to train transformers from scratch, multiple auxiliary tasks are designed for multi-task learning. The model hence learns a strong shared representation from all these tasks and in turn serves for better survival analysis. We further demonstrate how to inspect the covariate relevance and importance through interpretable attention mechanisms of SurvTRACE, which suffices to great potential in enhancing clinical trial design and new treatment development. Experiments on METABRIC, SUPPORT, and SEER data with 470k patients validate the all-around superiority of our method.

For agents

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

get_harvested_code_for_paper("2110.00855")
get_code_for_paper("2110.00855")
have("2110.00855")

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

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

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

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

Connect an agent — have() is free.