{"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/memory-space-visual-prompting-for-efficient","title":"Memory-Space Visual Prompting for Efficient Vision-Language Fine-Tuning","arxiv_id":"2405.05615","date":"2024-05-09","proceeding":null,"authors":["Shibo Jie","Yehui Tang","Ning Ding","Zhi-Hong Deng","Kai Han","Yunhe Wang"],"abstract":"Current solutions for efficiently constructing large vision-language (VL) models follow a two-step paradigm: projecting the output of pre-trained vision encoders to the input space of pre-trained language models as visual prompts; and then transferring the models to downstream VL tasks via end-to-end parameter-efficient fine-tuning (PEFT). However, this paradigm still exhibits inefficiency since it significantly increases the input length of the language models. In this paper, in contrast to integrating visual prompts into inputs, we regard visual prompts as additional knowledge that facilitates language models in addressing tasks associated with visual information. Motivated by the finding that Feed-Forward Network (FFN) of language models acts as \"key-value memory\", we introduce a novel approach termed memory-space visual prompting (MemVP), wherein visual prompts are concatenated with the weights of FFN for visual knowledge injection. Experimental results across various VL tasks and language models reveal that MemVP significantly reduces the training time and inference latency of the finetuned VL models and surpasses the performance of previous PEFT methods. Code: https://github.com/JieShibo/MemVP","url_abs":"https://arxiv.org/abs/2405.05615v1","url_pdf":"https://arxiv.org/pdf/2405.05615v1.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":"memory-space-visual-prompting-for-efficient","repo_url":"https://github.com/jieshibo/memvp","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"visual-prompting","task_name":"Visual Prompting"},{"task_slug":"parameter-efficient-fine-tuning","task_name":"parameter-efficient fine-tuning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.05615","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.05615"}},"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/jieshibo/memvp","reach":{"status":"ok"}}],"summary":{"ran_honours":1,"ran":3,"ran_fixture":2,"ran_draft_wrong":6,"ran_violates":1,"unverified":3},"by_repo_kind":{"official":{"samples":16,"ran":13,"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":16,"samples":[{"code_sha256_prefix":"bd3578806ecf5ac2","entry":"adjust_learning_rate","repo":"jieshibo/memvp","repo_kind":"official","path":"util/lr_sched.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/util/lr_sched.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bd3578806ecf5ac2"}},{"code_sha256_prefix":"3dc19396537db789","entry":"all_reduce_mean","repo":"jieshibo/memvp","repo_kind":"official","path":"util/misc.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/util/misc.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3dc19396537db789"}},{"code_sha256_prefix":"b47d48e431b34acd","entry":"apply_rotary_emb","repo":"jieshibo/memvp","repo_kind":"official","path":"memvp/model.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/memvp/model.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b47d48e431b34acd"}},{"code_sha256_prefix":"98f385d847636a3e","entry":"basic_clean","repo":"jieshibo/memvp","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/clip/simple_tokenizer.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"98f385d847636a3e"}},{"code_sha256_prefix":"a753e5742dbbb24b","entry":"forward_clip","repo":"jieshibo/memvp","repo_kind":"official","path":"memvp/adapter.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/memvp/adapter.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":"a753e5742dbbb24b"}},{"code_sha256_prefix":"92ae708bcae9023e","entry":"forward_llama","repo":"jieshibo/memvp","repo_kind":"official","path":"memvp/adapter.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/memvp/adapter.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":"92ae708bcae9023e"}},{"code_sha256_prefix":"7a8dffc83d89cedd","entry":"get_choice_text","repo":"jieshibo/memvp","repo_kind":"official","path":"util/base_prompt.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/util/base_prompt.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7a8dffc83d89cedd"}},{"code_sha256_prefix":"85f084f6054a421e","entry":"get_context_text","repo":"jieshibo/memvp","repo_kind":"official","path":"util/base_prompt.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/util/base_prompt.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"85f084f6054a421e"}},{"code_sha256_prefix":"d919ae32e5e4e616","entry":"get_pairs","repo":"jieshibo/memvp","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/clip/simple_tokenizer.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d919ae32e5e4e616"}},{"code_sha256_prefix":"c86a79e229253816","entry":"get_question_text","repo":"jieshibo/memvp","repo_kind":"official","path":"util/base_prompt.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/util/base_prompt.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c86a79e229253816"}},{"code_sha256_prefix":"14a84c2cbfebc413","entry":"precompute_freqs_cis","repo":"jieshibo/memvp","repo_kind":"official","path":"memvp/model.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/memvp/model.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"14a84c2cbfebc413"}},{"code_sha256_prefix":"70bf6ebaafd266c4","entry":"reshape_for_broadcast","repo":"jieshibo/memvp","repo_kind":"official","path":"memvp/model.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/memvp/model.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"70bf6ebaafd266c4"}},{"code_sha256_prefix":"9542161e9640b858","entry":"whitespace_clean","repo":"jieshibo/memvp","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/clip/simple_tokenizer.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9542161e9640b858"}},{"code_sha256_prefix":"e8286348138c7ef6","entry":"build_model","repo":"jieshibo/memvp","repo_kind":"official","path":"clip/model.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/clip/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e8286348138c7ef6"}},{"code_sha256_prefix":"ba1356e8ceb654d2","entry":"get_grad_norm_","repo":"jieshibo/memvp","repo_kind":"official","path":"util/misc.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/util/misc.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ba1356e8ceb654d2"}},{"code_sha256_prefix":"f6f30e41636ae569","entry":"load","repo":"jieshibo/memvp","repo_kind":"official","path":"clip/clip.py","file_url":"https://github.com/jieshibo/memvp/blob/HEAD/clip/clip.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f6f30e41636ae569"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}