Improving Adaptability of Multi-Mode Systems via Program Steering - - PowerPoint PPT Presentation

improving adaptability of multi mode systems via program
SMART_READER_LITE
LIVE PREVIEW

Improving Adaptability of Multi-Mode Systems via Program Steering - - PowerPoint PPT Presentation

Improving Adaptability of Multi-Mode Systems via Program Steering Lee Lin Michael D. Ernst MIT CSAIL 1 Multi-Mode Systems A multi-mode systems behavior depends on its environment and internal state Examples of multi-mode


slide-1
SLIDE 1

1

Improving Adaptability of Multi-Mode Systems via Program Steering

Lee Lin Michael D. Ernst MIT CSAIL

slide-2
SLIDE 2

2

Multi-Mode Systems

  • A multi-mode system’s behavior depends on its

environment and internal state

  • Examples of multi-mode systems:

– Web server: polling / interrupt – Cell phone: AMPS / TDMA / CDMA – Router congestion control: normal / intentional drops – Graphics program: high detail / low detail

slide-3
SLIDE 3

3

Controllers

  • Controller chooses which mode to use
  • Examples of factors that determine modes:

– Web server: heavy traffic vs. light traffic – Cell phone: rural area vs. urban area; interference – Router congestion control: preconfigured policy files – Graphics program: frame rate constraints

slide-4
SLIDE 4

4

Controller Example

while (true) { if ( checkForCarpet() ) indoorNavigation(); else if ( checkForPavement() )

  • utdoorNavigation();

else cautiousNavigation(); }

  • Do the predicates handle all situations well?
  • Is any more information available?
  • Does the controller ever fail?
slide-5
SLIDE 5

5

Improving Built-in Controllers

  • Built-in controllers do well in expected situations
  • Goal: Create a controller that adapts well to

unanticipated situations

– Utilize redundant sensors during hardware failures – Sense environmental changes – Avoid default modes if other modes are more appropriate – Continue operation if controller fails

slide-6
SLIDE 6

6

Why Make Systems Adaptive?

  • Testing all situations is impossible
  • Programmers make mistakes

– Bad intuition – Bugs

  • The real world is unpredictable

– Hardware failures – External environmental changes

  • Human maintenance is costly

– Reduce need for user intervention – Issue fewer software patches

slide-7
SLIDE 7

7

Overview

  • Program Steering Technique
  • Mode Selection Example
  • Program Steering Implementation
  • Experimental Results
  • Conclusions
slide-8
SLIDE 8

8

Program Steering Goals

  • Create more adaptive systems without

creating new modes

  • Allow systems to extrapolate knowledge

from successful training examples

  • Choose appropriate modes in unexpected

situations

slide-9
SLIDE 9

9

Program Steering Overview

1. Select representative training runs 2. Create models describing each mode using dynamic program analysis 3. Create a mode selector using the models 4. Augment the original program to utilize the new mode selector

slide-10
SLIDE 10

10

Collect Training Data Original Program

Original Controller

slide-11
SLIDE 11

11

Collect Training Data Original Program

Original Controller

Dynamic Analysis Models

slide-12
SLIDE 12

12

Collect Training Data Original Program Create Mode Selector

Original Controller

Mode Selector

Dynamic Analysis Models

slide-13
SLIDE 13

13

Collect Training Data Original Program Models Create Mode Selector

Original Controller

Original Program

Mode Selector

Dynamic Analysis Create New Controller

New Controller New Controller

slide-14
SLIDE 14

14

Overview

  • Program Steering Technique
  • Mode Selection Example
  • Program Steering Implementation
  • Experimental Results
  • Conclusions
slide-15
SLIDE 15

15

Laptop Display Controller

  • Three modes

– Normal Mode – Power Saver Mode – Sleep Mode

  • Available Data:

– Inputs: battery life and DC power availability – Outputs: brightness

slide-16
SLIDE 16

16

Properties Observed from Training Runs

Standard Mode Power Saver Mode Sleep Mode Brightness >= 0 Brightness <= 10 Battery > 0.15 Battery <= 1.00 Brightness >= 0 Brightness <= 4 Battery > 0.00 Battery <= 0.15 DCPower == false Brightness == 0 Battery > 0.00 Battery <= 1.00

slide-17
SLIDE 17

17

Mode Selection Problem

What mode is most appropriate?

Brightness == 8 Battery == 0.10 DCPower == true Current Program Snapshot

slide-18
SLIDE 18

18

Mode selection policy: Choose the mode with the highest percentage of matching properties.

Mode Selection

Brightness == 8 Battery == 0.10 DCPower == true Current Program Snapshot

slide-19
SLIDE 19

19

Mode selection policy: Choose the mode with the highest percentage of matching properties.

Mode Selection

