IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2412.19245.html
   My bibliography  Save this paper

Sentiment trading with large language models

Author

Listed:
  • Kemal Kirtac
  • Guido Germano

Abstract

We investigate the efficacy of large language models (LLMs) in sentiment analysis of U.S. financial news and their potential in predicting stock market returns. We analyze a dataset comprising 965,375 news articles that span from January 1, 2010, to June 30, 2023; we focus on the performance of various LLMs, including BERT, OPT, FINBERT, and the traditional Loughran-McDonald dictionary model, which has been a dominant methodology in the finance literature. The study documents a significant association between LLM scores and subsequent daily stock returns. Specifically, OPT, which is a GPT-3 based LLM, shows the highest accuracy in sentiment prediction with an accuracy of 74.4%, slightly ahead of BERT (72.5%) and FINBERT (72.2%). In contrast, the Loughran-McDonald dictionary model demonstrates considerably lower effectiveness with only 50.1% accuracy. Regression analyses highlight a robust positive impact of OPT model scores on next-day stock returns, with coefficients of 0.274 and 0.254 in different model specifications. BERT and FINBERT also exhibit predictive relevance, though to a lesser extent. Notably, we do not observe a significant relationship between the Loughran-McDonald dictionary model scores and stock returns, challenging the efficacy of this traditional method in the current financial context. In portfolio performance, the long-short OPT strategy excels with a Sharpe ratio of 3.05, compared to 2.11 for BERT and 2.07 for FINBERT long-short strategies. Strategies based on the Loughran-McDonald dictionary yield the lowest Sharpe ratio of 1.23. Our findings emphasize the superior performance of advanced LLMs, especially OPT, in financial market prediction and portfolio management, marking a significant shift in the landscape of financial analysis tools with implications to financial regulation and policy analysis.

