[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-119253-en":3,"doc-seo-119253-105":29,"detail-sidebar-cat-0-en-105":90},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":11,"language":21,"language_code":22,"site_id":23,"html_lang":22,"table_of_contents":24,"faqs":25,"seo_title":26,"seo_description":14,"update_tm":27,"read_time":28},119253,7971461740886,"Theodore","https://ap-avatar.wpscdn.com/davatar_3d24733baf745e90a7e4bdd5f77d97b2",8,"Research & Report","Predictive Modeling of Stock Prices Using Transformer Model","Financial market prediction using deep learning has drawn strong interest from both investors and researchers. Leveraging nonlinear characteristics of stock markets, the work aims to forecast stock indices with the latest deep learning framework, the Transformer. A comparative study evaluates stock closing price prediction using LSTM, Prophet, and Transformer, based on encoder-decoder design and multi-head attention. Experiments with Yahoo Finance data show Transformer achieves superior performance, improving predictive accuracy despite complex market dynamics.","Predictive Modeling of Stock Prices Using Transformer Model  \nLeila Mozaffari  \n[s372060@oslomet.no](s372060@oslomet.no)[ ](s372060@oslomet.no)Oslo Metropolitan University Oslo, Norway  \nJianhua Zhang  \n[jianhuaz@oslomet.no](jianhuaz@oslomet.no)[ ](jianhuaz@oslomet.no)Oslo Metropolitan University Oslo, Norway  \nABSTRACT  \nFinancial market prediction utilizing deep learning has attracted the attention of both investors and researchers. Deep learning methods, such as convolutional neural networks and recurrent neural networks work well at predicting stock indices based on the nonlinear characteristics of stock markets. The goal of this work is to predict the stock index using the latest deep learning framework, Transformer. This paper presents a comprehensive analysis of stock closing price prediction using three distinct machine learning models: Long Short-Term Memory (LSTM), Prophet, and Transformer. Using the encoder-decoder architecture and the multi-head attention mechanism, Transformer is able to better characterize stock market dynamics. The present study uses data from Yahoo Finance. The Transformer model demonstrated superior performance in comparison with LSTM and Prophet. In this work, we handle the complexities of market dynamics to improve stock price predictions.  \nCCS CONCEPTS  \n• Mathematics of computing → Time series analysis; • Computing methodologies → Neural networks.  \nKEYWORDS  \nStock Market, Time Series, Transformer, Prophet, LSTM, Stock Price Prediction  \nACM Reference Format:  \nLeila Mozaffari and Jianhua Zhang. 2024. Predictive Modeling of Stock Prices Using Transformer Model. In 2024 9th International Conference on Machine Learning Technologies (ICMLT) (ICMLT 2024), May 24–26, 2024, Oslo, Norway. ACM, New York, NY, USA, 8 pages. [https://doi.org/10.1145/3674029.3674037](https://doi.org/10.1145/3674029.3674037)  \n1 INTRODUCTION  \nIt has long been a challenge for investors, researchers, and data scientists to predict stock prices in the financial markets. Stock price forecasts can be immensely valuable to investors, helping them optimize trading decisions, manage portfolios, and mitigate risk [24] . In an attempt to uncover the complex patterns associated with stock price movements, robust models are continually being developed as a result of the attraction of potential financial gain from accurate predictions. The stock market, however, is a highly complex and dynamic system influenced by a multitude of variablesand external factors, making predictions difficult [19] .  \nThis work is licensed under a Creative Commons Attribution International 4.0 License.  \nICMLT 2024, May 24–26, 2024, Oslo, Norway © 2024 Copyright held by the owner/author(s) .  \nACM ISBN 979-8-4007-1637-9/24/05  \n[https://doi.org/10.1145/3674029.3674037](https://doi.org/10.1145/3674029.3674037)  \nThere is great significance to stock price prediction, since it can yield substantial returns while minimizing losses. Trading decisions can be informed by successful forecasting, guiding traders on when to buy, sell, or hold stocks. Investors can also use it to protect their portfolios and hedge their positions, which can be a key component of risk management.  \nStock price prediction presents a number of challenges. There are many factors that influence stock prices, including macroeconomic events, geopolitical shifts, market sentiment, and unforeseeable shocks. As a result of these inherent complexities, researchers have developed advanced prediction models designed to take into account this complex interaction of variables [1] . In recent years, neural networks, specifically deep learning models, have proven to be one of the most effective methods for stock price prediction. Since neural networks are capable of learning and adapting to non-linear patterns in data, they are well-suited to modeling stock markets, which are dynamic and unpredictable.  \nBy optimizing neural network architectures, this research aims to improve the predictive ac","cbCaihfnqI4C26wF","https://ap.wps.com/l/cbCaihfnqI4C26wF","pdf",879324,1,"English","en",105,"# Introduction\n## Financial market forecasting and challenges\n## Deep learning for stock prediction\n## Motivation and paper organization","[{\"question\":\"What is the main goal of the study?\",\"answer\":\"To predict stock closing prices and improve forecasting accuracy using the Transformer model.\"},{\"question\":\"Which models are compared in the paper?\",\"answer\":\"The study compares Transformer with LSTM and Prophet.\"},{\"question\":\"Why is Transformer expected to perform well for stock prediction?\",\"answer\":\"Its encoder-decoder architecture and multi-head attention mechanism help better characterize stock market dynamics.\"}]","Predictive Modeling of Stock Prices Using Transformer Model | PDF",1785723320,20,{"code":4,"msg":30,"data":31},"ok",{"site_id":23,"language":22,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":85,"head_meta":87,"extra_data":89,"updated_unix":27},"predictive-modeling-of-stock-prices-using-transformer-model","",{"@graph":35,"@context":84},[36,53,67],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/predictive-modeling-of-stock-prices-using-transformer-model/119253/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":22,"description":14,"dateModified":61,"datePublished":61,"encodingFormat":60,"isAccessibleForFree":62,"interactionStatistic":63},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-08-03",true,{"@type":64,"interactionType":65,"userInteractionCount":4},"InteractionCounter",{"@type":66},"ViewAction",{"@type":68,"mainEntity":69},"FAQPage",[70,76,80],{"name":71,"@type":72,"acceptedAnswer":73},"What is the main goal of the study?","Question",{"text":74,"@type":75},"To predict stock closing prices and improve forecasting accuracy using the Transformer model.","Answer",{"name":77,"@type":72,"acceptedAnswer":78},"Which models are compared in the paper?",{"text":79,"@type":75},"The study compares Transformer with LSTM and Prophet.",{"name":81,"@type":72,"acceptedAnswer":82},"Why is Transformer expected to perform well for stock prediction?",{"text":83,"@type":75},"Its encoder-decoder architecture and multi-head attention mechanism help better characterize stock market dynamics.","https://schema.org",{"og:url":51,"og:type":86,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":88,"canonical":51},"index,follow",{"doc_id":7,"site_id":23},{"code":4,"msg":5,"data":91},[92,96,100,104,109,114,119,122,126,129,133],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":93,"show_sort_weight":94,"slug":95},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":97,"show_sort_weight":98,"slug":99},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":101,"show_sort_weight":102,"slug":103},"Exam",70,"exam",{"id":105,"doc_module":4,"doc_module_name":45,"category_name":106,"show_sort_weight":107,"slug":108},5,"Comic",60,"comic",{"id":110,"doc_module":4,"doc_module_name":45,"category_name":111,"show_sort_weight":112,"slug":113},6,"Technology",50,"technology",{"id":115,"doc_module":4,"doc_module_name":45,"category_name":116,"show_sort_weight":117,"slug":118},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":120,"slug":121},30,"research-report",{"id":123,"doc_module":4,"doc_module_name":45,"category_name":124,"show_sort_weight":28,"slug":125},9,"Religion & Spirituality","religion-spirituality",{"id":28,"doc_module":4,"doc_module_name":45,"category_name":127,"show_sort_weight":28,"slug":128},"World Cup","world-cup",{"id":130,"doc_module":4,"doc_module_name":45,"category_name":131,"show_sort_weight":130,"slug":132},10,"Lifestyle","lifestyle",{"id":134,"doc_module":4,"doc_module_name":45,"category_name":135,"show_sort_weight":105,"slug":136},19,"General","general"]