{"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/read-only-prompt-optimization-for-vision","title":"Read-only Prompt Optimization for Vision-Language Few-shot Learning","arxiv_id":"2308.14960","date":"2023-08-29","proceeding":"ICCV 2023 1","authors":["Dongjun Lee","Seokwon Song","Jihee Suh","Joonmyung Choi","Sanghyeok Lee","Hyunwoo J. Kim"],"abstract":"In recent years, prompt tuning has proven effective in adapting pre-trained vision-language models to downstream tasks. These methods aim to adapt the pre-trained models by introducing learnable prompts while keeping pre-trained weights frozen. However, learnable prompts can affect the internal representation within the self-attention module, which may negatively impact performance variance and generalization, especially in data-deficient settings. To address these issues, we propose a novel approach, Read-only Prompt Optimization (RPO). RPO leverages masked attention to prevent the internal representation shift in the pre-trained model. Further, to facilitate the optimization of RPO, the read-only prompts are initialized based on special tokens of the pre-trained model. Our extensive experiments demonstrate that RPO outperforms CLIP and CoCoOp in base-to-new generalization and domain generalization while displaying better robustness. Also, the proposed method achieves better generalization on extremely data-deficient settings, while improving parameter efficiency and computational overhead. Code is available at https://github.com/mlvlab/RPO.","url_abs":"https://arxiv.org/abs/2308.14960v2","url_pdf":"https://arxiv.org/pdf/2308.14960v2.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":"read-only-prompt-optimization-for-vision","repo_url":"https://github.com/mlvlab/rpo","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"domain-generalization","task_name":"Domain Generalization"},{"task_slug":"few-shot-learning","task_name":"Few-Shot Learning"},{"task_slug":"prompt-engineering","task_name":"Prompt Engineering"}],"methods":[{"method_slug":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/prompt-engineering-on-caltech-101","task":"Prompt Engineering","dataset":"Caltech-101","model":"RPO","rank_in_archive_order":10,"of":14,"metrics":{"Harmonic mean":"96.03"},"uses_additional_data":false},{"leaderboard":"/sota/prompt-engineering-on-dtd","task":"Prompt Engineering","dataset":"DTD","model":"RPO","rank_in_archive_order":10,"of":14,"metrics":{"Harmonic mean":"68.61"},"uses_additional_data":false},{"leaderboard":"/sota/prompt-engineering-on-eurosat","task":"Prompt Engineering","dataset":"EuroSAT","model":"RPO","rank_in_archive_order":12,"of":14,"metrics":{"Harmonic mean":"76.79"},"uses_additional_data":false},{"leaderboard":"/sota/prompt-engineering-on-fgvc-aircraft","task":"Prompt Engineering","dataset":"FGVC-Aircraft","model":"RPO","rank_in_archive_order":12,"of":14,"metrics":{"Harmonic mean":"35.70"},"uses_additional_data":false},{"leaderboard":"/sota/prompt-engineering-on-food-101","task":"Prompt Engineering","dataset":"Food-101","model":"RPO","rank_in_archive_order":13,"of":13,"metrics":{"Harmonic mean":"90.58"},"uses_additional_data":false},{"leaderboard":"/sota/prompt-engineering-on-imagenet","task":"Prompt Engineering","dataset":"ImageNet","model":"RPO","rank_in_archive_order":12,"of":15,"metrics":{"Harmonic mean":"74.00"},"uses_additional_data":false},{"leaderboard":"/sota/prompt-engineering-on-oxford-102-flower","task":"Prompt Engineering","dataset":"Oxford 102 Flower","model":"RPO","rank_in_archive_order":11,"of":14,"metrics":{"Harmonic mean":"84.50"},"uses_additional_data":false},{"leaderboard":"/sota/prompt-engineering-on-oxford-iiit-pet-dataset","task":"Prompt Engineering","dataset":"Oxford-IIIT Pet Dataset","model":"RPO","rank_in_archive_order":13,"of":14,"metrics":{"Harmonic mean":"96.05"},"uses_additional_data":false},{"leaderboard":"/sota/prompt-engineering-on-sun397","task":"Prompt Engineering","dataset":"SUN397","model":"RPO","rank_in_archive_order":12,"of":14,"metrics":{"Harmonic mean":"79.18"},"uses_additional_data":false},{"leaderboard":"/sota/prompt-engineering-on-stanford-cars-1","task":"Prompt Engineering","dataset":"Stanford Cars","model":"RPO","rank_in_archive_order":11,"of":14,"metrics":{"Harmonic mean":"74.69"},"uses_additional_data":false},{"leaderboard":"/sota/prompt-engineering-on-ucf101","task":"Prompt Engineering","dataset":"UCF101","model":"RPO","rank_in_archive_order":12,"of":14,"metrics":{"Harmonic mean":"79.34"},"uses_additional_data":false}],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2308.14960","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.14960"}},"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/mlvlab/rpo","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/mlvlab/RPO","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":3,"ran":1,"unverified":2},"by_repo_kind":{"official":{"samples":6,"ran":4,"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":"98f385d847636a3e","entry":"basic_clean","repo":"mlvlab/RPO","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/mlvlab/RPO/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"98f385d847636a3e"}},{"code_sha256_prefix":"ba26afd892405335","entry":"compute_ci95","repo":"mlvlab/RPO","repo_kind":"official","path":"parse_test_res.py","file_url":"https://github.com/mlvlab/RPO/blob/HEAD/parse_test_res.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":"ba26afd892405335"}},{"code_sha256_prefix":"d919ae32e5e4e616","entry":"get_pairs","repo":"mlvlab/RPO","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/mlvlab/RPO/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d919ae32e5e4e616"}},{"code_sha256_prefix":"9542161e9640b858","entry":"whitespace_clean","repo":"mlvlab/RPO","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/mlvlab/RPO/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9542161e9640b858"}},{"code_sha256_prefix":"ae9d9d52a6fc74a3","entry":"build_model","repo":"mlvlab/RPO","repo_kind":"official","path":"clip/model.py","file_url":"https://github.com/mlvlab/RPO/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ae9d9d52a6fc74a3"}},{"code_sha256_prefix":"fbf8c0143d9c48e3","entry":"load","repo":"mlvlab/RPO","repo_kind":"official","path":"clip/clip.py","file_url":"https://github.com/mlvlab/RPO/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fbf8c0143d9c48e3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}