{"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/vector-quantization-prompting-for-continual","title":"Vector Quantization Prompting for Continual Learning","arxiv_id":"2410.20444","date":"2024-10-27","proceeding":null,"authors":["Li Jiao","Qiuxia Lai","Yu Li","Qiang Xu"],"abstract":"Continual learning requires to overcome catastrophic forgetting when training a single model on a sequence of tasks. Recent top-performing approaches are prompt-based methods that utilize a set of learnable parameters (i.e., prompts) to encode task knowledge, from which appropriate ones are selected to guide the fixed pre-trained model in generating features tailored to a certain task. However, existing methods rely on predicting prompt identities for prompt selection, where the identity prediction process cannot be optimized with task loss. This limitation leads to sub-optimal prompt selection and inadequate adaptation of pre-trained features for a specific task. Previous efforts have tried to address this by directly generating prompts from input queries instead of selecting from a set of candidates. However, these prompts are continuous, which lack sufficient abstraction for task knowledge representation, making them less effective for continual learning. To address these challenges, we propose VQ-Prompt, a prompt-based continual learning method that incorporates Vector Quantization (VQ) into end-to-end training of a set of discrete prompts. In this way, VQ-Prompt can optimize the prompt selection process with task loss and meanwhile achieve effective abstraction of task knowledge for continual learning. Extensive experiments show that VQ-Prompt outperforms state-of-the-art continual learning methods across a variety of benchmarks under the challenging class-incremental setting. The code is available at \\href{https://github.com/jiaolifengmi/VQ-Prompt}{this https URL}.","url_abs":"https://arxiv.org/abs/2410.20444v1","url_pdf":"https://arxiv.org/pdf/2410.20444v1.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":"vector-quantization-prompting-for-continual","repo_url":"https://github.com/jiaolifengmi/vq-prompt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"continual-learning","task_name":"Continual Learning"},{"task_slug":"quantization","task_name":"Quantization"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2410.20444","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.20444"}},"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":"deterministic:regex_extraction","url":"https://github.com/jiaolifengmi/VQ-Prompt","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jiaolifengmi/vq-prompt","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran_fixture":1,"ran_honours":1,"unverified":12},"by_repo_kind":{"official":{"samples":15,"ran":3,"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":"c6ec173f19f5c34d","entry":"interpolate_pos_embed","repo":"jiaolifengmi/vq-prompt","repo_kind":"official","path":"models/vit.py","file_url":"https://github.com/jiaolifengmi/vq-prompt/blob/HEAD/models/vit.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c6ec173f19f5c34d"}},{"code_sha256_prefix":"a763dc6f8d5d1498","entry":"ortho_penalty","repo":"jiaolifengmi/VQ-Prompt","repo_kind":"official","path":"models/zoo.py","file_url":"https://github.com/jiaolifengmi/VQ-Prompt/blob/HEAD/models/zoo.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a763dc6f8d5d1498"}},{"code_sha256_prefix":"3f33843b601c8d4d","entry":"tensor_prompt","repo":"jiaolifengmi/VQ-Prompt","repo_kind":"official","path":"models/zoo.py","file_url":"https://github.com/jiaolifengmi/VQ-Prompt/blob/HEAD/models/zoo.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3f33843b601c8d4d"}},{"code_sha256_prefix":"fe7f9a1f5cd3c429","entry":"CosineSchedulerIter","repo":"jiaolifengmi/vq-prompt","repo_kind":"official","path":"learners/prompt.py","file_url":"https://github.com/jiaolifengmi/vq-prompt/blob/HEAD/learners/prompt.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":"fe7f9a1f5cd3c429"}},{"code_sha256_prefix":"a447093382d3a413","entry":"NormalNN","repo":"jiaolifengmi/vq-prompt","repo_kind":"official","path":"learners/prompt.py","file_url":"https://github.com/jiaolifengmi/vq-prompt/blob/HEAD/learners/prompt.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":"a447093382d3a413"}},{"code_sha256_prefix":"677d8160bcc4ebc6","entry":"Prompt","repo":"jiaolifengmi/vq-prompt","repo_kind":"official","path":"learners/prompt.py","file_url":"https://github.com/jiaolifengmi/vq-prompt/blob/HEAD/learners/prompt.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":"677d8160bcc4ebc6"}},{"code_sha256_prefix":"6ffe4ffedcac064a","entry":"VQPrompt","repo":"jiaolifengmi/vq-prompt","repo_kind":"official","path":"learners/prompt.py","file_url":"https://github.com/jiaolifengmi/vq-prompt/blob/HEAD/learners/prompt.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":"6ffe4ffedcac064a"}},{"code_sha256_prefix":"23f35d8ff6184ceb","entry":"_LRSchedulerIter","repo":"jiaolifengmi/vq-prompt","repo_kind":"official","path":"learners/prompt.py","file_url":"https://github.com/jiaolifengmi/vq-prompt/blob/HEAD/learners/prompt.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":"23f35d8ff6184ceb"}},{"code_sha256_prefix":"0c4bbcb160a04955","entry":"accuracy","repo":"jiaolifengmi/VQ-Prompt","repo_kind":"official","path":"utils/metric.py","file_url":"https://github.com/jiaolifengmi/VQ-Prompt/blob/HEAD/utils/metric.py","link_basis":"plan_row","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":"0c4bbcb160a04955"}},{"code_sha256_prefix":"f83acd2eda10d232","entry":"build_cifar_transform","repo":"jiaolifengmi/VQ-Prompt","repo_kind":"official","path":"dataloaders/utils.py","file_url":"https://github.com/jiaolifengmi/VQ-Prompt/blob/HEAD/dataloaders/utils.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":"f83acd2eda10d232"}},{"code_sha256_prefix":"aa97aea5d1c8ffb8","entry":"build_transform","repo":"jiaolifengmi/VQ-Prompt","repo_kind":"official","path":"dataloaders/utils.py","file_url":"https://github.com/jiaolifengmi/VQ-Prompt/blob/HEAD/dataloaders/utils.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":"aa97aea5d1c8ffb8"}},{"code_sha256_prefix":"4e39da6c733f9f2c","entry":"calc_forgetting","repo":"jiaolifengmi/VQ-Prompt","repo_kind":"official","path":"utils/calc_forgetting.py","file_url":"https://github.com/jiaolifengmi/VQ-Prompt/blob/HEAD/utils/calc_forgetting.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":"4e39da6c733f9f2c"}},{"code_sha256_prefix":"b682650616ae4f66","entry":"get_transform","repo":"jiaolifengmi/VQ-Prompt","repo_kind":"official","path":"dataloaders/utils.py","file_url":"https://github.com/jiaolifengmi/VQ-Prompt/blob/HEAD/dataloaders/utils.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":"b682650616ae4f66"}},{"code_sha256_prefix":"e1da3ea75e559fb9","entry":"jpg_image_to_array","repo":"jiaolifengmi/VQ-Prompt","repo_kind":"official","path":"dataloaders/dataloader.py","file_url":"https://github.com/jiaolifengmi/VQ-Prompt/blob/HEAD/dataloaders/dataloader.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":"e1da3ea75e559fb9"}},{"code_sha256_prefix":"cdf0934ebf6a93cd","entry":"parse_txt","repo":"jiaolifengmi/VQ-Prompt","repo_kind":"official","path":"dataloaders/dataloader.py","file_url":"https://github.com/jiaolifengmi/VQ-Prompt/blob/HEAD/dataloaders/dataloader.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":"cdf0934ebf6a93cd"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}