| LLMs| ARTIFICIAL INTELLIGENCE| NLP|
Indirect Reasoning for LLMs: Not Always There is a Direct Way to the Answer
Contrapositive and Contradiction for Automated Reasoning can help your model find the right answering
For every complex problem there is an answer that is clear, simple, and wrong. — H. L. Mencken
There are many prompt engineering techniques, but many of them have one thing in common: direct reasoning. What happens if we try the opposite? Can we find a solution to problems that the model couldn’t solve before?
We discuss this in this article.
Direct versus indirect reasoning
Large Language Models (LLMs) have shown incredible capabilities even in complex tasks such as language comprehension, logical reasoning, and mathematical reasoning. The success of these models is even more incredible when you consider that they did it zero-shot or few-shot way. This means that the models are capable of learning from context (in-context learning).
This has caused several groups to focus on trying to understand how to increase these capabilities of the models, so techniques such as Chain-of-Thought (CoT) and many others have emerged.
Chain-of-Thought (CoT) encourages the model to explain the various intermediate steps leading to the final solution. The idea is that by unfolding the various steps, the model can arrive at the final solution correctly (whereas by jumping directly to the conclusion, the model often gets it wrong).
CoT and other techniques follow what is called the Direct Reasoning (DR) framework, where logical chains are created from given facts to the final result. The problem with this approach is that not all problems can be solved this way. So the question arises, if we are faced with a problem that cannot be solved can we take advantage of Indirect Reasoning (IR)?
Indirect Reasoning (IR) is a complementary and alternative approach to solving problems. One of the most commonly used methods is to exploit logical procedures to prove that two propositions are equivalent. For example, one can prove that a proposition is true by assuming it is false and arriving at a contradiction: p → q and its contrapositive ¬q → ¬p, if we show that ¬q → ¬p lead to a contradiction

Indirect reasoning to solve problems
G. H. Hardy described proof by contradiction as “one of a mathematician’s finest weapons”, saying “It is a far finer gambit than any chess gambit: a chess player may offer the sacrifice of a pawn or even a piece, but a mathematician offers the game.” — wikipedia
Indirect reasoning is a system exploited by humans and could be exploited by models to be able to solve various problems where direct reasoning techniques fail. How can we succeed in making LLMs benefit from IR?
A new study shows how this is possible simply by using a new type of prompt.
In mathematics and some practical applications, there are circumstances where direct proof may not be feasible or effective. In such cases, the methods of indirect proof are often used to verify a statement. There are two popular methods for indirect proof, which are: contrapositive method and contradiction method.(source)
The authors’ idea is to exploit both contradictions and contrasts to direct a model to the solution when direct evidence is not possible to obtain. The authors’ goal is to allow the model to conduct factual reasoning in natural language: having a question Q one must arrive at an answer A through reasoning P that exploits known facts F and rules R (rules are often part of prior knowledge and are not necessarily made explicit).

How to adapt indirect reasoning to an LLM?
For the authors, the process is divided into two parts:
- Rule augmentation. In this step, the model is prompted to augment the rule set.
- Indirect reasoning. Received the facts, rules, and questions the model performs indirect reasoning.
The authors therefore define both a zero-shot and a few-shot template for prompts so that IR can be used with an LLM.

The evaluation of reasoning performance for a method includes the correctness investigation on the answer A and the reasoning process P. Therefore, here we use three metrics: accuracy of answer (AA), accuracy of reasoning processes (AP), and the overall accuracy (OA). (source)
The authors practically define three metrics based on the number of examples with correct answers, correct process, and both correct.
The authors use both COT and self-consistency in addition to their prompt to see how the model changes in response to indirect reasoning. They use both GPT-3.5 and Gemini as models and test them on datasets of both natural languaging and mathematical.
For example, they test it on a dataset of natural language questions (ProofWriter) and one of mathematical problems (ProofMath) where it is necessary to use contradiction proof to solve the problems. The use of IR increases the model’s capabilities when solving these types of problems.

Another interesting result is that rule augmentation also helps the model even with DR alone.

Also, another advantage is that this approach reduces the steps to reach the conclusion (the process is therefore faster).

Parting thoughts
In recent times, various LLMs have been widely adopted to solve tasks such as factual reasoning, dialog generation, and multi-modal content generation. These approaches have generated noticeable economic value and social impact in multiple applications. (source)
LLMs have entered production today and are used by the public, on the one hand, these models still have problems with factual reasoning. Several techniques have been developed over time to improve the reasoning capabilities of the models. Those techniques exploit processes called direct reasoning, here the authors show that there are problems that cannot be solved with DR but benefit from indirect reasoning.
What do you think? Will you test this prompt method? Let me know in the comments
If you have found this interesting:
You can look for my other articles, and you can also connect or reach me on LinkedIn. Check this repository containing weekly updated ML & AI news. I am open to collaborations and projects and you can reach me on LinkedIn.
Here is the link to my GitHub repository, where I am collecting code and many resources related to machine learning, artificial intelligence, and more.
or you may be interested in one of my recent articles:
