{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/survtrace-transformers-for-survival-analysis","title":"SurvTRACE: Transformers for Survival Analysis with Competing Events","arxiv_id":"2110.00855","date":"2021-10-02","proceeding":null,"authors":["Zifeng Wang","Jimeng Sun"],"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.","url_abs":"https://arxiv.org/abs/2110.00855v2","url_pdf":"https://arxiv.org/pdf/2110.00855v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"survtrace-transformers-for-survival-analysis","repo_url":"https://github.com/RyanWangZf/SurvTRACE","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"multi-task-learning","task_name":"Multi-Task Learning"},{"task_slug":"selection-bias","task_name":"Selection bias"},{"task_slug":"survival-analysis","task_name":"Survival Analysis"}],"methods":[{"method_slug":"1x1-convolution","method_name":"1x1 Convolution"},{"method_slug":"average-pooling","method_name":"Average Pooling"},{"method_slug":"batch-normalization","method_name":"Batch Normalization"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"global-average-pooling","method_name":"Global Average Pooling"},{"method_slug":"grouped-convolution","method_name":"Grouped Convolution"},{"method_slug":"lars","method_name":"LARS"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"regnety","method_name":"RegNetY"},{"method_slug":"seer","method_name":"SEER"},{"method_slug":"sigmoid-activation","method_name":"Sigmoid Activation"},{"method_slug":"squeeze-and-excitation-block","method_name":"Squeeze-and-Excitation Block"},{"method_slug":"swav","method_name":"SwAV"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2110.00855","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2110.00855"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/RyanWangZf/SurvTRACE","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":1,"unverified":8},"by_repo_kind":{"official":{"samples":9,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"e7d542062316094a","entry":"warmup_constant","repo":"RyanWangZf/SurvTRACE","repo_kind":"official","path":"survtrace/train_utils.py","file_url":"https://github.com/RyanWangZf/SurvTRACE/blob/HEAD/survtrace/train_utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e7d542062316094a"}},{"code_sha256_prefix":"ab31c7a534e00c4f","entry":"apply_chunking_to_forward","repo":"RyanWangZf/SurvTRACE","repo_kind":"official","path":"survtrace/modeling_bert.py","file_url":"https://github.com/RyanWangZf/SurvTRACE/blob/HEAD/survtrace/modeling_bert.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ab31c7a534e00c4f"}},{"code_sha256_prefix":"26b7e24933ef7cd5","entry":"find_pruneable_heads_and_indices","repo":"RyanWangZf/SurvTRACE","repo_kind":"official","path":"survtrace/modeling_bert.py","file_url":"https://github.com/RyanWangZf/SurvTRACE/blob/HEAD/survtrace/modeling_bert.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"26b7e24933ef7cd5"}},{"code_sha256_prefix":"7bbb3a687909c072","entry":"log_softplus","repo":"RyanWangZf/SurvTRACE","repo_kind":"official","path":"survtrace/losses.py","file_url":"https://github.com/RyanWangZf/SurvTRACE/blob/HEAD/survtrace/losses.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7bbb3a687909c072"}},{"code_sha256_prefix":"573be5614841b77d","entry":"nll_logistic_hazard","repo":"RyanWangZf/SurvTRACE","repo_kind":"official","path":"survtrace/losses.py","file_url":"https://github.com/RyanWangZf/SurvTRACE/blob/HEAD/survtrace/losses.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"573be5614841b77d"}},{"code_sha256_prefix":"4ea08d15da7a3c15","entry":"nll_pc_hazard_loss","repo":"RyanWangZf/SurvTRACE","repo_kind":"official","path":"survtrace/losses.py","file_url":"https://github.com/RyanWangZf/SurvTRACE/blob/HEAD/survtrace/losses.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4ea08d15da7a3c15"}},{"code_sha256_prefix":"cb7ad332526f21ca","entry":"pad_col","repo":"RyanWangZf/SurvTRACE","repo_kind":"official","path":"survtrace/train_utils.py","file_url":"https://github.com/RyanWangZf/SurvTRACE/blob/HEAD/survtrace/train_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cb7ad332526f21ca"}},{"code_sha256_prefix":"5366c196cf596807","entry":"prune_linear_layer","repo":"RyanWangZf/SurvTRACE","repo_kind":"official","path":"survtrace/modeling_bert.py","file_url":"https://github.com/RyanWangZf/SurvTRACE/blob/HEAD/survtrace/modeling_bert.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5366c196cf596807"}},{"code_sha256_prefix":"20b3d25ba1b796e5","entry":"warmup_cosine","repo":"RyanWangZf/SurvTRACE","repo_kind":"official","path":"survtrace/train_utils.py","file_url":"https://github.com/RyanWangZf/SurvTRACE/blob/HEAD/survtrace/train_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"20b3d25ba1b796e5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}