Levels of Intelligence – Prolog’s Role in the LLM Era, Part 6

In this episode of Prolog’s Role in the LLM Era, I attempt to draw parallels between the natural intelligence of the creatures of Earth and Prolog, with the goal of smoothing out the translation friction between the two. After a few “codey” episodes (Parts 3, 4, and 5), which hopefully built some comfort with the idea of Prolog crashing in on the LLM party, I’d like to further the intuition for the value of Prolog.

I highly recommend reading Part 1 through Part 5 first. Mostly, I wish to ensure you understand that the context is of a symbiotic relationship between deterministic Prolog and broad and fuzzy LLMs—which is similar to a symbiotic relationship between knowledge graphs (also deterministic) and LLMs.

One of the biggest influences on how my thinking about analytics and business intelligence (BI) evolved from the incredibly intriguing book, Thought in a Hostile World, by Kim Sterelny. If I recall correctly, I read this book around early 2004. The insights shared in this blog are based on my interpretation of what is presented in Kim Sterelny’s book—so, my apologies in advance to Mr. Sterelny if I’ve misunderstood any of his ideas.

The concepts I’m discussing are framed in the context of designing a system capable of generating novel solutions to novel problems. My initial attempt was to create an expert system back in 2004 specifically to address unique SQL Server performance challenges. I discuss this project in my book, Enterprise Intelligence and a little in Part 1.

The value I hope to offer in this post is insight into how the rules we’ve learned and follow in our lives can translate into Prolog. But not in a big monolithic brain like LLMs. Rather, in a distributed, loosely-coupled manner similar to microservices.

The four levels of intelligence—simple, robust, iterative, and decoupled recognition and action—offer a compelling framework for understanding how both biological systems and artificial systems, like those encoded in Prolog, navigate their environments. By breaking down these levels, we can see how recognition and decision-making processes can be systematically encoded and refined.

Prolog, with its rule-based structure, provides a powerful tool for encoding these levels of recognition. Simple recognition can be easily captured with basic rules, while robust recognition benefits from more complex logic that accounts for variability and context. Iterative recognition, with its focus on hypothesis testing and refinement, can be mirrored in Prolog through recursive rules and queries. Finally, decoupled recognition and action allow for the encoding of strategic decision-making, where the consequences of each action are carefully weighed.

By leveraging Prolog to encode these levels of intelligence, we lay the groundwork for building AI systems that can think and reason in increasingly sophisticated ways. This approach demonstrates the power of combining logic-based systems like Prolog with the rich complexity of real-world recognition, decision-making processes, and the broad but fuzzy power of today’s LLMs.

I’m not anywhere near anything like an evolutionary biologist or evolutionary psychologist. I’m using what I had interpreted from Mr. Sterelny’s book as a model for an AI system. It’s a model that still seems to provide at least a reasonably plausible framework for how Prolog naturally fits into an enterprise ecosystem.

Annoying plug for my book:

Intelligence Formed from the Eternal Struggle Between Predator and Prey?

The most provocative takeaway from Thought in a Hostile World is the hypothesis that intelligence evolved from the eternal arms race of predator and prey out-muscling (or out-running) as well as out-deceiving. Predators conceal themselves from prey, and prey develop strategies to evade predators. Predators lie to their prey and prey lie to their predators. The deception part is a war of information.

In this analogy, the genes of species (life evolves at the species level, not individual level) are akin to machine learning models—both are encoded “sets of instructions” trained by their environments—interactions and datasets, respectively. Genes are the cumulative result of countless interactions of creatures acting within the stochastic nature of life, while machine learning models are trained through massive cases of states and events captured in our databases.

As an example, in the wild, the relationship between predators and prey is a constant battle of predator and prey adapting to techniques applied by each other. Cougars, as predators, have evolved to be stealthy, powerful, and able to launch surprise attacks. Pronghorns, as their prey, have developed exceptional speed, able to outrun most predators in a head-to-head chase. But this evolutionary arms race is not just physical; it involves deception, misdirection, and an intricate dance of outsmarting the other.

