CS 7637 Knowledge Based Artificial Intelligence (KBAI)

Georgia Tech Fall 2019

David Joyner, Ph.D. Professor
Ashok Goel, Ph.D. Professor

Course Website: http://lucylabs.gatech.edu/kbai/fall-2019/
Youtube Lectures : https://www.youtube.com/watch?v=onRUvL2SBG8&list=PLAwxTw4SYaPkdANSntXhY0btWkpPglDGD&index=1

Software Python: www.python.org/

Udacity https://auth.udacity.com/sign-in
Note that you must sign in with Organization then choose Georgia Tech

Transcript

  1. In Udacity click the Youtube logo This will open the video in youtube
  2. Copy the video URL
  3. Go to https://www.nitrxgen.net/
  4. Paste your URL

Instructions

Homework Format

Homework must be complete using Joyner Document Format (aka JDF) https://drive.google.com/drive/folders/1xDYIomn9e9FxbIeFcsclSbXHTtHROD1j

Homework Instructions

Complete your assignment using JDF, then save your submission as a PDF. Assignments should be submitted to the corresponding assignment submission page in Canvas. You should submit a single PDF for this assignment. This PDF will be ported over to Peer Feedback for peer review by your classmates. If your assignment involves things (like videos, working prototypes, etc.) that cannot be provided in PDF, you should provide them separately (through OneDrive, Google Drive, Dropbox, etc.) and submit a PDF that links to or otherwise describes how to access that material.

This is an individual assignment. All work you submit should be your own. Make sure to cite any sources you reference, and use quotes and in-line citations to mark any direct quotes.

Late work is not accepted without advanced agreement except in cases of medical or family emergencies. In the case of such an emergency, please contact the Dean of Students.

Lessons

There are 26 Lessons (aim to watch 2 per week)

Lectures

01 - Intro to Knowledge Based AI

Fundamental Conundrums

  • Intelligent Agents have limited resources
  • Computation is local, but have global constraints
  • Logic is deductive, but many problems are not
  • The world is dynamics but knowledge is limited
  • Problem solving, reasoning, learning are complex problems

Characteristics of AI Problems

  • Knowledge often arrives incrementally
  • Problems exhibit recurring patterns
  • Problems have multiple levels of granularity
  • Many problems are computationally intractable
  • The world is dynamic but knowledge of the world is static
  • The world is open ended but knowledge is limited

What are AI Problems?
Anything a human does can be an AI problem

Consider Jeopardy contestant as an AI Agent?
They must listen, understand, search their data (find answer), frame response as a question.

Three Fundamental Processes/Forms: Learning - Reasoning - Memory
We learn to reason, our learning is stored in Memory

AI seeks to unify these three processes under the heading DELIBERATION

Four Schools/quadrants of AI: Thinking, Human Like, optimally, acting
Extra Reading: https://people.eecs.berkeley.edu/~russell/aima1e/chapter01.pdf

Consider

  • autonomous vehicle. Ideally it should act optimally, which is not necassarily human like (getting in accidents)
  • A roomba acts optimally
  • Siri thinks and acts like a human

In this course we define:

  • Cognitive: dealing with human like intelligence
  • Systems: multiple interacting components (learning, reasoning, memory)
  • Cognitive systems: Systems that exhibit human like behaviour through learning, reasoning, memory) (It should be noted that Cognitive systems may also contain components: Metacognition and Reaction. These are outside the scope of our discussion)

Architecture:

  1. Input: Perceiving the world
  2. Deliberation
  3. Output: actions on the world

Our courses is broken into the following areas

  1. Fundamentals
  2. Planning: Logic and then Planning
  3. Common sense reasoning: Every day reasoning
  4. Learning
  5. Analogical Reasoning: Reasoning a problem based an analogy to familiar problems
  6. Visuospatial Reasoning
  7. Design and creativity
  8. Metacognition

02 - Intro to CS7637

In this lesson, we'll talk specifically about what you should expect from CS7637.

  • class projects and assessments
  • Computational Psychometrics
  • Raven's Progressive Matrices test of intelligence
  • commonly re-occuring principles

Learning goals

  • Core methods of KBAI
  • Tasks addressed by KBAI
  • KBAI approach to tasks (methodology)
  • Relt'n between AI and cognition

Learning Outcomes

  • Design and implement KBAI agent
  • Strategic approach to address problems
  • Understand and interpret the result in terms of human cognition

