Title: Flexible Reasoning with Functional Models
1Flexible Reasoning with Functional Models
J. William Murdock Intelligent Decision Aids
Group Navy Center for Applied Research in
Artificial Intelligence Naval Research
Laboratory, Code 5515 Washington, DC
20375 bill_at_murdocks.org http//bill.murdocks.org
Presentation at Ohio State University April 15,
2003
2General Motivation
- Complex dynamic environments demand quick and
flexible behavior. - Specialized software is quick but not flexible.
- Generative planning, reinforcement learning, etc.
are very flexible but very slow. - Functional models provide the power of
specialized software and the flexibility of AI.
3Specific Objectives (Outline)
- Retrospective adaptation
- A system encounters a new constraint during
execution - It uses a model of itself to redesign itself.
- Proactive adaptation
- A system is told to perform a new, unknown task.
- It must redesign itself before it can do an
execution. - Models for existing, similar tasks may be
adapted. - Or new models may be built from scratch.
- Self-explanation
- A system uses models of its reasoning process and
products to explain itself and justify its
results. - Explanation of threats
- A system has a model of enemy behavior.
- Uses that model to explain a potential threat and
help a user decide whether that that threat is
genuine.
4TMK (Task-Method-Knowledge)
- TMK models encode knowledge about a process
(e.g., a computer program, a military activity). - TMK encodes
- Tasks functional specification / requirements
and results - Methods behavioral specification / composition
and control - Knowledge Domain concepts and relations
5Partial History of TMK
Key Influences
Functional Representation (Sembugamoorthy
Chandrasekaran 1986)
Generic Tasks (Chandrasekaran 1986)
OSU
SBF Models (Goel, Bhatta, Stroulia 1997)
ZD (Liver and Allemang 1995)
TMK Projects
Autognostic Failure-driven learning (Stroulia
Goel 1995)
...
Interactive Kritik Self-Explanation (Goel
Murdock 1996)
GT
SIRRINE Retrospective Adaptation (Murdock Goel
2001)
REM Proactive Adaptation (Murdock 2001)
ToRQUE Scientific Cognition (Griffith 1999)
AHEAD Explanation of Threats (Murdock, Aha,
Breslow 2003)
NRL
DiscoveryMachine
6SIRRINERetrospective Adaptation
- Self-Improving Reflective Reasoner Integrating
Noteworthy Experience - A shell for adaptive software systems.
- Systems encoded in SIRRINE contain a TMK model of
themselves - Used to automate adaptation in response to new
constraints for a known task.
7SIRRINE Functional Architecture
Model
8Meeting Scheduling Agent
- Example agent which schedules a regular weekly
meeting. - Given a length of time and a list of schedules,
it produces a time slot that fits into those
schedules. - It has a set of time constraints which require
that meetings be held from 9AM to 5PM on Monday
through Friday.
9Diagrams of TMK Models
10Model Animation
11Example Problem
- Research group needs to schedule a 90 minute
meeting. There are no available 90 minute slots
between 9AM and 5PM on Mondays through Fridays. - The agent fails for this problem. Feedback is
given stating that the meeting should be held on
Tuesdays from 430PM to 600PM. - Credit assignment process identifies the
find-next-slot task as one which could have
produced the desired result. - Modification process alters that task.
12Knowledge forCredit Assignment
- Feedback State what the overall results should
have been. - Trace State what the results actually were also
used to localize failure - Models indicate differences between what the
results should have been and what they were
drive the modification process
13Trace
14Credit Assignment Process
- Heuristics guide search through trace
- Causal proximity temporally closest to end first
- Functional abstraction most abstract first
- Model used at each step of the search
- When a potential contradiction is found, a
particular type of credit is assigned - task-does-not-produce-value, method-does-not-produ
ce-value, primitive-generates-invalid-state,
primitive-fails - Result Localization of credit
15Modification
- Library of modification strategies indexed by the
type of credit assigned and characteristics of
the task or method - In the example
- Type of credit task-does-not-produce-value
- Localized to the find-next-slot task (a
primitive task implemented by a LISP procedure) - SIRRINE selects the fixed value production by
task decomposition strategy.
16Fixed Value Productionby Task Decomposition
- Existing task is divided into two methods a base
method and an alternate method. - The base method invokes a single task whose
behavior is identical to the existing task. - The alternate method invokes a new task
- Primitive that produces a single fixed value
- Example 430PM to 600PM on Tuesdays
- Applicability conditions on the alternate method
require that it be invoked only in the same
situation. - Same defined by bindings in the trace that are
referenced in the model of the existing task.
17Model Zoom
18Relevant Portions of the Model
19Modification to the Model
20ExampleWeb Browsing Agent
- A mock-up of web browsing software
- Based on Mosaic for X Windows, version 2.4
- Imitates not only behavior but also internal
process and information of Mosaic 2.4
ps
???
html
pdf
txt
21Example PDF Viewer
- The web agent is asked to browse the URL for a
PDF file. - Mosaic 2.4 not have any information about
external viewers for PDF. - The system cannot display the file.
- The user provides feedback indicating the command
for the correct viewer. - Adaptation Strategy Fixed Value Production by
Primitive Modification
22SIRRINE User Interface
23REM Proactive Adaptation
- Reflective Evolutionary Mind
- Like SIRRINE, REM is a shell for adaptive
software systems using TMK models. - Unlike SIRRINE, REM is able to address new tasks.
- It can retrieve and adapt methods for known
tasks, or it can build new methods from scratch. - Off-the-shelf generative planning and
reinforcement learning techniques are used to
build new methods
24REM Functional Architecture
Model
25Task-Method-Knowledge Language (TMKL)
- A new, powerful formalism of TMK developed for
REM. - Uses LOOM, a popular off-the-shelf knowledge
representation framework concepts, relations,
etc.
REM models not only the tasks of the domain but
also itself in TMKL.
26Sample TMKL Task
- (define-task communicate-with-www-server
- input (input-url)
- output (server-reply)
- makes
- (and
- (document-at-location (value server-reply)
- (value
input-url)) - (document-at-location (value server-reply)
-
local-host)) - by-mmethod (communicate-with-server-method))
27Sample TMKL Method
- (define-mmethod external-display
- provided (not (internal-display-tag (value
server-tag))) - series (select-display-command
- compile-display-command
- execute-display-command))
28Decision Making in REM Q-Learning
- Popular, simple form of reinforcement learning.
- In each state, each possible decision is assigned
an estimate of its potential value (Q). - For each decision, preference is given to higher
Q values. - Each decision is reinforced, i.e., its Q value
is altered based on the results of the actions. - These results include actual success or failure
and the Q values of next available decisions.
29Q-Learning in REM
- Decisions are made for method selection and for
selecting new transitions within a method. - A decision state is a point in the reasoning
(i.e., task, method) plus a set of all decisions
which have been made in the past. - Initial Q values are set to 0.
- Decides on option with highest Q value or
randomly selects option with probabilities
weighted by Q value (configurable). - A decision receives positive reinforcement when
it leads immediately (without any other
decisions) to the success of the overall task.
30ExampleDisassembly and Assembly
- Software agent for disassembly operating in the
domain of cameras - Information about cameras
- Information about relevant actions
- e.g., pulling, unscrewing, etc.
- Information about the disassembly process
- e.g., decide how to disconnect subsystems from
each other and then decide how to disassemble
those subsystems separately. - Agent now needs to assemble a camera
31Adaptation UsingRelation Mapping
- Requires a model for an existing agent which has
a task similar to the desired task. - e.g., disassembly is similar to assembly
- Effects (makes slot) of the two tasks must match
except for one term, and that one term must be
connected by a single relation. - e.g., disassembly produces a disassembled state
- assembly produces an assembled state
- (inverse-of disassembled assembled) is known.
- Uses the relation to alter tasks and methods
32Pieces of ADDAM which are key to Disassembly ?
Assembly
Disassemble
Plan Then Execute Disassembly
Adapt Disassembly Plan
Execute Plan
Hierarchical Plan Execution
Topology Based Plan Adaptation
Make Plan Hierarchy
Map Dependencies
Select Next Action
Execute Action
Select Dependency
Assert Dependency
Make Equivalent Plan Nodes Method
Make Equivalent Plan Node
Add Equivalent Plan Node
33New Adapted Task inDisassembly ? Assembly
Assemble
COPIED Plan Then Execute Disassembly
COPIED Adapt Disassembly Plan
COPIED Execute Plan
COPIED Hierarchical Plan Execution
COPIED Topology Based Plan Adaptation
COPIED Make Plan Hierarchy
COPIED Map Dependencies
Select Next Action
INSERTED Inversion Task 2
Execute Action
COPIED Select Dependency
INVERTED Assert Dependency
COPIED Make Equivalent Plan Nodes Method
COPIED Add Equivalent Plan Node
INSERTED Inversion Task 1
COPIED Make Equivalent Plan Node
34Task Assert Dependency
- Before
- define-task Assert-Dependency
- input target-before-node, target-after-node
- asserts (node-precedes (value
target-before-node) - (value target-after-node))
- After
- define-task Mapped-Assert-Dependency
- input target-before-node, target-after-node
- asserts (node-follows (value
target-before-node) - (value target-after-node)))
35Task Make Equivalent Plan Node
- define-task make-equivalent-plan-node
- input base-plan-node, parent-plan-node,
equivalent-topology-node - output equivalent-plan-node
- makes (and
- (plan-node-parent (value
equivalent-plan-node) -
(value parent-plan-node)) - (plan-node-object (value
equivalent-plan-node) -
(value equivalent-topology-node)) - (implies (plan-action (value
base-plan-node)) - (type-of-action
(value equivalent-plan-node) -
(type-of-action (value base-plan-node))))) - by procedure ...
36TaskInverted-Reversal-Task
- define-task inserted-reversal-task
- input equivalent-plan-node
- asserts (type-of-action
- (value equivalent-plan-node)
- (inverse-of
- (type-of-action
- (value
equivalent-plan-node))))
37Adaptation UsingGenerative Planning
- Does not require a pre-existing model
- Requires operators and a set of facts (initial
state) - Invokes Graphplan
- Operators Those primitive tasks known to the
agent which can be translated into Graphplans
operator language - Facts Known assertions which involve relations
referred to by the operators - Goal Makes condition of main task
- Translates plan into more general method by
turning specific objects into parameters
propagating - Stores method for later reuse
38Adaptation UsingSituated Learning
- Does not require a pre-existing model
- Does not even require preconditions and
postconditions of the operators - Creates a method that
- Performs any action
- Checks whether the desired state is achieved
- If not, loops to the start.
- During execution, all decision making is done
using Q-learning policy. - Over time, the Q-learning mechanism selects
actions that tend to lead to desirable results.
39ADDAM Example Layered Roof
40Roof Assembly
Situated Learning
Generative Planning
Relation Mapping
41Modified Roof Assembly No Conflicting Goals
Situated Learning
Relation Mapping
Generative Planning
42Combining Proactive Retrospective Adaptation in
REM
- Proactive adaptation techniques have been the
primary focus of REM - However, REM also has facilities for
retrospective adaptation - inherited from SIRRINE
- REM can use SIRRINE-style analysis of traces to
localize an opportunity for adaptation to a
particular subtask. - It can then use a proactive technique to build a
new method for that subtask.
43Explanation
- As I have discussed, TMK models are useful for
automated adaptation. - This implies that they encode important knowledge
about processes. - This suggests that TMK may be an effective
mechanism for explaining processes to human
users. - Some TMK research has investigated this idea.
44Interactive KritikSelf-Explanation
- Objective Interactive explanation and
justification for conceptual design of physical
devices - Input Functional specification for a device
- Output Model of a device that meets the
specification and a graphical explanation of how
the device was designed - Knowledge Library of functional models of
devices and a graphical model of the design
process - Reasoning Kritik2 (Goel, Bhatta, Stroulia,
1997) performs case-based design. Interactive
Kritik adds graphical presentation of the
reasoning process and product.
45Part of a behavior of an acid cooler
Water at 25º
Heated to 50º
By clicking on the transition, a user can jump to
the part of the acid cooling behavior that is
enabled by the heating of the water
46That task is accomplished by a reasoning method.
The top level task of Interactive Kritik is
design.
The method decomposes the task into subtasks.
Some subtasks have methods that further decompose
them.
47AHEADExplanation of Threats
- Analogical Hypothesis Elaborator for Activity
Detection - Objective Helping intelligence analysts
understand and trust hypotheses about detected
hostile activity - e.g., organized crime, terrorism
- Input Hypothesis about hostile activity
related evidence. - Output Arguments for and/or against the
hypothesis. - Knowledge TMK models encode how hostile actions
are performed and what they are intended to
accomplish. - Reasoning First, MAC/FAC (Forbus Gentner 1991)
maps the hypothesis to a TMK model. Then, TMK
simulation guides analysis of hypotheses using
evidence.
48AHEAD Functional Architecture
FIRE Analogy Server
Link Discovery Tools
Hypothesis/Model Mapping
TMK Models (Qualitative, Functional)
Trace Extractor
Evidence Extraction Tools, Existing
Knowledge-Bases
Model Trace
TIA, Assorted EELD Tools, etc.
Argument Generator
GUI
49AHEAD User Interface
Statement of the hypothesis (input)
Red and black icons indicate qualitative
certainty for arguments and evidence
Arguments against the hypothesis have missing or
contradictory evidence
Arguments for the hypothesis are backed by
evidence
Hyperlinks to original sources for evidence.
A key allows users to quickly see what each icon
means.
50Preliminary User Study
- Partial implementation handmade output files.
- Tested the interface and content of AHEAD.
- In some trials, users were given hypothesis
evidence - i.e., inputs to AHEAD
- In other trials, users also given arguments for
and arguments against. - Users with arguments showed better performance.
- Difference in error in judgment statistically
significant.
Metric WithArgument WithoutArgument
Elapsed Time 518 555
Confidence 7.40 6.86
Error in judgment 1.83 3.01
Error in confidence 1.70 2.26
51Summary
- Retrospective adaptation SIRRINE
- Encounters a constraint during execution
- Uses trace to find a candidate for modification
- Uses model to perform modification
- Experiments in meeting scheduling and web
browsing (etc.) - Proactive adaptation REM
- User requests a new task
- REM retrieves similar task and adapts the method
for that task - Or REM uses Graphplan or Q-learning to build a
new method - Can also use these techniques retrospectively on
subtasks - Self-explanation Interactive Kritik
- Presentation of design process and product using
models - Explanation of threats AHEAD
- Models ? traces ? arguments for and arguments
against hypotheses. - Arguments help analysts understand and trust
hypotheses.
52Backup Slides
53SIRRINE
54Model Knowledge
55Model Tasks and Methods
56Model
57Tasks and Methodsof Web Agent
Process URL
Process URL Method
Communicate with WWW Server
Display File
Communicate with WWW Server Method
Display File Method
Request from Server
Receive from Server
Interpret Reply
Display Interpreted File
External Display
Internal Display
Execute Internal Display
Select Display Command
Compile Display Command
Execute Display Command
58Web Agent Adaptation
...
External Display
Select Display Command
Compile Display Command
Execute Display Command
...
External Display
Compile Display Command
Execute Display Command
Select Display Command
Select Display Command Base Method
Select Display Command Alternate Method
Select Display Command Base Task
Select Display Command Alternate Task
59REM/TMKL
60Tasks in TMKL
- All tasks can have input output parameter lists
and given makes conditions. - A non-primitive task must have one or more
methods which accomplishes it. - A primitive task must include one or more of the
following source code, a logical assertion, a
specified output value. - Unimplemented tasks have neither of these.
61TMKL Task
- (define-task communicate-with-www-server
- input (input-url)
- output (server-reply)
- makes
- (and
- (document-at-location (value server-reply)
- (value
input-url)) - (document-at-location (value server-reply)
-
local-host)) - by-mmethod (communicate-with-server-method))
62Methods in TMKL
- Methods have provided and additional result
conditions which specify incidental requirements
and results. - In addition, a method specifies a start
transition for its processing control. - Each transition specifies requirements for using
it and a new state that it goes to. - Each state has a task and a set of outgoing
transitions.
63Simple TMKL Method
- (define-mmethod external-display
- provided (not (internal-display-tag (value
server-tag))) - series (select-display-command
- compile-display-command
- execute-display-command))
64Complex TMKL Method
- (define-mmethod make-plan-node-children-mmethod
- series (select-child-plan-node
- make-subplan-hierarchy
- add-plan-mappings
- set-plan-node-children))
- (tell (transitiongtlinks make-plan-node-children-mm
ethod-t3 - equivalent-plan-nodes
- child-equivalent-plan-nod
es) - (transitiongtnext make-plan-node-children-mm
ethod-t5 - make-plan-node-children-mm
ethod-s1) - (create make-plan-node-children-terminate
transition) - (reasoning-stategttransition
make-plan-node-children-mmethod-s1 -
make-plan-node-children-terminate) - (about make-plan-node-children-terminate
- (transitiongtprovided
- '(terminal-addam-value (value
child-plan-node)))))
65Knowledge in TMKL
- Foundation LOOM
- Concepts, instances, relations
- Concepts and relations are instances and can have
facts about them.
Knowledge representation in TMKL involves LOOM
some TMKL specific reflective concepts and
relations.
66Some TMKLKnowledge Modeling
- (defconcept location)
- (defconcept computer
- is-primitive location)
- (defconcept url
- is-primitive location
- roles (text))
- (defrelation text
- range string
- characteristics single-valued)
- (defrelation document-at-location
- domain reply
- range location)
- (tell (external-state-relation
- document-at-location))
67Sample Meta-Knowledge in TMKL
- relation characteristics
- single-valued/multiple-valued
- symmetric, commutative
- relations over relations
- external/internal
- state/definitional
- generic relations
- same-as
- instance-of
- inverse-of
- concepts involving concepts
- thing
- meta-concept
- concept
68Planning and REM
- REM is not a planning system, its an agent
environment. - Agents in REM dont just decide what to do, they
actually do things. - They may base their next action on the results of
past actions. - Once they have taken an action, they may not be
able to undo that action. - REM consists of two major modules execution of
agents and adaptation of agents. - However, research on REM has involved many
planning issues. - Agents in REM are represented as hierarchies of
tasks and methods thus execution of agents
resembles HTN planning. - One mechanism for adaptation of agents is
traditional generative planning. - Agents encoded in REM may perform planning.
- An agent in REM can act in a deterministic
logically-defined simulated environment such
agents blur the distinction between deciding what
to do and doing things.
69REM vs.Derivational Analogy
- REM adapts models of tasks and methods.
- Derivational analogy generally assumes some sort
of universal process (e.g., generative planning)
and only needs to represent and reason about key
decision points. - Advantage of derivational analogy Models not
needed traces alone enable reuse. - Advantage of REM Applicable to problems for
which a universal process is not appropriate
(e.g., 6 board roof example takes days using
planning Q-learning). - REM demands more knowledge but makes effective
use of that additional knowledge.
70REM andCase-Based Reasoning (CBR)
- Given a task, REM retrieves a method, applies it,
and then (if necessary) adapts it. This process
is a form of CBR. - Most CBR projects, however, adapt solutions not
processes. Some problems require the latter. - Adaptation of processes can enable extending the
efficiency benefits of CBR to problems which the
case library does not directly address.
71Recursion and Looping
72REM vs.Case-Based Adaptation
- REM reasons about and adapts an entire reasoning
process. - Case-based adaptation restricts adaptation to one
portion of a case-based process adaptation. - Being more focused is a substantial advantage for
case-based adaptation. - However, for problems which require adaptation of
different sorts of reasoning processes, it is
useful to have models of these processes, as in
REM.
73Q-Learning in REM
- Decisions are made for method selection and for
selecting new transitions within a method. - A decision state is a point in the reasoning
(i.e., task, method) plus a set of all decisions
which have been made in the past. - Initial Q values are set to 0.
- Decides on option with highest Q value or
randomly selects option with probabilities
weighted by Q value (configurable). - A decision receives positive reinforcement when
it leads immediately (without any other
decisions) to the success of the overall task.
74Monkey Bananas Tower of Hanoi Hybrid
75AHEAD
76Key Ideas for AHEAD
Objective Helping analysts understand and trust
hypotheses about detected hostile activity
Knowledge Functional models encode how hostile
actions are performed and what they are intended
to accomplish. Reasoning Analogy maps
hypotheses to models. Functional models guide
analysis of hypotheses in the context of
evidence. Product Structured arguments that
support and/or refute the given hypothesis.
77ReasoningFIRE Analogy Server
- Unified system for performing analogical
reasoning from Ken Forbus group at Northwestern
University. - SME Structure-Mapping Engine
- Produces a mapping between source and target
cases. - Evaluates similarity based on these mappings.
- Recommends candidate inferences, i.e., new
elements for the target that would be analogous
to elements in the source. - MAC/FAC Many are Called / Few are Chosen
- Searches a library of cases for those that match
a given target. - MAC step uses fast superficial matching to
identify many candidates. - FAC step uses SME for more precise matching.
- Additional related tools, e.g., a GUI knowledge
acquisition tool based on SME.
78Illustrative ExampleExtracted Trace
- The trace shows
- Steps in the model that were taken
- Values the parameters were bound to
- Pieces of evidence that support the steps and
bindings.
TMK Model
Evidence
Architecture
79AHEAD Functional Architecture Structured Argument
A hypothesis is a potential conclusion about what
happened in the world.
An argument against asserts that some part of the
relevant model was not performed.
An argument for is a asserts that some part of
the relevant model was performed.
Hypothesis
...
...
Argument For
Argument Against
Argument Against
Argument For
Other argument against simply indicate a lack of
evidence.
Evidence
Evidence
Evidence
Some arguments against have explicit links to
evidence that supports them.
All arguments for are supported by references to
the original evidence.
Dashed lines in this figure indicate a connection
plus a qualitative confidence level.
80Other
81Comparison
Autognostic SIRRINE REM
Why To repair agents which fail to address the task for which they were designed To add new capabilities to an agent. To add new capabilities to an agent.
What Modifications to the model Modifications to the model and addition and modification of primitive computations Modifications to the model and addition and modification of primitive computations
How Collection of strategies which make specific types of changes. Collection of strategies which make specific types of changes. Collection of strategies which make specific types of changes, plus generative planning and reinforcement learning.
When After execution After execution Before and after execution
82Bibliography
- Chandrasekaran, B. (1986). Generic tasks in
knowledge-based reasoning High-level building
blocks for expert systems design. IEEE Expert
13, 23-30. - Gentner, D. Forbus, K. (1991). MAC/FAC A model
of similarity-based retrieval. Proceedings of the
Thirteenth Annual Conference of the Cognitive
Science Society (pp. 504-509). Chicago, IL
Lawrence Earlbaum. - Goel, A.K., Bhatta, S., Stroulia, E. (1997).
Kritik An Early Case-Based Design System. In
Maher, M. and Pu, P. (Eds.) Issues and
Applications of Case-Based Reasoning in Design
(pp. 87-123), Mahwah, NJ Erlbaum. - Goel, A.K. Murdock, J.W. (1996). Meta-Cases
Explaining Case-Based Reasoning. Proceedings of
the Third European Workshop on Case-Based
Reasoning. Lausanne, Switzerland Springer. - Griffith, T.W. (1999). A computational theory of
generative modeling in scientific reasoning. PhD
Thesis. College of Computing, Georgia Institute
of Technology. - Liver, B. Allemang, D. (1995). A functional
representation for software design. International
Journal of Software Engineering and Knowledge
Engineering, 52, 227-269. - Murdock, J.W. (2001). Self-Improvement through
Self-Understanding Model-Based Reflection for
Agent Adaptation. PhD Thesis. College of
Computing, Georgia Institute of Technology. - Murdock, J.W., Aha, D.W., Breslow, L.A. (2003).
Case-based argumentation via process models. To
appear in Proceedings of the Fifteenth
International Conference of the Florida
Artificial Intelligence Research Society. St.
Augustine, FL AAAI Press. - Murdock, J.W. Goel, A.K. (2001). Learning about
Constraints by Reflection. Proceedings of the
Fourteenth Canadian Conference on Artificial
Intelligence (AI'01), Ottawa, Ontario - Sembugamoorthy, V. Chandrasekaran, B. (1986).
Functional representation of devices and
compilation of diagnostic problem-solving
systems. In J. Kolodner C. Reisbeck (Eds.)
Experience, Memory, and Learning (pp. 47-73).
Mahwah, NJ Erlbaum 1986. - Stroulia, E., Goel, A.K. (1995). Functional
representation and reasoning in reflective
systems. Applied Intelligence, 9, 101-124.