Following is a sample scenario where, over a really long time, these two species engage in a series of adaptations that involve not just physical changes but also a kind of “lying” or strategic misdirection:

  1. Initial State:
    • Cougar Strategy: The cougar uses its natural camouflage to blend into the environment, waiting in ambush for the pronghorn to pass by.
    • Pronghorn Strategy: The pronghorn relies on its incredible speed to escape when it senses movement, reacting instantly to any disturbance.
  2. Increment 1: Misdirection by the Cougar:
    • Cougar Strategy: The cougar begins to adopt behaviors that make it seem less threatening. It may move slowly or feign disinterest when observed by a pronghorn, only to attack when the pronghorn lets its guard down.
    • Pronghorn Strategy: The pronghorn adapts by learning to ignore certain signals or movements, focusing only on specific patterns of threat.
  3. Increment 2: Feigned Vulnerability by the Pronghorn:
    • Pronghorn Strategy: The pronghorn develops a tactic where it pretends to be injured or weak, drawing the cougar into a premature attack. The pronghorn then uses its full speed to escape at the last moment.
    • Cougar Strategy: The cougar, in turn, learns to wait and observe the pronghorn’s behavior more closely before committing to an attack, looking for signs of deception.
  4. Increment 3: Complex Deception by Both:
    • Cougar Strategy: The cougar starts to create false trails, using its scent to lead the pronghorn into thinking it is in one location while planning an ambush from another direction.
    • Pronghorn Strategy: The pronghorn, in response, begins to create decoy movements, leading the cougar to believe it will flee in one direction before darting in another.

This is a partial look at what those iterations encoded as Prolog might look like:

% Initial state: Basic strategies
cougar_strategy(camouflage).
pronghorn_strategy(speed).

% Increment 1: Misdirection by the cougar
cougar_strategy(misdirection) :-
previous_strategy(cougar, camouflage),
observe(pronghorn, behavior),
behavior = low_threat.
pronghorn_strategy(ignore_misdirection) :-
previous_strategy(pronghorn, speed),
ignore_signal(cougar, low_threat_signal).

% Increment 2: Feigned vulnerability by the pronghorn
pronghorn_strategy(feigned_vulnerability) :-
previous_strategy(pronghorn, ignore_misdirection),
appear_weak(pronghorn),
cougar_attacks_early(cougar).
cougar_strategy(observe_carefully) :-
previous_strategy(cougar, misdirection),
notice(pronghorn, deception).

% Increment 3: Complex deception by both
cougar_strategy(false_trail) :-
previous_strategy(cougar, observe_carefully),
create_scent_trail(cougar, false_location).
pronghorn_strategy(decoy_movement) :-
previous_strategy(pronghorn, feigned_vulnerability),
lead_cougar(cougar, false_direction),
escape_actual_direction(pronghorn).

BTW, I did generate the Prolog in this blog with the help of ChatGPT. Much of what makes the idea of revisiting Prolog in the LLM era is that LLMs should make the authoring of Prolog expert systems substantially easier than in the 1980/1990s (and 2004 when I tried to write a SQL Server performance-tuning expert system). It took a few iterations, with some manual finessing, but I feel ChatGPT and I got far enough for this purpose.

Conflict between creatures isn’t just predator species versus prey species. It’s also between competitors – for example, candidates running for an office or job. Think of Texas Holdem Poker. It’s the epitome of competitors lying to each other, one figuring out “tells” that reveal the lie, and the others adapting somehow to that tell. Whereas interactions of predator and prey are a matter of life or death, the competitors of games or positions live to learn from their mistakes – they live to author their lessons in Prolog.

Just as predators and prey adapt through deception and strategic misdirection, competitors in other contexts—whether they are sports, businesses, politicians, or poker players—engage in similar strategies. In these scenarios, the objective is not merely to survive but to outmaneuver the opponent, often by misleading them or uncovering their intentions before they can act.

Four Levels of Intelligence

With Prolog, we can encode four levels of intelligence, from most mundane (like in single-celled creatures, to plants and mollusks) to that which is closer to our human intelligence. Although I think these levels of intelligence were rolled out to life on earth in sequence, creatures at higher levels apply the lower levels. For example, humans are at the fourth level, decoupled recognition and action, but we regularly apply simple, robust, and iterative recognition.

Simple Recognition

