Prompting a language model (LM) is an increasingly important research topic for better utilization of large language models (LLMs). While simple prompting is effective for single-step questions, it fails to activate the correct knowledge path for multi-step reasoning tasks consistently. The few-shot Chain of Thought (CoT), serves as an advanced prompting strategy that explains and demonstrates the reasoning process to the LLM, outperforming simple prompting in challenging reasoning tasks such as arithmetic and common-sense reasoning. The Program of Thought (PoT) aims to generate text and programming language solutions for multi-step reasoning problems. In zero-shot CoT, the prompt is simply “Let’s think step by step”, which is overly simplistic and does not adequately demonstrate a robust reasoning process for complex reasoning challenges. Additionally, PoT requires an extra interpreter to execute the answer and struggles with semantic reasoning problems like StrategyQA. This paper introduces a novel Hint of Pseudo Code (HoPC) prompting technique that does not require extra interpreter as in PoT and incorporates a more powerful zero-shot problem decomposition and semantic code reasoning capabilities than zero-shot CoT. It consists of three components: problem decomposition, semantic code reasoning, and answer extraction. We prompt these components as hints in a sequential, step by step manner, making it easy to tailor and explain for various tasks. Our experimental results on various LLMs indicate that HoPC prompting outperforms zero-shot CoT in zero-shot reasoning tasks. We conduct experiments on mathematical tasks, including GSM8K, ADDSUB, AQUA, SVAMP, and common-sense tasks such as StrategyQA. Notably, the accuracy of the proposed HoPC prompting implemented on Llama3-8b improved from 51.8% to 63.5% on GSM8K, from 37.4% to 74.4% on AQUA, from 51.8% to 75.5% on SVAMP, and from 53.6% to 74.9% on ADDSUB.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Hint of Pseudo Code (HoPC): Zero-Shot Step by Step Pseudo Code Reasoning Prompting

  • Iok Tong Lei,
  • Ziyu Zhu,
  • Han Yu,
  • Yige Yao,
  • Zhidong Deng

摘要

Prompting a language model (LM) is an increasingly important research topic for better utilization of large language models (LLMs). While simple prompting is effective for single-step questions, it fails to activate the correct knowledge path for multi-step reasoning tasks consistently. The few-shot Chain of Thought (CoT), serves as an advanced prompting strategy that explains and demonstrates the reasoning process to the LLM, outperforming simple prompting in challenging reasoning tasks such as arithmetic and common-sense reasoning. The Program of Thought (PoT) aims to generate text and programming language solutions for multi-step reasoning problems. In zero-shot CoT, the prompt is simply “Let’s think step by step”, which is overly simplistic and does not adequately demonstrate a robust reasoning process for complex reasoning challenges. Additionally, PoT requires an extra interpreter to execute the answer and struggles with semantic reasoning problems like StrategyQA. This paper introduces a novel Hint of Pseudo Code (HoPC) prompting technique that does not require extra interpreter as in PoT and incorporates a more powerful zero-shot problem decomposition and semantic code reasoning capabilities than zero-shot CoT. It consists of three components: problem decomposition, semantic code reasoning, and answer extraction. We prompt these components as hints in a sequential, step by step manner, making it easy to tailor and explain for various tasks. Our experimental results on various LLMs indicate that HoPC prompting outperforms zero-shot CoT in zero-shot reasoning tasks. We conduct experiments on mathematical tasks, including GSM8K, ADDSUB, AQUA, SVAMP, and common-sense tasks such as StrategyQA. Notably, the accuracy of the proposed HoPC prompting implemented on Llama3-8b improved from 51.8% to 63.5% on GSM8K, from 37.4% to 74.4% on AQUA, from 51.8% to 75.5% on SVAMP, and from 53.6% to 74.9% on ADDSUB.