Most people work out problems by starting with what they know and then working towards an answer. That’s the approach we’d all naturally take (forward reasoning). There’s however another approach that AI systems tend to take, which is to start at the destination and work backwards to find the path to get there.
This is known as backward chaining (a goal driven form of reasoning) where you start with a conclusion you want to reach and then work backwards to find the evidence/conditions that would support it. It’s a fundamental concept in AI logic, rule based systems and expert systems. If you’re doing AI training in Hyderabad, it’s absolutely vital that you understand backward chaining if you’re to have any real understanding of how an intelligent system works and makes decisions.
What Is Backward Chaining?
Backward chaining is a form of reasoning used in AI where you start with a goal, a hypothesis or a conclusion and then work backwards through a chain of rules to see if you can prove that goal is true.
In contrast to forward chaining (which starts with the facts you have and then applies the rules to derive new conclusions), backward chaining asks a different question: what conditions must be true in order for this goal to be valid?
The system then looks to see if those conditions are already established as facts. If they aren’t then it treats each of the unverified conditions as a sub-goal and carries on the backward search until either all the supporting facts are in place or it can establish that the goal is unprovable.
This is sometimes referred to as hypothesis driven reasoning and is particularly useful when the number of possible goals is less than the number of possible facts. In such cases it is more efficient to reason backwards from the goal rather than forwards from the facts.
How Backward Chaining Works: A Step-by-Step View
To get a feel for backward chaining in action, consider a fairly simple medical diagnosis scenario.
Goal: To ascertain whether the patient has the flu.
The rule is: a patient has the flu if they have a fever AND body aches AND fatigue.
Rather than scanning all available patient data, the system focuses only on verifying these three conditions. It asks:
- Does the patient have a fever? → Yes (confirmed fact)
- Does the patient have body aches? → Yes (confirmed fact)
- Does the patient have fatigue? → Not yet confirmed → treat as a sub-goal
The system then looks for evidence of fatigue. If that evidence is found the original goal (flu diagnosis) is confirmed. If any of the goals remain unverifiable then the goal is rejected or marked as uncertain.
This is a very efficient approach to backward chaining in that it’s goal driven. A student going through an AI training in Hyderabad would be going through essentially the same kind of tree in their studies of expert systems and reasoning engines.
Where Backward Chaining Is Applied
Backward chaining isn’t just a classroom thing. It has real world applications in a number of areas.
Expert systems: early AI applications in the fields of medicine, law and engineering all used backward chaining to mimic the way a human expert would reason. MYCIN, the system designed to diagnose bacterial infections, is a good example of this.
Logic programming: the programming language Prolog is all about backward chaining. You query a Prolog program and it works backwards from your query through the rules and facts to find a valid answer.
Theorem proving: in formal mathematics and in automated verification generally, backward chaining is used to determine whether a statement is a logical consequence of a set of axioms.
Troubleshooting systems: the kind of technical support tool that would use backward chaining to work out a fault. You start with the problem as reported and then work backwards through the possible causes until you’ve isolated the actual root of the fault.
Game AI: In the case of strategic games AI agents will sometimes employ backward chaining to work out a sequence of moves from a desired game state (i.e. a state they want to achieve) and work backwards to determine what the required sequence of actions is to get to that state.
Each of these applications is a case in point of how a goal first approach leads to much more focused reasoning, especially where it would be infeasible to explore every possible fact forward.
Backward Chaining vs. Forward Chaining: Choosing the Right Approach
Neither backward nor forward chaining is in fact the better approach in all cases. It really depends on the problem at hand.
Forward chaining works a treat when you’ve got a lot of known facts and want to work out what conclusions you can draw from them. It’s the approach of choice for monitoring systems, for data driven alerts and for classification.
Backward chaining is better when you have a very clear goal and you’re trying to establish whether that goal is in fact true. It’s the method of choice for diagnostic systems, for query answering and for planning.
Many modern AI systems will in fact combine both approaches, picking the one that is most appropriate for the particular reasoning task. That blended understanding is a major area of study in any good AI Training in Hyderabad, with the emphasis being on both the theory and the practical application.
Conclusion
Backward chaining is a very disciplined form of reasoning that is goal driven and is absolutely still a very relevant approach to AI design. You start with a goal and then work backwards to identify the conditions that would support that goal. It’s a very focused form of reasoning which avoids the need to process all the irrelevant information.
Backwards chaining is still one of the fundamental reasoning techniques in AI whether you’re using it in expert systems, logic programming or automated planning. If you understand it properly then you’re in a much better position to go on and build more intelligent, more purposeful AI.