1. Introduction
The cryptocurrency market constitutes a highly dynamic financial ecosystem characterized by pronounced stochastic volatility, complex non-linear dynamics, and heterogeneous information-driven behaviors [
1,
2]. Its price trajectories and risk profiles are governed by an intricate interplay of internal market mechanisms, such as order book depth and trading volume, and on-chain activities, while remaining acutely sensitive to multidimensional external factors, including macroeconomic indicators, regulatory shifts, and social media sentiment [
3].
To navigate this complexity, deep learning architectures have emerged as the dominant paradigm, evolving from fundamental recurrent units to sophisticated hybrid frameworks that significantly outperform traditional statistical models in forecasting tasks [
4,
5,
6,
7]. Early approaches, such as the Long Short-Term Memory (LSTM) models utilized by Hoa et al. [
8], demonstrated effectiveness in regression tasks, specifically for closing price prediction using daily OHLCV data. To capture more intricate local and temporal patterns, subsequent research has pivoted toward hybrid architectures. For instance, Amirshahi et al. [
9] integrated Convolutional Neural Networks (CNNs) with LSTMs and Multi-Layer Perceptrons (MLPs) to classify high-frequency trends. Similarly, mixed recurrent architectures combining LSTM and Gated Recurrent Unit (GRU) modules, as proposed by Kaur et al. [
10], have proven capable of handling multi-time window predictions and modeling complex interdependencies. Furthermore, the incorporation of attention mechanisms into CNN-LSTM structures, as demonstrated by Peng et al. [
11], has significantly enhanced the capacity to process multi-frequency and multi-currency data for robust trend forecasting. By automatically extracting latent feature patterns from high-dimensional data, these models effectively integrate information across related assets, thereby enhancing both modeling efficiency and predictive accuracy [
12].
However, the superior performance of these deep models comes at the cost of transparency. Their inherent opacity, resulting from complex internal non-linear mappings, renders decision-making processes inaccessible to human reasoning, posing severe challenges to interpretability [
13]. In the high-stakes domain of cryptocurrency trading and risk management, this “black-box” nature directly undermines trustworthiness [
14,
15]. Stakeholders, ranging from institutional investors to regulatory authorities, require more than accurate point predictions; they urgently need to comprehend the key drivers behind model outputs and the boundary conditions under which models may fail. Trust, built upon deep understanding, is a prerequisite for integrating these predictive tools into decision-making workflows.
To enhance model transparency, the research community has developed various post-hoc explanation methods, including gradient-based saliency maps [
16], local surrogate models like LIME, and game theoretic approaches such as SHAP. While these methods effectively quantify feature importance [
17], they primarily address the question of “attribution”, explaining why a model made a specific prediction in the past. Crucially, they lack “actionability,” failing to provide guidance on how to intervene to alter an unfavorable outcome. For instance, when a model forecasts a high-risk market state, users derive limited utility from a static heatmap of feature importance; rather, they require identification of the minimal, realistic modifications to historical conditions that would have averted such a prediction.
Counterfactual Explanations [
18,
19] offer a promising avenue to address this limitation by providing actionable recourse. The core objective of a counterfactual explanation is to answer “what-if” questions: what is the minimal, constraint-compliant perturbation to the original input that shifts the model’s output to a predefined target state? This paradigm has been successfully applied in image recognition [
20] and natural language processing [
21] and is beginning to be explored in time series classification [
22]. Its primary advantage lies in its model-agnostic nature and the provision of intuitive recommendations that reveal model sensitivities and decision boundaries [
23,
24].
Despite these advancements, a significant gap remains in applying counterfactuals to financial time series. As categorized in the comprehensive survey by Guidotti et al. [
25], existing methods predominantly rely on generic optimization strategies [
26,
27] or heuristic search algorithms [
28] tailored for static tabular data. Although recent works such as ForecastCF [
29] and CounTS [
30] have extended these concepts to the time-series domain, they function primarily as general-purpose tools. Consequently, they fail to address the unique challenges inherent to the cryptocurrency market, specifically its extreme volatility and the critical requirement for actionable, interval-based risk thresholds rather than precise point targets.
To bridge this gap, inspired by ForecastCF [
29], this study proposes CryptoForecastCF, a novel counterfactual explanation framework specifically designed for cryptocurrency risk prediction. Our work distinguishes itself from existing approaches through three key dimensions. First, unlike standard optimization methods (e.g., WACH [
26]) that target precise point-wise decision flips, CryptoForecastCF introduces a novel interval-based optimization objective. This aligns with practical trading needs such as steering predictions into a safe “non-liquidation” range rather than achieving an arbitrary specific value. Second, in contrast to methods prioritizing explanation diversity (e.g., DiCE [
27]), we prioritize economic feasibility. By enforcing strict
norm constraints, we ensure that generated counterfactuals represent minimal, realistic market shifts rather than theoretical statistical artifacts. Finally, unlike self-interpretable frameworks like CounTS [
30] that require specific Bayesian architectures, our approach is model-agnostic and post-hoc. This allows it to provide interpretability for the wide array of pre-trained, high-performance deep learning models currently deployed in quantitative finance.
As illustrated in
Figure 1, we envision a scenario where counterfactual explanations enhance the trustworthiness of volatility predictions. Suppose a model predicts an unfavorable 12-day price trend based on a 14-day history. The counterfactual explanation method generates a modified historical price sequence that is very close to the original history but contains targeted perturbations. When the prediction model uses this counterfactual history as input, its generated prediction results successfully fall within the user-predefined desired target interval. This provides insights beyond simple attribution, clearly indicating which temporal dynamics were pivotal in driving the unfavorable forecast.
Based on this analysis, this research addresses the core question: How can we design effective counterfactual explanation methods for cryptocurrency prediction models that provide actionable interpretability guidance? We focus on three sub-problems: (1) defining a counterfactual framework suitable for high-dimensional, multivariate cryptocurrency data; (2) designing generation algorithms that guide predictions toward specific desired intervals; and (3) ensuring the economic feasibility of the recommended interventions. The core contributions of this paper are summarized as follows:
Problem Formalization: We systematically define the problem of counterfactual explanations for cryptocurrency prediction, demonstrating its critical value in enhancing model transparency and providing actionable decision support in high-risk financial environments.
The CryptoForecastCF Framework: We propose a universal, gradient-optimization-based framework capable of generating counterfactuals for complex black-box models. It uniquely incorporates interval-based constraints (upper and lower bounds) to align with practical risk management strategies.
Empirical Evaluation: We conduct extensive experiments on representative cryptocurrency datasets across multiple mainstream deep learning architectures, systematically validating the capability of CryptoForecastCF to generate effective, meaningful, and minimally modified counterfactual explanations.
2. Problem Definition
The inherent volatility and non-linear complexity of cryptocurrency markets render accurate forecasting a non-trivial task. While deep learning models have achieved superior performance, their “black-box” nature often obscures the decision-making process, limiting their trustworthiness in high-stakes financial applications. To bridge the gap between predictive performance and interpretability, this study addresses a fundamental question: How can we generate counterfactual explanations that elucidate the specific conditions under which a model yields a desired prediction outcome?
Formally, the objective is to identify minimal yet plausible perturbations to the historical input data such that the model’s output, over a specified future horizon, conforms to user-defined interval constraints. These counterfactual explanations not only enhance model transparency but also provide actionable insights for risk management and strategic investment.
2.1. Mathematical Formulation
Let
denote a multivariate time series, where
represents an
F-dimensional feature vector at time step
t. Consider a pre-trained predictive model
, which maps a historical lookback window of length
d to a prediction sequence of length
T. The prediction process at time
n is defined as:
where
denotes the input matrix from the lookback window, and
is the predicted value at future time step
i.
To incorporate user intent, we define lower and upper bound constraint vectors, , which delineate the acceptable range for the prediction trajectory. These bounds can be dynamically generated via functions and , instantiated based on statistical properties, technical indicators (e.g., support/resistance levels), or risk thresholds.
2.2. Problem Statement
Based on the aforementioned notation, we formally define the Interval-based Cryptocurrency Counterfactual Prediction problem.
Definition 1 (Counterfactual Generation). Given a time series , a predictive model f, and target constraints , the goal is to synthesize a counterfactual input sequence that satisfies the following criteria:
Locality: Perturbations are strictly confined to the lookback window, i.e., , ensuring historical integrity outside the relevant context.
Validity: The modified input generates a valid counterfactual prediction .
Constraint Adherence: The counterfactual prediction must lie within the target interval for all , such that .
Minimality: The counterfactual input must remain proximal to the original input to ensure plausibility. This is achieved by minimizing a distance metric .
We formulate this task as a regularized optimization problem. To facilitate gradient-based solutions, we express the objective function as:
where
represents the candidate input,
is a penalty function enforcing interval constraints,
is a regularization coefficient balancing validity and proximity, and
denotes the feasible domain of the input space.
5. Conclusions
This paper addresses the critical imperative for interpretability in deep learning-based cryptocurrency forecasting by introducing CryptoForecastCF, a rigorous interval-constrained counterfactual explanation framework. By formalizing the problem through the core principles of input modification, prediction validity, constraint satisfaction, and modification minimization, and leveraging a gradient-based optimization strategy with dynamic masking, the proposed method efficiently generates actionable, high-fidelity explanations. Empirical evaluations substantiate the framework’s superiority, demonstrating a greater than 20% improvement in counterfactual effectiveness and a reduction of over 30% in input perturbations compared to baselines. These technical advancements translate into substantial practical utility for the fintech industry: empowering traders to validate algorithmic signals, facilitating precise stress testing via “what-if” simulations, and providing transparent audit trails for regulatory compliance. While the current reliance on white-box gradient access and structured OHLCV data presents certain limitations regarding proprietary systems and multi-modal market drivers, these constraints delineate clear pathways for future investigation. Prospective research will focus on integrating unstructured sentiment data to enable comprehensive market analysis, extending the architecture to Graph Neural Networks to capture systemic risk contagion, and exploring model-agnostic reinforcement learning approaches to eliminate gradient dependencies. Ultimately, CryptoForecastCF establishes a foundational paradigm for trustworthy, transparent, and actionable AI within the high-stakes domain of financial decision-making.