Simple recognition is all about fast, push-button reactions that require minimal processing—essential for survival in both low and high animals. Think Paramecium, a single-celled organism that swiftly and robotically changes direction in response to harmful chemicals or light, embodying the essence of simple recognition with its push-button reflexes.

For example:

  • Insects: A fly’s escape reflex when sensing a shadow is almost automatic, driven by a hardwired response that triggers instant flight.
  • Fish: A startle response in fish, where any sudden movement in the water causes them to dart away without any further assessment.
  • Cats: Cats often jump or bolt at sudden noises—an instinctive reaction without analyzing the source.
  • Humans (PTSD): In PTSD, hypervigilance and the startle response are exaggerated forms of simple recognition, where the brain reacts immediately to triggers resembling past trauma.

This is what those simple rules might look like encoded as Prolog – a direct mapping of recognition to action:

% Fly's escape reflex triggered by shadow
escape_fly(Trigger) :-
Trigger = shadow,
write('Fly escapes quickly').

% Fish startle response to sudden movement
dart_fish(Trigger) :-
Trigger = sudden_movement,
write('Fish darts away instantly').

% Cat's jump or bolt at sudden noise
jump_cat(Trigger) :-
Trigger = sudden_noise,
write('Cat jumps or bolts').

% Human PTSD startle response
startle_human(Trigger) :-
(Trigger = loud_noise; Trigger = unexpected_movement),
write('Human startles and reacts due to PTSD').

Simple recognition is about quick, reflexive responses, ensuring immediate action when the cost of a false positive is low, but the cost of not reacting—a false negative—could be high. What I find compelling about simple recognition is that it’s more plausible that a push-button mechanism like this could self-assemble naturally.

Simple recognition is great in situations where agents reproduce in prodigious numbers. The simple rules by which they live ensure that a certain, albeit very tiny, fraction of the individuals survive to reproduce (again, in prodigious numbers). Think of millions of crab larvae with limited intellect and weaponry defying the odds until just a few actually grow to adulthood. That’s all the crab species needs—it’s a numbers game that doesn’t care about an individual crab.

You Snooze, You Lose

Another aspect of simple recognition is speed of reaction. Both in the animal kingdom and enterprises such as high-stakes finance. Simple recognition is about making split-second decisions where the consequences of being wrong can be severe, and the cost of a false positive is minimal. This type of rapid decision-making is reminiscent of the amygdala, the part of the brain responsible for our most primal, fight-or-flight responses.

For animals, this mechanism is crucial for survival. For instance, if a creature fails to recognize a lurking predator, like a bear, the cost is its life. On the other hand, the creature might frequently panic and flee at the sight of any large, brownish mass in the distance—many of which may not be bears at all. While these false positives result in wasted energy and heightened stress, they are a small price to pay for the much more significant consequence of missing a real threat.

This kind of rapid response also plays out in the financial world, particularly in the high-frequency trading (HFT) sector. In his book Flash Boys: A Wall Street Revolt, Michael Lewis explores how hedge funds and trading firms engage in an arms race to execute trades milliseconds faster than their competitors. In these fractions of a second, the ability to act first on market inefficiencies can lead to substantial profits. Just as an animal might benefit from reacting swiftly to a perceived threat, traders in the HFT world capitalize on speed, exploiting the tiniest of advantages to outmaneuver the competition.

The important thing is that a quick, simple recognition decision only makes sense when we know exactly what to do with that information.

In both cases, whether in nature or finance, simple recognition is about reacting quickly to opportunities or threats. The key is that the potential losses from a delayed response far outweigh the occasional costs of false alarms. This rapid, almost instinctual, decision-making is what gives both predators and high-frequency traders their edge in a highly competitive environment.

Robust Recognition

This is what I think of as “lower animal intelligence” (not fellow primates, cetaceans, or birds like corvids). The intelligence of most plants and animals are at this level. Variables plugged into rules can themselves be queries (a simple recognition). Robust recognition is a network of simple recognitions. This is soft-coded logic, the separation of logic and procedure.

Robust recognition builds on simple recognition by considering many simple factors simultaneously. It involves a multivariable function that goes beyond just f(x)f(x)f(x) to include multiple parameters, such as f(x,y,z) or f(x,y,a). While it’s still a fast decision-making process, it can handle situations where some data might be missing or of low quality.

