Deep Attentive Learning for Stock Movement Prediction From Social Media Text and Company Correlations (2020)

Abstract: In the financial domain, risk modeling and profit generation heavily rely on the sophisticated and intricate stock movement prediction task. Stock forecasting is complex, given the stochastic dynamics and non-stationary behavior of the market. Stock movements are influenced by varied factors beyond the conventionally studied historical prices, such as social media and correlations among stocks. The rising ubiquity of online content and knowledge mandates an exploration of models that factor in such multimodal signals for accurate stock forecasting. We introduce an architecture that achieves a potent blend of chaotic temporal signals from financial data, social media, and inter-stock relationships via a graph neural network in a hierarchical temporal fashion. Through experiments on real-world S&P 500 index data and English tweets, we show the practical applicability of our model as a tool for investment decision making and trading.

## introduction stock prices have an intrinsically volatile and non-stationary nature, making their rise and fall hard to forecast @xcite . investment in stock markets involves a high risk regarding profit-making. prices are driven by diverse factors that include but are not limited to company performance (anthony and ramesh, 1992), historical trends @xcite , investor sentiment @xcite . uninformed trading decisions can leave traders and investors prone to financial risk and experience monetary losses. on the contrary, careful investment choices can maximize profits @xcite . conventional research focused on time series and technical analysis of a stock, i.e., using patterns from historical price signals to forecast stock movements @xcite ). however, price signals alone fail to capture market surprises and impacts of sudden unexpected events. social media texts like tweets can have huge impacts on the stock market. for instance, us president donald trump shared tweets expressing negative sentiments against lockheed martin, which led to a loss of around $5.8 billion to the company's market capitalization. 1 the efficient market hypothesis (emh) @xcite states that financial markets are informationally efficient, such that stock prices reflect all known information. existing works (sec. 2) mainly focus on subsets of stock relevant data. although useful, they do not jointly optimize learning over modalities like social media text and inter stock relations limiting their potential to capture a broader scope of stock movement affecting data, as we show in sec. 6. multimodal stock prediction involves multiple challenges @xcite . both price signals and tweets exhibit sequential context dependencies, where singular samples may not be informative enough but can be considered a sequence for a unified context. tweets often have diverse influence on stock prices, based on their intrinsic content, such as breaking news as opposed to noise like vague comments. fusing multiple modalities of vast stock related data generated with varying characteristics (frequency, noise, source) is complex and mandates the careful design of joint optimization over modality-specific components. building on the emh and prior work (sec. 2), we propose man-sf: multipronged attention network for stock forecasting that jointly learns from historical prices, social media, and inter stock relations. man-sf through hierarchical attention captures relevant signals across diverse data to train a graph attention network (gat) for stock prediction (sec. 3). man-sf (sec. 4) jointly learns from price and tweets over graph-based models for stock prediction. through varied experiments (sec. 5), we show the predictive power of man-sf along with profitability analysis (sec. 6) and qualitatively analyze man-sf in high risk scenarios (sec. 7). ## related work predicting stock movements spans multiple domains @xcite ; 1) theoretical: quantitative models like modern portfolio theory @xcite , black-scholes model @xcite , etc. and, 2) practical: investment strategies (blitz and van vliet, 2007), portfolio management @xcite , and beyond the world of finance @xcite . financial models conventionally focused on technical analysis (ta) relying only on numerical features like past prices @xcite and macroeconomic indicators like gdp @xcite . such ta methods include discrete: garch @xcite , continuous (andersen, 2007), and neural approaches @xcite . newer models based on the emh that are categorized under fundamental analysis (fa) @xcite , account for stock affecting factors beyond numerical ones such as investor sentiment through news, etc. work in natural language processing (nlp) from sources such as news @xcite , social media data @xcite , earnings calls @xcite shows the merit of fa in capturing market sentiment, surprises, mergers, acquisitions that traditional ta based methods fail to account. a limitation of existing nlp methods for stock prediction is that they assume stock movements to be independent of each other, contrary to true market function @xcite . this assumption hinders nlp centric fa's ability to learn latent patterns for the study of interrelated stocks. another line of fa revolves around employing graph-based methods to improve ta (e.g., pricebased models) by augmenting them with inter stock relations @xcite . @xcite combine historical prices with stock graphs through graph convolution networks (gcns), outperforming price-only models. similarly, @xcite further improve graph neural network methods by weighing stock relations through attention mechanisms, as not all stock movements are equally correlated. despite the popularity of nlp and graph-based stock prediction, multimodal methods that capture inter stock relations and market sentiment through linguistic cues are seldom explored. jue liu (2019) combines feature extraction from news sentiment scores, financial information (price-earnings ratio, etc.) along with knowledge graph embeddings through transr. however, such existing approaches @xcite are unable to represent textual signals from social media and prices temporally, as they only utilize sentiment scores and do not account for stock correlations. to cover this gap in prior research, man-sf captures a broader set of features as opposed to both conventional ta and fa that singularly focus on either text or graph modalities, but not both together. ## problem formulation man-sf's main objective is to learn temporally relevant information jointly from tweets and historical price signals and make use of corporate relations among stocks to predict movements. following @xcite , we formalize movement based on the difference between the adjusted closing prices of the stock @xmath0. we formulate stock movement prediction as a binary classification problem. problem statement: given stock @xmath1, and historical price data and tweets for stock s over a lookback window of t days over the day range [t -t, t -1], we define the price movement of stock s from day t -1 to t as: ## man-sf: components and learning in this section, we first give an overview of man-sf, followed by a detailed explanation of each component. as shown in figure 1 , man-sf first encodes market data for each stock over a fixed period. formally, we encode stock features x @xmath2, x @xmath3, q t ); where, c @xmath4, s 2 , . . . s s }. similarly, q @xmath5. we detail these encoders first, and then explain the fusion b(•) over c t and q t to obtain x @xmath6. we then describe the graph to represent the inter stock relations. lastly, we explain the gat to which the fused feature vector x t is passed to propagate features based on inter-stock relations along with the joint optimization of man-sf. ## results and analysis we now discuss the experimental results and some findings with their financial implications. ## qualitative analysis we conduct an extended analysis across two highrisk scenarios, as shown in figure 5 , to study the applicability of man-sf to investors in the stock market. the study is based on apple's (aapl) trend during 12 th nov -18 th nov. figure 5 shows some of the tweets posted and aapl's relations with relevant stocks such as alibaba (baba), google (goog), and among others during that period. ## conclusion and future work we study stock movement prediction by using natural language, graph-based and numeric features. we propose man-sf, a neural model that jointly learns temporally relevant signals from chaotic multimodal data spanning historical prices, tweets, and inter stock correlations in a hierarchical fashion. extensive quantitative and qualitative experiments on real market data demonstrate man-sf's applicability for neural stock forecasting. we plan to further use news articles, earnings calls, and other data sources to capture market dynamics better. another interesting direction of future research is to explore the cold start problem, where man-sf could be leveraged to predict stock movements for new stocks. lastly, we would also like to extend man-sf's architecture to not be limited to model all stocks together (because of its gat component) to increase scalability to cross-market scenarios.