Accurate short-term photovoltaic (PV) power generation forecasting is critical for the stable integration of renewable energy into the grid. This study proposes a Transformer model enhanced with an adaptive sparse self-attention (ASSA) mechanism for PV power forecasting. The ASSA framework employs a dual-branch attention structure that combines sparse and dense attention paths with adaptive weighting to effectively filter noise while preserving essential spatiotemporal features. This design addresses the critical issues of computational redundancy and noise amplification in standard self-attention by adaptively filtering irrelevant interactions while maintaining global dependencies in Transformer-based PV forecasting. In addition, a deep feedforward network and a feature refinement feedforward network (FRFN) adapted from the ASSA–Transformer are incorporated to further improve feature extraction. The proposed algorithms are evaluated using time-series data from the Desert Knowledge Australia Solar Centre (DKASC), with input features including temperature, relative humidity, and other environmental variables. Comprehensive experiments demonstrate that the ASSA models’ accuracy in short-term PV power forecasting increases with longer forecast horizons. For 1 h ahead forecasts, it achieves an R2 of 0.9115, outperforming all other models. Under challenging rainfall conditions, the model maintains a high prediction accuracy, with an R2 of 0.7463, a mean absolute error of 0.4416, and a root mean square error of 0.6767, surpassing all compared models. The ASSA attention mechanism enhances the accuracy and stability in short-term PV power forecasting with minimal computational overhead, increasing the training time by only 1.2% compared to that for the standard Transformer.