{"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/reversible-vision-transformers-1","title":"Reversible Vision Transformers","arxiv_id":"2302.04869","date":"2023-02-09","proceeding":"CVPR 2022 1","authors":["Karttikeya Mangalam","Haoqi Fan","Yanghao Li","Chao-yuan Wu","Bo Xiong","Christoph Feichtenhofer","Jitendra Malik"],"abstract":"We present Reversible Vision Transformers, a memory efficient architecture design for visual recognition. By decoupling the GPU memory requirement from the depth of the model, Reversible Vision Transformers enable scaling up architectures with efficient memory usage. We adapt two popular models, namely Vision Transformer and Multiscale Vision Transformers, to reversible variants and benchmark extensively across both model sizes and tasks of image classification, object detection and video classification. Reversible Vision Transformers achieve a reduced memory footprint of up to 15.5x at roughly identical model complexity, parameters and accuracy, demonstrating the promise of reversible vision transformers as an efficient backbone for hardware resource limited training regimes. Finally, we find that the additional computational burden of recomputing activations is more than overcome for deeper models, where throughput can increase up to 2.3x over their non-reversible counterparts. Full code and trained models are available at https://github.com/facebookresearch/slowfast. A simpler, easy to understand and modify version is also available at https://github.com/karttikeya/minREV","url_abs":"https://arxiv.org/abs/2302.04869v1","url_pdf":"https://arxiv.org/pdf/2302.04869v1.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":"reversible-vision-transformers-1","repo_url":"https://github.com/karttikeya/minrev","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"reversible-vision-transformers-1","repo_url":"https://github.com/facebookresearch/SlowFast","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"reversible-vision-transformers-1","repo_url":"https://github.com/facebookresearch/mvit","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"reversible-vision-transformers-1","repo_url":"https://github.com/open-mmlab/mmclassification","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":null,"task_name":"GPU"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"object-detection","task_name":"Object Detection"},{"task_slug":"video-classification","task_name":"Video Classification"},{"task_slug":"image-classification","task_name":"image-classification"},{"task_slug":"object-detection-1","task_name":"object-detection"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"},{"method_slug":"vision-transformer","method_name":"Vision Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2302.04869","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2302.04869"}},"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/facebookresearch/SlowFast","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/open-mmlab/mmclassification","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/karttikeya/minrev","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/facebookresearch/mvit","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":11,"ran_fixture":1,"unverified":17},"by_repo_kind":{"official":{"samples":26,"ran":10,"repositories":3},"listed":{"samples":3,"ran":2,"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":26,"samples":[{"code_sha256_prefix":"7a79df18a8737c98","entry":"AttentionSubBlock","repo":"karttikeya/minrev","repo_kind":"official","path":"rev.py","file_url":"https://github.com/karttikeya/minrev/blob/HEAD/rev.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7a79df18a8737c98"}},{"code_sha256_prefix":"907cd8a323eb8319","entry":"MLPSubblock","repo":"karttikeya/minrev","repo_kind":"official","path":"rev.py","file_url":"https://github.com/karttikeya/minrev/blob/HEAD/rev.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"907cd8a323eb8319"}},{"code_sha256_prefix":"27fd09daf2d75017","entry":"RevBackProp","repo":"karttikeya/minrev","repo_kind":"official","path":"rev.py","file_url":"https://github.com/karttikeya/minrev/blob/HEAD/rev.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"27fd09daf2d75017"}},{"code_sha256_prefix":"a306e79d47b4c032","entry":"RevViT","repo":"karttikeya/minrev","repo_kind":"official","path":"rev.py","file_url":"https://github.com/karttikeya/minrev/blob/HEAD/rev.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a306e79d47b4c032"}},{"code_sha256_prefix":"2d92c96d4cb34c69","entry":"ReversibleBlock","repo":"karttikeya/minrev","repo_kind":"official","path":"rev.py","file_url":"https://github.com/karttikeya/minrev/blob/HEAD/rev.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2d92c96d4cb34c69"}},{"code_sha256_prefix":"049db0114a85e508","entry":"attention_pool","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/models/attention.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/models/attention.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"049db0114a85e508"}},{"code_sha256_prefix":"a322f2edda4b2d6e","entry":"ckpt_to_state_dict","repo":"open-mmlab/mmclassification","repo_kind":"listed","path":".dev_scripts/ckpt_tree.py","file_url":"https://github.com/open-mmlab/mmclassification/blob/HEAD/.dev_scripts/ckpt_tree.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a322f2edda4b2d6e"}},{"code_sha256_prefix":"8eebff71c1cabe84","entry":"filter_models_by_task","repo":"open-mmlab/mmclassification","repo_kind":"listed","path":".dev_scripts/generate_readme.py","file_url":"https://github.com/open-mmlab/mmclassification/blob/HEAD/.dev_scripts/generate_readme.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8eebff71c1cabe84"}},{"code_sha256_prefix":"4927733091f71100","entry":"multiple_samples_collate","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/datasets/loader.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/datasets/loader.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"4927733091f71100"}},{"code_sha256_prefix":"e866e1196986f728","entry":"shear_x","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/datasets/rand_augment.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/datasets/rand_augment.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"e866e1196986f728"}},{"code_sha256_prefix":"7b2503c99c9447fb","entry":"shear_y","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/datasets/rand_augment.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/datasets/rand_augment.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"7b2503c99c9447fb"}},{"code_sha256_prefix":"323759f906fbb394","entry":"translate_x_rel","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/datasets/rand_augment.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/datasets/rand_augment.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"323759f906fbb394"}},{"code_sha256_prefix":"4c9ffd3f576a6936","entry":"assert_and_infer_cfg","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/config/defaults.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/config/defaults.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"4c9ffd3f576a6936"}},{"code_sha256_prefix":"a4723eab8df61dbe","entry":"attention_pool","repo":"facebookresearch/SlowFast","repo_kind":"official","path":"slowfast/models/attention.py","file_url":"https://github.com/facebookresearch/SlowFast/blob/HEAD/slowfast/models/attention.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"a4723eab8df61dbe"}},{"code_sha256_prefix":"5de56fec3ce10382","entry":"cal_rel_pos_spatial","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/models/attention.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/models/attention.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"5de56fec3ce10382"}},{"code_sha256_prefix":"156d0bf08e703f3c","entry":"cal_rel_pos_spatial","repo":"facebookresearch/SlowFast","repo_kind":"official","path":"slowfast/models/attention.py","file_url":"https://github.com/facebookresearch/SlowFast/blob/HEAD/slowfast/models/attention.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"156d0bf08e703f3c"}},{"code_sha256_prefix":"7ca72f77bea1e546","entry":"construct_loader","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/datasets/loader.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/datasets/loader.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"7ca72f77bea1e546"}},{"code_sha256_prefix":"8e7aad946e7f3346","entry":"construct_optimizer","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/models/optimizer.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/models/optimizer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"8e7aad946e7f3346"}},{"code_sha256_prefix":"b5b248acb6375fcc","entry":"contrastive_forward","repo":"facebookresearch/SlowFast","repo_kind":"official","path":"slowfast/models/contrastive.py","file_url":"https://github.com/facebookresearch/SlowFast/blob/HEAD/slowfast/models/contrastive.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"b5b248acb6375fcc"}},{"code_sha256_prefix":"547be2babaca4859","entry":"convert_to_one_hot","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/datasets/mixup.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/datasets/mixup.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"547be2babaca4859"}},{"code_sha256_prefix":"bcc1cdae3bb3212c","entry":"drop_path","repo":"facebookresearch/SlowFast","repo_kind":"official","path":"slowfast/models/common.py","file_url":"https://github.com/facebookresearch/SlowFast/blob/HEAD/slowfast/models/common.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"bcc1cdae3bb3212c"}},{"code_sha256_prefix":"9abd4b00a0d36a31","entry":"get_flops_params","repo":"open-mmlab/mmclassification","repo_kind":"listed","path":".dev_scripts/fill_metafile.py","file_url":"https://github.com/open-mmlab/mmclassification/blob/HEAD/.dev_scripts/fill_metafile.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9abd4b00a0d36a31"}},{"code_sha256_prefix":"366cdd880af84645","entry":"get_ld_param_groups","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/models/optimizer.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/models/optimizer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"366cdd880af84645"}},{"code_sha256_prefix":"836ddfc4a5544d55","entry":"get_loss_func","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/models/losses.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/models/losses.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"836ddfc4a5544d55"}},{"code_sha256_prefix":"4b81f68c735859d7","entry":"get_param_groups","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/models/optimizer.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/models/optimizer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"4b81f68c735859d7"}},{"code_sha256_prefix":"5fc6c9c916e0ebc7","entry":"get_rel_pos","repo":"facebookresearch/SlowFast","repo_kind":"official","path":"slowfast/models/attention.py","file_url":"https://github.com/facebookresearch/SlowFast/blob/HEAD/slowfast/models/attention.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"5fc6c9c916e0ebc7"}},{"code_sha256_prefix":"1ef3753d70ebb220","entry":"l2_loss","repo":"facebookresearch/SlowFast","repo_kind":"official","path":"slowfast/models/contrastive.py","file_url":"https://github.com/facebookresearch/SlowFast/blob/HEAD/slowfast/models/contrastive.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"1ef3753d70ebb220"}},{"code_sha256_prefix":"fd3e5fd51b6d7296","entry":"mixup_target","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/datasets/mixup.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/datasets/mixup.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"fd3e5fd51b6d7296"}},{"code_sha256_prefix":"f18f66adc8c6b70f","entry":"rand_bbox","repo":"facebookresearch/mvit","repo_kind":"official","path":"mvit/datasets/mixup.py","file_url":"https://github.com/facebookresearch/mvit/blob/HEAD/mvit/datasets/mixup.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"f18f66adc8c6b70f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}