Accelerating Business Knowledge Acquisition For Investments
Financial due diligence is crucial for making informed investment decisions. Traditionally, this process involved labor-intensive manual analysis of financial documents. However, integrating Large Language Models (LLMs) can transform financial due diligence for the “little guy”.
LLMs rapidly analyze vast textual information, offering insights and summaries to guide investment decisions. Moreover, they enhance financial analysts’ capabilities by processing complex data at higher speed. Still, human expertise remains essential.
We introduce a systematic approach using ASML as an example. We create a template with over 400 questions. These questions cover various aspects of a business. The LLM then analyzes the company’s annual report. It provides detailed answers to each question, separately.
The result is a comprehensive report giving insights into finances, strategy, risks, and more.
This article is structured as follows:
- QA Template Document for Financial Due Diligence with LLMs
- Automating the Due Diligence Analysis with an OpenAI Assistants
- Producing an Extensive Exective Report with Key Summary
1. Technical Implementation
1.1 Financial Due Diligence with LLMs QAs
We start the process by creating a ‘QA template document’. This document is the key for performing the automated financial due diligence with LLMs.
It structures the evaluation of financial documents through targeted questions that delve into key details of a company.
We’ve developed a template which can be adapted with the analyst’s own questions. The templates breaks down into 16 sections, each contains 3 to 4 sub sections, which then contain around 10 questions we’d like the investigate. This sums to over 400+ questions to be explored.
We will be working with annual reports, but as you’ll see later on, the methdology can be applied to other type of reports as well.
The sections of the template are the following:
- Executive Summary
- Company Overview
- Market Analysis
- Financial Analysis
- Operational Review
- Technology and Innovation
- Customer and Supplier Analysis
- Competitive Strategy
- Legal Compliance
- Human Resources
- Environmental, Social, and Governance (ESG)
- Risk Management
- IT and Cybersecurity
- Cultural and Organizational Health
- External Factors
- Conclusion and Investment Thesis
Each section holds specific questions. For instance, the ‘Executive Summary’ might ask, “What are the primary financial highlights from the last fiscal year?” and “What significant risks did the due diligence uncover?”.
Whereas in the market section, we ask questions such as “What is the current size of the semiconductor equipment industry globally?” and“Who are ASML’s main competitors, and what are their strengths and weaknesses?”.
Please note that we are using ASML as an example, you’d need to adjust the questions slightly depending on the company you are investigating.
The main benefits of this structured approach:
- Coverage: Ensures all vital business aspects are examined
- Consistency: Maintains uniform analysis across different reports
- Efficiency: The AI addresses queries directly, speeding up the analysis.
The AI processes these questions to generate a detailed reports, question and answer pairs as well as a summary report.
The template that we will be using can be downloaded from Google Drive.
Powered By EmbedPress
from docx import Document
# Load the Word document from its path
doc_path = 'Business Due Dilligence TEMPLATE.docx'
doc = Document(doc_path)
# Initialize the dictionary to hold the document structure
questions_by_section = {}
# Temporary holders for current section and subsection
current_section = None
current_subsection = None
# Iterate over each paragraph in the document
for para in doc.paragraphs:
if para.style.name.startswith('Heading 1'):
# New main section
current_section = para.text.strip()
questions_by_section[current_section] = {}
elif para.style.name.startswith('Heading 2'):
# New subsection under the current section
current_subsection = para.text.strip()
questions_by_section[current_section][current_subsection] = []
elif para.text.strip(): # Ensure we don't add empty lines
# Regular text under a subsection, assumed to be a question
if current_section and current_subsection:
questions_by_section[current_section][current_subsection].append(para.text.strip())
# Example: print the structured data
for section, subsections in questions_by_section.items():
print(f"Section: {section}")
for subsection, questions in subsections.items():
print(f" Subsection: {subsection}")
for question in questions:
print(f" Question: {question}")
Section: Executive Summary
Section: 1. Company Overview
Subsection: History and Background
Question: When was ASML founded and by whom?
Question: What were the significant milestones in ASML's history?
Question: How has ASML's market share evolved over time?
...
Subsection: Business Model
Question: What is ASML's core business model?
Question: How does ASML generate revenue?
Question: What are the primary cost components of ASML's business?
Question: How does ASML's business model align with industry practices?
Question: What unique value does ASML offer to its customers?
...
Subsection: Strategic Objectives
...
Question: How often should ASML's performance and market conditions be reviewed post-investment?
Question: What performance indicators should be closely monitored?
Question: What contingency plans are recommended in case of adverse developments?
Question: What follow-up actions are suggested to ensure the implementation of recommendations?
1.2 Automating Analysis with OpenAI Assistants
To get answer to the QA template questions effectively, we will be using OpenAI Assistants, which have the ability to analyze all sort of documents.
We begin by setting up the OpenAI client and preparing our data:
- Initialize the OpenAI Client: We start by initializing the OpenAI client using a specific API key.
- Upload the Financial Report: We then upload the annual financial report. This report serves as the basis for gathering the due diligence anwers. You can download this report from here.
- Create an AI Assistant: An AI assistant is created with specific instructions to analyze the financial report. This assistant uses the LLMs to interpret and answer queries based on the document’s content.
- Process Questions and Retrieve Answers: We process each question from the structured QA template. We add every question to the thread, and the assistant generates responses based on the document analysis.
- Review and Output: Finally, the answers are reviewed and compiled into a structured dictionary (
qa_dict
), ready for analysis or reporting. This dictionary maps each section and its corresponding questions to the answers.
We’re giving the assistant one question at a time and asking it to look over the whole document for the answers.
This takes more effort, but it stops the AI from giving quick, incomplete answers that might happen if we asked all the questions at once.
Related Articles
Intelligent Web Browsing & Reporting with LangChain and OpenAI
Newsletter