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
TL;DR
HoPC addresses zero-shot multi-step reasoning gaps by introducing a hint-chain prompting framework that produces problem decomposition, semantic pseudo code reasoning, and answer extraction without external interpreters. It demonstrates competitive or superior performance to zero-shot CoT and PoT on arithmetic and commonsense benchmarks across GPT-3.5-Turbo, Qwen2.5, and Llama3-8b, while offering an interpretable mind map of the model's reasoning. By leveraging general pseudo code as a semantic interpreter, HoPC improves logical reasoning and transparency in zero-shot settings. The work suggests practical, interpreter-free prompting strategies that can generalize to diverse reasoning tasks.
Abstract
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.
