IDEAS home Printed from https://ideas.repec.org/p/ehl/lserod/122592.html
   My bibliography  Save this paper

Sentiment trading with large language models

Author

Listed:
  • Kirtac, Kemal
  • Germano, Guido

Abstract

We analyse the performance of the large language models (LLMs) OPT, BERT, and FinBERT, alongside the traditional Loughran-McDonald dictionary, in the sentiment analysis of 965,375 U.S. financial news articles from 2010 to 2023. Our findings reveal that the GPT-3-based OPT model significantly outperforms the others, predicting stock market returns with an accuracy of 74.4%. A long-short strategy based on OPT, accounting for 10 basis points (bps) in transaction costs, yields an exceptional Sharpe ratio of 3.05. From August 2021 to July 2023, this strategy produces an impressive 355% gain, outperforming other strategies and traditional market portfolios. This underscores the transformative potential of LLMs in financial market prediction and portfolio management and the necessity of employing sophisticated language models to develop effective investment strategies based on news sentiment.

Suggested Citation

  • Kirtac, Kemal & Germano, Guido, 2024. "Sentiment trading with large language models," LSE Research Online Documents on Economics 122592, London School of Economics and Political Science, LSE Library.
  • Handle: RePEc:ehl:lserod:122592
    as

    Download full text from publisher

    File URL: http://eprints.lse.ac.uk/122592/
    File Function: Open access version.
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. 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.
    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. 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.
    4. 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.
    5. 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.
    6. Jegadeesh, Narasimhan & Wu, Di, 2013. "Word power: A new approach for content analysis," Journal of Financial Economics, Elsevier, vol. 110(3), pages 712-729.
    7. 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.
    8. Richard Frankel & Jared Jennings & Joshua Lee, 2022. "Disclosure Sentiment: Machine Learning vs. Dictionary Methods," Management Science, INFORMS, vol. 68(7), pages 5514-5532, July.
    9. Diego García, 2013. "Sentiment during Recessions," Journal of Finance, American Finance Association, vol. 68(3), pages 1267-1300, June.
    10. 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.
    11. 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.
    12. 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.
    13. A. Craig MacKinlay, 1997. "Event Studies in Economics and Finance," Journal of Economic Literature, American Economic Association, vol. 35(1), pages 13-39, March.
    14. 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.
    Full references (including those not matched with items on IDEAS)

    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. 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 2023.
    2. 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.
    3. Ardia, David & Bluteau, Keven & Boudt, Kris, 2022. "Media abnormal tone, earnings announcements, and the stock market," Journal of Financial Markets, Elsevier, vol. 61(C).
    4. García, Diego & Hu, Xiaowen & Rohrer, Maximilian, 2023. "The colour of finance words," Journal of Financial Economics, Elsevier, vol. 147(3), pages 525-549.
    5. 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.
    6. Fraiberger, Samuel P. & Lee, Do & Puy, Damien & Ranciere, Romain, 2021. "Media sentiment and international asset prices," Journal of International Economics, Elsevier, vol. 133(C).
    7. 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.
    8. 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.
    9. Hubert, Paul & Labondance, Fabien, 2021. "The signaling effects of central bank tone," European Economic Review, Elsevier, vol. 133(C).
    10. Renault, Thomas, 2017. "Intraday online investor sentiment and return patterns in the U.S. stock market," Journal of Banking & Finance, Elsevier, vol. 84(C), pages 25-40.
    11. Andrea Ajello & Diego Silva & Travis Adams & Francisco Vazquez-Grande, 2023. "More than Words: Twitter Chatter and Financial Market Sentiment," Finance and Economics Discussion Series 2023-034, Board of Governors of the Federal Reserve System (U.S.).
    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. Liu, Jun & Wu, Kai & Zhou, Ming, 2023. "News tone, investor sentiment, and liquidity premium," International Review of Economics & Finance, Elsevier, vol. 84(C), pages 167-181.
    14. Sharpe, Steven A. & Sinha, Nitish R. & Hollrah, Christopher A., 2023. "The power of narrative sentiment in economic forecasts," International Journal of Forecasting, Elsevier, vol. 39(3), pages 1097-1121.
    15. Daniel Borup & Jorge Wolfgang Hansen & Benjamin Dybro Liengaard & Erik Christian Montes Schütte, 2023. "Quantifying investor narratives and their role during COVID‐19," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 38(4), pages 512-532, June.
    16. Nyman, Rickard & Kapadia, Sujit & Tuckett, David, 2021. "News and narratives in financial systems: Exploiting big data for systemic risk assessment," Journal of Economic Dynamics and Control, Elsevier, vol. 127(C).
    17. Mohammad Alomari & Abdel Razzaq Al rababa’a & Ghaith El-Nader & Ahmad Alkhataybeh, 2021. "Who’s behind the wheel? The role of social and media news in driving the stock–bond correlation," Review of Quantitative Finance and Accounting, Springer, vol. 57(3), pages 959-1007, October.
    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. Shapiro, Adam Hale & Sudhof, Moritz & Wilson, Daniel J., 2022. "Measuring news sentiment," Journal of Econometrics, Elsevier, vol. 228(2), pages 221-243.
    20. Löffler, Gunter & Norden, Lars & Rieber, Alexander, 2021. "Negative news and the stock market impact of tone in rating reports," Journal of Banking & Finance, Elsevier, vol. 133(C).

    More about this item

    Keywords

    artificial intelligence investment strategies; generative pre-trained transformer (GPT); large language models; machine learning in stock return prediction; natural language processing (NLP);
    All these keywords.

    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

    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:ehl:lserod:122592. 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: LSERO Manager (email available below). General contact details of provider: https://edirc.repec.org/data/lsepsuk.html .

    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.