Abstract
Many automated system analysis techniques (e.g., model checking, model-based testing) rely on first obtaining a model of the system under analysis. System modeling is often done manually, which is often considered as a hindrance to adopt model-based system analysis and development techniques. To overcome this problem, researchers have proposed to automatically “learn” models based on sample system executions and shown that the learned models can be useful sometimes. There are however many questions to be answered. For instance, how much shall we generalize from the observed samples and how fast would learning converge? Or, would the analysis result based on the learned model be more accurate than the estimation we could have obtained by sampling many system executions within the same amount of time? In this work, we investigate existing algorithms for learning probabilistic models for model checking, propose an evolution-based approach for better controlling the degree of generalization and conduct an empirical study in order to answer the questions. One of our findings is that the effectiveness of learning may sometimes be limited.
Introduction
Building formal system models manually is a significant bottleneck in formal verification. It is time-consuming, error-prone, and often impossible for "black box" systems. To address this, researchers have explored "learning" models from system execution traces. This paper investigates the effectiveness of learning probabilistic models for model checking, introduces a novel Genetic Algorithm (GA) approach, and provides an empirical comparison against traditional methods.
Problem Formulation: Learning Probabilistic Models
Probabilistic Model Checking (PMC) requires a formal model, typically a Discrete-Time Markov Chain (DTMC), to calculate the exact probability of system properties, such as failure rates or success conditions.
Existing learning algorithms like AALERGIA face two primary challenges:
- Generalization Control: They rely on a sensitivity parameter ($\epsilon$) to decide when to merge states, which is difficult to tune without prior knowledge.
- Mathematical Assumptions: They often assume the scoring function is concave, allowing for simple search techniques. This paper demonstrates that this assumption is frequently invalid, leading to local optima and poor model quality.
Methodology: The ZIQIAN Tool
The authors propose ZIQIAN, a tool that utilizes a Genetic Algorithm (GA) to learn models.
Genetic Algorithm Approach
- Encoding: Models are represented as "chromosomes" where genes map observed event sequences (from a prefix tree) to states in the final DTMC.
- Fitness Function: The Bayesian Information Criterion (BIC) is used to balance model likelihood against complexity, preventing overfitting by penalizing models with too many states.
- Evolutionary Operators: Mutation and crossover allow the GA to explore the non-concave scoring landscape more effectively than traditional gradient-based or golden section search methods.
Evaluation Framework
The approach was compared against AALERGIA and Statistical Model Checking (SMC) across various datasets including PRISM benchmarks (brp, lse, crowds), synthetic models, and real-world systems like the Secure Water Testbed (SWaT).
Key Insights and Results
The Concavity Myth
A major finding is that the BIC score is not a concave function of the generalization parameter. This explains why previous algorithms often failed to find optimal models. The GA's robust search capability allows it to navigate this jagged landscape more effectively.
Performance and Accuracy
- Convergence: ZIQIAN generally converges to accurate models faster and more reliably than AALERGIA.
- Scalability: While accurate for small systems (~8 states), error rates (Absolute Relative Difference) increase significantly for complex protocols like
nandorrsp. - Learning vs. Sampling: In time-limited trials, Statistical Model Checking (SMC) often produced more accurate results than model learning for specific properties. This suggests a "learning tax" where the intermediate model introduces additional error compared to direct sampling.
- Real-World Viability: On SWaT data, the GA-learned model achieved over 97% predictive accuracy for sensor behavior, proving viability for stationary physical systems.
Discussion and Limitations
The study highlights several challenges:
- Rare Events: Both learning and SMC struggle with events that rarely appear in training data. If a failure only happens once in a billion runs, the learned model may incorrectly assign it a probability of zero.
- State Explosion: High-dimensional systems require abstraction techniques to group variables before learning becomes feasible.
Conclusion
While automated model learning via Genetic Algorithms offers a more robust alternative to traditional methods, its utility compared to direct statistical sampling depends on the specific analysis goals. Future work should focus on automated abstraction to handle the state explosion problem in large-scale industrial systems.
Summary updated