Catch up on the latest AI articles

Can ChatGPT Predict Stock Price Movements? By: In News Headlines Sentiment Prediction

Can ChatGPT Predict Stock Price Movements? By: In News Headlines Sentiment Prediction

Large Language Models

3 main points
✔️ Investigate ChatGPT's ability to predict stock market price movements
✔️ Task to predict the impact of news headlines on a company's stock price (sentiment)
✔️ ChatGPT's sentiment prediction is better than existing methods and based on ChatGPT's output Trading strategies outperformed baseline strategies

Can ChatGPT Forecast Stock Price Movements? Return Predictability and Large Language Models
written by Alejandro Lopez-LiraYuehua Tang
(Submitted on 15 Apr 2023 (v1), last revised 22 Apr 2023 (this version, v2))
Comments: Previously posted in SSRN this https URL

Subjects: Statistical Finance (q-fin.ST); Computation and Language (cs.CL)

code:

The images used in this article are from the paper, the introductory slides, or were created based on them.

summary

In recent months, large-scale language models (LLMs), such as ChatGPT, have attracted a great deal of attention. However, their power in the field of economics is not yet clear. Although these LLMs are not specifically trained for economic data, they learn from any textual information and may be used to predict market price movements. In this study, we conducted experiments to investigate this point.

background

ChatGPT is a large-scale language model (LLM) developed based on GPT (Generative Pre-trained Transformer) and is one of the most advanced natural language processing models. GPT is a deep learning model for natural language processing that uses the Transformer structure and is capable of performing various tasks such as translation, summarization, and question answering. ChatGPT, a successor to Transformer, can handle similar tasks, and its strength lies in its ability to respond interactively like a human, and it is expected to be applied to chatbots and virtual assistants. On the other hand, ChatGPT has not been specifically trained for the individual task of predicting stock prices, and it was not clear how well it could handle this task.

data

Two datasets were used for analysis in this study.

Center for Research in Security Prices (CRSP): Consists of daily returns, stock prices, trading volumes, market capitalization, and other information for various companies listed on the major U.S. stock exchanges. Since ChatGPT is trained on data up to September 2021, we use data from October 2021 to December 2022 as our sample.

News headline data: News article headline data for the CRSP sample period (October 2021 to December 2022). These headlines were obtained from prominent news agencies, financial news sites, and social media. These headlines were pre-processed and filtered to ensure that the headlines are relevant to the company and to remove extremely similar headlines.

(computer) prompt

A prompt is a sentence that provides context and instructions for a ChatGPT response. The following forms of prompts were used in this study.

Forget all your previous instructions. Pretend you are a financial expert.

a financial expert with stock recommendation experience.

news, "NO" if bad news, or "UNKNOWN" if uncertain in the first line.

Is this headline

good or bad for the stock price of _company_name_ in the _term_ term?

Headline: _headline_.

In the prompt, _term_ is either short or long. The _company_name_ is the name of the company, and the _headline_ is the headline of the news about the company.

This prompt tells ChatGPT to act as if it were a financial expert skilled in stock trading. It asks the user to predict whether a given news headline is good or bad for the company's stock price. Specifically, the answer is YES if the headline is good for the company's stock price, BAD if the headline is bad, and UNKNOWN if the headline is uncertain. In addition, they are asked to give a one-sentence answer as to why they answered that way.

Experiments and Results

Cumulative returns from multiple trading strategies (not considering transaction fees)

We compared strategies that either buy or sell short according to ChatGPT's predictions with a baseline strategy that equally included the shares of all companies for which news was announced in the portfolio (black line).

The green line corresponds to a strategy that buys stocks of companies that ChatGPT identifies as good news, the red line corresponds to a strategy that shorts stocks of companies that ChatGPT identifies as bad news, and the blue line corresponds to a strategy that combines both strategies. The red line corresponds to the strategy of shorting the stock of the company that was determined to have bad news by ChatGPT, and the blue line corresponds to the strategy that combines both.

Average of next day's returns relative to predicted score

Here, the output of ChatGPT is quantified as follows: 1 for YES, 0 for UNKNOWN, and -1 for NO. The table shows that ChatGPT is better at predicting sentiment than GPT-1,2, BERT, etc. in capturing the average next-day returns.

This experiment demonstrates that the sentiment score from ChatGPT is effective in predicting stock market returns. Comparison of existing sentiment analysis methods with ChatGPT revealed that ChatGPT is superior to existing sentiment analysis methods, possibly because ChatGPT has a high level of linguistic comprehension that can capture subtle nuances in the textual data of news headlines. These results suggest that LLM is a good investment for LLM. These results suggest the potential utility of incorporating LLM into the investment decision-making process.

summary

This study investigated the ability of ChatGPT, a large-scale language model (LLM), to predict stock market returns based on the sentiment predictions of news headlines. Experimental results show that ChatGPT outperforms existing traditional sentiment analysis methods, suggesting that LLMs are useful in the financial and economic domains.

How LLMs will affect market dynamics and whether they will have a positive effect on the market when they penetrate the economy in the future are important issues that should continue to be investigated.

  • メルマガ登録(ver
  • ライター
  • エンジニア_大募集!!

If you have any suggestions for improvement of the content of the article,
please contact the AI-SCHOLAR editorial team through the contact form.

Contact Us