seminar on machine teaching

44
Seminar on Machine Teaching Saarland University – Winter Semester 2019 Adish Singla 5 th Nov 2019

Upload: others

Post on 22-Apr-2022

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Seminar on Machine Teaching

Seminar on Machine TeachingSaarland University – Winter Semester 2019

Adish Singla5th Nov 2019

Page 2: Seminar on Machine Teaching

Machine Teaching: Key Components

2

Teacher’s algorithm

Application

Learner’s model

Page 3: Seminar on Machine Teaching

• Type and complexity of task

• Type and model of learning agent

• Teacher’s knowledge and observability

Machine Teaching: Problem Space

3

#1

Page 4: Seminar on Machine Teaching

Complexity Measures: TDNotion of teaching complexity: Teaching dimension TD• Introduced by [Goldman, Kearns ’91] • Analysis setting

• randomized version space learner• worst-case analysis• finite size hypothesis class• exact teaching

Formal definition of TD• Length of optimal teaching sequence for ℎ∗ is #$(ℎ∗;ℋ,) |• Teaching dimension is defined as

#+ ℋ,) := max1∗∈ℋ |#$ ℎ∗;ℋ,) |

4

Page 5: Seminar on Machine Teaching

Complexity Measures: TDExamples for computing TD

5

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

0 0 0 0

!" !# !$ !%ℎ"ℎ#ℎ$ℎ%ℎ'

1 1 1 1 1

0 1 1 1 1

0 0 1 1 1

0 0 0 1 1

0 0 0 0 1

!" !# !$ !%ℎ"ℎ#ℎ$ℎ%ℎ'

!'1

1

1

1

4

1

2

2

2

2

