Vol. 3 No. 7 (2024)
Articles

Deep Forecasting of Stock Prices via Granularity-Aware Attention Networks

Published 2024-10-30

How to Cite

Su, X. (2024). Deep Forecasting of Stock Prices via Granularity-Aware Attention Networks. Journal of Computer Technology and Software, 3(7). https://doi.org/10.5281/zenodo.15851627

Abstract

This paper addresses the challenges of long-term stock price prediction, including complex temporal structures, diverse information granularities, and cross-scale dependencies. It proposes a prediction framework based on a multi-granularity hybrid attention mechanism. The method incorporates a Granularity-Aware Fusion module to deeply integrate short-term local fluctuations with long-term trend features. This enhances the model's ability to represent structural characteristics across different temporal scales. On this basis, a Cross-Level Hybrid Attention mechanism is further introduced. By employing an inter-layer attention coupling strategy, the model builds contextual interactions across multiple semantic layers. This improves its capacity to perceive dynamic structural changes and potential trend signals. The model is implemented using a modular deep network architecture, which ensures strong scalability and adaptability. It maintains stable prediction performance under different time window settings, feature dimension configurations, and data perturbations. Comprehensive comparative experiments and ablation studies are conducted across multiple evaluation metrics. The results validate the proposed method's advantages in terms of prediction accuracy, robustness, and structural awareness. In addition, visualization results reveal the model's ability to fit real stock price trajectories. These findings demonstrate the effectiveness of the proposed approach for complex financial time series modeling tasks.