Exploring the Curious Case of Code Prompts

Li Zhang, Liam Dugan, Hainiu Xu, Chris Callison-Burch
4/26/2023
cs.CL

No confident code implementation found for this paper. 1 possible match can be shown below.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhang2023exploring,
  title  = {Exploring the Curious Case of Code Prompts},
  author = {Li Zhang and Liam Dugan and Hainiu Xu and Chris Callison-Burch},
  year   = {2023},
  eprint = {2304.13250},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2304.13250v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2304.13250.svg)](https://codeofpaper.com/paper/2304.13250)

Discussion