Learning methodology

  • By Example
  • By Doing
  • Project Based (building upon each other)
  • Personalization
  • By reflection (Understand your learnings)

Introduction to Computational Psychometrics

  • Psychometrics is the study of human intelligence/aptitude
  • Computational Psychometrics is the design of AI Agents that mimic human intelligence Can take a test Does it make the same errors? what does this tell us?

Raven's Progressive Matrices

  • Written in the 1930s to examine general intelligence
  • 60 multiple choice visual analogy problems
  • 2 main types of problems (2x2 and 3x3 matrix problems) Where The dimensions here represent the number of relationships
  • We will also look at 1x1 problems but these are introductory

Went through a few examples of the Raven Matrices

Principles of CS7637

Be on the lookout for the seven principals, they'll occur again and again throughout the course.

  • Principal number one, agents use knowledge to guide reasoning and they represent and organize this knowledge into knowledge structures.
  • Principle number two, learning is often incremental. This connects back to one of the characteristics of problems, where data and experience was coming incrementally.
  • Principle number three, reasoning is top down not just bottom up. We just don't reason from data, we also use data to pull out knowledge from memory, then we use this knowledge to generate expectations to make sense of the world.
  • Principle number four, knowledge-based AI agents match methods to tasks. We'll discuss a number of different methods. We'll discuss how AI agents can select specific methods to address particular tasks and even integrate different methods to address complex tasks.
  • Principle number five, agents use heuristics to find solutions that are good enough. They do not necessarily find optimal solutions. This is because of a trade off between computer efficiency and the optimality of solutions. Our focus will be on using bounded rationality and yet, giving near real-time time performance on intractable problems. This happens, because agents use heuristics to find solutions that are just good enough.
  • Principle number six, agents make use of recurring patterns of problems in the world. Of course, there are a number of problems. But even this number of problems are characterized the patterns that occur again and again.
  • Number seven, reasoning, learning and memory constrain and support each other. We'll build theories that are not just theories of reasoning or theories of learning or theories of memory, but we'll build theories that unify the three of them into one single cognitive system.

These principles will come again and again in this particular class. So we highly recommend that you take a moment, pause the video and read over the principles once again.

03 - Semantic Networks

Is a type of knowledge representation

Each knowledge representation has a language/vocabulary (aka lexicon), and content. Content can be the representation of a relationship. For example equality in an equation, or Position (over, under, etc)

A semantic network first seeks to represent knowledge by identifying objects (Labelling) and their relationships. Ex: circle inside square. Then it seeks to describe a transformation between states. Consider 2 image A & B, from the Maven's progressive matrices. Each image will contain some shapes. Our task is to define the transformation of the image from A to B using a well defined vocabulary of relationships. This constructs the semantic network.
A: Square inside circle; Triangle above Circle
B: Circle inside square;
Transform: Circle expanded, Triangle deleted

Good representation characteristics

  • Make relationships explicit
  • Expose natural constraints
  • Bring objects and relations together
  • Exclude extraneous details
  • Transparent, Concise, complete, fast, computable

Example: Guards & Prisoners
Three guards and three prisoners are on one side of a river and must cross using a boat. Boat can only transport 1-2 people at a time. Prisoners may never outnumber guards on either side, but they can be alone.

Textbook: page 33

04 - Generate & Test

The first of many problem solving methods
Given a problem, generate potential solutions, then test each solution for efficiency. In a perfect world with perfect and complete knowledge, infinite computational resources, and perfect reasoning methods you could come up with the perfect solution each time. But the world is not like this so you must generate several plausible answers and test each one.

Recall: Guards and Prisoners problem. Previously we discussed simply the representation. We ignored the algorithm of how an AI agent would solve the problem.

05 - Means end Analysis

06 - Production

07 - Frames

Frames -> Understanding -> common sense reasoning -> scripts
Functions, Properties, Relationship to previous topics

Ashok ate a frog: What is common sense reasoning. Is the frog dead or alive?, where was it?, did it make him happy?

Deconstruction of the sentence into a frame Ate: The verb but you could use the subject/noun (On the left we have Slots, on the right is the filler) Subject: Ashok Object: frog Location: time: utensil: Object-alive: false Object-is: in stomach Subject-mood: happy

A frame is a knowledge structure. Like a molecule they have a structure Frames can also point to frames. In the above example we could construct a frame for Ashok. Then the filler would point into the Ashok frame. This can lead to more and more complex frames.

