{"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/position-guided-text-prompt-for-vision","title":"Position-guided Text Prompt for Vision-Language Pre-training","arxiv_id":"2212.09737","date":"2022-12-19","proceeding":"CVPR 2023 1","authors":["Alex Jinpeng Wang","Pan Zhou","Mike Zheng Shou","Shuicheng Yan"],"abstract":"Vision-Language Pre-Training (VLP) has shown promising capabilities to align image and text pairs, facilitating a broad variety of cross-modal learning tasks. However, we observe that VLP models often lack the visual grounding/localization capability which is critical for many downstream tasks such as visual reasoning. In this work, we propose a novel Position-guided Text Prompt (PTP) paradigm to enhance the visual grounding ability of cross-modal models trained with VLP. Specifically, in the VLP phase, PTP divides the image into $N\\times N$ blocks, and identifies the objects in each block through the widely used object detector in VLP. It then reformulates the visual grounding task into a fill-in-the-blank problem given a PTP by encouraging the model to predict the objects in the given blocks or regress the blocks of a given object, e.g. filling `P\" or ``O\" in aPTP ``The block P has a O\". This mechanism improves the visual grounding capability of VLP models and thus helps them better handle various downstream tasks. By introducing PTP into several state-of-the-art VLP frameworks, we observe consistently significant improvements across representative cross-modal learning model architectures and several benchmarks, e.g. zero-shot Flickr30K Retrieval (+4.8 in average recall@1) for ViLT \\cite{vilt} baseline, and COCO Captioning (+5.3 in CIDEr) for SOTA BLIP \\cite{blip} baseline. Moreover, PTP achieves comparable results with object-detector based methods, and much faster inference speed since PTP discards its object detector for inference while the later cannot. Our code and pre-trained weight will be released at \\url{https://github.com/sail-sg/ptp}.","url_abs":"https://arxiv.org/abs/2212.09737v2","url_pdf":"https://arxiv.org/pdf/2212.09737v2.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":"position-guided-text-prompt-for-vision","repo_url":"https://github.com/sail-sg/ptp","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"cross-modal-retrieval","task_name":"Cross-Modal Retrieval"},{"task_slug":"image-captioning","task_name":"Image Captioning"},{"task_slug":"object","task_name":"Object"},{"task_slug":null,"task_name":"Position"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"visual-grounding","task_name":"Visual Grounding"},{"task_slug":"visual-reasoning","task_name":"Visual Reasoning"},{"task_slug":"zero-shot-cross-modal-retrieval","task_name":"Zero-Shot Cross-Modal Retrieval"}],"methods":[{"method_slug":"align","method_name":"ALIGN"},{"method_slug":"blip","method_name":"BLIP"},{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/cross-modal-retrieval-on-coco-2014","task":"Cross-Modal Retrieval","dataset":"COCO 2014","model":"PTP-BLIP (14M)","rank_in_archive_order":6,"of":36,"metrics":{"Image-to-text R@1":"81.5","Image-to-text R@10":"97.9","Image-to-text R@5":"95.9","Text-to-image R@1":"64.9","Text-to-image R@10":"92.2","Text-to-image R@5":"87.4"},"uses_additional_data":true},{"leaderboard":"/sota/image-captioning-on-coco-captions","task":"Image Captioning","dataset":"COCO Captions","model":"PTP-BLIP (14M)","rank_in_archive_order":19,"of":41,"metrics":{"BLEU-4":"40.1","CIDER":"135.0","METEOR":"30.4","SPICE":"23.7"},"uses_additional_data":false},{"leaderboard":"/sota/zero-shot-cross-modal-retrieval-on-coco-2014","task":"Zero-Shot Cross-Modal Retrieval","dataset":"COCO 2014","model":"PTP-BLIP","rank_in_archive_order":5,"of":18,"metrics":{"Image-to-text R@1":"69.7","Image-to-text R@10":"94.7","Image-to-text R@5":"90.0","Text-to-image R@1":"49.5","Text-to-image R@10":"84.2","Text-to-image R@5":"75.9"},"uses_additional_data":false},{"leaderboard":"/sota/zero-shot-cross-modal-retrieval-on-flickr30k","task":"Zero-Shot Cross-Modal Retrieval","dataset":"Flickr30k","model":"PTP-BLIP (14M)","rank_in_archive_order":16,"of":22,"metrics":{"Image-to-text R@1":"87.1","Image-to-text R@10":"99.3","Image-to-text R@5":"98.4","Text-to-image R@1":"73.1","Text-to-image R@10":"94.8","Text-to-image R@5":"91.0"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2212.09737","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2212.09737"}},"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/sail-sg/ptp","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_fixture":2,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"official":{"samples":5,"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":"aa81d03f07735ab8","entry":"compute_acc","repo":"sail-sg/ptp","repo_kind":"official","path":"src/blip_src/utils.py","file_url":"https://github.com/sail-sg/ptp/blob/HEAD/src/blip_src/utils.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"aa81d03f07735ab8"}},{"code_sha256_prefix":"ad12a494674d23fb","entry":"compute_n_params","repo":"sail-sg/ptp","repo_kind":"official","path":"src/blip_src/utils.py","file_url":"https://github.com/sail-sg/ptp/blob/HEAD/src/blip_src/utils.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ad12a494674d23fb"}},{"code_sha256_prefix":"c7f85279d772ea19","entry":"itm_eval","repo":"sail-sg/ptp","repo_kind":"official","path":"src/blip_src/train_retrieval.py","file_url":"https://github.com/sail-sg/ptp/blob/HEAD/src/blip_src/train_retrieval.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c7f85279d772ea19"}},{"code_sha256_prefix":"d0feb6a1aa7fd1e1","entry":"generate_object_bbox","repo":"sail-sg/ptp","repo_kind":"official","path":"src/data_preprocess/generate_sample_with_bbox_and_classes.py","file_url":"https://github.com/sail-sg/ptp/blob/HEAD/src/data_preprocess/generate_sample_with_bbox_and_classes.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d0feb6a1aa7fd1e1"}},{"code_sha256_prefix":"600f616bde761407","entry":"init_distributed_ddpjob","repo":"sail-sg/ptp","repo_kind":"official","path":"src/blip_src/utils.py","file_url":"https://github.com/sail-sg/ptp/blob/HEAD/src/blip_src/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"600f616bde761407"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}