Brightness == 8 Battery == 0.10 DCPower == true Current Program Snapshot Standard Mode BRT >= 0 BRT <= 10 BAT > 0.15 BAT <= 1.00

Score: 75%

slide-20
SLIDE 20

20

Mode selection policy: Choose the mode with the highest percentage of matching properties.

Mode Selection

Brightness == 8 Battery == 0.10 DCPower == true Current Program Snapshot Standard Mode BRT >= 0 BRT <= 10 BAT > 0.15 BAT <= 1.00

Score: 75% Score: 60%

BRT >= 0 BRT <= 4 BAT > 0.00 BAT <= 0.15 DC == false Power Saver Mode

slide-21
SLIDE 21

21

Mode selection policy: Choose the mode with the highest percentage of matching properties.

Mode Selection

Brightness == 8 Battery == 0.10 DCPower == true Sleep Mode

Score: 66%

Standard Mode BRT >= 0 BRT <= 10 BAT > 0.15 BAT <= 1.00

Score: 75% Score: 60%

BRT >= 0 BRT <= 4 BAT > 0.00 BAT <= 0.15 DC == false BRT == 0 BAT > 0.00 BAT <= 1.00 Power Saver Mode Current Program Snapshot

slide-22
SLIDE 22

22

Mode selection policy: Choose the mode with the highest percentage of matching properties.

Mode Selection

Brightness == 8 Battery == 0.10 DCPower == true Current Program Snapshot Sleep Mode

Score: 66%

Standard Mode BRT >= 0 BRT <= 10 BAT > 0.15 BAT <= 1.00

Score: 75% Score: 60%

BRT >= 0 BRT <= 4 BAT > 0.00 BAT <= 0.15 DC == false BRT == 0 BAT > 0.00 BAT <= 1.00 Power Saver Mode

slide-23
SLIDE 23

23

Mode selection policy: Choose the mode with the highest percentage of matching properties.

Second Example

Brightness == 8 Battery == 0.10 DCPower == false Current Program Snapshot

slide-24
SLIDE 24

24

Mode selection policy: Choose the mode with the highest percentage of matching properties.

Second Example

BRT == 0 BAT > 0.00 BAT <= 1.0 Brightness == 8 Battery == 0.10 DCPower == false Current Program Snapshot Sleep Mode

Score: 66%

Standard Mode BRT >= 0 BRT <= 10 BAT > 0.15 BAT <= 1.00

Score: 75% Score: 80%

BRT >= 0 BRT <= 4 BAT > 0.00 BAT <= 0.15 DC == false Power Saver Mode

slide-25
SLIDE 25

25

Overview

  • Program Steering Technique
  • Mode Selection Example
  • Program Steering Implementation
  • Experimental Results
  • Conclusions
slide-26
SLIDE 26

26

Collect Training Data Original Program Models Create Mode Selector

Original Controller

Original Program

Mode Selector

Dynamic Analysis Create New Controller

New Controller New Controller

slide-27
SLIDE 27

27

Training

  • Train on successful runs

– Passing test cases – High performing trials

  • Amount of training data:

– Depends on modeling technique – Cover all modes

slide-28
SLIDE 28

28

Dynamic Analysis

  • Create one set of properties per mode
  • Daikon Tool

– Supply program and execute training runs – Infers properties involving inputs and outputs – Properties were true for every training run

  • this.next.prev == this
  • currDestination is an element of visitQueue[]
  • n < mArray.length

http://pag.csail.mit.edu/daikon/

slide-29
SLIDE 29

29

Collect Training Data Original Program Models Create Mode Selector

Original Controller

Original Program

Mode Selector

Dynamic Analysis Create New Controller

New Controller New Controller

slide-30
SLIDE 30

30

Mode Selection Policy

Check which properties in the models are true in the current program state. For each mode, calculate a similarity score (percent of matching properties). Choose the mode with the highest score. Can also accept constraints, for example

  • Don’t select Travel Mode when destination null
  • Must switch to new mode after Exception
slide-31
SLIDE 31

31

Collect Training Data Original Program Models Create Mode Selector

Original Controller

Original Program

Mode Selector

Dynamic Analysis Create New Controller

New Controller New Controller

slide-32
SLIDE 32

32

Controller Augmentation

Call the new mode selector during:

– Uncaught Exceptions – Timeouts – Default / passive mode – Randomly during mode transitions

Otherwise, the controller is unchanged

slide-33
SLIDE 33

33

Why Consider Mode Outputs?

  • Mode selection considers all properties
  • Output properties measure whether mode is

behaving as expected

  • Provides inertia, avoids rapid switching
  • Suppose brightness is stuck at 3 (damaged).

– No output benefit for Standard Mode. – More reason to prefer Power Saver to Standard.

slide-34
SLIDE 34

34

Why Should Program Steering Improve Mode Selection?

  • Eliminates programmer assumptions about what