At the simplest level, it means IF X AND Y AND Z THEN Execute. However, simple recognition goes further, as in IF (X AND Y AND Z) OR (A AND B) THEN Execute. The OR means that a particular action can be triggered by more than one rule.

Creatures working at the simple to robust recognition level are not “intelligent” as we normally think of it relative to we humans. They can suffer from high percentages of false negatives. This means they fail to recognize situations because their rules are too rigid. For example, we can easily catch fish because we only need to mimic the movement, smell, and shape of a fish’s prey with a hook, line, and bait, and it will fall for it every time… well, maybe not. The important thing is that the rules ensure that a certain percentage of the members will survive to reproduce. This isn’t too different from a casino winning a certain percentage as long as the rules are strictly adhered to.

This is the general state of the logic in most software today—well-defined and deterministic. Simple and robust recognition are the decision points in our programming code. Rules are rather hard-coded (for example, as IF-THEN, CASE-WHEN, or IIF statements). However, many inputs used by the rules are soft-coded; for example, configuration files for an application where values can be set independently of the software.

In general, the variables plugged into a rule are directly measured and factual values. In fact, the key difference between simple and robust recognition is that for the latter, variables plugged into a rule are usually in turn the result of other rules. Simple recognition is like a function or Web Service call these days that accept a fixed set of parameters (even though there may be multiple “signatures” for the call) which are all solid values processed by the rules encapsulated by the function.

For example, if a rabbit is to recognize a fox stalking it, it would need to do this from an incredibly large number of angles. In order to learn that, it would need to first see the fox from all “dimensions of observation” – the existence of attributes and the perspective from different angles or contexts. That Prolog might look something like this example of a rabbit recognizing a fox:

% Facts about different characteristics of a fox
has_feature(fox, sharp_teeth).
has_feature(fox, bushy_tail).
has_feature(fox, reddish_fur).
has_feature(fox, pointed_ears).

% Rule for recognizing a fox based on multiple features
recognize_fox(Rabbit, fox) :-
has_feature(fox, Feature1),
has_feature(fox, Feature2),
Feature1 = Feature2, % Ensure different features are recognized
write(Rabbit), write(' recognizes a fox based on features: '),
write(Feature1), write(' and '), write(Feature2), nl.

It would take forever to process all of those rules from each angle. If the requirement for a direct hit is removed, the rabbit can successfully recognize the fox quickly and fairly accurately through a less direct hit.

With simple recognition, the fox would need to be an exact shade of red, an exact size, have an exact smell, etc. With simple recognition, the shade of red is determined through a rule that takes into account the level of light and other things.

Most of our software and ML models are at this level of robust recognition. It could be a very convoluted set of nested IF-THEN-ELSE statements or trained ML models that derived a formula from many cases of events. Many animals have the ability to learn to recognize something.

With robust recognition, the “too many false positives” problem is mitigated. This is a little different from the fox and the rabbit problem. The rabbit and fox problem is a rabbit needing to recognize something in many different ways. This problem occurs when there are so many learned rules that too many rules fire. This problem would be restated from “Is this a fox?” to “What has ears and a nose?”

Iterative Recognition

Iterative recognition addresses imperfect information. There are gaps to be filled, and processes are employed to methodically fill those gaps.

Ideally, the doctors we visit use iterative recognition. Iterative recognition is a process, not just a set of rules like simple and robust recognition. Doctors are tasked with mapping a set of symptoms to a diagnosis. However, some symptoms require tests (which cost money and time) to validate and/or measure. This might involve asking questions about what happened to fill in more gaps.

It’s usually an iterative scientific process. The doctor forms initial hypotheses based on your initial complaints, symptoms, and their thousands of hours of medical training and experience. The doctor then iteratively attempts to disprove—or, conversely, prove—the hypothesis by testing it against subsequently revealed data points. In the world of plants and animals, it’s fair to say we “own” this category. A few other animals have some level of this capability, but they don’t come close to matching the level of capability found in humans.

The difference between robust and iterative recognition is that iterative recognition will actually take steps to proactively improve the recognition accuracy by iteratively proving it through experiments and feedback. Iterative recognition adds a process that begins with a list of possibilities and culls the list by gathering more data to prove which possibility is the most likely. Each iteration could add new possibilities as well as new evidence is gathered.

