1. Introduction
The financial health of a company is the foundation of its survival and development. When a company faces financial risks, operational difficulties may trigger a chain reaction, including debt defaults, layoffs and bankruptcy, damaging the interests of investors and creditors and undermining the stability of the wider economic system [
1,
2]. Therefore, accurately predicting financial risks is one of the core issues in corporate finance and financial management [
3]. An effective early warning method provides managers with a window in which to take corrective action, enables creditors and investors to reprice risk, and supports regulators in maintaining market order [
4,
5]. In recent years, with the rapid development of deep learning and time-series modelling, research on financial risk early warning has been evolving from static discrimination toward dynamic, interpretable and gradable methods [
6,
7,
8].
Research on financial risk prediction has broadly gone through three stages. The first stage is dominated by statistical discriminant methods. Altman [
1] pioneers the Z-score model, using multiple discriminant analysis to combine accounting ratios to distinguish between healthy enterprises and potential bankruptcy candidates. Beaver [
2] examines the predictive ability of individual financial ratios for company failure with a univariate analysis.Ohlson [
3] employes logistic regression to relax distributional assumptions such as normality and provided easily rankable probability estimates. These linear models are transparent and easy to apply, yet they rest on strict statistical assumptions and treat each reporting period in isolation rather than capturing the joint evolution of indicators across years. The second stage introduces machine learning classifiers such as support vector machines, decision trees, random forests and gradient-boosted trees [
9], which can capture nonlinear interactions among financial metrics. These often outperform classical statistical models in cross-sectional data and are further combined with imbalance mitigation techniques like SMOTE to enhance minority class recognition, such as SMOTE [
10]. Many works [
11] point out that, although this stage markedly improves predictive accuracy, most studies still compress multi-period information into hand-crafted summary features, discarding the temporal structure that risk evolution should inherently reveal. The third stage applies deep learning to the inherently temporal nature of financial data. The LSTM proposed by Hochreiter [
4] models sequences directly , and captures short-range dependencies between adjacent reporting periods through gated memory mechanism. Vaswani [
5] proposes Transformerto replace cyclic structures with self attention, which excels in modeling long-range dependencies and identifying the most important time points. Subsequently, representative works such as Informer [
12], Temporal Fusion Transformer [
13] and Autoformer [
14] emerged in the field of long sequence prediction.
For financial warning tasks, Cheng [
15] proposes a DUAL-LSTM with embedded attention that confirms the value of attention mechanisms in improving warning accuracy. Mai et al. [
16] integrate textual disclosures into deep bankruptcy prediction. Hosaka [
17] visualizes financial ratios and applies convolutional neural networks. Jiang et al. [
19] further mine semantic features from patent texts to assist distress prediction. Because financial statements exhibit both short-range continuity and long-range dependency, hybrid designs that couple recurrent components with attention-based components are particularly attractive. LTR-Net [
18] fuses LSTM, Transformer and residual modules and reports that the joint design outperforms any single architecture in capturing temporal dependencies, global information and non-linear relations. Wang et al. [
19] propose a fusion deep neural network for multi-period annual report data. Mohamed [
20] constructs a deep warning model for multidimensional analysis. Yang [
21] explores how CNN-LSTM supports company financial forecasting. Beyond Transformers-based, selective state space models represented by Mamba [
22] have emerged as efficient sequence learners. Recent frameworks such as TSCMamba [
23], Mamba-hypergraph [
24] and MambaSL [
25] report strong improvements on time series classification benchmarks, offering competitive baselines for sequence modelling.
Although deep models and hybrid architectures continue to advance the accuracy of financial early warning, there are still three prominent limitations when facing actual company risk warning demands. First, most studies formulate the task as a binary classification between distressed and healthy firms [
16,
17]. However, managers actually make decisions in a hierarchical warning manner. It is necessary to distinguish between companies in a state of concern and those in acute danger in order to apply differentiated intervention measures. Second, high-risk companies are extremely rare, and this class imbalance biases models trained with ordinary cross-entropy toward the majority class, making the high-risk firms whose misclassification cost is the highest precisely the most likely to be missed [27]. Thirdly, deep models often sacrifice transparency while improving performance, and regulatory agencies' requirements for model interpretability are increasing. More works are integrating interpretability tools into financial warning models , such as attention weights and Shapley attribution [
15,26], enabling a warning to be traced back to its underlying risk drivers.To solve the above problems, we propose an improved LSTM-Transformer model for company financial risk grading warning, named FA-LSTFormer. FA-LSTFormer models the enterprise financial risk early-warning as a three classification of low risk, medium risk, and high risk. The core idea is to combine the time-series encoding backbone composed of LSTM and Transformer with the Risk Sensitive Hierarchical Indicator Attention (RSHA) module, and the Class Imbalance Aware Loss (CIAL) function, to provide timely and accurate segmentation early-warnings for company financial indicators.
Our contributions are as follows:
(1) FA-LSTFormer consists of LSTM-Transformer, RSHA module and CIFLloss function. The LSTM-Transformer maps multi-year financial indicator sequences into contextual representations that combine short-term continuity and cross period long-term dependencies, thereby characterising the gradual evolution trajectory of risk. The RSHA adaptively focuses on key financial risk drivers factors. CIFL is an imbalanced loss function that corrects the class bias caused by the scarcity of high-risk companies during training, reducing false negatives.
(2) We propose RSHA, which decomposes the contextual representation obtained by LSTM-Transformer backbone into tensors with financial indicator, and then uses Softmax to learn a set of normalized attention weights, enabling the model to dynamically focus on key risk driven indicators . RSHA both suppresses the interference of irrelevant indicators on the warning result and makes the result traceable to specific financial factors, thereby enhancing interpretability.
(3) We propose CIFL to address the scarcity of high-risk enterprise samples and the highest cost of underreporting. CIFL collaboratively corrects the bias of enterprise category distribution in three ways: introducing a focus modulation factor in the loss layer, focusing training on high-risk samples that are difficult to distinguish, using category weights based on the number of effective samples in the sample layer, and introducing a minority class synthesis mechanism in the training layer.
(4) On the dataset of Chinese A-share manufacturing listed companies from 2015 to 2025, we compare FA-LSTFormer with six methods, including LSTM, Transformer, LSTM-Transformer, LTR- Net, TSCMamba and MambaSL. The results show that FA-LSTFormer achieves optimal performance in both algorithm performance and financial risk warning application. The former is manifested in superior accuracy, F1, and AUC indicators. The latter is reflected in the lowest cost weighted misjudgment, the longest warning lead time, and the strongest cross industry robustness.