{"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/clip-with-generative-latent-replay-a-strong","title":"CLIP with Generative Latent Replay: a Strong Baseline for Incremental Learning","arxiv_id":"2407.15793","date":"2024-07-22","proceeding":null,"authors":["Emanuele Frascaroli","Aniello Panariello","Pietro Buzzega","Lorenzo Bonicelli","Angelo Porrello","Simone Calderara"],"abstract":"With the emergence of Transformers and Vision-Language Models (VLMs) such as CLIP, fine-tuning large pre-trained models has recently become a prevalent strategy in Continual Learning. This has led to the development of numerous prompting strategies to adapt transformer-based models without incurring catastrophic forgetting. However, these strategies often compromise the original zero-shot capabilities of the pre-trained CLIP model and struggle to adapt to domains that significantly deviate from the pre-training data. In this work, we propose Continual Generative training for Incremental prompt-Learning, a simple and novel approach to mitigate forgetting while adapting CLIP. Briefly, we employ Variational Autoencoders (VAEs) to learn class-conditioned distributions within the embedding space of the visual encoder. We then exploit these distributions to sample new synthetic visual embeddings and train the corresponding class-specific textual prompts during subsequent tasks. Through extensive experiments on different domains, we show that such a generative replay approach can adapt to new tasks while improving zero-shot capabilities, evaluated using a novel metric tailored for CL scenarios. Notably, further analysis reveals that our approach can bridge the gap with joint prompt tuning. The codebase is available at https://github.com/aimagelab/mammoth.","url_abs":"https://arxiv.org/abs/2407.15793v4","url_pdf":"https://arxiv.org/pdf/2407.15793v4.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":"clip-with-generative-latent-replay-a-strong","repo_url":"https://github.com/aimagelab/mammoth","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"class-incremental-learning","task_name":"Class Incremental Learning"},{"task_slug":"continual-learning","task_name":"Continual Learning"},{"task_slug":"incremental-learning","task_name":"Incremental Learning"},{"task_slug":"prompt-learning","task_name":"Prompt Learning"}],"methods":[{"method_slug":"align","method_name":"ALIGN"},{"method_slug":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2407.15793","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2407.15793"}},"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"}}],"summary":{"ran":5,"ran_draft_wrong":3},"by_repo_kind":{"official":{"samples":8,"ran":8,"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":"7e7efa6d1976111a","entry":"calculate_output_image_size","repo":"aimagelab/mammoth","repo_kind":"official","path":"backbone/EfficientNet.py","file_url":"https://github.com/aimagelab/mammoth/blob/HEAD/backbone/EfficientNet.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":"7e7efa6d1976111a"}},{"code_sha256_prefix":"2a80220dabcb742a","entry":"conv1x1","repo":"aimagelab/mammoth","repo_kind":"official","path":"backbone/ResNetBottleneck.py","file_url":"https://github.com/aimagelab/mammoth/blob/HEAD/backbone/ResNetBottleneck.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":"2a80220dabcb742a"}},{"code_sha256_prefix":"600ff2c45e0de056","entry":"conv3x3","repo":"aimagelab/mammoth","repo_kind":"official","path":"backbone/ResNetBottleneck.py","file_url":"https://github.com/aimagelab/mammoth/blob/HEAD/backbone/ResNetBottleneck.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":"600ff2c45e0de056"}},{"code_sha256_prefix":"dd1114865f06f0fd","entry":"conv3x3","repo":"aimagelab/mammoth","repo_kind":"official","path":"backbone/ResNet32.py","file_url":"https://github.com/aimagelab/mammoth/blob/HEAD/backbone/ResNet32.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":"dd1114865f06f0fd"}},{"code_sha256_prefix":"25e04c3b7a8cc075","entry":"conv3x3","repo":"aimagelab/mammoth","repo_kind":"official","path":"backbone/ResNetBlock.py","file_url":"https://github.com/aimagelab/mammoth/blob/HEAD/backbone/ResNetBlock.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":"25e04c3b7a8cc075"}},{"code_sha256_prefix":"f1e3c822763f3ebb","entry":"drop_connect","repo":"aimagelab/mammoth","repo_kind":"official","path":"backbone/EfficientNet.py","file_url":"https://github.com/aimagelab/mammoth/blob/HEAD/backbone/EfficientNet.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":"f1e3c822763f3ebb"}},{"code_sha256_prefix":"1e2dad967f965366","entry":"get_width_and_height_from_size","repo":"aimagelab/mammoth","repo_kind":"official","path":"backbone/EfficientNet.py","file_url":"https://github.com/aimagelab/mammoth/blob/HEAD/backbone/EfficientNet.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1e2dad967f965366"}},{"code_sha256_prefix":"5d65b508e8b1cbad","entry":"project","repo":"aimagelab/mammoth","repo_kind":"official","path":"models/agem.py","file_url":"https://github.com/aimagelab/mammoth/blob/HEAD/models/agem.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5d65b508e8b1cbad"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}