{"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/ranpac-random-projections-and-pre-trained","title":"RanPAC: Random Projections and Pre-trained Models for Continual Learning","arxiv_id":"2307.02251","date":"2023-07-05","proceeding":"NeurIPS 2023 11","authors":["Mark D. McDonnell","Dong Gong","Amin Parveneh","Ehsan Abbasnejad","Anton Van Den Hengel"],"abstract":"Continual learning (CL) aims to incrementally learn different tasks (such as classification) in a non-stationary data stream without forgetting old ones. Most CL works focus on tackling catastrophic forgetting under a learning-from-scratch paradigm. However, with the increasing prominence of foundation models, pre-trained models equipped with informative representations have become available for various downstream requirements. Several CL methods based on pre-trained models have been explored, either utilizing pre-extracted features directly (which makes bridging distribution gaps challenging) or incorporating adaptors (which may be subject to forgetting). In this paper, we propose a concise and effective approach for CL with pre-trained models. Given that forgetting occurs during parameter updating, we contemplate an alternative approach that exploits training-free random projectors and class-prototype accumulation, which thus bypasses the issue. Specifically, we inject a frozen Random Projection layer with nonlinear activation between the pre-trained model's feature representations and output head, which captures interactions between features with expanded dimensionality, providing enhanced linear separability for class-prototype-based CL. We also demonstrate the importance of decorrelating the class-prototypes to reduce the distribution disparity when using pre-trained representations. These techniques prove to be effective and circumvent the problem of forgetting for both class- and domain-incremental continual learning. Compared to previous methods applied to pre-trained ViT-B/16 models, we reduce final error rates by between 20% and 62% on seven class-incremental benchmarks, despite not using any rehearsal memory. We conclude that the full potential of pre-trained models for simple, effective, and fast CL has not hitherto been fully tapped. Code is at github.com/RanPAC/RanPAC.","url_abs":"https://arxiv.org/abs/2307.02251v3","url_pdf":"https://arxiv.org/pdf/2307.02251v3.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":"ranpac-random-projections-and-pre-trained","repo_url":"https://github.com/ranpac/ranpac","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"ranpac-random-projections-and-pre-trained","repo_url":"https://github.com/aimagelab/mammoth","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"continual-learning","task_name":"Continual Learning"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2307.02251","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2307.02251"}},"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/aimagelab/mammoth","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ranpac/ranpac","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":2,"ran_draft_wrong":4,"ran_honours":3,"unverified":6},"by_repo_kind":{"official":{"samples":15,"ran":9,"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":"8425222b4660e321","entry":"build_transform","repo":"ranpac/ranpac","repo_kind":"official","path":"utils/data.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/utils/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8425222b4660e321"}},{"code_sha256_prefix":"d9def42110729a85","entry":"conv1x1","repo":"ranpac/ranpac","repo_kind":"official","path":"resnet.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d9def42110729a85"}},{"code_sha256_prefix":"160bb14bd76201b4","entry":"conv3x3","repo":"ranpac/ranpac","repo_kind":"official","path":"resnet.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"160bb14bd76201b4"}},{"code_sha256_prefix":"6bdbe3d6368c4cde","entry":"count_parameters","repo":"ranpac/ranpac","repo_kind":"official","path":"utils/toolkit.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/utils/toolkit.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6bdbe3d6368c4cde"}},{"code_sha256_prefix":"def23f7d7d042968","entry":"get_init_weights_vit","repo":"ranpac/ranpac","repo_kind":"official","path":"petl/vision_transformer_ssf.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/petl/vision_transformer_ssf.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"def23f7d7d042968"}},{"code_sha256_prefix":"896b5eec245f1bab","entry":"init_ssf_scale_shift","repo":"ranpac/ranpac","repo_kind":"official","path":"petl/vision_transformer_ssf.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/petl/vision_transformer_ssf.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"896b5eec245f1bab"}},{"code_sha256_prefix":"61e8364b7e9bcb70","entry":"ssf_ada","repo":"ranpac/ranpac","repo_kind":"official","path":"petl/vision_transformer_ssf.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/petl/vision_transformer_ssf.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"61e8364b7e9bcb70"}},{"code_sha256_prefix":"284e2e0345abe291","entry":"target2onehot","repo":"ranpac/ranpac","repo_kind":"official","path":"utils/toolkit.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/utils/toolkit.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"284e2e0345abe291"}},{"code_sha256_prefix":"929c76a2fa2e8c42","entry":"tensor2numpy","repo":"ranpac/ranpac","repo_kind":"official","path":"utils/toolkit.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/utils/toolkit.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"929c76a2fa2e8c42"}},{"code_sha256_prefix":"caf426ace8f9b740","entry":"build_promptmodel","repo":"ranpac/ranpac","repo_kind":"official","path":"petl/vpt.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/petl/vpt.py","link_basis":"first_harvest_node","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":"caf426ace8f9b740"}},{"code_sha256_prefix":"2edd6df79bc77668","entry":"get_convnet","repo":"ranpac/ranpac","repo_kind":"official","path":"inc_net.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/inc_net.py","link_basis":"first_harvest_node","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":"2edd6df79bc77668"}},{"code_sha256_prefix":"66b63ed4f327a712","entry":"pil_loader","repo":"ranpac/ranpac","repo_kind":"official","path":"utils/data_manager.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/utils/data_manager.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":"66b63ed4f327a712"}},{"code_sha256_prefix":"d48a8b0d2e61f5f7","entry":"resnet18","repo":"ranpac/ranpac","repo_kind":"official","path":"resnet.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/resnet.py","link_basis":"first_harvest_node","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":"d48a8b0d2e61f5f7"}},{"code_sha256_prefix":"f51aa4aca78dae1d","entry":"vit_base_patch16_224_adapter","repo":"ranpac/ranpac","repo_kind":"official","path":"petl/vision_transformer_adapter.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/petl/vision_transformer_adapter.py","link_basis":"first_harvest_node","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":"f51aa4aca78dae1d"}},{"code_sha256_prefix":"606a5e08f74e25f2","entry":"vit_base_patch16_224_in21k_adapter","repo":"ranpac/ranpac","repo_kind":"official","path":"petl/vision_transformer_adapter.py","file_url":"https://github.com/ranpac/ranpac/blob/HEAD/petl/vision_transformer_adapter.py","link_basis":"first_harvest_node","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":"606a5e08f74e25f2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}