is important

  • Extrapolates knowledge from successful runs
  • Considers all accessible information
  • Every program state is handled
  • The technique requires no domain-specific

knowledge

slide-35
SLIDE 35

35

What Systems Can Benefit from Program Steering?

  • Discrete transitions between modes
  • Deployed in unpredictable environments
  • Multiple modes often applicable
slide-36
SLIDE 36

36

Overview

  • Program Steering Technique
  • Mode Selection Example
  • Program Steering Implementation
  • Experimental Results
  • Conclusions
slide-37
SLIDE 37

37

Droid Wars Experiments

  • Month-long programming competition
  • Teams of simulated robots are at war (27

teams total)

  • Robots are autonomous
  • Example modes found in contestant code:

Attack, defend, transport, scout enemy, relay message, gather resources

slide-38
SLIDE 38

38

Program Steering Upgrades

  • Selected 5 teams with identifiable modes
  • Ran in the original contest environment
  • Trained on victorious matches
  • Modeling captured sensor data, internal state,

radio messages, time elapsed

slide-39
SLIDE 39

39

Upgraded Teams

The new mode selectors considered many more properties than the original mode selectors

Team NCNB Lines

  • f Code

Number of Modes Properties Per Mode Team04 658 9 56 Team10 1275 5 225 Team17 846 11 11 Team20 1255 11 26 Team26 1850 8 14

slide-40
SLIDE 40

40

Evaluation

  • Ran the upgraded teams in the original

environments (performed same or better)

  • Created 6 new environments

– Hardware failures: – Deceptive GPS: – Radio Spoofing: – Radio Jamming: – Increased Resources: – New Maps: random rebooting navigation unreliable simulate replay attacks some radio messages dropped faster building, larger army randomized item placement

slide-41
SLIDE 41

41

Examples of Environmental Effects

  • Hardware Failures

– Robot did not expect to reboot mid-task, far from base – Upgraded robots could deduce and complete task

  • Radio Spoofing

– Replay attacks resulted in unproductive team – Upgraded robots used other info for decision making

slide-42
SLIDE 42

42

Hardware Failures Deceptive GPS

Program Steering Effects on Tournament Rank

Team Original Upgrade Team04 11 5 +6 Team10 20 16 +4 Team17 15 9 +6 Team20 21 6 +15 Team26 17 13 +4 Team Original Upgrade Team04 12 9 +3 Team10 23 8 +15 Team17 15 9 +6 Team20 22 7 +15 Team26 16 13 +3

slide-43
SLIDE 43

43

Original Team20

  • Centralized Intelligence
  • Queen Robot

– Pools information from sensors and radio messages – Determines the best course of action – Issues commands to worker robots

  • Worker Robot

– Capable of completing several tasks – Always returns to base to await the next order

slide-44
SLIDE 44

44

Upgraded Team20

  • Distributed Intelligence
  • Queen Robot (unchanged)
  • Worker Robot

– Capable of deciding next task without queen – Might override queen’s orders if beneficial

slide-45
SLIDE 45

45

Understanding the Improvement

Question: What if the improvements are due to when the new controller invokes the new mode selector, not what the selector recommends? Experiment:

  • Ran same new controller with a random mode selector.
  • Programs with random selector perform poorly.
  • Program steering selectors make intelligent choices
slide-46
SLIDE 46

46

Hardware Failures Deceptive GPS

Comparison with Random Selector

Team Original Upgrade Random Team04 11 5 +6 9 +2 Team10 20 16 +4 21

  • 1

Team17 15 9 +6 20

  • 5

Team20 21 6 +15 23

  • 2

Team26 17 13 +4 22

  • 5

Team Original Upgrade Random Team04 12 9 +3 17

  • 5

Team10 23 8 +15 18 +5 Team17 15 9 +6 15 Team20 22 7 +15 21 +1 Team26 16 13 +3 20

  • 4
slide-47
SLIDE 47

47

Overall Averages

Team Upgrade Random Team04 +4.0 +0.7 Team10 +3.8 +1.2 Team17 +4.2

  • 1.5

Team20 +8.8

  • 1.3

Team26 +1.0

  • 3.7
slide-48
SLIDE 48

48

Overview

  • Program Steering Technique
  • Mode Selection Example
  • Program Steering Implementation
  • Experimental Results
  • Conclusions
slide-49
SLIDE 49

49

Future Work

  • Use other mode selection policies

– Refine property weights with machine learning – Detect anomalies using models

  • Try other modeling techniques

– Model each transition, not just each mode

  • Automatically suggest new modes
slide-50
SLIDE 50

50

Conclusion

  • New mode selectors generalize original

mode selector via machine learning

  • Technique is domain independent
  • Program steering can improve adaptability

because upgraded teams perform:

– As well or better in old environment – Better in new environments

slide-51
SLIDE 51

51