Frame Properties: Represent stereotypes, Provide default values(in-stomach), Exhibit inheritance (The idea of frames comes from OO - programming)

A semantic network as a frame:
Object
     Name x
     shape Triangle
     size Large
     Fill false
     inside
     Above
Object
     Name y
     shape circle
     size medium
     Fill false
     inside     pointer to x
     Above
Object
     Name z
     shape circle
     size small
     Fill true
     inside
     Above     pointer to y

08 - Learning By Recording

Is the first step in analogical reasoning which is at the core process of cognition. Sometimes it is simply the best guess best on previous learnings.

Suppose your given a square (ie a new problem). Your first instinct would be to compare it to what's in your memory. You would retrieve the most similar problem from memory. Then you'd apply the solution to the problem from memory to the new problem.

What is "most similar"? One method might be using frames. However if you used distances you would be on the verge of a nearest neighbour approach: which is using the Euclidean distance between points. In the real world however things are much more difficult

Suppose you were looking at a map of a city, and you have shiny new automated car. Unfortunately though your car only comes with a few preset navigation paths. Where you need to go represents a new problem. What do you do?

One method would be to map each preset route onto a 2D grid, and each preset destination onto a 2D grid. On each of these grids you would also place your start and end. Then minimizing the sum of error should yield the best result.

This leads to the Knn method

$$d = \sqrt{\sum_{i=1}^{k} (c_i - p_i)^2 } $$

Summary

This lesson cover the following topics:

  1. Memory is as important as Learning/Reasoning so that we can fetch the answer to similar cases encountered in the past and avoid having to redo the non-trivial task of learning and reasoning, thereby saving effort.

  2. A case is an encapsulation of a past experience that can be applied to a large number of similar situations in future. The similarity metric can be as simple as the Euclidean distance metric or a complex metric involving higher dimensions.

  3. kNN method is one method to find the most similar case from memory for a new problem

  4. In some cases, we need to adapt the cases from our memory to fit the requirements of the new problem. In some cases, we also need to store cases based on qualitative labels along with numeric labels to make the comparison applicable for particular situations.

  5. Learning by storing cases in memory has a very strong connection to Cognition since human cognition works in a similar manner by recording cases and applying them to new problems in real world by exploting the patterns of regularity in them.

09 - Case Based Reasoning

In case based reasoning an AI agent solves new problems by analogy to previously encountered problems. It builds on recording cases. Here it is similar but needs not be the same.

Similar to the previous unknown block problem. What if we encounter a new problem? It may be similar to pother blocks and it may not.

Let's revisit the map and the automation car with a limited preset memory.

Our new problem is not in the preset solutions

  1. Retrieve a case from memory
  2. Adapt it to the fit the current problem
  3. Evaluate how the adapted solution addresses the current problem
  4. Store the new problem + solution for future use

Notice how we've unified storage and learning!

Assumptions:

  1. There are patterns to problems
  2. Similar problems have similar solutions (In general but not always)

Adaptation: does not need to be exact. It simply needs to be close enough to be sufficient. This saves a good deal of resources. So in our map problem we can take a preset route ... and by adding a bit we adapt it to get to our desired destination.

Adaptation by recursion: Suppose we want to get from our home to a restaurant. If we had a preset route from home to work and from work to the restaurant. Then the two cases can be put together to formulate a final solution.

Adaptations by Rules: Rules are a type of heuristic, a rule of thumb. So now that we know how to get from home to restaurant, we can flip to get from restaurant to home.

Case evaluation: What if our heuristic solution fails? We may have used one way roads?

Case storage: It's only by accumulating and storing data that we can build upon our learning

By Indexing: Could be as simple as the co-ordinates of start and end points. these are basically just tags to identify cases and make searching easy, efficient, and effective.

Using Discrimination Tree: Are basically decision trees. A series of nodes (decisions) that need to be made. All together they represent the learning process. They can be binary (yes-no) or more complex.

10 Incremental Concept learning

Purpose: Build upon case based learning by focusing on the abstraction of concept from the case based examples. Variabilization, Specialization, and Generalization are how we abstract the concept.

Suppose you have a definition and some problem. You would try to infer from the definition whether the problem fits it. If a bacon lettuce tomato between sliced bread is a sandwich then is a hot dog a sandwich? How we answer depends greatly on the variables/parameters we feel are necessary to the sandwich solution as well as how far the problem is in comparison. Would BLT in between concrete bricks be a sandwich? Also note that 2 different people may deduce different cases from the BLT sandwich, ie their background knowledge is different.

