ALFFLLM·FINANCE

The List / Reports, Filings, Accounting, and Risk / paper

GPT-InvestAR: Enhancing Stock Investment Strategies through Annual Report Analysis with Large Language Models

Udit Gupta

2023Social Science Research Networkcites 29P1arXiv ↗DOI ↗Semantic Scholar ↗Source ↗

Abstract

Annual Reports of publicly listed companies contain vital information about their financial health which can help assess the potential impact on Stock price of the firm. These reports are comprehensive in nature, going up to, and sometimes exceeding, 100 pages. Analysing these reports is cumbersome even for a single firm, let alone the whole universe of firms that exist. Over the years, financial experts have become proficient in extracting valuable information from these documents relatively quickly. However, this requires years of practice and experience. This paper aims to simplify the process of assessing Annual Reports of all the firms by leveraging the capabilities of Large Language Models (LLMs). The insights generated by the LLM are compiled in a Quant styled dataset and augmented by historical stock price data. A Machine Learning model is then trained with LLM outputs as features. The walkforward test results show promising outperformance wrt S&P500 returns. This paper intends to provide a framework for future work in this direction. To facilitate this, the code has been released as open source.

In one sentence

GPT-InvestAR demonstrates that LLM-generated insights from 10-K filings, when used as features in a non-negative linear regression model, can outperform the S&P 500 in annual stock selection with minimal transaction costs.

Summary

This paper addresses the challenge of efficiently extracting actionable investment signals from lengthy, unstructured annual reports (10-K filings). While financial experts spend years mastering this analysis, the process is cumbersome for large universes of firms. The research positions Large Language Models (LLMs) as a scalable alternative to manual expert analysis, aiming to simplify the assessment of corporate financial health and strategic positioning by converting qualitative textual data into quantitative features for investment strategies. The methodology involves fetching 10-K filings for the top 1500 US companies by market cap from 2002 to 2023. The authors use the all-mpnet-base-v2 embedding model to chunk documents and retrieve relevant context for 27 curated questions posed to GPT-3.5-Turbo. The LLM outputs confidence scores (0-100) for each question, which serve as features. These are combined with historical price data to create target variables based on 12-month returns and maximum returns. A non-negative least squares linear regression model is trained on data from 2002-2017 and tested on 2018-2023, selecting the top k predicted stocks annually. Results indicate that the LLM-enhanced model outperforms the S&P 500 benchmark, particularly when selecting a small number of top-ranked stocks (k=5). The strategy utilizing maximum return targets showed significant outperformance, quadrupling a $1 investment over five years compared to the S&P 500's doubling. The paper highlights that annual rebalancing minimizes transaction costs, making long-horizon LLM signals viable. Limitations include the high computational cost and time required for LLM inference, the reliance on a specific model version (GPT-3.5), and the potential for overfitting given the small sampled dataset used for training and testing.

Research problem

The paper tackles the difficulty of analyzing comprehensive, unstructured annual reports (10-K filings) for large universes of companies. It seeks to determine if LLMs can effectively extract qualitative insights from these documents to generate predictive features for stock selection, thereby automating a process traditionally requiring significant human expertise.

Core contributions

  • Proposes a framework for converting 10-K filing text into quantitative investment features using LLMs.
  • Demonstrates the use of GPT-3.5 to answer specific financial and strategic questions from annual reports.
  • Integrates LLM-generated confidence scores with historical price data for regression-based stock prediction.
  • Validates the approach using a non-negative linear regression model on a large sample of US stocks.
  • Shows that annual rebalancing based on LLM signals reduces transaction costs compared to short-term strategies.

Method

  • Retrieved 10-K filings from SEC Edgar and Financial Modeling Prep.
  • Used all-mpnet-base-v2 for document embedding and ChromaDB for vector storage.
  • Curated 27 questions targeting financial health and strategic initiatives.
  • Queried GPT-3.5-Turbo with context from relevant document chunks.
  • Extracted confidence scores (0-100) as features for the ML model.
  • Created target variables based on 12-month and maximum returns.
  • Trained a non-negative least squares linear regression model.
  • Selected top-k stocks annually based on predicted target values.

Results & findings

  • The model outperforms the S&P 500 in selecting stocks for the upcoming year.
  • Selecting the top 5 stocks (k=5) yielded the best risk-adjusted returns.
  • The strategy using maximum return targets quadrupled a $1 investment over 5 years, while the S&P 500 doubled it.
  • LLM features provided predictive power for long-horizon (annual) stock selection.
  • Annual rebalancing minimized transaction costs, making the strategy net profitable.
  • Non-negative linear regression effectively filtered out irrelevant LLM features by assigning them zero coefficients.

Data & experiments

  • Dataset: 10-K filings for top 1500 US companies by market cap (S&P 500, 400, 600) from 2002-2023.
  • Sample size: 1,000 training datapoints and 500 testing datapoints due to LLM cost constraints.
  • Target variables: 12-month returns and maximum returns between successive filing dates.
  • Benchmark: S&P 500 index returns calculated over the same intervals.
  • Evaluation: Walk-forward testing with annual rebalancing, comparing top-k stock portfolios against the benchmark.

Limitations & caveats

  • High computational cost and time required for LLM inference on large datasets.
  • Reliance on a single LLM version (GPT-3.5) which may become outdated.
  • Small sampled dataset for training and testing may limit generalizability.
  • Potential for overfitting due to the specific target variable construction.
  • Does not account for all market microstructure effects or liquidity constraints.
  • The non-negative constraint may limit the model's ability to capture negative correlations.

Curator notes

Discovery status: round2_promoted. Source links: A Comprehensive Review of Generative AI in Finance; Revolutionizing Finance with LLMs: An Overview of Applications and Insights