{"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/exploring-the-curious-case-of-code-prompts","title":"Exploring the Curious Case of Code Prompts","arxiv_id":"2304.13250","date":"2023-04-26","proceeding":null,"authors":["Li Zhang","Liam Dugan","Hainiu Xu","Chris Callison-Burch"],"abstract":"Recent work has shown that prompting language models with code-like representations of natural language leads to performance improvements on structured reasoning tasks. However, such tasks comprise only a small subset of all natural language tasks. In our work, we seek to answer whether or not code-prompting is the preferred way of interacting with language models in general. We compare code and text prompts across three popular GPT models (davinci, code-davinci-002, and text-davinci-002) on a broader selection of tasks (e.g., QA, sentiment, summarization) and find that with few exceptions, code prompts do not consistently outperform text prompts. Furthermore, we show that the style of code prompt has a large effect on performance for some but not all tasks and that fine-tuning on text instructions leads to better relative performance of code prompts.","url_abs":"https://arxiv.org/abs/2304.13250v1","url_pdf":"https://arxiv.org/pdf/2304.13250v1.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":"exploring-the-curious-case-of-code-prompts","repo_url":"https://github.com/zharry29/codex_vs_gpt3","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"discriminative-fine-tuning","method_name":"Discriminative Fine-Tuning"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt","method_name":"GPT"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2304.13250","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2304.13250"}},"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/zharry29/codex_vs_gpt3","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":6},"by_repo_kind":{"official":{"samples":6,"ran":0,"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":"1dd88bb81228f8d3","entry":"apply_code_template","repo":"zharry29/codex_vs_gpt3","repo_kind":"official","path":"datasets/ANLI/anli.py","file_url":"https://github.com/zharry29/codex_vs_gpt3/blob/HEAD/datasets/ANLI/anli.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":"1dd88bb81228f8d3"}},{"code_sha256_prefix":"8ff7c69b1ad84bb7","entry":"apply_code_template","repo":"zharry29/codex_vs_gpt3","repo_kind":"official","path":"datasets/HotpotQA/hotpotqa.py","file_url":"https://github.com/zharry29/codex_vs_gpt3/blob/HEAD/datasets/HotpotQA/hotpotqa.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":"8ff7c69b1ad84bb7"}},{"code_sha256_prefix":"1dced73dcd9693b4","entry":"check_prompt_number","repo":"zharry29/codex_vs_gpt3","repo_kind":"official","path":"datasets/ANLI/utils.py","file_url":"https://github.com/zharry29/codex_vs_gpt3/blob/HEAD/datasets/ANLI/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":"1dced73dcd9693b4"}},{"code_sha256_prefix":"b7e50cb04060c537","entry":"compute_avg_gen","repo":"zharry29/codex_vs_gpt3","repo_kind":"official","path":"utils/est_cost.py","file_url":"https://github.com/zharry29/codex_vs_gpt3/blob/HEAD/utils/est_cost.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":"b7e50cb04060c537"}},{"code_sha256_prefix":"0fa2bee683e5a3de","entry":"est_cost","repo":"zharry29/codex_vs_gpt3","repo_kind":"official","path":"utils/est_cost.py","file_url":"https://github.com/zharry29/codex_vs_gpt3/blob/HEAD/utils/est_cost.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":"0fa2bee683e5a3de"}},{"code_sha256_prefix":"689971558cd59b1e","entry":"gpt3_tokenizer","repo":"zharry29/codex_vs_gpt3","repo_kind":"official","path":"datasets/ANLI/utils.py","file_url":"https://github.com/zharry29/codex_vs_gpt3/blob/HEAD/datasets/ANLI/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":"689971558cd59b1e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}