In general AI agents as well as people learn on a case by case basis. This is generally performed in a supervised manner where both pos & neg re-enforcements are provided.

In a nutshell

  1. Learning is on a case-by-case basis
  2. Cases are labelled (positive vs negative)
  3. Cases are ordered: This may lead to incremental changes to a concept
  4. Differs from case based where all cases are in memory. Here the number of cases are unknown.
  5. Number of cases is generally pretty small
  6. Generalizing: We must learn what to look for

For each case an AI agent will either generalize or specialize. Positive case not encountered previously will improve our generalization, whereas neg examples will lead to a specialization to exclude such cases.

In each iterative case what is learned must be incorporated into the learned case. Incorporating background knowledge into the definition involves a climb tree heuristic. In our previous BLT example this could be say edibleness? or it could be bread. A blt on rye, ciabatta, or bun. Any form of bread would still consititute a sandwich.

Heuristics for Concept Learning

How do we specialise and generalize? We look for the following heurisitcs

  • Require-Link must be present to be a positive example of a concept
  • Forbid-Link must be absent to be a positive example of a concept
  • Drop-Link is not necessary to be a positive example
  • Enlarge-Set Multiple objects or links may fit one role in the concept. Expand the range of values that fit a concept
  • Climb-Tree generalize over multiple objects in the same role based on knowledge
  • Close-Interval Expand range of values to be a positive example of the concept

11 Classification*

Overview: Learning Concepts; Equivalence classes; Concept hierarchies; types of concepts; Bottom-up search
Definition: Mapping sets of precepts in the world into equality classes, for the purpose of actions.

Imagine that we have a set of precepts (a general rule intended to regulate behavior or thought): Has wings? Has feathers etc. We assume for simplicity that they have a binary result. Depending on the precept and their combinations there may be many actions possible.

If the number of actions is $2^m$ and the number of precept combinations is $2^n$. then just 10 precepts(n) leads to 1024 combinations. This number can get very large very quickly and a computer would run out of resources.

Suppose we wanted to create a classification of BIRD.

12 Logic*

13 Planning*

14 Understanding

Recall: Frames -> Understanding -> Commonsense Reasoning -> Scripts

Understanding

  • Thematic Role System
  • Resolving ambiguity
  • Applying constraints

Consider: Ashok made pancakes for David with a griddle

Frame:
    Verb: make
    Agent: Ashok
    Beneficiary: David
    Thematic Object: pancakes
    Instrument: Griddle

Notice that in building the frame we used a top down approach. Beginning with the verb, then moving to both the agent of the verb and the beneficiary of the verb, then the outcome of the verb, and finally the tool of the verb

How do we resolve ambiguous words in a sentence: An idea hit me vs A ball hit me use hit in vastly different ways.

Thematic Role frame Categories: Verb, Agent, CoAgent, Destination, conveyance.
Are generally derived from Prepositions with Semantic Roles

PrepositionThematic Role
ByAgent, Conveyance, location
Forbeneficiary, duration
Fromsource
Todestination
Withco-agent, instrument

In AI Ontology is a conceptualization of the world. Example

Things
-> Agents
    -> People
        -> Ashok
        -> David
-> Objects
    -> Conveyances
        -> Car
        -> Train
-> Locations
    -> Park
    -> Statue

Resolving in ambiguity in words: It's hard to explain things to kleptomaniacs as they always take things literally
In this case each meaning might have it's own frame like representation

15 Commonsense Reasoning

  • Primitive Actions
  • Actions and subactions
  • State changes

Context can be used to distinguish between different understandings. But also different sentences can have the same meaning. Equivalence can be described as the specification of a primitive action. So for example Ahok ate a frog, Ashok consumed a frog, Ashok ingested a frog all mean the same thing. The verb is different in each but the underlying idea is the same. This underlying idea is the Primitive Action.

Consider the following list (Ontology) of Primitve Actions: Move-Body-Part, Expel, Propel, See, Smell, Move-Possession, Think-about, Move-Object, Ingest, Speak, Hear, Feel, Move-Concept, Conclude

These may not be complete, they're intent is to illustrate. So for Ashok we may use "ingested" in both sentences.

When building a frame the primitive is the verb enacted by the agent, subject.
If the primitive is missing then it must be implied. Ex: John fertilized the field => John put fertilizer on the field.

