Abstract:
This thesis investigates the application of Large Language Models (LLMs) to stock price prediction, a challenging task traditionally addressed through technical analysis and, more recently, machine learning (ML) and deep learning (DL) techniques. The research benchmarks the performance of an LLM, based on Google's Gemini architecture, against established ML models (XGBoost, Random Forest) and a DL model (Gated Recurrent Unit, GRU) in predicting the binary direction (up or down) of Apple Inc. (AAPL) stock's daily closing price. The models were trained and evaluated using five years of historical price and volume data from Yahoo Finance, transformed into five widely used technical indicators: Exponential Moving Average (EMA), Relative Strength Index (RSI), Triple Exponential Moving Average (TEMA), Chaikin Money Flow (CMF), and Money Flow Index (MFI). These indicators served as input features, with sequences of 20 days used for the LLM and GRU. The study found that the LLM significantly outperformed both XGBoost and Random Forest in terms of accuracy, F1-score, and AUC-ROC (p < 0.05), while achieving results comparable to the GRU, a model specifically designed for sequential data. These findings support the hypothesis that LLMs, with their Transformer-based architecture and attention mechanism, are particularly well-suited to capturing long-range dependencies and learning complex patterns within sequences of technical indicators. The research contributes to the nascent field of LLMs in finance by demonstrating their potential to enhance and potentially transform traditional technical analysis. The results suggest that LLMs can offer a significant advantage in stock prediction accuracy, potentially leading to more informed investment decisions. Further research is recommended to explore the generalizability of these findings to other stocks and market conditions, incorporate additional data sources, optimize LLM architectures for this task, and develop methods for interpreting the models' decision-making processes. The results of applying LLMs on technical indicators will provide more insights whether these models are able to predict the stock price accurately or not. It will also provide insights whether these models are better than the traditional models or not. Also, the results indicate that deep learning models are more suitable for financial forecasting.