8 AI for financial research

 

This chapter covers

  • The challenges of using machine learning to predict stock prices
  • Research investments with LLMs
  • Submitting prompts to LLM with Python
  • Using prompt engineering to improve our queries

Let’s start this chapter with a radical idea. What if we stopped using code for financial research and relied on generative AI chatbots for investment advice? We can ask a large language model(LLM) questions such as “I am a risk-averse investor, and I want to invest in stocks in the Information Technology sector. What are three stocks with maximized returns and minimized risks?” Would you buy the three recommended stocks without additional due diligence?

This chapter examines the discriminative applications of machine learning in finance in the first part. We will highlight the limitations of linear regression and similar algorithms in chaotic systems, such as stock prices, which often lack patterns and are typically characterized by “random walks.” We will also outline how these algorithms can be used meaningfully in more isolated scenarios.

8.1 From code to machine learning

8.1.1 Unsupervised learning example

8.1.2 Supervised learning example

8.1.3 Market challenges

8.1.4 Technical challenges

8.1.5 Narrowing the scope

8.2 From machine learning to generative AI

8.2.1 Comparing LLMs

8.2.2 Complementing ML with GenAI

8.2.3 Challenges

8.2.4 Final judgement on ML and GenAI

8.3 Practical use of GenAI

8.3.1 Using LLMs as research assistants

8.3.2 Integrating LLMs into code

8.4 Prompt engineering

8.4.1 An investor’s profile

8.4.2 Using prompts to find companies to invest in

8.5 Summary