Ashok put the wedge on the block:

16 Scripts

Scripts are the culmination of Frames and common sense reasoning.
Common Sense: Frames -> Understanding -> Reasoning -> Scripts

Consider the sentence: Ashok wanted to become rich, he got a gun.
Some may say this makes sense? Maybe Ashok robbed a bank or held someone up. In either case background inference was used to imply a context which the sentence didn't give.

Stories help you make sense of the world.

Imagine you went to a coffee house. You know exactly what to do. It doesn't matter which coffee house you walk into, your actions will be the same. You'll get in line, you'll give your order, you'll pay for it, you'll wait for the order to be completed. You're basically following a script.

A causally coherent set of events
Causally: Each event sets off, or causes, another
Coherent: The causal connections between events make sense
Events: The parts are actions or scenes in the world

Parts of a script

  • Entry conditions: Conditions necessary to execute the script
  • Result: Conditions that will be true after the script has taken place
  • Props: Objects involved in the execution of the script
  • Roles: Agents involved in the execution of the script
  • Track: Variations or subclasses of the particular script
  • Scenes: The sequence of events that occurs during execution of the script

Scripts are often represented using a frame and should capture the knowledge representations. These frames should define the various action frames. Several of the action frames can be considered a scene when they form a sequence of action frames.

To learn a script an agent uses

  • Semantic networks
  • Frames
  • Incremental Concept Learning
  • Planning
  • Common sense Reasoning: gives the agent a language to learn the script

To using a script an agent might use

  • Problem Reduction: Breaking a scene down into multiple expectations
  • Classification: The type of the script to be executed
  • Logic: a plan that can be executed
  • Understanding: How to disambiguate

17 Explanation Based Learning

Here the agent learns about connecting concepts. Concept Space, Abstraction, Analogical Transfer.

Imagine you needed to transport soup. You have the options: Backpack, Pitcher, Box, Car. Which would you use? A human knows that a pitcher would be best but how would an agent make that connection?

What sort of prior knowledge should an AI Agent have to make the connection that the pitcher is the best utensil for the task of transporting soup? An AI Agent needs some understanding of causal relationships. So for example it might know that a pitcher carries water.

Object enables Drinking
because
    Object carries liquids because it is concave
    Object is liftable because it is light

All together these define the characterisitcs of the concept cup.

  • Problem reduction: It must reduce an object to a set of characteristics
  • Planning:

Imagine your given the following info:

  • A mug is an object that is stable, enables drinking, and protects against heat
  • A Pot carries liquids because it has a concavity. It limits heat transfer because it has thick sides and is made of clay.

Asked: This object is light and made of clay. It has concavity and a handle. The bottom is flat, and the sides are thick

Is this object a mug?

Given the Mug description: There are 3 conditions: Stability, Drinking, and the protection against
Similarly the pot description gives the conditions: Concavity, limits heat transfer, thick sides, made of clay.

Analogical Reasoning

Understanding new problems in terms of familiar problems. Addressing new problems by transfering knowledge from previous problems. Similarity via relationships, and/or objects. Recall the K-nearest neighbour example of the driving agent.

Consider: There's a patient with a tumour, and a doc with a laser gun. The laser gun will kill the tumour, but will also kill all cells around the tumour. What should the doctor do?

Consider the idea of similarity as a spectrum. On the one end the target case and the source case are highly similar, on the other end there is a large difference between the two. You can think of this as a matrix like illustration.

More Similar
RelationsObjectsFeaturesValues
SimilarSimilarSimilarSimilar
SimilarSimilarSimilardissimilar
SimilarSimilardissimilardissimilar
Similardissimilardissimilardissimilar
Less similar

Transferring Knowledge from familiar problems requires:

  • Retrieval
  • Mapping
  • Transfer
  • Evaluation
  • Storage

Recall that case based reasoning is very similar, instead of Mapping & transfer it used adaptation. Another large difference between analogical reasoning and case based is the domain. In analogical reasoning they do not have to be the same. Analogical differences focus on the objects, relationships, features and value similarities.

Superficial Similarity: Features, counts, objects (Unary Relationships)
Deep Similarity: Relationships between objects, Relationships between relationships (tertiary Relationships)

Types of Similarity (measures)

  • Semantic: Conceptual similarity between the target problem and the source case
  • Pragmatic: Similarity of external factors, such as goals
  • Structural: Similarity between representational structures
In [ ]: