A Hybrid Framework for Stock Price Forecasting Using Metaheuristic Feature Selection Approaches and Transformer Models Enhanced by Temporal Embedding and Attention Pruning

ABSTRACT Accurately predicting stock prices remains a major challenge in financial analytics due to the complexity and noise inherent in market data. Feature selection plays a critical role in improving both computational efficiency and predictive performance. In this study, we introduce a novel hybrid framework that integrates metaheuristic feature‐selection algorithms with an enhanced transformer‐based prediction model fine‐tuned using temporal embedding and adaptive attention pruning. We evaluate and compare the effectiveness of three nature‐inspired metaheuristic algorithms: bat algorithm (BAT), gray wolf optimization (GWO), and beluga whale optimization (BWO) for selecting the most informative features from a time‐series stock dataset. After feature selection, the optimal subsets are fed into our modified transformer equipped with temporal embeddings and adaptive attention pruning. Extensive experiments conducted on the Bharat Heavy Electricals Limited (BHEL) dataset show that the proposed hybrid framework outperforms traditional methods in terms of predictive accuracy. Among the evaluated approaches, the combination of BWO and the fine‐tuned transformer achieves the best performance, yielding a Test RMSE of 0.0030 and a Test MAPE of 0.0108, demonstrating the superiority of BWO in identifying relevant features. This work provides a comprehensive comparative analysis of hybrid metaheuristic–deep learning models for stock price prediction and offers a foundation for integrating more explainable and scalable AI techniques into financial forecasting.

Authors

Institutions

Publication Details

Journal
Applied AI Letters
Published
2026-01-08
DOI
https://doi.org/10.1002/ail2.70018
Primary Topic
Stock Market Forecasting Methods
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Hybrid Framework for Stock Price Forecasting Using Metaheuristic Feature Selection Approaches and Transformer Models Enhanced by Temporal Embedding and Attention Pruning

S kordrostami, Amirhossein Malakouti Semnani, Mohammad Hossein Moattar, Amirhossein Refahi Sheikhani
Applied AI Letters
Stock Market Forecasting Methods
article

A Hybrid Framework for Stock Price Forecasting Using Metaheuristic Feature Selection Approaches and Transformer Models Enhanced by Temporal Embedding and Attention Pruning

S kordrostami, Amirhossein Malakouti Semnani, Mohammad Hossein Moattar, Amirhossein Refahi Sheikhani
article en

Abstract

ABSTRACT Accurately predicting stock prices remains a major challenge in financial analytics due to the complexity and noise inherent in market data. Feature selection plays a critical role in improving both computational efficiency and predictive performance. In this study, we introduce a novel hybrid framework that integrates metaheuristic feature‐selection algorithms with an enhanced transformer‐based prediction model fine‐tuned using temporal embedding and adaptive attention pruning. We evaluate and compare the effectiveness of three nature‐inspired metaheuristic algorithms: bat algorithm (BAT), gray wolf optimization (GWO), and beluga whale optimization (BWO) for selecting the most informative features from a time‐series stock dataset. After feature selection, the optimal subsets are fed into our modified transformer equipped with temporal embeddings and adaptive attention pruning. Extensive experiments conducted on the Bharat Heavy Electricals Limited (BHEL) dataset show that the proposed hybrid framework outperforms traditional methods in terms of predictive accuracy. Among the evaluated approaches, the combination of BWO and the fine‐tuned transformer achieves the best performance, yielding a Test RMSE of 0.0030 and a Test MAPE of 0.0108, demonstrating the superiority of BWO in identifying relevant features. This work provides a comprehensive comparative analysis of hybrid metaheuristic–deep learning models for stock price prediction and offers a foundation for integrating more explainable and scalable AI techniques into financial forecasting.

Applied AI LettersVol. 7(1)
Islamic Azad University, Mashhad (IR), Islamic Azad University, Lahijan Branch (IR)
Openalex Percentile: Top 94%
Stock Market Forecasting Methods
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.