Vision makes a bigger impact as a sensory role. With vision, comes the ability to camouflage. This camouflage is generally not perfect. If a reptile spots a partial view of its prey, because the match isn’t perfect, the reptile’s recognition rule doesn’t fire, and it passes up an opportunity to eat. (How often will it find prey in full view?) Therefore, it must recognize that partial view as a “hypothesis” rather than a direct match and begin to prove the theory through iterations of query and experiment. For example, we see something in the distance that looks like a shady tree to sit under. But something isn’t quite right about it. We walk more closely and it looks even less like a tree. Or we toss a rock at it to see anything move. We walk closer and see that it’s a bear holding tree branches.

So, a creature with iterative recognition may be smarter about recognizing something, but it also needs to be smarter about knowing what to do about it. Which brings up #4, Decoupled Recognition and Action

Iterative recognition is the application of robust rules in the scientific process of validating hypothesis. It doesn’t refer to iterations of ml algorithms such as that of k-means or even genetic algorithms.

Decoupled Recognition and Action

All decisions come with varying levels of opportunity, risk, and missed opportunity. In any decision, we ideally identify as many risks as possible and maximize the value of our action.

We could think of simple, robust, and iterative recognition as “coupled recognition and action” – we associate elements to the best action option. In other words, we take an action if we recognize something: IF Cougar AND Cougar_Aggressive THEN RUN

For humans, we’ve seen videos of people yelling, “Don’t run, he’ll think you’re prey!” So while our amgydala will tell our legs to run fast, our brain can override it to decide whether it’s better to hold our ground and yell. Or, we might stand our ground if we have a bear-level firearm ready to shoot. Or, we’re in the safety of our car. The consequences of each possible action are very different.

Something may be recognized accurately (using iterative recognition), but what do we do about it? For example, we do recognize that we see a bear. What do we do? Do we run away? Do we fight? Do we pray to our maker and wish the bear bon appétit? Is it really a threat? Maybe the kind bear is offering us shade. The point is that recognition is only half the problem. Deciding what to do is what keeps us from being caught with a fishing hook and bait.

Here is an example of a decoupled recognition and action Prolog:

% Recognition rules
recognize(animal, bear).
recognize(bear, aggressive).
recognize(bear, calm).

