DiffsFormer: A Diffusion Transformer on Stock Factor Augmentation

Yuan Gao, Haokun Chen, Xiang Wang, Zhicai Wang, Xue Wang, Jinyang Gao, Bolin DingarXiv 2024 · DOI

Abstract

Stock market forecasting is often hindered by the inherent noise and homogeneity of financial data, leading to significant challenges in model generalization. This paper introduces DiffsFormer, a novel Diffusion Transformer framework designed to mitigate the "data scarcity" problem through high-fidelity factor augmentation. By employing a "Transfer-based Editing" approach rather than generating data from scratch, DiffsFormer creates synthetic stock factors that preserve financial logic while increasing diversity. Experimental results demonstrate that DiffsFormer significantly enhances downstream trading models, achieving up to a 27.8% boost in annualized returns.

Introduction: The Challenges of Financial Data

Machine learning models in finance face two primary hurdles that limit their predictive power: low Signal-to-Noise Ratio (SNR) and data homogeneity.

  1. Low SNR: Stock price movements are heavily influenced by random speculative behavior. As shown in the distribution of Pearson correlation coefficients, the "signal" in factors is often buried under significant noise.
  2. Data Homogeneity: Stocks within the same industry sector frequently move in lockstep. This lack of diversity creates a form of data scarcity where models overfit on a limited set of patterns and fail to generalize to shifting market conditions.
Figure 1: Visualization of (a) low Signal-to-Noise Ratio through correlation density and (b) data homogeneity across sectors and years.

Standard augmentation techniques, such as Gaussian noise injection, often disrupt the delicate relationships between financial factors. DiffsFormer addresses this by generating realistic, diverse data that adheres to underlying financial distributions.

The DiffsFormer Framework

DiffsFormer utilizes a Diffusion Model built upon a Transformer architecture. Unlike generative models that start from pure noise, DiffsFormer adopts a Transfer-based Editing strategy to ensure data fidelity.

Factor Editing and Transfer Learning

Instead of starting from a random Gaussian state, the model takes an existing stock sample and adds a controlled amount of noise (the editing step $T'$). The model then denoises this sample, ensuring the synthetic data remains anchored to real market distributions while introducing beneficial variation. To capture global market dynamics, the model is first trained on a broad "source domain" (the entire China A-share market) before being applied to specific "target domains" like the CSI300 index.

Figure 2: The DiffsFormer pipeline, illustrating the transformation from original factors to augmented data guided by sector and return ratio conditions.

Conditional Guidance and Robustness

To ensure the generated factors align with expected market outcomes, the authors implement predictor-free guidance. The model is conditioned on ground-truth return ratios and industry sector information during the denoising process. Furthermore, a Loss-guided Noise Addition mechanism is used: stronger noise is applied to samples the model already fits well, forcing the framework to learn more robust, non-trivial features.

Experimental Results

The efficacy of DiffsFormer was evaluated using the Alpha158 factor set across major benchmarks, including the CSI300 and CSI800 indices. The framework served as a pre-processing step for eight distinct backbone models, including MLPs, LSTMs, and Graph Attention Networks (GATs).

  • Profitability: Augmented training led to relative improvements in Annualized Return Ratios of 7.2% on the CSI300 and 27.8% on the CSI800.
  • Stability: The Information Ratio (IR), which measures return consistency, improved across the board, indicating more stable model performance.
  • Fidelity: Using Fréchet Inception Distance (FID) metrics, the researchers confirmed that DiffsFormer produces data statistically closer to real-world distributions than traditional noise-based augmentation.

Conclusion and Future Work

DiffsFormer demonstrates that "editing" real financial data is a superior strategy to generating it from scratch, effectively solving the data collision problem where multiple models fail simultaneously due to identical training inputs. While the computational cost of diffusion models remains a hurdle, future research will focus on handling high-frequency dynamic data and adapting to sudden market regime shifts or "black swan" events.

Summary updated

BibTeX
@misc{gao2024diffsformer,
  author = {Yuan Gao and Haokun Chen and Xiang Wang and Zhicai Wang and Xue Wang and Jinyang Gao and Bolin Ding},
  title = {{DiffsFormer: A Diffusion Transformer on Stock Factor Augmentation}},
  year = {2024},
  eprint = {2402.06656},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.06656},
}
Figure