Abstract
Learning the structure of Bayesian Networks (BNs) is a fundamental but computationally challenging task, classified as NP-hard due to the super-exponential growth of the Directed Acyclic Graph (DAG) search space. Traditional score-based heuristic algorithms, such as Genetic Algorithms and Simulated Annealing, often struggle with hyperparameter sensitivity and convergence to local optima. This paper presents RLBayes, a novel approach that redefines the structure search as a Reinforcement Learning (RL) problem. By employing a dynamic Q-learning strategy, RLBayes maintains a memory of high-performing structures and transitions, enabling more efficient navigation of the search space. Experimental results on standard benchmarks demonstrate that RLBayes outperforms traditional heuristics in terms of F1-score, AUC, and stability, particularly in large-scale networks.
Introduction
Bayesian Networks are probabilistic graphical models used to represent conditional dependencies between variables. Identifying the optimal structure—the "who-causes-what" relationships—is critical for accurate modeling. However, as the number of variables increases, the number of possible DAGs grows at a rate that makes exhaustive search impossible.
Current research primarily relies on score-based learning, where a fitness function (e.g., Bayesian Information Criterion, BIC) is maximized using heuristic search. Despite their popularity, these heuristics are often difficult to tune and frequently get trapped in local optima. RLBayes addresses these challenges by treating the search process as an agent-based exploration of the state space.
Methodology: The RLBayes Framework
RLBayes frames the search for a BN structure as a Markov Decision Process (MDP).
State and Action Space
In this framework, each state represents a unique BN structure. The agent navigates this space by performing one of three actions:
- Add an edge between two nodes.
- Delete an existing edge.
- Reverse the direction of an existing edge.
Reward Mechanism
The reward for any action is defined as the change in the Bayesian score (BIC) resulting from the transition. This ensures that the agent is incentivized to move toward structures with higher probabilistic fitness.
Dynamic Q-Table and Pruning
To manage the effectively infinite search space, RLBayes utilizes a dynamic Q-table with a fixed maximum length. This table acts as a cache for the most promising structures encountered. When the table reaches its capacity, the algorithm prunes the network with the lowest score, focusing computational resources on high-reward regions.
State Transfer
To prevent the agent from becoming stuck in local optima, a "transfer factor" ($\theta$) is introduced. This mechanism periodically resets the agent to the best-known structure found during the search, allowing it to explore the immediate neighborhood of the current global maximum.
Experimental Evaluation
The authors evaluated RLBayes against six benchmark networks of varying complexity, ranging from small networks like asia (8 nodes) to large networks like win95pts (76 nodes). RLBayes was compared against several popular heuristics, including Hill Climbing (HC), Genetic Algorithms (GA), and Particle Swarm Optimization (BNC-PSO).
Key Results
- Performance: RLBayes achieved an average ranking of 1.83 on F1-score and 1.5 on AUC, consistently placing at the top across nearly all datasets.
- Stability: While swarm-based algorithms showed significant performance degradation on larger networks, RLBayes remained stable, maintaining high AUC and F1 scores even as complexity increased.
- Convergence: The paper provides theoretical proof that RLBayes is guaranteed to converge to the global optimal structure given sufficient iterations and an appropriate state transfer factor.
Discussion and Future Work
A significant advantage of RLBayes is its predictable scaling; performance improves monotonically with the number of iterations and Q-table size, reducing the "black magic" typically required for hyperparameter tuning in other heuristics.
However, maintaining a large tabular Q-table can become memory-intensive for extremely large networks. Future research may explore Deep Reinforcement Learning (DRL) to approximate Q-values using neural networks. This would allow the model to generalize across different datasets without the need to explicitly store every state, potentially offering even greater scalability for networks with thousands of nodes.
Summary updated