TimeSAE: Causal Sparse Decoding for Faithful Explanations of Black-Box Time Series Models
Abstract
As black box models and pretrained models gain traction in time series applications, understanding and explaining their predictions becomes increasingly vital, especially in high-stakes domains where interpretability and trust are essential. However, most of the existing methods involve only in-distribution explanation, and do not generalize outside the training support, which requires the learning capability of generalization. In this work, we aim to provide a framework to explain black-box models for time series data through the dual lenses of Sparse Autoencoders (SAEs) and causality. We show that many current explanation methods are sensitive to distributional shifts, limiting their effectiveness in real-world scenarios. Building on the concept of Sparse Autoencoder, we introduce TimeSAE, a framework for black-box model explanation. We conduct extensive evaluations of TimeSAE on both synthetic and real-world time series datasets, comparing it to leading baselines. The results, supported by both quantitative metrics and qualitative insights, show that TimeSAE provides more faithful and robust explanations. Our code is available in an easy-to-use library TimeSAE-Lib: https://oublalkhalid.github.io/TimeSAE/
Lay Summary
Understanding how complex machine learning models make predictions is important in applications such as healthcare, finance, and other high-stakes settings. However, most existing explanation methods only work well on data similar to what the model has seen during training, and often fail when conditions change. In this work, we introduce a new framework for explaining black-box models for time series data that is designed to remain reliable even under changing conditions. Our approach learns interpretable components of the model and uses them to provide more stable and meaningful explanations. Experiments on both synthetic and real-world datasets show that our method produces more faithful and robust explanations than existing approaches. We also release an open-source library to make our method easy to use and reproduce.