This paper introduces CSlearn, a new algorithm for structure learning in categorical data that captures "context-specific independence" (CSI). By combining a novel sparsity assumption with an order-based Markov chain Monte-Carlo (MCMC) search, the authors demonstrate a method that scales to hundreds of variables—a significant leap over previous methods that were limited to small systems.
TL;DR
CSlearn is a scalable algorithm for learning context-specific graphical models from categorical data, capable of handling hundreds of variables where previous methods stalled at dozens. It achieves this by solving a fundamental combinatorial problem to enable efficient MCMC searching over variable orderings rather than complex graph structures.
What Problem Does This Paper Address?
In probabilistic modeling, Directed Acyclic Graphs (DAGs) are the gold standard for representing conditional independence. However, standard DAGs are "context-blind." They might show that variable $A$ depends on $B$, even if that dependency only exists when variable $C$ is in a specific state (e.g., "high"). This is Context-Specific Independence (CSI).
While models like "staged trees" and "Labeled DAGs" (LDAGs) can represent these nuances, learning them from data is notoriously difficult. Optimization-based methods face an explosion of possible models, while constraint-based methods (testing for independence) become highly prone to error as the number of required tests grows. Consequently, most existing CSI learners only work for systems with fewer than 40 variables.
Methods
The authors propose a three-phase algorithm called CSlearn:
- Variable Selection (Optional): Uses a standard DAG learner (like the PC algorithm or GRaSP) to identify a "skeleton" of possible parent-child relationships, reducing the search space.
- Order-based MCMC Search: Instead of searching through the astronomical space of possible graphs, the algorithm searches through the space of variable orderings. This is more efficient and guaranteed to converge to the true posterior distribution of orderings.
- Exact Optimization: For a given ordering, the algorithm identifies the optimal "staging" (how contexts are grouped).
The "secret sauce" is a new context-specific sparsity constraint ($\beta$). By limiting the number of variables that can define a context (setting $\beta=2$), the authors were able to solve a combinatorial problem recently posed by mathematicians Alon and Balogh. This solution allows the algorithm to exactly count and score possible models, making the MCMC search computationally feasible.
Datasets
The authors evaluated CSlearn using:
- Synthetic CStree models: Used to test accuracy and scalability up to $p=500$ variables.
- ALARM: A classic synthetic benchmark for medical diagnostic systems (37 variables).
- Mushroom Dataset: A real-world UCI dataset with 22 categorical features used for a classification task.
- Sachs Dataset: A real-world protein-signaling network (11 variables) commonly used in causal discovery.
Key Insights and Ideas
- Order vs. Graph Search: Searching over variable orderings is the key to scalability. Once an ordering is fixed, finding the best context-specific structure becomes a much simpler optimization problem.
- The Power of $\beta$-Sparsity: Bounding the complexity of the contexts ($\beta$) is distinct from bounding the number of parents ($\alpha$). A model can have many parents but still be "sparse" if those parents only interact in simple, context-specific ways.
- Bridging Combinatorics and ML: By solving a specific case of the hypercube partitioning problem (Alon and Balogh, 2023), the authors provided the mathematical foundation necessary for exact scoring of sparse CStrees.
Key Results
- Massive Speedup: On the ALARM dataset, CSlearn found a high-quality model in just 14 seconds. Previous state-of-the-art exact optimization methods took 7 hours for the same task.
- Scalability: The algorithm successfully scaled to 500 variables. As shown in the runtime results, CSlearn maintains reasonable compute times even as the number of variables grows, whereas competing staged-tree methods (like Backwards Hill Climbing) explode exponentially.
- High Accuracy: In synthetic tests, CSlearn's accuracy (measured by KL-divergence) remained near zero even as the number of variables increased, significantly outperforming standard DAG learners that ignore context-specific info.
- Real-World Utility: On the Mushroom dataset, the learned model achieved over 95.8% prediction accuracy in identifying poisonous mushrooms.
Limitations and Future Work
- The $\beta=2$ Limit: The current implementation is optimized for contexts involving at most two variables. While this already allows for dense underlying graphs, generalizing the combinatorial results to $\beta > 2$ would allow for even richer context-specific structures.
- Interventional Data: The current work focuses on observational data. The authors suggest extending the algorithm to handle interventional data, which is crucial for true causal discovery.
- General Staged Trees: Future work could explore relaxing the CStree requirements to handle more general staged trees, though this might sacrifice the compact, human-interpretable LDAG representation.
For more details, the authors have made their implementation available in the open-source Python package CSlearn.
Summary updated