Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Neuro-Symbolic AI

You're reading from   Neuro-Symbolic AI Design transparent and trustworthy systems that understand the world as you do

Arrow left icon
Product type Paperback
Published in May 2023
Publisher Packt
ISBN-13 9781804617625
Length 196 pages
Edition 1st Edition
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Alexiei Dingli Alexiei Dingli
Author Profile Icon Alexiei Dingli
Alexiei Dingli
David Farrugia David Farrugia
Author Profile Icon David Farrugia
David Farrugia
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Chapter 1: The Evolution and Pitfalls of AI 2. Chapter 2: The Rise and Fall of Symbolic AI FREE CHAPTER 3. Chapter 3: The Neural Networks Revolution 4. Chapter 4: The Need for Explainable AI 5. Chapter 5: Introducing Neuro-Symbolic AI – the Next Level of AI 6. Chapter 6: A Marriage of Neurons and Symbols – Opportunities and Obstacles 7. Chapter 7: Applications of Neuro-Symbolic AI 8. Chapter 8: Neuro-Symbolic Programming in Python 9. Chapter 9: The Future of AI 10. Index 11. Other Books You May Enjoy

Enabling machine intelligence through symbols

This symbolic philosophy was highly influential in the field of AI. The first examples of AI programs, such as the Logic Theorist (an AI program written in 1956 by Allen Newell, Herbert A. Simon, and Cliff Shaw that was able to prove theorems on the same level as a human mathematician) and the General Problem Solver (an AI programmed in 1957 by Herbert A. Simon, J. C. Shaw, and Allen Newell that used symbolic rule representations of problem knowledge as input to solve general tasks), involved symbolical processing in conquering the quest of achieving machine intelligence.

The concept of intelligence

Before we proceed any further, we must first answer one crucial question – what is intelligence? At face value, this question might seem relatively simple to answer. However, the term intelligence is complex to define. Intelligence tends to become a subjective concept that is quite open to interpretation.

Consider a popular TV talk show. In one of its popular segments, the host introduces two prodigy children: A and B. Child A can solve every mathematical problem in the world in record time. Child B can understand and speak every language like it’s their native tongue. The host starts by introducing the audience to child A and, for the sake of entertainment, asks the child to solve a couple of math problems, each increasing in difficulty. The child answers correctly every time, and the audience is stunned and speechless. Everyone is in awe of this child’s intelligence. Then, child B is also brought out by the host. The host asks child B to solve the same math problems as child A. Child B is not able to solve them correctly. The audience is not impressed. Is child B intelligent? To the audience, probably not. But to anyone who has witnessed the skills of child B, then probably the answer would be a strong and resounding yes.

“Everybody is a genius, but if you judge a fish by its ability to climb a tree, it will live its whole life believing it’s stupid.”

– Unknown author (commonly misattributed to Albert Einstein)

What is the takeaway here?

The definitions of intelligence, while being super subjective, essentially become a direct association and measure of the following:

  • The problem we are trying to solve
  • The context and environment of that problem

Although it is complex to define, humans subconsciously understand that intelligence is directly measured by how well you can do the task you are interested in. Intelligence is associated with reducing the significance and effect of our target problem. So, if we want a machine to be intelligent, it must solve a specific problem or task. But how can we teach the machine to solve a task? As we previously mentioned, early forms of AI were all about enabling computers to mimic human behavior. In short, it would allow machines to think.

Humans think in symbols. Computers operate using symbols. Therefore, computers can be thought to think.

Our journey through symbolic awareness ultimately significantly influenced how we design, program, and interact with AI technologies.

Towards Symbolic AI

Symbolic AI allows a machine to manipulate symbols about our world. The premise behind Symbolic AI is using symbols to solve a specific task. In Symbolic AI, we formalize everything we know about our problem as symbolic rules and feed it to the AI. Note that the more complex the domain, the larger and more complex the knowledge base becomes.

Symbolic AI leverages factual logic computation and comparison. Symbolic AI is more concerned with representing the problem in symbols and logical rules (our knowledge base) and then searching for potential solutions using logic. In Symbolic AI, we can think of logic as our problem-solving technique and symbols and rules as the means to represent our problem, the input to our problem-solving method. The natural question that arises now would be how one can get to logical computation from symbolism. We do this by defining symbol relations.