()(ℎ∗ |()(ℎ∗ |

(- ℋ,0 = 4(- ℋ,0 = 2

Page 6: Seminar on Machine Teaching

Complexity Measures: VCDNotion of learning complexity: VCD• Introduced by [Vapnik, Chervonenkis ’71]

• Sample complexity bounds for learning grow as Θ "#$ ℋ,'

Formal definition of ``shattering” and VCD• Consider a set C ⊆ ' of size * given by C = ,-, ,. , … , ,0

• Pattern of ℎ on C is given by 2(ℎ, #) ≔ ℎ ,- , ℎ ,. , … , ℎ ,0• Unique patterns of ℋ on C are given by 2(ℋ, #) ≔ ⋃7∈ℋ{2(ℎ, #)}

• ℋ shatters C if |2(ℋ, #)| = 20• ℋ has VCD of * , i.e., "#$ ℋ,' = * when

1. ∃ C ⊆ ' of size * such that ℋ shatters C2. ∄ C ⊆ ' of size * + 1 such that ℋ shatters C

6

Page 7: Seminar on Machine Teaching

Complexity Measures: VCDExamples for computing VCD

7

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

0 0 0 0

0 0 1 1

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

0 0 0 0

!" !# !$ !%ℎ"ℎ#ℎ$ℎ%ℎ'

()* ℋ,- = 2()* ℋ,- = 1

!" !# !$ !%ℎ"ℎ#ℎ$ℎ%ℎ'ℎ1

Page 8: Seminar on Machine Teaching

Complexity Measures: TD vs. VCDA fundamental question: TD vs. VCD?• !" ℋ,% is & '(" ℋ,% ?• There exist problems with

• !" ℋ,% ≪ & '(" ℋ,%• !" ℋ,% ≫ & '(" ℋ,%

8

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

0 0 0 0

+, +- +. +/ℎ,ℎ-ℎ.ℎ/ℎ1

!" ℋ,% = 4'(" ℋ,% = 1

Page 9: Seminar on Machine Teaching

Improved Notions of TD: RTDTeaching an “adversarial” learner: Classic TD• Simple classes can be difficult to teach

Teaching a “cooperative” learner: Recursive TD (RTD)• Introduced by [Zilles et al. @ COLT’08]

• !"# ℋ,& is ' ()# ℋ,& ? [Simon, Zilles @ COLT’15]

• An active area of research• ' * 2, log log |ℋ| [Moran et al. @ FOCS’15]

• ' * 2, [Chen et al. @ NIPS’ 16]

• ' *1 [Hu et al. @ COLT’ 17]

9

where * denotes ()# ℋ,&

Page 10: Seminar on Machine Teaching

Improved Notions of TD: Unified ViewKey limitations of existing models and measures• A number of complexity measures: Classic-TD, RTD, PBTD, NCTD, …• Batch teaching

• Order of examples does not matter• Learner’s feedback does not matter

• Teaching complexity not linear in VCD

Our recent work• ``Preference-Based Batch and Sequential Teaching: Towards a

Unified View of Models” [NeurIPS’19] • ``Understanding the Role of Adaptivity in Machine Teaching: The

Case of Version Space Learners” [NeurIPS’18]

10

Page 11: Seminar on Machine Teaching

• Type and complexity of task

• Type and model of learning agent

• Teacher’s knowledge and observability

Machine Teaching: Problem Space

11

#1 #2, #3

Page 12: Seminar on Machine Teaching

Cognitive Model of Skill AcquisitionCognitive tutors• Used by millions of students for K-12 education

• https://www.carnegielearning.com/• https://new.assistments.org/

Bayesian Knowledge Tracing (BKT)• Introduced by [Corbett, Anderson ’95] • Knowledge Components (KC)

• A learning task is associated with a set of skills• Practicing a skill leads to mastery of that skill

12

Page 13: Seminar on Machine Teaching

Task: Geometry and AlgebraKnowledge components (KCs) and exercises

13

! = #: Congruent triangles

! = $: One variable equations

# $

%& %' %( %) %* %+%, %-Exercises

KCs

Page 14: Seminar on Machine Teaching

Teaching Interaction under BKT• Each KC ! is associated with a knowledge state ℎ#

• ℎ# = 1 represents that the skill has been mastered• ℎ# = 0 otherwise

Interaction at time ' = 1, 2, …+• Denote the value of ℎ# at the end of time ' as ℎ,#• Initialize ℎ-# for all KCs• At time ':

• Teacher provides exercise ., associated with KC !• Learner responds /, ∈ {0, 1} with knowledge ℎ,34#

• Learner updates knowledge from ℎ,34# to ℎ,#

14

Page 15: Seminar on Machine Teaching

BKT Learner ModelLearner’s initial knowledge (one parameter per KC)• Probability of mastery before teaching !"#"$% ≔ !(ℎ)% = 1)

Learner’s response (two parameters per KC)• Conditional probability of guessing !-./00% ∶= ! 23 = 1 | ℎ356% = 0• Conditional probability of slipping !08"9% ∶= ! 23 = 0 | ℎ356% = 1

Learner’s update (one parameter per KC)• Conditional probability of learning !8/:;#% ∶= ! ℎ3% = 1 | ℎ356% = 0

15

Page 16: Seminar on Machine Teaching

BKT Learner Model: HMM RepresentationHidden Markov Model (HMM) for a single KC !

16

"#$#%&1 − "#$#%&

start state

ℎ& knowledge states(unobserved)

Responses: Wrong or Correct(observed)

"*+,--&

1 − "*+,--&"-.#/&

1 − "-.#/&

".,01$&

W C

0 1

Page 17: Seminar on Machine Teaching

BKT Learner Model: DBN RepresentationDynamic Bayesian Network (DBN) for a single KC !

17

"#$#%& '()*& = 0 "-./0$&

'()*& = 1 1

"('3& = 1) " '(& = 1 | '()*&" 6( = 1 | '()*&

'()*& = 0 "78.99&

'()*& = 1 1 − "9-#;&

6()* 6(

'()<& '()*& '(&

Page 18: Seminar on Machine Teaching

BKT Learner Model: DBN RepresentationDynamic Bayesian Network for two independent KCs {", $}

&'()*'() &'*'

+'(,- +'()- +'-

+'(,. +'(). +'.

+'()- = 0, *' = " 123456-

+'()- = 1, *' = " 1+'()- = 0, *' = $ 0+'()- = 1, *' = $ 1

1 +'- = 1 | +'()- , *'1 &' = 1 | +'()- , +'(). , *'

Exercise * is chosen by teacher and takes value {", $}

18

*' = " *' = $+'()- = 0, +'(). = 0 19:3;;- 19:3;;.

+'()- = 1, +'(). = 0 1 − 1;2=>- 19:3;;.

+'()- = 0, +'(). = 1 19:3;;- 1 − 1;2=>.

+'()- = 1, +'(). = 1 1 − 1;2=>- 1 − 1;2=>.

Page 19: Seminar on Machine Teaching

BKT TeacherPrediction and inference for a single KC !• Learner’s responses at the end of time ": #$ ≔ {'(, '*, … , '$}• Predicting learner’s response: - .$/ = 1 | #$3(• Inferring learner’s knowledge: - 4$/ = 1 | #$ denoted as 5$/

Incremental computations• Initial 56/ = -7879/ is known• Compute - .$/ = 1 | #$3( from 5$3(/

• Compute 5$/ from 5$3(/ and '$

19

Page 20: Seminar on Machine Teaching

BKT TeacherPredicting learner’s response

20

! "#$ = 1 | (#)* = ! "#$ = 1,,#)*$ = 1 | (#)* + ! "#$ = 1,,#)*$ = 0 | (#)*= ! "#$ = 1 | ,#)*$ = 1, (#)* / ! ,#)*$ = 1 | (#)*+ ! "#$ = 1 | ,#)*$ = 0, (#)* / ! ,#)*$ = 0 | (#)*

= ! "#$ = 1 | ,#)*$ = 1 / ! ,#)*$ = 1 | (#)*+ ! "#$ = 1 | ,#)*$ = 0 / ! ,#)*$ = 0 | (#)*

= (1 − !2345$ ) / 7#)*$ + !89:22$ / (1 − 7#)*$ )

! "#$ = 1 | (#)* = (1 − !2345$ ) / 7#)*$ + !89:22$ / (1 − 7#)*$ )

Derivation:

Page 21: Seminar on Machine Teaching

BKT TeacherInferring learner’s knowledge

where !"#$%& is an intermediate quantify computed from "#$%& and '#

Computing ("#$%& by applying Bayes rule

• For '# = 1, !"#$%& ≔(%$-./01

2 )456782

%$-./012 45678

2 9 -:;<..2 4(%$5678

2 )

• For '# = 0, !"#$%& ≔-./012 45678

2

-./012 45678

2 9 %$-:;<..2 4(%$5678

2 )

21

> ?#& = 1 | A# = !"#$%

& + >CDEFG& 4 (1 − !"#$%

& )

Page 22: Seminar on Machine Teaching

BKT TeacherAn example of prediction and inference• Parameters: !"#"$% = 0.5, !*+,-#% = 0.2, !/0+11% = 0.1, !1*"3% = 0.1

22

Student 1

Student 2

45% 46% 47%

1 0

0 0

0.28

0.92

0.32

0.84

0.23

0.65

0.28

0.62

89% 85% 86%0.50

0.50

Page 23: Seminar on Machine Teaching

Teaching Process using BKT

23

Teacher’s algorithm

ApplicationParameter fitting using

historic data of students

Learner’s model

• Datasets publicly available• Parameter fitting by standard techniques

Page 24: Seminar on Machine Teaching

BKT: Two Main Research ThemesImproving learner model• Forgetting• Individualization per student• Skill discovery

• exercises to skills mapping• Inter-skill similarity and prerequisite structure

Designing teaching policies• When to stop teaching a skill?• Optimizing the curriculum via planning in DBN

24

Page 25: Seminar on Machine Teaching

Improved Learner Models for BKTDBN for a single KC ! with forgetting

25

"#$#%& '()*& = 0 "-./0$&

'()*& = 1 1

"('3& = 1) " '(& = 1 | '()*&" 6( = 1 | '()*&

'()*& = 0 "78.99&

'()*& = 1 1 − "9-#;&

6()*& 6(&

'()<& '()*& '(&

1 − "=>07.%&

Page 26: Seminar on Machine Teaching

Improved Learner Models for BKTComparing different models• BKT: Standard model

• BKT1: One model for all skills• BKT2: Multiple models, one per skill

• BKT-F: With forgetting• BKT-I: Individualization per student • BKT-S: Skill discovery as part of BKT• BKT-FIS: Above three extensions combined

26

[Khajah, Lindsey, Mozer @ EDM’16]

Page 27: Seminar on Machine Teaching

Deep Knowledge Tracing [Piech et al. @ NIPS’15]

Improved Learner Models for BKTComparing different models• Dataset from

• # students: 15,900

• # skills: 124 (with multiple exercises per skill)

• # student-exercise attempts: 0.5 million

• Cross-validation by splitting data based on student ids

• Performance metric: AUC (ranging from 0.5 to 1)

27

BKT1 BKT2 BKT-F BKT-I BKT-S BKT-FIS Deep BKT

0.67 0.73 0.83 0.785 0.76 0.825 0.86

[Khajah, Lindsey, Mozer @ EDM’16]

Page 28: Seminar on Machine Teaching

Designing Teaching PoliciesMuch less research on designing teaching policies• The most popular way of using BKT for teaching is

• STOP teaching skill ! when " #$% = 1 | )$ ≥ 0.95• Planning techniques

• Faster teaching via POMDP Planning [Rafferty et al. @ CogSci’16] • “When to stop” instrucMonal policies with guarantees

• When to stop? Towards Universal InstrucMonal Policies [Käser, Klingler, Gross @ LAK’16] • From PredicMve Models to InstrucMonal Policies [Rollinson, Brunskill @ LAK’15]

28

Better predictive models Better instructional policies

Page 29: Seminar on Machine Teaching

Cognitive Models of Skill AcquisitionSummary of BKT• Well-studied cognitive model, used in real-world applications• Generic model for complex learning tasks (e.g., learning Algebra)

Limitations of using cognitive models• Difficult to design optimal teaching policies• Generic models but might not capture fine-grained task details

29

Page 30: Seminar on Machine Teaching

• Type and complexity of task

• Type and model of learning agent

• Teacher’s knowledge and observability

Machine Teaching: Problem Space

30

#1 #2, #3

Page 31: Seminar on Machine Teaching

• Type and complexity of task

• Type and model of learning agent

• Teacher’s knowledge and observability

Machine Teaching: Problem Space

31

#1 #2, #3#4

Page 32: Seminar on Machine Teaching

• Type and complexity of task

• Type and model of learning agent

• Teacher’s knowledge and observability

Machine Teaching: Problem Space

32

#1 #2, #3#4 #5

Page 33: Seminar on Machine Teaching

• Type and complexity of task

• Type and model of learning agent

• Teacher’s knowledge and observability

Machine Teaching: Problem Space

33

#1 #2, #3#4 #5 #6, #7, #8

Page 34: Seminar on Machine Teaching

Sequential Decision Making: IngredientsKey ingredients• A sequence of actions with long term consequences• Delayed feedback

• Safely reaching the destination in time• Successfully solving the exercise• Winning or losing a game

• Main components• Environment representing the problem• Student is the learning agent taking actions• Teacher helping the student to learn faster

34

Page 35: Seminar on Machine Teaching

Sequen&al Decision Making: EnvironmentMarkov Decision Process ! ≔ ($, &, ', $()(*, $+),, -)• $: states of the environment• &: actions that can be taken by agent• P(/0|/, 2): the transition of the environment when action is taken• $()(*: defines a set of initial states• $+),: defines a set of terminal states• -(/, 2): reward function

35

Page 36: Seminar on Machine Teaching

Sequential Decision Making: PolicyAgent’s policy !• "($) → ': A deterministic policy • "($) → ((') : A stochastic policy

Utility of a policy• Expected total reward when executing a policy " is given by

• Agent’s goal is to learn an optimal policy

36

)* = ,-, * /01 $0, '0

"∗ = argmax* )*

Page 37: Seminar on Machine Teaching

An Example: Car Driving Simulator• State ! represented by a feature vector "(!)

(location, speed, acceleration, car-in-front, HOV, …)

• Action % could be discrete/continuous{left, straight, right, brake, speed+, speed-, …}

• Transition & !' !, % defines how world evolves (stochastic as it depends on other drivers in the environment)

• ) !, % defines immediate reward, e.g.,• 100 if ! ∈ +,-.• -1 if ! ∉ +,-.• -10 if ! represents ``accident”

• Policy 0∗ dictates how an agent should drive

37

Page 38: Seminar on Machine Teaching

An Example: Tutoring System for Algebra• State ! represents the current layout of variables• Action " could be {move, combine, distribute, stop, …}• Transition # !$ !, " is deterministic• & !, " defines immediate reward, e.g.,

• 100 if ! ∈ ()*+• -1 if ! ∉ ()*+

38

Page 39: Seminar on Machine Teaching

An Example: Tutoring System for Coding• State ! could be represent

• raw source code• abstract syntax tree (AST)• execution behavior• ...

• Action " could be eligible updates (e.g., allowed by the interface)

39Image credits: [Piech et al. @ LAK’15]

HoC Problem 4

HoC Problem 18

Page 40: Seminar on Machine Teaching

Learning Settings: Rewards• Standard setting in reinforcement learning (RL)• ! is known, " is known

• Mode-based planning algorithms (e.g., Value iteration)

• !, " are both unknown• Model-free learning algorithms (e.g., Q-learning)

40

(Book) Reinforcement Learning: An Introduction [Barto and Sutton 2018]

Page 41: Seminar on Machine Teaching

Learning Se*ngs: Demonstra1ons• Also known as “Imitation Learning”

• Learning via observing behavior of another agent

• A popular framework: Inverse reinforcement learning (IRL)• Recover reward function explaining observed demonstrations• E.g., Maximum Causal Entropy algorithm (MCE-IRL)

41

(Survey) An Algorithmic Perspective on Imitation Learning [Osa et al. 2018]

Page 42: Seminar on Machine Teaching

The Role of Teacher: Research Problems

42

Teaching viademonstra3ons

Teaching via reward signals

Optimizing curriculum of tasks

Providing advice (e.g., correcting errors)

Optimizing sequence of demonstrations

Accounting formodel mismatch

Reward shaping (e.g., defining sub-goals)

Optimizing curriculum of tasks

#6

#7

#8

Page 43: Seminar on Machine Teaching

• Type and complexity of task

• Type and model of learning agent

• Teacher’s knowledge and observability

Machine Teaching: Problem Space

43

#1 #2, #3#4 #5 #6, #7, #8

Page 44: Seminar on Machine Teaching

Course Logistics• Webpage

https://machineteaching.mpi-sws.org/course-mt-w19.html

[email protected]

• Slideshttps://machineteaching.mpi-sws.org/files/course-mt-w19/machineteaching-day1.pdfhttps://machineteaching.mpi-sws.org/files/course-mt-w19/machineteaching-day2.pdf

44