Suggested Citation

  • Kemal Kirtac & Guido Germano, 2024. "Sentiment trading with large language models," Papers 2412.19245, arXiv.org.
  • Handle: RePEc:arx:papers:2412.19245
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2412.19245
    File Function: Latest version
    Download Restriction: no
    ---><---

    Other versions of this item:

    References listed on IDEAS

    as
    1. Malcolm Baker & Jeffrey Wurgler, 2006. "Investor Sentiment and the Cross‐Section of Stock Returns," Journal of Finance, American Finance Association, vol. 61(4), pages 1645-1680, August.
    2. Stephen Hansen & Michael McMahon & Andrea Prat, 2018. "Transparency and Deliberation Within the FOMC: A Computational Linguistics Approach," The Quarterly Journal of Economics, President and Fellows of Harvard College, vol. 133(2), pages 801-870.
    3. Daron Acemoglu & David Autor & Jonathon Hazell & Pascual Restrepo, 2022. "Artificial Intelligence and Jobs: Evidence from Online Vacancies," Journal of Labor Economics, University of Chicago Press, vol. 40(S1), pages 293-340.
    4. Scott R. Baker & Nicholas Bloom & Steven J. Davis, 2016. "Measuring Economic Policy Uncertainty," The Quarterly Journal of Economics, President and Fellows of Harvard College, vol. 131(4), pages 1593-1636.
    5. Fama, Eugene F. & French, Kenneth R., 1993. "Common risk factors in the returns on stocks and bonds," Journal of Financial Economics, Elsevier, vol. 33(1), pages 3-56, February.
    6. Paul C. Tetlock, 2007. "Giving Content to Investor Sentiment: The Role of Media in the Stock Market," Journal of Finance, American Finance Association, vol. 62(3), pages 1139-1168, June.
    7. Richard Frankel & Jared Jennings & Joshua Lee, 2022. "Disclosure Sentiment: Machine Learning vs. Dictionary Methods," Management Science, INFORMS, vol. 68(7), pages 5514-5532, July.
    8. Carhart, Mark M, 1997. "On Persistence in Mutual Fund Performance," Journal of Finance, American Finance Association, vol. 52(1), pages 57-82, March.
    9. Calomiris, Charles W. & Mamaysky, Harry, 2019. "How news and its context drive risk and returns around the world," Journal of Financial Economics, Elsevier, vol. 133(2), pages 299-336.
    10. Diego García, 2013. "Sentiment during Recessions," Journal of Finance, American Finance Association, vol. 68(3), pages 1267-1300, June.
    11. Gerard Hoberg & Gordon Phillips, 2016. "Text-Based Network Industries and Endogenous Product Differentiation," Journal of Political Economy, University of Chicago Press, vol. 124(5), pages 1423-1465.
    12. A. Craig MacKinlay, 1997. "Event Studies in Economics and Finance," Journal of Economic Literature, American Economic Association, vol. 35(1), pages 13-39, March.
    13. Tim Loughran & Bill Mcdonald, 2011. "When Is a Liability Not a Liability? Textual Analysis, Dictionaries, and 10‐Ks," Journal of Finance, American Finance Association, vol. 66(1), pages 35-65, February.
    14. Jegadeesh, Narasimhan & Wu, Di, 2013. "Word power: A new approach for content analysis," Journal of Financial Economics, Elsevier, vol. 110(3), pages 712-729.
    15. Pekka Malo & Ankur Sinha & Pekka Korhonen & Jyrki Wallenius & Pyry Takala, 2014. "Good debt or bad debt: Detecting semantic orientations in economic texts," Journal of the Association for Information Science & Technology, Association for Information Science & Technology, vol. 65(4), pages 782-796, April.
    16. Manela, Asaf & Moreira, Alan, 2017. "News implied volatility and disaster concerns," Journal of Financial Economics, Elsevier, vol. 123(1), pages 137-162.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Dong, Mengming Michael & Stratopoulos, Theophanis C. & Wang, Victor Xiaoqi, 2024. "A scoping review of ChatGPT research in accounting and finance," International Journal of Accounting Information Systems, Elsevier, vol. 55(C).
    2. Han Ding & Yinheng Li & Junhao Wang & Hang Chen, 2024. "Large Language Model Agent in Financial Trading: A Survey," Papers 2408.06361, arXiv.org.
    3. Olamilekan Shobayo & Sidikat Adeyemi-Longe & Olusogo Popoola & Bayode Ogunleye, 2024. "Innovative Sentiment Analysis and Prediction of Stock Price Using FinBERT, GPT-4 and Logistic Regression: A Data-Driven Approach," Papers 2412.06837, arXiv.org.
    4. Sui, Cong & Wang, Shuhan & Zheng, Wei, 2024. "Sentiment as a shipping market predictor: Testing market-specific language models," Transportation Research Part E: Logistics and Transportation Review, Elsevier, vol. 189(C).

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Obaid, Khaled & Pukthuanthong, Kuntara, 2022. "A picture is worth a thousand words: Measuring investor sentiment by combining machine learning and photos from news," Journal of Financial Economics, Elsevier, vol. 144(1), pages 273-297.
    2. Alejandro Lopez-Lira & Yuehua Tang, 2023. "Can ChatGPT Forecast Stock Price Movements? Return Predictability and Large Language Models," Papers 2304.07619, arXiv.org, revised Sep 2024.
    3. García, Diego & Hu, Xiaowen & Rohrer, Maximilian, 2023. "The colour of finance words," Journal of Financial Economics, Elsevier, vol. 147(3), pages 525-549.
    4. Alejandro Bernales & Marcela Valenzuela & Ilknur Zer, 2023. "Effects of Information Overload on Financial Markets: How Much Is Too Much?," International Finance Discussion Papers 1372, Board of Governors of the Federal Reserve System (U.S.).
    5. Jin, Xuejun & Chen, Cheng & Yang, Xiaolan, 2024. "The effect of international media news on the global stock market," International Review of Economics & Finance, Elsevier, vol. 89(PA), pages 50-69.
    6. Ahmad, Khurshid & Han, JingGuang & Hutson, Elaine & Kearney, Colm & Liu, Sha, 2016. "Media-expressed negative tone and firm-level stock returns," Journal of Corporate Finance, Elsevier, vol. 37(C), pages 152-172.
    7. Fraiberger, Samuel P. & Lee, Do & Puy, Damien & Ranciere, Romain, 2021. "Media sentiment and international asset prices," Journal of International Economics, Elsevier, vol. 133(C).
    8. Vegard Høghaug Larsen & Leif Anders Thorsrud, 2022. "Asset returns, news topics, and media effects," Scandinavian Journal of Economics, Wiley Blackwell, vol. 124(3), pages 838-868, July.
    9. Ali Kabiri & Harold James & John Landon‐Lane & David Tuckett & Rickard Nyman, 2023. "The role of sentiment in the US economy: 1920 to 1934," Economic History Review, Economic History Society, vol. 76(1), pages 3-30, February.
    10. Anand, Abhinav & Basu, Sankarshan & Pathak, Jalaj & Thampy, Ashok, 2021. "The impact of sentiment on emerging stock markets," International Review of Economics & Finance, Elsevier, vol. 75(C), pages 161-177.
    11. Eleni Kalamara & Arthur Turrell & Chris Redl & George Kapetanios & Sujit Kapadia, 2022. "Making text count: Economic forecasting using newspaper text," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 37(5), pages 896-919, August.
    12. Ali Kabiri & Harold James & John Landon-Lane & David Tuckett & Rickard Nyman, 2020. "The Role of Sentiment in the Economy: 1920 to 1934," CESifo Working Paper Series 8336, CESifo.
    13. Andres Algaba & David Ardia & Keven Bluteau & Samuel Borms & Kris Boudt, 2020. "Econometrics Meets Sentiment: An Overview Of Methodology And Applications," Journal of Economic Surveys, Wiley Blackwell, vol. 34(3), pages 512-547, July.
    14. Kim, Hee-Eun & Jo, Hoje & Ahn, Tae-Wook & Yi, Junesuh, 2022. "Corporate misconduct, media coverage, and stock returns," International Review of Financial Analysis, Elsevier, vol. 84(C).
    15. Ardia, David & Bluteau, Keven & Boudt, Kris, 2022. "Media abnormal tone, earnings announcements, and the stock market," Journal of Financial Markets, Elsevier, vol. 61(C).
    16. Liu, Sha & Han, Jingguang, 2020. "Media tone and expected stock returns," International Review of Financial Analysis, Elsevier, vol. 70(C).
    17. Nicky J. Ferguson & Dennis Philip & Herbert Y. T. Lam & Jie Michael Guo, 2015. "Media Content and Stock Returns: The Predictive Power of Press," Multinational Finance Journal, Multinational Finance Journal, vol. 19(1), pages 1-31, March.
    18. Daniele Ballinari & Simon Behrendt, 2021. "How to gauge investor behavior? A comparison of online investor sentiment measures," Digital Finance, Springer, vol. 3(2), pages 169-204, June.
    19. Karsten Müller, 2022. "German forecasters’ narratives: How informative are German business cycle forecast reports?," Empirical Economics, Springer, vol. 62(5), pages 2373-2415, May.
    20. Gu, Chen & Kurov, Alexander, 2020. "Informational role of social media: Evidence from Twitter sentiment," Journal of Banking & Finance, Elsevier, vol. 121(C).

    More about this item

    JEL classification:

    • C53 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Forecasting and Prediction Models; Simulation Methods
    • G10 - Financial Economics - - General Financial Markets - - - General (includes Measurement and Data)
    • G11 - Financial Economics - - General Financial Markets - - - Portfolio Choice; Investment Decisions
    • G12 - Financial Economics - - General Financial Markets - - - Asset Pricing; Trading Volume; Bond Interest Rates
    • G14 - Financial Economics - - General Financial Markets - - - Information and Market Efficiency; Event Studies; Insider Trading

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2412.19245. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.