{ "cells": [ { "cell_type": "markdown", "id": "634e4707c4e77143", "metadata": {}, "source": [ "# Reverse Chain of Thought: Enhancing LLM Reasoning with Self-Reflection\n", "\n", "This recipe demonstrates how to implement the Reverse Chain of Thought technique using Large Language Models (LLMs) with Mirascope. Reverse Chain of Thought is a prompt engineering method that enhances an LLM's reasoning capabilities by encouraging it to reflect on and correct its own thought process.\n", "\n", "
Mirascope Concepts Used
\n", "Background
\n", "\n", "Reverse chain of thought is a prompt engineering technique where a chain of thought call is made for a query, then we attempt to reconstruct the query from the attempted solution. Both the original and reconstructed query are broken down into their individual conditions, and each condition is cross-referenced with the totality of conditions for the other query to determine the existence of overlooked facts or hallucinations. The questions themselves are also compared to ensure that the two queries not only share the context but also ask the same question. This fine-grained comparison is used in a final prompt.\n", "
\n", "\n", "In the original paper, no prompt was given for the case when mistakes do not exist, so we took the liberty of asking the model to repeat a solution without mistakes. \n", "
\n", "\n", "Reverse chain of thought is a technique that works for any prompt which has shown signs of susceptibility to hallucinations or misinterpretations in its initial attempts to answer the question.\n", "
\n", "Additional Real-World Applications
\n", "