Cognitive Tutors: Bringing advanced cognitive research to the
Shared by: HC120929045439
-
Stats
- views:
- 0
- posted:
- 9/28/2012
- language:
- English
- pages:
- 54
Document Sample


Cognitive Modeling 1: Production
Systems and Knowledge Representation
Lecture 4
Associated reading: Anderson, J. R. 1993. Rules of
the Mind, Ch. 1-2. Hillsdale, NJ: Erlbaum
Intelligent Tutoring Systems and
Cognitive Modeling
Slides Originally From Ken
Koedinger & Vincent Aleven
Rules are in TDK and not JESS 1
Brainstorming
Possible Domains of Interest for
Final Project:
2
Overview
• ACT-R theory
– Features of production rules and their
predictions about learning
• How Production Systems Work
– A Simple Example
– ACT-R Addition Example
• Production System Notation
– Working memory “chunks”
– Production rule notation
• Preview homework
3
ACT-R Theory
• Key Claim of Rules of the Mind:
“Cognitive skills are realized by
production rules”
• What does this mean?
What predictions does it make about
learning?
How does it help explain learning
phenomena?
4
Main claims of ACT-R
1 There are two long-term memory
stores, declarative memory and
procedural memory.
2 The basic units in declarative memory
are chunks.
3 The basic units in procedural memory
are production rules.
5
Declarative-Procedural
Distinction
• Declarative knowledge
– Includes factual knowledge that people can report or
describe, but can be non-verbal
– Stores inputs of perception & includes visual memory
– Is processed & transformed by procedural knowledge
– Thus, it can be used flexibly, in multiple ways
• Procedural knowledge
– Is only manifest in people’s behavior, not open to
inspection, cannot be directly verbalized
– Is processed & transformed by fixed processes of the
cognitive architecture
– It is more specialized & efficient
6
Intuition for difference between
declarative & procedural rules
• Although the rules for writing music (such as
allowable chord structures and sequences)
were often changed after a major composer
had become a great influence, the actual rules
by which composers shaped their compositions
were often only known to later followers.
When they first used them the composer was
not consciously restricting himself/herself to
the rules, but was rather using them
subconsciously, leaving the collecting of the
rules to later followers.
7
Production Rules Describe How People
Use Declarative Rules in their Thinking
Declarative rule: Production rules describe thinking patterns:
Side-side-side theorem Special condition to aid search
IF the 3 corresponding sides IF two triangles share a side AND
of two triangles are the other 2 corresponding sides are
congruent ()
THEN the triangles are congruent ()
THEN
the triangles are
Using rule backward
IF goal: prove triangles AND
2 sets of corresponding sides are
THEN subgoal: prove 3rd set of sides
Using rule heuristically
IF two triangles look
THEN try to prove any of the corresponding
sides & angles
8
4 Critical Features of
Production Rules
• Modular
– Performance knowledge is learned in
“pieces”
• Goal & context sensitive
– Performance knowledge is tied to particular
goals & contexts by the “if-part”
• Abstract
– Productions apply in multiple situations
• Condition-Action Asymmetric
– Productions work in one direction
9
Features 1 & 2 of ACT-R
Production Rules
1. Modularity
– production rules are the units by which a
complex skill is acquired
– empirical evidence: data from the Lisp tutor
2. Abstract character
– each production rule covers a range of
situations, not a single situation
– variables in the left-hand side of the rule
can match different working memory
elements
10
Student Performance As They
Practice with the LISP Tutor
11
Production Rule Analysis
0.5
Evidence for Production Rule as an
0.4 appropriate unit of knowledge acquisition
Error Rate
0.3
0.2
0.1
0.0
0 2 4 6 8 10 12 14
Opportunity to Apply Rule (Required Exercises)
12
Production
Rule Analysis
“Cleans Up”
A surface level model
does not explain/clarify
learning process.
Production rule model
does.
0.5
Learning? 0.4
Error Rate
0.3
0.2
Yes! At the
production 0.1
rule level. 0.0
0 2 4 6 8 10 12 14
Opportunity to Apply Rule (Required Exercises)
13
Features 3 & 4 of ACT-R
Production Rules
3. Goal structuring
– productions often include goals among their
conditions - a new production rule must be
learned when the same action is done for a
different purpose
– abstract character means that productions
capture a range of generalization, goal
structuring means that the range is restricted
to specific goals
4. Condition-action asymmetry
– For example, skill at writing Lisp code does
not transfer (fully) to skill at evaluating Lisp
code. 14
Production rules have limited generality --
depending on purpose & context of
acquisition
Overly general
IF “Num1 + Num2” appears in an
expression Leads to order of operations error:
THEN “x * 3 + 4” is rewritten as “x * 7”
replace it with the sum
Overly specific
IF “ax + bx” appears in an expression
and c = a + b Works for “2x + 3x” but not for “x + 3x”
THEN
replace it with “cx”
Not explicitly taught
IF you want to find Unknown and the
final result is Known-Result and the In “3x + 48 = 63”:
last step was to apply Last-Op to 63
Last-Num, - 48
THEN -----
Work backwards by inverting Last- 15 / 3 = 5 (no use of equations!)
Op and applying it to Known-Result
and Last-Num
15
Production Rule Asymmetry Example
Declarative rule: Production rules describe thinking patterns:
Side-side-side theorem Special condition to aid search
IF the 3 corresponding sides IF two triangles share a side AND
of two triangles are the other 2 corresponding sides are
congruent ()
THEN the triangles are congruent ()
THEN
the triangles are
Using rule backward
Forward use of IF goal: prove triangles AND
declarative rule 2 sets of corresponding sides are
THEN subgoal: prove 3rd set of sides
Backward uses of
declarative rule
Using rule heuristically
Productions are learned IF two triangles look
independently, so a student THEN try to prove any of the corresponding
might be only able to use a rule sides & angles
in the forward direction.
16
The chunk in declarative
memory
1 Limited size
2 Configural structure
-> different parts of have different roles
3 Hierarchically organized
-> chunks can have subchunks
17
Declarative Knowledge
Terms
• Declarative Knowledge
– Is the “Working Memory” of a production
system
• A “chunk” is an element of declarative
knowledge
– Also called “working memory element” or
“wme” (pronounced “wimee”)
– Chunks or wme’s are made up of pairs of
“slots” and “values”
18
Summary
• Features of cognition explained by
ACT-R production rules:
– Procedural knowledge:
• modular, limited generality, goal structured,
asymmetric
– Declarative knowledge:
• flexible, verbal or visual, less efficient
19
Multiple Uses of Cognitive
Model
• Summarizes results of analysis of data
on student thinking
• Is the “intelligence” in the tutor
• Most importantly, provides guidance for
all aspects of tutor development
– Interface, tutorial assistance, problem
selection and curriculum sequencing
20
Overview
• ACT-R theory
– Features of production rules and their
predictions about learning
• How Production Systems Work
– A Simple Example
– ACT-R Addition Example
• Production System Notation
– Working memory “chunks”
– Production rule notation
21
How Production Systems Fit
into Cognitive Tutors
• The main step in developing a Cognitive
Tutor is to develop a cognitive model.
– Decompose the skill to be taught into small
knowledge units.
– We use “production rules” to represent these
knowledge units.
• A production system combines:
– A set of if-then production rules that transform
data in working memory as directed by a
procedure called the interpreter.
22
Components of a Production
Rule System
• Working memory -- the database
• Production rule memory
• Interpreter
Repeats the following cycle:
– 1. Match
• Match “if-parts” of productions with working memory
• Collect all applicable production rules
– 2. Conflict resolution
• Select one of these productions to “fire”
– 3. Act
• “Fire” production by making changes to working
memory as indicated in “then-part”
23
An example production
system
• You want a program that can answer
questions and make inferences about
food items
• Like:
– What is purple and perishable?
– What is packed in small containers and
gives you a buzz?
– What is green and weighs 15 lbs?
24
A simple production rule system
making inferences about food
WORKING MEMORY (WM)
Initially WM = (green, weighs-15-lbs)
RULE MEMORY
P1. IF [weighs-15-lbs AND produce] THEN watermelon
P2. IF [perishable AND weighs-15-lbs] THEN turkey
P3. IF [refrigerated OR produce ]THEN perishable
P4 IF green THEN produce
P5. IF packed-in-small-container THEN delicacy
P6. IF [weighs-15-lbs AND inexpensive AND NOT perishable]
THEN staple
INTERPRETER
1. Find all productions whose condition parts are true
2. Deactivate productions that would add a duplicate symbol
3. Execute the lowest numbered production (or quit)
4. Repeat until there is no rule to execute
Adapted from the Handbook of AI, Vol I, pp. 191
First cycle of execution
WORKING MEMORY
WM = (green, weighs-15-lbs)
CYCLE 1
1. Productions whose condition parts are true: P1
2. No production would add duplicate symbol
3. Execute P1.
This gives: WM = (produce, green, weighs-15-lbs)
RULE MEMORY INTERPRETER
P1. IF green THEN produce 1. Find all productions whose
P2. IF packed-in-small-container condition parts are true
THEN delicacy 2. Deactivate productions that
P3. IF refrigerated OR produce would add a duplicate symbol
THEN perishable 3. Execute the lowest numbered
production (or quit)
P4. IF weighs-15-lbs AND inexpensive
AND NOT perishable 4. Repeat
THEN staple
P5. IF perishable AND weighs-15-lbs
THEN turkey
P6. IF weighs-15-lbs AND produce
THEN watermelon Adapted from the Handbook of AI, Vol I, pp. 191
Do This Yourself Before
Going On!
• Hand simulate the execution of the production
rule model.
• For each cycle, write down the following
information:
Activate rules:
Deactivate rules:
Execute rule:
WM = ( …. )
• What is in working memory when the
production rule model finishes?
• Are there any mistakes in the production
rules?
27
Cycle 2
WORKING MEMORY
WM = (produce, green, weighs-15-lbs)
CYCLE 2
1. Productions whose condition parts are true: P1, P3, P6
2. Production P1 would add duplicate symbol, so deactivate P1
3. Execute P3 because it is the lowest numbered production.
This gives: WM = (perishable, produce, green, weighs-15-lbs)
RULE MEMORY INTERPRETER
P1. IF green THEN produce 1. Find all productions whose
P2. IF packed-in-small-container condition parts are true
THEN delicacy 2. Deactivate productions that
P3. IF refrigerated OR produce would add a duplicate symbol
THEN perishable 3. Execute the lowest numbered
production (or quit)
P4. IF weighs-15-lbs AND inexpensive
AND NOT perishable 4. Repeat
THEN staple
P5. IF perishable AND weighs-15-lbs
THEN turkey
P6. IF weighs-15-lbs AND produce
THEN watermelon Adapted from the Handbook of AI, Vol I, pp. 191
Cycle 3
WORKING MEMORY
WM = (perishable, produce, green, weighs-15-lbs)
CYCLE 3
1. Productions whose condition parts are true: P1, P3, P5, P6
2. Productions P1 and P3 would add duplicate symbol, so deactivate P1 and P3
3. Execute P5. Incorrect rule!?
This gives: WM = (turkey, perishable, produce, green, weighs-15-lbs)
RULE MEMORY INTERPRETER
P1. IF green THEN produce 1. Find all productions whose
P2. IF packed-in-small-container condition parts are true
THEN delicacy 2. Deactivate productions that
P3. IF refrigerated OR produce would add a duplicate symbol
THEN perishable 3. Execute the lowest numbered
production (or quit)
P4. IF weighs-15-lbs AND inexpensive
AND NOT perishable 4. Repeat
THEN staple
P5. IF perishable AND weighs-15-lbs
THEN turkey
P6. IF weighs-15-lbs AND produce
THEN watermelon Adapted from the Handbook of AI, Vol I, pp. 191
Cycle 4
WORKING MEMORY
WM = (turkey, perishable, produce, green, weighs-15-lbs)
CYCLE 4
1. Productions whose condition parts are true: P1, P3, P5, P6
2. Productions P1, P3, P5 would add duplicate symbol, so deactivate them
3. Execute P6. This gives: WM = (watermelon, turkey, perishable, produce,
green, weighs-15-lbs)
RULE MEMORY INTERPRETER
P1. IF green THEN produce 1. Find all productions whose
P2. IF packed-in-small-container condition parts are true
THEN delicacy 2. Deactivate productions that
P3. IF refrigerated OR produce would add a duplicate symbol
THEN perishable 3. Execute the lowest numbered
production (or quit)
P4. IF weighs-15-lbs AND inexpensive
AND NOT perishable 4. Repeat
THEN staple
P5. IF perishable AND weighs-15-lbs
THEN turkey
P6. IF weighs-15-lbs AND produce
THEN watermelon Adapted from the Handbook of AI, Vol I, pp. 191
Cycle 5
WORKING MEMORY
WM = (watermelon, turkey, perishable, produce, green, weighs-15-lbs)
CYCLE 5
1. Productions whose condition parts are true: P1, P3, P5, P6
2. Productions P1, P3, P5, P6 would add duplicate symbol, so deactivate them
3. Quit.
RULE MEMORY INTERPRETER
P1. IF green THEN produce 1. Find all productions whose
P2. IF packed-in-small-container condition parts are true
THEN delicacy 2. Deactivate productions that
P3. IF refrigerated OR produce would add a duplicate symbol
THEN perishable 3. Execute the lowest numbered
production (or quit)
P4. IF weighs-15-lbs AND inexpensive
AND NOT perishable 4. Repeat
THEN staple
P5. IF perishable AND weighs-15-lbs
THEN turkey
P6. IF weighs-15-lbs AND produce
THEN watermelon Adapted from the Handbook of AI, Vol I, pp. 191
WM = (produce, green, weighs-15-lbs)
CYCLE 2
Cycles 2-5
1. Activate: P1, P3, P6
RULE MEMORY
2. Deactivate P1
P1. IF green THEN produce
3. Execute P3. WM= (perishable, produce, green,
P2. IF packed-in-small-
weighs-15-lbs)
container
THEN delicacy
CYCLE 3
1. Activate: P1, P3, P5, P6 Is this a P3. IF refrigerated OR
produce
2. Deactivate: P1 and P3 bug? THEN perishable
3. Execute P5. WM= (turkey, perishable, produce,
P4. IF weighs-15-lbs AND
green, weighs-15-lbs)
inexpensive AND
NOT perishable
CYCLE 4
THEN staple
1. Activate: P1, P3, P5, P6
P5. IF perishable AND
2. Deactivate: P1, P3, P5
weighs-15-lbs
3. Execute P6. WM = (watermelon, turkey,
THEN turkey
perishable, produce, green, weighs-15-lbs)
P6. IF weighs-15-lbs AND
CYCLE 5 produce
THEN watermelon
1. Activate: P1, P3, P5, P6
2. Deactivate: P1, P3, P5, P6.
3. Quit.
How ACT-R production
system is more complex
• Watermelon is simple example:
– Working memory elements: a single word
– Production rules: no variables in if-part
– Interpreter: conflict resolution selects lowest
numbered unused production
• In contrast, in ACT-R:
– Working memory elements: database-like record
structures with attributes and values
– Production rules: includes variables & patterns
– Interpreter: match must deal with variables and
patterns, conflict resolution does not use rule order
33
A Second Production Rule
Model Example
• Think about how you would write
production rules to do multi-column
addition?
264
+ 716
• What if-then rules would you write to
perform this task in a step-by-step
fashion?
34
Production Rules Set New
Goals & Perform Actions
Goal: Solve the addition problem
264
FOCUS-ON-FIRST-COLUMN, + 716
FOCUS-ON-NEXT-COLUMN
Goal: Process column C
ADD-ADDENDS
ADD-CARRY Goal: Write sum in column C MUST-CARRY
WRITE-SUM
Action: Write the sum Goal: Write carry in next column
WRITE-CARRY
Adapted from Anderson, J. R. 1993.
Rules of the Mind. Hillsdale, NJ: LEA.
Action: Write the carry
35
Production rule model for addition
FOCUS-ON-FIRST-COLUMN MUST-CARRY
IF The goal is to do an addition problem IF There is a goal to write Sum as the result in column C
And there is no pending subgoal And the carry into column C (if any) has been added
And there is no result yet in the rightmost to Sum
column of the problem And Sum > 9
THEN Set a subgoal to process the rightmost column And Next is the column to the left of C
THEN Change the goal to write Sum-10 as the result in C
FOCUS-ON-NEXT-COLUMN Set a subgoal to write 1 as a carry in column Next
IF The goal is to do an addition problem
And here is no pending subgoal WRITE-SUM
And C is the rightmost column with numbers to IF There is a goal to write Sum as the result in
add and no result column C
THEN Set a subgoal to process column C And Sum < 10
And the carry into column C (if any) has been added
ADD-ADDENDS THEN Write Sum as the result in column C
IF There is a goal to process column C And remove the goal
THEN Set Sum to the sum of the addends in column C
And set a subgoal to write Sum as the result in WRITE-CARRY
column C IF There is a goal to write a carry in column C
And remove the goal to process column C THEN Write the carry in column C
And remove the goal
ADD-CARRY
IF There is a goal to write Sum as the result in DONE
column C IF The goal is to do an addition problem
And there is a carry into column C And there is no incomplete subgoal to work on
And the carry has not been added to Sum And there is no column left with numbers to add (or a
THEN Change the goal to write Sum+1 as the result carry) and no result
And mark the carry as added THEN Mark the problem as done
column3
column2
column1
A Trace of Production
Rule Firings
Step 1 Pending goal:
264 Write carry in
1. FOCUS-ON-FIRST-COLUMN
C = column1
+ 716 column2
Goal: Process column1 0
2. ADD-ADDENDS
C = column1 Q: Could the carry have been written first?
Sum = 10 A: Yes, the condition of WRITE-CARRY holds
Goal: Process column1 after step 3. The model is flexible w.r.t.
Goal: Write 10 as result in column1 the order of writing the carry and writing
3. MUST-CARRY the result.
C = column1
Sum = 10 Step 2
Next = column2 5. WRITE-CARRY
Goal: Write carry in column2 C = column2
Goal: Write 0 as result in column1 Action: Write carry in column2
Goal: Write carry in column2
4. WRITE-SUM
C = column1
Sum = 0 Q: Could we have moved on without writing
the carry?
Action: Write 0 as result in column1
A: No, FOCUS-ON-NEXT-COLUMN can fire
Goal: Write 0 as result in column1 only if there is no pending goal. The
model does NOT allow implicit carrying.
A Trace of Production Rule Firings (ctnd.)
Step 3 No pending goal
1
6. FOCUS-ON-NEXT-COLUMN
C = column2 264
Goal: Process column2 + 716
7. ADD-ADDENDS 80
9800 DONE
C = column2
Sum = 7 Step 4
Goal: Process column2 10. FOCUS-ON-NEXT-COLUMN
Goal: Write 7 as result in column2 C = column3
8. ADD-CARRY Goal: Process column3
C = column2 11. ADD-ADDENDS
Sum = 7 C = column3
Goal: Write 8 as result in column2 Sum = 9
Q: Good thing that WRITE-SUM did not fire Goal: Process column3
instead after step 7. Why didn’t it? Goal: Write 9 as result in column3
A: WRITE-SUM has condition that carry into 12. WRITE-SUM
the column must have been added. C = column3
9. WRITE-SUM Sum = 9
C = column2 Action: Write 9 as result in column3
Sum = 8 Goal: Write 9 as result in column3
Action: Write 8 as result in column1
Step 5
Goal: Write 8 as result in column1
13. DONE
How could you model
students that don’t carry?
• Instead of doing the addition correctly:
1
264
+ 716
980
• Can you model a student that writes:
264
+ 716
970
• How can you change the production
rule model?
39
Overview
• ACT-R theory
– Features of production rules and their
predictions about learning
• How Production Systems Work
– A Simple Example
– ACT-R Addition Example
• Production System Notation
– Working memory “chunks”
– Production rule notation
40
Production Rules in the
Tutor Development Kit (TDK)
• How do you go about writing a
production rule?
• The TDK Production System
– Working Memory:
• Make up of “Working Memory Elements” (WMEs)
– Production Rules
– Interpreter (Match, Conflict Resolution,
Fire)
41
Implementing a Production
Rule Model in TDK
• Simple example: a model for single-
column addition without carrying!
4 4 4
+ 3 + 3 + 3
7 7 Done
• How would you define:
– Working Memory representation for the
problem states
– Production rules that transform working
memory
42
A Notation for Working Memory
Elements (“WMEs”) in TDK
4
+ 3
WME Name
WME Type
Separator
PROBLEM4+3>
ISA SINGLE-COLUMN-ADDITION-PROBLEM
FIRST-ADDEND 4
SECOND-ADDEND 3
RESULT nil
DONE nil
Slot Values
Slots
43
Working Memory Transitions
4 4 4
+ 3 + 3 + 3
7 7 Done
PROBLEM4+3> PROBLEM4+3> PROBLEM4+3>
ISA SINGLE-COLUMN- ISA SINGLE-COLUMN- ISA SINGLE-COLUMN-
ADDITION-PROBLEM ADDITION-PROBLEM ADDITION-PROBLEM
FIRST-ADDEND 4 FIRST-ADDEND 4 FIRST-ADDEND 4
SECOND-ADDEND 3 SECOND-ADDEND 3 SECOND-ADDEND 3
RESULT nil RESULT 7 RESULT 7
DONE nil DONE nil DONE T
Production: ADD Production: DONE
44
TDK Production Rule Notation
(defproduction add single-column-addition (=problem)
=problem>
isa single-column-addition-problem ADD (English version)
result NIL IF
first-addend =num1 The goal is to do =problem, a
second-addend =num2 single-column addition problem
And no result has been found yet
==> And the first addend is =num1
And the second added is =num2
!eval! =sum (+ =num1 =num2) THEN
Set =sum to the sum of
=problem> =num1 and =num2
result =sum Write =sum as the result
)
45
TDK Production Rule Notation
(defproduction add single-column-addition (=problem)
=problem>
isa single-column-addition-problem
If-part result NIL
first-addend =num1
second-addend =num2
==>
!eval! =sum (+ =num1 =num2)
Then-part
=problem>
result =sum
)
46
TDK Production Rule Notation
(defproduction add single-column-addition (=problem)
=problem>
isa single-column-addition-problem
If-part result NIL WME pattern
first-addend =num1
second-addend =num2
==>
!eval! =sum (+ =num1 =num2) Computation
in Lisp
Then-part
=problem>
result =sum WME pattern
)
47
TDK Production Rule Notation
(defproduction add single-column-addition (=problem)
=problem>
isa single-column-addition-problem
result NIL WME pattern
first-addend =num1
second-addend =num2
Variables
(“bound” to
==>
values
through
matching) !eval! =sum (+ =num1 =num2) Separator
(JESS uses ?
Instead of =problem>
=)
result =sum
)
48
JESS Production Rule Notation
(defrule add single-column-addition (=problem)REMOVE
(addition
(problem ?problem))
?problem <- (single-column-addition-problem //note-no name
(result NIL)
(first-addend ?num1)
(second-addend ?num2) No Arguments in
JESS
=> //only one =
(bind ?sum (+ ?num1 ?num2)) //call out to Jess
(modify ?problem
( result ?sum)
)
49
Matching a Production Rule to Working
Memory—Find Values for Each Variable
Working Memory Production Rule Find value for each
problem4+3> add variable
isa single-column- =problem> Variable Value
addition-problem isa single-column- =problem Problem4+3
first-addend 4 addition-problem =num1 4
second-addend 3 result NIL =num2 3
result NIL first-addend =num1 =sum 7
done NIL second-addend =num2
==> What changes are made
Match! !eval! =sum to Working Memory?
(+ =num1 =num2) Modify WME
=problem> problem4+3>
result =sum isa single-column-
) addition-problem
This WME pattern in the first-addend 4
THEN-part means change second-addend 3
slot value of existing WME result 7
done NIL 50
Summary—Components of a TDK
Production Rule Model
• Working Memory is a collection of WMEs
wme-name>
isa wme-type
slot1 value1
slot2 value2
• Production rules specify working memory
transitions
– WME patterns in the IF-part are matched against
Working Memory
=wme-variable>
isa wme-type
slot1 value-pattern1
slot2 value-pattern2
– WME patterns in the THEN-part specify changes to
Working Memory
51
Overall Summary
• Components of Production Systems:
– Working memory, production memory, interpreter
– Steps in the interpreter: Match, conflict resolution,
fire
• Features of cognition explained by
ACT-R production rules:
– Procedural knowledge:
• modular, limited generality, goal structured,
asymmetric
– Declarative knowledge:
• flexible, verbal or visual, less efficient
52
Overview
• ACT-R theory
– Features of production rules and their
predictions about learning
• How Production Systems Work
– A Simple Example
– ACT-R Addition Example
• Production System Notation
– Working memory “chunks”
– Production rule notation
• Preview homework
53
END
54
Get documents about "