Understanding symbolic relations

Relations allow us to formalize how the different symbols in our knowledge base interact and connect. For example, let us consider a hamburger. The basic hamburger is a patty in between a bun. In this case, our symbols representing the object are BUN and PATTY. The relation would then be BETWEEN. We can define this symbolic relation as BETWEEN(PATTY, BUN).

We typically use predicate logic to define these symbols and relations formally – more on this in the A quick tangent on Boolean logic section later in this chapter.

Let us pick the task of determining whether an object is an orange or not as an analogy. When we see an orange or any other entity, we immediately dissect it and split it into its more minor constituents – its respective symbols. We use all our senses to build the knowledge base of the orange. For example, some properties of the profile that we consider might include the following:

  • Shape
  • Size
  • Texture
  • Color
  • Body
  • Origin

Figure 2.2 illustrates how one might represent an orange symbolically.

Figure 2.2: A symbolic representation of an orange

Figure 2.2: A symbolic representation of an orange

We observe its shape and size, its color, how it smells, and potentially its taste. We feel its texture and investigate its structure. In short, we extract the different symbols and declare their relationships. With our knowledge base ready, determining whether the object is an orange becomes as simple as comparing it with our existing knowledge of an orange. For example, we know that an orange should be orange in color. An orange should have a diameter of around 2.5 inches and fit into the palm of our hands. An orange resembles a round object with a stem emerging from its top. We learn these rules and symbolic representations through our sensory capabilities and use them to understand and formalize the world around us.

From symbols and relations to logic rules

So far, we have discussed what we understand by symbols and how we can describe their interactions using relations. The final puzzle is to develop a way to feed this information to a machine to reason and perform logical computation. We previously discussed how computer systems essentially operate using symbols. More specifically, computer processing is done through Boolean logic.

A quick tangent on Boolean logic

Any variable that can be either TRUE (1) or FALSE (0) is said to be a Boolean variable. A computer system comprises multiple digital circuits, with components with an input voltage that is either ON (i.e., state 1) or OFF (i.e., state 0).

In Boolean logic, we evaluate and compute a set of logical propositions (also called expressions) whose final output can be TRUE or FALSE. Logical propositions use three leading logical operators (logic gates) – AND, OR, and NOT:

  • AND: All propositions must be TRUE for the entire proposition to be TRUE. We multiply the values of the propositions.
  • OR: At least one of the propositions must be TRUE for the entire proposition to be TRUE. Then, we add the values of the propositions.
  • NOT: Reverses the state of the logical proposition. If it is FALSE, it will become TRUE.

For a logical expression to be TRUE, its resultant value must be greater than or equal to 1. If the result is 0, then the expression is said to be FALSE.

There are some other logical operators based on the leading operators, but these are beyond the scope of this chapter.

Predicate logic 101

Predicate (first-order) is a formal system heavily used in multiple domains, including computing, discrete mathematics, and philosophy. We use predicate logic to define and represent expressions and statements in a standardized way. We use the symbol := to denote a definition. On the left-hand side of the symbol is what we are trying to define, and on its right is the definition. We use the symbol ˄ to represent the AND operator, ˅ to denote the OR operator, and to replace the NOT operator. Given these three core operators, we can construct other operators due to functional completeness. For example, the NAND operator combines the AND and NOT operators. There are other symbols, such as the implication symbol ().The AND, OR, and NOT operators are enough for this chapter. If the concept of predicate logic is new to you, we recommend you read more about this system.

Consequently, for a computer system to understand and process our symbolic relations, we must transform them into logical propositions. We can do this by adding logical operators to our symbolic relations. We typically refer to the logical operators as logical connectives since they connect all our symbols and their respective relations. For the sake of simplicity, let us pick a dummy example to understand this better. Consider the following statement:

People watch interesting and engaging movies

Given a specific movie, we aim to build a symbolic program to determine whether people will watch it. At its core, the symbolic program must define what makes a movie watchable. Then, we must express this knowledge as logical propositions to build our knowledge base. Following this, we can create the logical propositions for the individual movies and use our knowledge base to evaluate the said logical propositions as either TRUE or FALSE.

Step 1 – defining our knowledge base

The first step is to understand the problem we are trying to solve. Then, our problem becomes the world that we need to model. Finally, we can define our world by its domain, composed of the individual symbols and relations we want to model.

If we recall the original statement, we know that for people to watch a specific movie, the movie must be both interesting AND engaging. Therefore, let us tabulate and categorize the different components of the statement:

Symbols

Relations

Logical Connectives

PEOPLE

MOVIES

WATCH

INTERESTING

ENGAGING

AND

Table 2.1: Statement dissected into its respective symbols, relations, and logical connectives

This step is vital for us to understand the different components of our world correctly. Our target for this process is to define a set of predicates that we can evaluate to be either TRUE or FALSE. This target requires that we also define the syntax and semantics of our domain through predicate logic.

Our symbols here are People and movies. They are our statement’s primary subjects and the components we must model our logic around. Following this, we must define their binary relations.

  • People watch movies
  • A movie can be interesting
  • A movie can be engaging

It is also an excellent idea to represent our symbols and relationships using predicates. In short, a predicate is a symbol that denotes the individual components within our knowledge base. For example, we can use the symbol M to represent a movie and P to describe people. We can also represent relations using predicates. A predicate relationship can have one or more arguments. Let us formally define the preceding relations.

Our first relation is that people watch movies. We can denote people watching movies using the WATCH predicate symbol. In this case, WATCH accepts two arguments: people and movies. Therefore, we can write this down as WATCH(P, M). Next, we have two other relations that accept only a single argument. These two relations define a property that a movie can possess. We can write them as IS_INTERESTING(M) and IS_ENGAGING(M).

Furthermore, the final representation that we must define is our target objective. Let us represent IS_INTERESTING(M) with I and IS_ENGAGING(M) with E.

Using first-order logic, we can define our target T as T = I ˄ E:

T is TRUE if both I and E are also TRUE

Let us also denote two movies – X and Y:

  • Movie X is not interesting but engaging (therefore, X = I ˄ E)
  • Movie Y is interesting and engaging (therefore, Y = I ˄ E)

Recall our target objective – i.e., to determine whether a person will watch the movie. We can formally write this inference rule as an implication as follows:

Person(P) AND Movie(M) AND IS_INTERESTING(M) AND IS_ENGAGING(M) => WATCH(P, M)

If we have a person, P, and a movie, M, where the movie is both interesting and engaging, then that implies the person will watch the movie.

Step 2 – evaluating our logical relations

So far, we have defined our domain regarding symbols and relations. The next step is to build our truth table to evaluate the validity of our expressions:

I

E

T

Movie X

FALSE

TRUE

FALSE

Movie Y

TRUE

TRUE

TRUE

Table 2.2: Logical relation evaluation using a truth table

Based on our knowledge base, we can see that movie X will probably not be watched, while movie Y will be watched. Of course, this is a trivial example to get the message across.

Defining the knowledge base requires skills in the real world, and the result is often a complex and deeply nested set of logical expressions connected via several logical connectives. Compare the orange example (as depicted in Figure 2.2) with the movie use case; we can already start to appreciate the level of detail required to be captured by our logical statements. We must provide logical propositions to the machine that fully represent the problem we are trying to solve. As previously discussed, the machine does not necessarily understand the different symbols and relations. It is only we humans who can interpret them through conceptualized knowledge. Therefore, a well-defined and robust knowledge base (correctly structuring the syntax and semantic rules of the respective domain) is vital in allowing the machine to generate logical conclusions that we can interpret and understand.

Nonetheless, a Symbolic AI program still works purely as described in our little example – and it is precisely why Symbolic AI dominated and revolutionized the computer science field during its time. Symbolic AI systems can execute human-defined logic at an extremely fast pace. For example, a computer system with an average 1 GHz CPU can process around 200 million logical operations per second (assuming a CPU with a RISC-V instruction set). This processing power enabled Symbolic AI systems to take over manually exhaustive and mundane tasks quickly.

So far, we have defined what we mean by Symbolic AI and discussed the underlying fundamentals to understand how Symbolic AI works under the hood. In the next section of this chapter, we will discuss the major pitfalls and challenges of Symbolic AI that ultimately led to its downfall.

You have been reading a chapter from
Neuro-Symbolic AI
Published in: May 2023
Publisher: Packt
ISBN-13: 9781804617625
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime