Paper: Instance Needs More Care: Rewriting Prompts for Instances Yields Better Zero-Shot Performance (ICLR-2024)

Reviewer comment (Experiments):
The efficacy of PROMPTD is likely highly dependent on the initial quality of the prompts it is based upon. The paper could better address how the system performs with suboptimal base prompts and the robustness of the method to variations in prompt quality.

Author response:
**W2: Reliance on Prompt Quality and Robustness**

We clarify that PROMPTD does not rely on the initial quality of the prompts it is based upon. We note that, as we focus on zero-shot prompting, the “base prompt” in our experiments is simply the task instruction from the original test benchmarks (see examples in Table 2), and we make no assumption on its quality.


Our approach PROMPTD does not assume optimal “good prompts” in prompt rewriting either. Instead, PROMPTD relies on its ability to reason over the shortcomings of a given “bad prompt” and overcome them in rewriting. This ensures robust performance even with suboptimal starting prompts, as demonstrated across various tasks and datasets, including unseen ones.

Reviewer comment (Experiments):
There have been so many zero-shot prompting methods recently. The paper would be strengthened by including a more comprehensive comparison with the recent state-of-the-art methods for zero-shot learning.

Author response:
**W4: Comparison with other zero-shot approaches**

Thank you for your comment regarding the comparison with other zero-shot approaches. Indeed, the approaches for zero-shot learning in LLMs are rich and rapidly expanding. To address your point, we have identified several recent papers that present innovative zero-shot techniques. Wang et al., 2023 introduced a two-step approach that plans out subtasks and then executes the plans to derive the final answer. On the contrary, our work focuses on enriching prompts with hints and encouraging LLMs to generate rationales before deriving the final answer. Reynolds and McDonell2021 suggested a meta-prompt “Let's solve this problem by splitting it into steps.” to facilitate multi-step reasoning in simple arithmetic problems. However, they did not evaluate quantitatively on diverse reasoning tasks against baselines. In this paper, we evaluate PROMTPD on a diverse set of tasks beyond reasoning. Wei et al., 2021 proposed instruction-tuning which gives models an instruction describing a task while with PROMPTD, on the other hand, instead of tuning an instruction we aim to optimize task-specific instructions and test instances. Recent approaches, similar to PROMPTD,  have also proposed to optimize task-level instructions (Hong et al., 2023) enriching task-specific hints. Through experiments, we show that such task-specific instruction optimization does not lead to stable performance across different tasks motivating the need for instance-level prompt optimization. Huang et al., 2022 show that reasoning performance improves by multi-task finetuning a model on several self-generated synthetic CoT datasets. We, on the other hand, do not perform finetuning and in addition to mathematical and logical reasoning, also focus on content generation and code generation tasks.


**References:**

Lei Wang, Wanyu Xu, Yihuai Lan, Zhiqiang Hu, Yunshi Lan, Roy Ka-Wei Lee, Ee-Peng Lim "Plan-and-solve prompting: Improving zero-shot chain-of-thought reasoning by large language models." In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics. Association for Computational Linguistics.

Jiaxin Huang, Shixiang Shane Gu, Le Hou, Yuexin Wu, Xuezhi Wang, Hongkun Yu, & Jiawei Han. (2023). Large Language Models Can Self-improve. International Conference on Learning Representations. 2023.

Sun, Hong, et al. "AutoHint: Automatic Prompt Optimization with Hint Generation." Workshop on Foundations and Applications in Large-scale AI Models -Pre-training, Fine-tuning, and Prompt-based Learning, colocated with the 29TH ACM SIGKDD CONFERENCE ON KNOWLEDGE DISCOVERY AND DATA MINING (KDD), August 6-10, 2023, Long Beach, CA, USA

Wei, Jason, et al. "Finetuned Language Models are Zero-Shot Learners." International Conference on Learning Representations. 2021.

Laria Reynolds and Kyle McDonell. 2021. Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigm. In Extended Abstracts of the 2021 CHI Conference on Human Factors in Computing Systems (CHI EA '21). Association for Computing Machinery, New York, NY, USA, Article 314, 1–7. https://doi.org/10.1145/3411763.3451760

Reviewer comment (Experiments):
The evaluation of PROMPTD on a single new task type (sentiment classification) is a significant limitation. Given the length and complexity of the original PromptD, it is unclear how well the method would generalize to other task types. The reviewer's expectation of a more general prompt applicable to a wide array of task types is unmet. This is a critical aspect, as the creation of highly specialized prompts may not be feasible in many real-world applications.

Author response:
**W5: Generalization to other task types**

This is a very good point! To address this concern, we have added two experiments, last latter concatenation (Kojima et al. 2022) and StrategyQA (Geva et al. 2021), which fall under the task types of symbolic reasoning and open-domain question answering, respectively. 


| | ZeroShot | ZeroShotCoT | PROMPTD | PROMPTD (Python Exec) |
|:------------------:|:--------:|:-----------:|:-------:|:-----------------------:|
| OpenDomain-QA (StrategyQA) | 71.600 | 73.272 | 78.400 | - |
| Symbolic Reasoning (Last Letter Concatenation) | 6.000 | 90.800 | 58.800 | 80.800 |




Our results showed that PROMPTD improved StrategyQA by a large margin. We included one example in Table 12 in Appendix C, where the original task prompt was “Answer questions in which the required reasoning steps are implicit in the question:\nDo the anchors on Rede Globo speak Chinese?\nYour choices are: (1) Yes (2) No”. The rewritten prompt provides more context for this Open-Domain question and hints by suggesting “Your task is to answer the following question: "Do the anchors on Rede Globo speak Chinese?" Consider the context of the question, such as the language typically spoken on Rede Globo, a Brazilian television network …[truncated]” which enables task_llm to reason about the possibility of anchors from a Brazillian TV show being talking in Chinese. 

However, on the last letter concatenation dataset, PROMPTD does not seem to help. We found that in most cases this was caused by the task LLM’s inherent hallucination. For example, consider the rewritten prompt 
Your task is to take the last letters of each word in the given sentence "Camilo Becky Eliza Rebecca", concatenate them in the order they appear in the sentence, and return the result. Ensure that you handle words of different lengths and ignore any punctuation or special characters. Print the output in the format "The answer is \\answer{}” 
This rewritten prompt precisely enriched the task demand and reminded the task LLM to handle potentially tricky cases. The task LLM responds with: 

“To achieve this task, we start by splitting the sentence into individual words. Then for each word, we extract the last letter and concatenate them in order.

Here is a Python script that accomplishes this task:

\`\`\`
python

sentence = "Camilo Becky Eliza Rebecca"

words = sentence.split()

last_letters = [word[-1] for word in words]

answer = ''.join(last_letters)

print("The answer is {}".format(answer))```

When you run this script, it prints: \"The answer is oaky". "

Interestingly, while the task LLM is not instructed to write code, it does so correctly. At the end of its generation, the task LLM “executes” this Python code in its imagination. However, the execution result is incorrect, leading to the final error. While this is not a generic solution, we intentionally detected the generation of Python code and extracted its execution result, which led to significant performance gain (80.80%), though still underperforming the naive zero-shot CoT, with remaining errors caused by the task LLM playing a “shortcut” by directly generating “The answer is …” without reasoning. This result indicates a potential issue with PROMPTD, as also indicated in the response to Reviewer vep9, that PROMPTD could be enhanced by taking into the task LLM in the rewriting loop so that the rewritten instruction can be effective for the specific task LLM.

Finally, to provide the reviewer and the readers a better view of PROMPTD’s generalization capability, including generalizing across seen datasets, across seen task types but unseen datasets with increasing complexity (e.g., GSM8K to MATH), and across unseen task types, we draw a summary table below. 


| Evaluation Dataset | Task Type | Seen Dataset | Seen Task Type but Unseen Dataset | Unseen Task Type |
|:------------------------------------:|:------------------------:|:------------:|:----------------------------------:|:----------------:|
| GSM8K | Mathematical Reasoning | Y | N | N |
| MATH | Mathematical Reasoning | N | Y(more complex) | N |
| HumanEval | Code Generation | N | Y | N |
| Anachronisms | Implicit Reasoning | N | N | Y |
| Date Understanding | Logical Reasoning | Y | N | N |
| Analytical Entailment | Logical Reasoning | N | Y | N |
| Sports Understanding | Commonsense Reasoning | Y | N | N |
| Known Unknown | Commonsense Reasoning | N | Y | N |
| Sentiment Classification (Big Bench) | Sentiment Classification | N | N | Y |


**References:**
Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. Advances in neural information processing systems, 35:22199–22213, 2022

Mor Geva, Daniel Khashabi, Elad Segal, Tushar Khot, Dan Roth, and Jonathan Berant. Did aristotle use a laptop? a question answering benchmark with implicit reasoning strategies. TACL, 9:346–361, 2021. URL https://aclanthology.org/2021.tacl-1.21/.