Learning Markov Models for Stationary System Behaviors
Yingke Chen Hua Mao Manfred Jaeger Thomas D. Nielsen Kim G. Larsen Brian Nielsen
Department of Computer Science, Aalborg University, Denmark
Learning Markov Models for Stationary System Behaviors Yingke Chen - - PowerPoint PPT Presentation
Learning Markov Models for Stationary System Behaviors Yingke Chen Hua Mao Manfred Jaeger Thomas D. Nielsen Kim G. Larsen Brian Nielsen Department of Computer Science, Aalborg University, Denmark NFM 2012 April 4, 2012 Motivation
Department of Computer Science, Aalborg University, Denmark
27
Learning Markov Models for Stationary System Behaviors Introduction
2 Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ Constructing formal models manually can be time consuming ◮ Formal system models may not exist
◮ legacy software ◮ 3rd party components ◮ black-box embedded system component
◮ Our proposal: learn models from observed system behaviors
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation 3 Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
Idle, idle, coffe_request, idle, idle, cup, idle, idle, coffee, coffee, idle, idle, ... Model Checker
yes/no
learn
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview 4 Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ Learning probabilistic finite automata
◮ Alergia— R. Carrasco and J. Oncina (1994) ◮ Probabilistic Suffix Autumata — D. Ron et al. (1996)
◮ Learning models for model checking
◮ Learning CTMCs — K. Sen and et al. (2004) ◮ Learning DLMCs — H. Mao and et al. (2011)
◮ Hard to restart the system any number of times. ◮ Can not reset the system to a well-defined unique initial state.
◮ Learn a model from a single observation sequence
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
5 LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ Q: a finite set of states ◮ Σ: finite alphabet ◮ π : Q → [0, 1] is an initial probability distribution ◮ τ : Q × Q → [0, 1] is the transition probability function ◮ L : Q → Σ is a labeling function
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC 6 PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ H : Q → Σ≤N is a extended labeling function, which
◮ Each state qi is associated with a string si = H(qi)L(qi). If
◮ Let S be the set of strings associated with states in the PSA,
cup, milk 0.5 0.5 0.3 1 0.7 0.3 1 0.7 cup coff milk, milk idle
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC 7 PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ A tree over the alphabet Σ = {idle, cup, milk, coff} ◮ Each node is labeled by a pair (s, γs), and each edge is
◮ The parent’s string is the suffix of its children’s cup, milk 0.5 0.5 0.3 1 0.7 0.3 1 0.7 cup coff milk, milk idle
e idle cup coff cup, milk milk, milk
(0,0,0.5,0.5) (0,0,0.3,0.7) (0,0,0,1)
milk
(0.7,0.3,0,0) (0,0,0.3,0.7) (1,0,0,0) (0.57,0.16,0.1,0.16)
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST 8 SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
⊳r(ϕ)
⊳r(ϕ) iff Pπs M ({s ∈ Σω|s |
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL 9
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL 10
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
e idle cup coff cup, milk milk, milk
(0,0,0.5,0.5) (0,0,0.3,0.7) (0,0,0,1)
milk
(0.7,0.3,0,0) (0,0,0.3,0.7) (1,0,0,0) (0.57,0.16,0.1,0.16)
cup, milk 0.5 0.5 0.3 1 0.7 0.3 1 0.7 cup coff milk, milk idle milk 0.5 0.5 0.3 1 0.7 0.3 1 0.7 cup coff milk idle
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
11 Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ Start with T, only consisting root node (e), and
◮ For each s ∈ S, s will be included in T if
◮ For each s that ˜
◮ Loop until S is empty ◮ Calculate the next symbol distribution for each node in T e idle cup coff milk, milk milk
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
11 Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ Start with T, only consisting root node (e), and
◮ For each s ∈ S, s will be included in T if
◮ For each s that ˜
◮ Loop until S is empty ◮ Calculate the next symbol distribution for each node in T e idle cup coff cup, milk milk, milk milk
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
11 Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ Start with T, only consisting root node (e), and
◮ For each s ∈ S, s will be included in T if
◮ For each s that ˜
◮ Loop until S is empty ◮ Calculate the next symbol distribution for each node in T e idle cup coff cup, milk milk, milk
(0,0,0.5,0.5) (0,0,0.3,0.7) (0,0,0,1)
milk
(0.7,0.3,0,0) (0,0,0.3,0.7) (1,0,0,0) (0.57,0.16,0.1,0.16)
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST 12 PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
e idle cup coff cup, milk milk, milk
(0,0,0.5,0.5) (0,0,0.3,0.7) (0,0,0,1)
milk
(0.7,0.3,0,0) (0,0,0.3,0.7) (1,0,0,0) (0.57,0.16,0.1,0.16)
cup, milk 0.5 0.5 0.3 1 0.7 0.3 1 0.7 cup coff milk, milk idle milk 0.5 0.5 0.3 1 0.7 0.3 1 0.7 cup coff milk idle transform (Ron96) relabel
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC 13 Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ ˜
σ∈Σ ˜
˜ P(σ|s) ˜ P(σ|suffix(s)) ≥ ǫ ◮ ˜
◮ Overfitting;
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC 13 Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ ˜
σ∈Σ ˜
˜ P(σ|s) ˜ P(σ|suffix(s)) ≥ ǫ ◮ ˜
◮ Overfitting;
◮ BIC(A | Seq) := log(L(A | Seq)) − 1/2 |A| log(|Seq |)
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning 14
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning 15
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
◮ A single sequence is generated by a given LMC model ◮ The difference between the generating model Mg and the
Mg(φ) − Ps Ml(φ)| ◮ PSA-equivalent ◮ Non PSA-equivalent
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning 16
Experiment
PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
17 PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
0.7 0.3 0.4 0.6 0.4 0.6 0.95 0.4 0.4 0.6 0.2 0.8 0.4 0.6 0.3 0.7 0.9 0.1 0.2 0.8 0.05 0.9 0.6 0.4 1 0.6 0.1
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
18 PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
cont.
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
19 PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
x1 x2 x3 xn-1 xn
“000,110,000,000,011,000,010,000,011, 000,101,000,001,000,011,000,000,001, 000,001,000,101,000,101,000,….” Generate
Learned Model
3 processes Learn
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
19 PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
x1 x2 x3 xn-1 xn
“000,110,000,000,011,000,010,000,011, 000,101,000,001,000,011,000,000,001, 000,001,000,101,000,101,000,….” “tokens3,stable,tokens3,stable,tokens3, stable,tokens3,tokens3,tokens3,tokens3, stable,tokens3,stable,tokens3,….” Generate Abstract Learn
Learned Model
3 processes Learn 000, 111 à 3tokens 010, 110, 011, 101, 001, 100à stable
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
20 PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
cont.
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
21 PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
cont. 20 40 60 80 100 120 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 L Stationary Probability
real model−11 proc. abstract model−11 proc. real model−19 proc. abstract model−19 proc.
5 10 15 20 25 30 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 L Stationary Probability
real model−3 proc. full model−3 proc. abstract model−3 proc. real model−7 proc. full model−7 proc. abstract model−7 proc.
M(trueU≤L stable | token = N)
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
22 PSA-equivalent Non PSA-equivalent
Conclusion
Aalborg University, Denmark
cont.
real model−19 proc. abstract−19 proc. real −21 proc. abstract−21 proc.
M(trueU≤L stable | token = N) in the
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent 23 Non PSA-equivalent
Conclusion
Aalborg University, Denmark
start H T H T H T t1 h2 t3 h4 t5 h6
0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 1 1 1 1 1 1
start H T H T H T t1 h2 t3 h4 t5 h6
0.52 0.48 0.52 0.48 0.52 0.5 0.5 0.48 0.32 0.44 0.45 0.49 0.51 0.34 1 1 1 1 1 1 0.18 0.16
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent 24 Non PSA-equivalent
Conclusion
Aalborg University, Denmark
cont.
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent 25 Non PSA-equivalent
Conclusion
Aalborg University, Denmark
start
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent 26
Conclusion
Aalborg University, Denmark
27
Learning Markov Models for Stationary System Behaviors Introduction
Motivation Overview Related Work
Preliminaries
LMC PSA & PST SPLTL
PSA Learning
Construct PST PST to PSA and PSA to LMC Parameter Tunning
Experiment
PSA-equivalent Non PSA-equivalent 27
Conclusion
Aalborg University, Denmark
◮ Single observation sequence ◮ Learning algorithms ◮ SPLTL for stationary behavior ◮ Experimental validation