To handle uncertainty in AI, first identify the kind of uncertainty you face, then choose a method that represents it. Use probability when you have evidence and reasonable estimates of how likely things are. Use fuzzy logic for vague terms, default rules for exceptions that can be overturned, and Dempster-Shafer theory when evidence is missing or conflicting. Finally, check that the system’s confidence matches how often it turns out to be right.
Start by naming the uncertainty
Before you pick a method, write down where the uncertainty comes from. The source usually points to a suitable tool:
- Hidden or random factors. Some causes cannot be observed directly, so you reason about how likely each one is. Use probability.
- Vague words. Terms such as “warm,” “busy” or “heavy” have no sharp edge. Use fuzzy logic.
- Rules with exceptions. Most cases follow the rule, but some do not, and a conclusion may need to be withdrawn later. Use default logic.
- Missing or conflicting sources. Sensors disagree, or some evidence is absent altogether. Use Dempster-Shafer theory.
Real systems often mix these methods. That is fine, as long as you know what each number means.
Method 1: Use probability and Bayes’ rule
Probability is the most widely used tool, and it is a good place to start. Consider a factory test. Suppose 2% of parts are defective. The test flags 95% of defective parts, and it wrongly flags 10% of good parts.
- Chance that a part is flagged: (0.02 × 0.95) + (0.98 × 0.10) = 0.019 + 0.098 = 0.117
- Chance that a flagged part is defective: 0.019 ÷ 0.117 ≈ 0.16
Even with a test that catches most defective parts, only about 16% of flagged parts are actually defective. Most flags are false alarms, because good parts far outnumber defective ones. This is the base-rate effect, and it is one of the most common surprises in probabilistic reasoning.
Probability depends on good estimates for the starting chances and for the test’s accuracy. If those numbers are guesses, label the results as estimates. If you have labeled past cases, you can estimate the numbers from data, using methods such as those in supervised learning types with examples.
Method 2: Use fuzzy logic for vague terms
When the problem is a vague word, fuzzy logic gives each item a degree of membership between 0 and 1. A system might treat a room at 22°C as “warm” to degree 0.6. A rule can then say: IF the room is warm, THEN run the fan at medium speed. The exact degrees come from the membership function the designer chooses, so write that definition down and test it on real examples.
Fuzzy logic does not tell you how sure you are that a fact is true. For that, use probability.
Method 3: Use default rules for exceptions
Some rules hold most of the time. A default rule applies unless there is evidence against it, and its conclusion can be withdrawn later. For example, a system might assume that a shop is open on weekdays. When it learns that the shop is closed for a holiday, it drops the conclusion that the shop is open that day. This style of reasoning is called non-monotonic reasoning, and default logic is one formal version of it.
Method 4: Use Dempster-Shafer theory for conflict and ignorance
Dempster-Shafer theory lets a system assign belief to sets of possibilities. This helps when evidence is missing. The system can say “I do not know which of these two outcomes is true” without splitting belief between them arbitrarily. It also helps when two sources conflict, because the theory includes a rule for combining their evidence. The math is more involved than probability, so use it when you need that extra expressiveness.
A note on certainty factors
Early expert systems attached a number to each rule, called a certainty factor. These are simple to add to a rule base, but their combination formulas are not probabilities. If you use them, record what each number means, and avoid mixing them with probabilities in the same calculation.
Check that confidence is calibrated
A confidence score is useful only if it matches reality. A well-calibrated system is right about 80% of the time when it says 80%. To check calibration:
- Save each prediction together with its confidence score.
- Once the true outcomes are known, group the predictions by confidence, such as 0.6 to 0.7, 0.7 to 0.8, and so on.
- Compare the average confidence in each group with how often those predictions were right.
If the numbers do not match, adjust the rules or the probabilities, or report confidence more cautiously.
Common mistakes
- Treating certainty numbers as probabilities. A certainty factor does not follow the rules of probability.
- Using fuzzy logic for random uncertainty. Fuzzy degrees describe vague meaning, not missing facts.
- Assuming independence without checking. Many Bayesian methods treat pieces of evidence as independent. When they are linked, the system becomes overconfident.
- Hiding uncertainty from users. Show a confidence level, or allow an “unknown” answer, rather than presenting one answer as if it were certain.
- Expecting one method to fit every problem. The no free lunch rule in machine learning means that the best choice depends on the task.
Practical steps
- List each fact and rule that depends on uncertain information.
- Name the kind of uncertainty for each one, and choose a method for it.
- Use data to estimate the numbers where you can, and label the rest as estimates.
- Test the system on cases with known answers, and check calibration.
- Let the system answer “unknown” or ask for more information when its confidence is low.
- Keep a person involved in decisions that have serious consequences.
For the wider context of rule-based systems and uncertain facts, symbolic reasoning under uncertainty in artificial intelligence covers the same methods in more depth.