% Contextual rules
context(human, armed).
context(human, unarmed).
context(human, in_car).
context(human, on_foot).
% Decoupled recognition and action rules
action(human, flee) :-
recognize(animal, bear),
recognize(bear, aggressive),
context(human, unarmed),
write('I run away because I recognize the bear is aggressive,
and I am unarmed.').
action(human, stand_ground) :-
recognize(animal, bear),
recognize(bear, aggressive),
context(human, armed),
write('I stand my ground because I recognize the bear is aggressive,
but I am armed.').
action(human, stay_calm) :-
recognize(animal, bear),
recognize(bear, calm),
(context(human, in_car); context(human, on_foot)),
write('I stay calm because I recognize the bear is calm,
and I am either in a safe place or can move away safely.').

% Example queries
% action(human, WhatAction).

Notice that although this is “decoupled recognition and action” (“I recognize a calm bear so I will remain calm”), the Prolog is more in the structure of “I see a calm bear, so should I run or stay calm?”

This is higher animal recognition; of which humans are in a class of their own. It’s the human’s ability to think symbolically that separates us from all other animals. That is, we’re able to perform experiments in our heads before actually committing to a physical action, which is probably not retractable.

Humans, with our self-awareness, are each a species of one. Most creatures aren’t really aware of their mortality. All that matters for most species is that enough individuals survive to produce the next generation. Humans are aware of our mortality and have the ability to cleverly preserve our individual lives. Like an entire species, each human fills a niche, each carries a unique intelligence, each is capable of profoundly changing the world.

Lastly, humans and most higher animals still do rely on simple recognition. We still encounter dangers where a knee-jerk, very quick, “better safe than sorry” response is good enough.

LLM Interpretation

Even if a Prolog script isn’t perfect or introduces unique ideas, it can still be highly valuable. For example, the Prolog rules shown just above (for decoupled recognition and action) offer a structured approach to deciding how a human might respond when encountering a bear, depending on the bear’s behavior and the human’s context (whether they are armed, unarmed, in a car, or on foot).

Prolog is essentially just another language to an LLM (at least to ChatGPT, which is able to produce Prolog from my prompts). So if you don’t have a Prolog interpreter and/or the Prolog isn’t perfect, it can still be submitted as part of a prompt to an LLM:

Consider the following Prolog and describe what it says in English <<place prolog from above here>>.

It responds very impressively:

The script defines different actions—fleeing, standing ground, or staying calm—based on the recognition of the bear's behavior and the human's situation. If this script were shared with an LLM along with other text, the LLM could interpret these rules and help refine or expand them. The LLM could offer nuanced interpretations, fill in gaps, or generate new rules, enhancing the script's effectiveness and aligning it more closely with real-world scenarios.

In some sort of application, the process for engaging the Prolog might go something like this:

  1. Eugene encounters a bear while hiking at Yellowstone.
  2. That proverbial app that listens to every single thing I say picks up my saying, “There’s a bear walking towards me. Bad day to have left my bear spray at home.”
  3. That app creates an embedding for my statement above and searches a vector database for anything resembling my statement.
  4. It finds matches a Prolog file that seems to describe what to do when encountering a bear.
  5. That app gathers whatever else it knows, such as my location (which it can infer that I’m not in a car).
  6. The Prolog and other information are submitted to an LLM for advice. In this case, the LLM translates the relatively simple Prolog into English text as supplementary information of the prompt. That is, as opposed to submitting a Prolog query to a Prolog engine (which at the time of writing isn’t available for ChatGPT).

This prompt could be constructed from what the app hears, my location, and the Prolog that was found about the rules for engaging bears:

Eugene: There's a bear walking towards me. Bad day to have let my bear spray at home. What should I do?
ChatGPT Instructions: Compute an answer based on the rules of the Prolog below and consideration of other information provided in this prompt. You may infer any values you require that aren't in this prompt. But run your logic through the prolog to ensure it's correct before returning a response. Only return the answer so it can be readily understood by Eugene.
Location: 44.806629, -110.896713
This Prolog expresses rules for engaging with bears: <<place bear engagement prolog here>>

It correctly answered:

I run away because I recognize the bear is aggressive, and I am unarmed.

This demonstrates the symbiotic potential between Prolog and LLMs—where Prolog provides a deterministic, rule-based framework, and LLMs add a layer of flexibility and interpretation, making the overall system more robust and adaptable.

The advantage of encoding those rules in Prolog (as opposed to a spoken language) is that it is unambiguous—it’s code that can only be correctly interpreted one way. When we submit it to an LLM instead of a manually authored sentences is that the latter could be fraught with imperfect information. Really, even code such as C#, Python, and Java would work. But Prolog is centered on deductive logic, something that is rather intuitive to non-programmers.

The Four Levels of Intelligence and the Confusion Matrix

Let’s explore the link between the four levels of intelligence and statistical concepts, particularly the confusion matrix, which is a fundamental tool in machine learning. The confusion matrix helps us assess the performance of a model by categorizing predictions into true positives, false positives, true negatives, and false negatives. These metrics allow us to calculate key measures such as recall, precision, and accuracy, all of which are crucial for understanding the effectiveness of decision-making processes.

When we explore the four levels of intelligence, we see how each level can be linked to elements of the confusion matrix. Simple recognition, for instance, is closely tied to maximizing true positives, often at the expense of higher false positives. As intelligence evolves to more complex forms—robust, iterative, and decoupled recognition—the balance shifts, with a greater focus on minimizing false negatives and optimizing the trade-offs between errors and the costs or benefits of different outcomes. This progression mirrors how machine learning models evolve from basic algorithms that might prioritize certain types of errors to more sophisticated systems that better manage the complexities of real-world decision-making.

Keep in mind:

  • In general, we wish to maximize true positives.
  • False positives and false negatives are OK as long as the consequences of being wrong is low.
  • False negatives are much worse than false positives. At least we’re generally aware of a false positive. We usually don’t see the false negative. Tweaking models often is a matter of trading false negatives for false positives.
  • The confusion matrix are probabilities of our decisions being right or wrong. But we need to fold in the rewards for being right and the consequences of being wrong.

Simple Recognition and the Confusion Matrix

At the level of simple recognition, true positives must dominate. The rule is often biased toward being overly cautious, prioritizing the reduction of false negatives, which in turn results in a high rate of false positives. The key here is that the cost of a false positive—such as wasting energy or missing an opportunity—is relatively low. The focus is on immediate, binary, responses: “If X then act.” This simplicity ensures survival even when recognition isn’t perfect, but it also means the system is more rigid, with less capacity to handle complex or ambiguous situations.

Robust Recognition and the Confusion Matrix

Robust recognition becomes necessary when the aggregate cost of false positives grows significant. Here, refining the rules to minimize errors is crucial. This stage introduces more sophisticated logic, where rules evolve to include AND conditions or allow alternatives through OR conditions. The goal is to reduce false positives while maintaining a high rate of true positives and lowering false negatives.

I think of the difference between simple and robust recognition as follows:

  • Simple recognition (IF X THEN Y) can be thought of as a single gate or perception mechanism, which could “spontaneously” generate in real life.
  • Robust recognition is the ability to compose new rules from simple ones, akin to how AND/OR gates combine to create more complex logic in digital circuits.

Iterative Recognition and the Confusion Matrix

Iterative recognition is process akin to a game of 20 Questions. Like simple or robust recognition, iterative recognition starts out reactive – responding to input. Here, the system doesn’t just react to information as it comes in; it begins with incomplete and imperfect information, then initiates a proactive process to seek out and fill in the missing data.

Most higher animals, including mammals, operate at this level, continuously learning and adjusting their behavior to avoid errors. When we’re making a decision, to fill in blanks, we run experiments, move to get a closer look, and use our experience to hone our understanding of the context of our situation.

It involves actively testing assumptions and refining hypotheses to improve accuracy. This level is crucial for situations where the cost of being wrong—whether it’s a false positive or a false negative—is very high. Of course, it takes time to fill in all those blanks. If we don’t have that time, we take a guess with simple and/or robust recognition.

Decoupled Recognition and Action and the Confusion Matrix

In decoupled recognition and action, the recognition process can be simple, robust, or iterative, so the link to the confusion matrix depends on the type of recognition applied.

What distinguishes this level of intelligence is the focus on determining the best course of action after recognizing a situation. Once recognition has occurred, the next step is to weigh potential consequences and consider contingency plans, ultimately selecting the most effective and least risky response. This approach enables strategic decision-making by moving beyond merely identifying a threat or opportunity.

In relation to the confusion matrix, decoupled recognition and action isn’t fundamentally different from other recognition types. The key concern remains: after making a decision based on recognition, what action is selected? The critical questions are: What is the probability of being wrong in the recognition, and what are the consequences of making a wrong decision?

It’s important to remember that all types of recognition—simple, robust, or iterative—can be modeled in Prolog. The response, however, might vary based on whether the process follows simple, robust, iterative, or decoupled recognition and action.

Conclusion

By examining the four levels of intelligence—simple, robust, iterative, and decoupled recognition and action—we can see how these concepts offer a structured approach to navigating complex environments, both in biological systems and in artificial systems like those encoded in Prolog. These levels provide a compelling framework for encoding decision-making processes, allowing us to systematically refine and improve the accuracy of our actions.

Prolog, with its rule-based logic, is well-suited to capturing these levels of intelligence. From simple recognition that mirrors basic, reflexive responses, to decoupled recognition and action that enables strategic decision-making, Prolog allows us to create AI systems capable of nuanced reasoning. By integrating these logical structures with the broader capabilities of LLMs, we can harness the strengths of both deterministic and flexible approaches to build more sophisticated, intelligent systems.

Ultimately, the exploration of these intelligence levels through Prolog highlights the power of combining structured logic with the adaptability of modern AI, paving the way for more effective and resilient decision-making in an ever-evolving world.

Part 7 is the season finale of Prolog’s Role in the LLM Era. We close with something we punted in Episode 1: Prolog and knowledge graphs seem redundant.

Leave a comment