Improving Zero-Shot Chain-of-Thought Reasoning with Embedding and Plan-and-Solve Prompting

Ante Gojsalić

Hatched by Ante Gojsalić

Feb 28, 2024

3 min read

0

Improving Zero-Shot Chain-of-Thought Reasoning with Embedding and Plan-and-Solve Prompting

Introduction:

Large language models (LLMs) have proven to be highly effective in various NLP tasks. However, when it comes to multi-step reasoning tasks, additional strategies are required to enhance their performance. Two key approaches that have been explored are embedding and plan-and-solve prompting. In this article, we will discuss the benefits and challenges of these techniques and how they can be combined to improve zero-shot chain-of-thought (CoT) reasoning by LLMs.

Embedding - text length vs accuracy:

The question of text length versus accuracy in embedding is a fascinating one. While there is a trade-off between long and short texts, the addition of longer texts does not necessarily compromise accuracy. Even if a specific question is only answered in a small portion of the embedded text, the semantic search mechanism can still assign a high similarity to the question-text pair. However, very short chunks should be avoided as they can lead to a loss of accuracy and context. On the other hand, injecting very long and unrelated texts can confuse the answering module and hinder its ability to provide relevant responses. It is also challenging to inject multiple texts with very long chunks. To strike a balance, a two-step semantic search approach can be employed.

Two-step chunking strategy:

The two-step chunking strategy involves embedding chunks of both long texts (around 4k characters) and short texts (around 1k characters). When a new question is received, the semantic search is first conducted in the "long chunks" space to identify the most relevant chunks to focus on. Then, a classifier determines whether the question is general or specific. If it is a general question, the answer is sought within the long chunks. If it is a specific question, a second semantic search is performed within the short chunks that belong to the pre-selected long chunks. This approach helps improve the accuracy and context of the responses.

Plan-and-Solve Prompting:

Plan-and-Solve (PS) Prompting is another technique used to enhance zero-shot CoT reasoning. It involves dividing the entire task into smaller subtasks and then carrying out these subtasks according to a devised plan. This approach addresses the issue of missing-step errors in reasoning. To further improve the quality of generated reasoning steps and reduce calculation errors, PS prompting can be extended with more detailed instructions, resulting in PS+ prompting.

Combining Embedding and Plan-and-Solve Prompting:

By combining embedding and plan-and-solve prompting, we can leverage the strengths of both techniques to enhance zero-shot CoT reasoning. The embedding approach allows for efficient retrieval of relevant information, while the plan-and-solve prompting ensures a structured and comprehensive reasoning process. This combined approach has shown promising results in various reasoning problems, outperforming other prompting strategies and achieving comparable performance to more data-intensive approaches.

Actionable Advice:

  1. Experiment with different text lengths in embedding: Finding the right balance between long and short chunks is crucial for accuracy and context. Conduct experiments to determine the optimal text length that works best for your specific task.

  2. Develop a classifier for question categorization: Building a classifier that can accurately categorize questions as general or specific is essential for effective prompt selection. Invest time and effort into training a classifier that can differentiate between these question types.

  3. Refine the plan-and-solve strategy: Continuously improve the plan-and-solve prompting strategy by incorporating more detailed instructions and addressing calculation errors. Regularly evaluate and update the plan to ensure optimal performance.

Conclusion:

In conclusion, the combination of embedding and plan-and-solve prompting offers a powerful approach to enhance zero-shot chain-of-thought reasoning by large language models. By leveraging the strengths of both techniques, we can improve the accuracy, context, and reasoning capabilities of LLMs. However, further innovations and refinements are still needed to fully optimize these strategies. By experimenting with text lengths, developing accurate classifiers, and refining the plan-and-solve strategy, we can continue to advance the field of zero-shot reasoning and unlock the full potential of large language models.

Sources

← Back to Library

Hatch New Ideas with Glasp AI 🐣

Glasp AI allows you to hatch new ideas based on your curated content. Let's curate and create with Glasp AI :)

Start Hatching 🐣