XClusters: Explainability-First Clustering

Hyunseung Hwang, Steven Euijong Whang

In machine learning, clustering serves as a foundational tool for uncovering patterns in large, unlabeled datasets. However, a persistent challenge remains: while algorithms can group "similar" data points, the underlying rationale for these groupings is often opaque to human users. Traditionally, explainability is treated as a post-hoc task—researchers cluster first and attempt to generate explanations later.

A recent paper from KAIST, presented at AAAI-23, proposes a paradigm shift. Their framework, XClusters, treats explainability as a primary objective during the clustering process itself. By optimizing for both cluster tightness and the simplicity of human-readable explanations, XClusters ensures that the resulting groups are inherently interpretable.

What Problem Does This Paper Address?

The standard approach to "explainable clustering" typically involves a disjointed two-step pipeline. First, data is clustered using distance metrics like Euclidean distance. Second, a surrogate model, such as a decision tree, is trained to explain these clusters using a separate set of descriptive features (e.g., demographic data).

The fundamental flaw in this approach is that the clusters formed in the first step may be geometrically complex relative to the explanatory features. This often results in excessively large, unreadable decision trees. For instance, a cluster defined by spending habits might be so fragmented across demographic variables that a simple "if-then" explanation becomes impossible.

Visualizing the trade-off between decision tree complexity and cluster distortion.

The authors argue that for AI to be truly explainable, the clustering algorithm must be "aware" of the eventual explanation's complexity. XClusters addresses this by balancing the trade-off between cluster distortion (the internal cohesion of clusters) and tree size (the number of nodes required for the explanation).

The core of XClusters is a joint optimization problem that minimizes a combined objective function: $$Objective = Distortion + \lambda \cdot (\text{Number of Tree Nodes})$$ where $\lambda$ is a hyperparameter controlling the emphasis on explainability.

To solve this efficiently, the authors introduced several key innovations:

  1. Differentiated Feature Sets: The framework distinguishes between accuracy features used to define similarity (e.g., time-series trends) and explainability features used for the decision tree (e.g., user metadata).
  2. Monotonicity Discovery: A critical observation was that the objective function exhibits monotonic properties. Generally, increasing the number of clusters ($k$) reduces distortion but increases tree size. Similarly, adjusting the weight ($\alpha$) toward explainability features simplifies the tree at the cost of increased distortion.
  3. Branch-and-Bound Algorithm: Leveraging these monotonic trends, the authors developed a custom branch-and-bound algorithm. This approach allows XClusters to systematically prune large portions of the parameter space $(k, \alpha)$ that are guaranteed to yield sub-optimal results.
The branch-and-bound algorithm efficiently searches the parameter space by pruning sub-optimal regions.

This search strategy makes XClusters significantly faster than traditional black-box optimization methods like grid search or Bayesian Optimization.

Experimental Evaluation

The researchers evaluated XClusters on three diverse real-world relational time-series datasets:

  • Credit Card: A massive dataset containing 5.7 billion transactions, where clusters are based on spending trends and explained via demographics.
  • DS4C: A public COVID-19 dataset from South Korea, clustering movement patterns and explaining them by age and gender.
  • Contracts: A public dataset of Washington State government contracts, clustering by sales volume and explaining by vendor/customer metadata.

Key Insights and Results

  • Superior Pareto Frontiers: XClusters consistently identifies better trade-offs between distortion and explainability than the traditional two-step approach. It can often produce significantly smaller decision trees with only a marginal impact on cluster tightness.
  • Computational Efficiency: The branch-and-bound approach provides substantial speedups. On the DS4C dataset, XClusters found optimal parameters in just 0.12 seconds, compared to 1.55 seconds for Bayesian Optimization.
  • Interpretability at Scale: By allowing the clustering to "shift" to accommodate simpler explanations, the framework produces results that are much more accessible to human analysts without sacrificing the core patterns in the data.

Limitations and Future Directions

While XClusters marks a significant advancement, the authors identify several avenues for future work. The current framework assumes a degree of monotonicity that may be challenged by highly noisy data or significant missing values. Additionally, the explicit handling of outliers—which can often complicate explanations—remains a potential area for integration. Finally, while currently focused on relational and time-series data, extending this "explainability-first" philosophy to unstructured data like images or graphs represents a promising frontier for research.

Summary updated

BibTeX
@inproceedings{hwang2023xclusters,
  author = {Hyunseung Hwang and Steven Euijong Whang},
  title = {{XClusters: Explainability-First Clustering}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i7.25963},
}
Figure