Using Large Language Models for Stock Valuation Analysis

Given structured inputs, LLMs can reproduce the logical framework for DCF valuation and generate multiple scenarios.

Wayne Thorp leads a class in AAII's new Essential Investing Video Course. Go to https://www.aaii.com/ves for more information and to subscribe.

Featured Tickers:
  • Shows how AI tools like ChatGPT can assist with stock valuation tasks
  • Teaches investors how to write effective AI prompts for accurate, logic-based financial models
  • Emphasizes limitations of LLMs and the need for realistic assumptions, oversight and human judgment

Artificial intelligence (AI) has entered a new era—one where large language models (LLMs), such as OpenAI’s ChatGPT and Anthropic’s Claude, can assist individual investors with tasks once reserved for Wall Street analysts. These models are not only capable of summarizing earnings reports or drafting emails, but when guided correctly, they can also walk an investor through complex valuation processes, such as discounted cash flow (DCF) analysis, scenario stress-testing, peer comparison using multiples and even portfolio-level exposure modeling.

For individual investors, this represents a profound shift in both access and capability. You no longer need to be fluent in Excel modeling or a computer’s terminal commands to build a valuation framework. With a well-written prompt, you can now create multiple valuation cases, interpret whether a stock is overvalued or undervalued based on growth expectations and test your investment thesis in minutes. The LLM becomes a financial analyst in your pocket—ready to estimate fair value or pressure-test assumptions anytime.

This guide offers a practical, step-by-step approach to using LLMs in stock valuation analysis. Here we explore two core use cases of LLMs in stock valuation: generating DCF models and running what-if scenarios. The online version of this article covers two other core use cases: interpreting multiples and evaluating valuation exposures across your stock portfolio.

What LLMs Are, and What They’re Not

LLMs, such as ChatGPT and Claude, are trained on a massive amount of financial texts, investment discussions and economic literature. As a result, they can perform many of the cognitive tasks required in valuation analysis—as long as the investor provides clear, detailed input. Understanding what these tools can and can’t do is essential before relying on them to assist in decision-making.

LLMs also serve as on-demand tutors. Confused about EV/EBITDA versus P/E? Need to know why a terminal growth rate can’t exceed the discount rate? Ask. These models excel at turning financial jargon into accessible logic.

But, they are not sentient. They don’t “know” that your 11% terminal growth rate is nonsense. (The terminal growth rate is the constant growth rate a company is expected to maintain over the long term.) They won’t challenge a fantasy forecast unless you explicitly ask. They do not fetch live data, scrape filings or account for breaking news. LLMs are tools—deterministic, bounded and deeply dependent on the quality of what you feed them.

Finally, LLMs are not tools for market timing. They don’t predict price movements, macroeconomic shifts or investor sentiment. They are best used as logic engines for valuation thinking—not as crystal balls.

What they excel at is structure, narrative and speed: turning assumptions into modeled outcomes; turning numbers into logic; turning investor hypotheses into valuation ranges. But they require context, constraints and oversight. In that sense, they’re akin to junior analysts.

DCF Modeling: Stock Valuation Foundation

DCF valuation is one of the most established methods of estimating the intrinsic value of a stock. It’s also one of the easiest to misuse. It requires projecting future cash flows and estimating terminal value (the value of an asset beyond the forecast period) and then discounting both to present value using a rate of return. Traditionally, this process involved complex spreadsheet modeling. With ChatGPT or Claude, the process becomes more conversational, intuitive and accessible—even for nontechnical investors.

Figure 1 shows a complete prompt template for creating a DCF model in an LLM. You can use this template by inserting your parameters for the bracketed placeholders.

FIGURE 1

The Complete DCF Prompt Template

This prompt can be pasted into ChatGPT, Claude or another large language model (LLM) to conduct discounted cash flow (DCF) analysis. Replace the bracketed text with your parameters. FCFF is free cash flow to the firm after accounting for investment spending. WACC is weighted average cost of capital, which is a blend of a company’s equity and borrowing costs.

“Create a 5-year DCF model for [Company] using these assumptions:
REVENUE PROJECTIONS:
- Year 1: [X]% growth (justify based on recent trends)
- Years 2-3: [Y]% growth (consider industry maturation)
- Years 4-5: [Z]% growth (converging to long-term industry rate)
PROFITABILITY:
- EBITDA margin: [X]% (specify if expanding/contracting over time)
- Tax rate: [applicable corporate rate]%
- Depreciation: [X]% of revenue (if significantly different from industry norm)
CAPITAL REQUIREMENTS:
- CapEx as % of revenue: [X]% (maintenance vs. growth)
- Working capital change: [assumption and reasoning]
- Free cash flow calculation: use FCFF methodology
TERMINAL VALUE:
- Terminal growth rate: [X]% (not exceeding long-term GDP growth of ~2-3%)
- Terminal EBITDA margin: [X]% (justify if different from year 5)
DISCOUNT RATE:
- WACC: [X]% (verify this is reasonable for industry and company size)
OUTPUT REQUIREMENTS:
- Show year-by-year cash flows
- Explain terminal value calculation
- Provide per-share valuation
- Include sensitivity analysis for key assumptions
QUALITY CONTROL:
- Sanity-check these assumptions against [Company’s] 5-year historical averages and industry benchmarks.
- Flag any assumptions that appear unrealistic and explain what business changes would justify departures from historical norms.”

Example: Realistic DCF for a Growth Stock

Here’s how to use the template to approach a company like Salesforce Inc. (CRM) with realistic assumptions.

“Create a 5-year DCF model for Salesforce using these assumptions:
REVENUE PROJECTIONS:
- Year 1: 11% growth (recent guidance suggests high single-digit to low double-digit)
- Years 2-3: 9% growth (market maturation in CRM space)
- Years 4-5: 7% growth (converging to long-term SaaS industry average)
PROFITABILITY:
- EBITDA margin: Year 1: 27%, expanding to 30% by Year 5 (operating leverage)
- Tax rate: 22% (corporate rate)
CAPITAL REQUIREMENTS:
- CapEx: 3% of revenue (primarily data centers and technology)
- Working capital: assume neutral (typical for SaaS businesses)
TERMINAL VALUE:
- Terminal growth rate: 2.5% (slightly below long-term GDP growth)
- Terminal EBITDA margin: 30% (mature SaaS margins)
DISCOUNT RATE:
- WACC: 9% (verify against software industry averages)”

Then ask:

“What would justify higher or lower growth assumptions? How sensitive is the valuation to margin expansion timing?”

Avoiding Common Pitfalls With DCF

The most common misuse of LLMs in DCF analysis is feeding overly optimistic assumptions. The model won’t tell you that 25% revenue growth for 10 years is unrealistic—it will just run the math. Here’s how to build better discipline with prompts.

Always Include Historical Context: “Before running this DCF, show me [Company’s] revenue growth, EBITDA margins, and CapEx as % of revenue for the past 5 years. Compare my assumptions to these historical ranges.”

Force Business Logic: “Explain the business logic behind each major assumption in this model. What specific factors would drive revenue growth to accelerate or decelerate from current levels?”

Specify Calculation Methods: Use FCFF methodology throughout. Exclude interest expense from cash flow calculations. Apply WACC as the discount rate. Show the calculation for each year’s free cash flow.”

FCFF is free cash flow to the firm after accounting for investment spending. WACC is weighted average cost of capital, which is a blend of a company’s equity and borrowing costs.

Ensure Nominal Growth Rates Are Being UsedConfirm all growth rates are nominal (including inflation). Ensure the terminal growth rate is consistent with long-term nominal GDP growth expectations.”

When to Use DCF Versus Other Valuation Tools

DCF valuation is most useful when:

  • The company has reasonably predictable cash flows;
  • You want to test upside/downside valuation cases;
  • You’re valuing growth or technology stocks where earnings are volatile; and
  • You have conviction about long-term business trends.

It’s less useful when:

  • The business is asset-intensive with erratic cash flow (e.g., banks, insurers);
  • You lack confidence in long-term forecasts;
  • The company’s value is driven more by asset values than cash generation; and
  • You’re looking at cyclical companies at peak/trough earnings.

In those cases, relative valuation—which involves comparing a company’s current valuation to its past or its competitors—may be a better starting point.

Scenario Modeling: Testing Your Thesis

Scenario modeling is where LLMs truly shine. They can rapidly generate multiple valuation cases for a stock, helping you understand the range of possible outcomes and identify key value drivers.

The Three-Scenario Framework

Here is a structured approach to build three robust scenario models. Insert your parameters for the bracketed text in this prompt.

“Create three DCF scenarios for [Company Name]:
BASE CASE (Most Likely):
- Revenue growth: [realistic based on recent performance]
- Margins: [current levels with modest improvement]
- Key assumption: [state your central thesis]
DOWNSIDE CASE (Conservative):
- Revenue growth: [X]% below base case
- Margins: [contract due to competition/costs]
- Key risks: [list 3-4 specific risks that could drive this outcome]
UPSIDE CASE (Optimistic but Achievable):
- Revenue growth: [X]% above base case
- Margins: [expand due to scale/efficiency]
- Key catalysts: [list 3-4 specific factors that could drive this outcome]
For each scenario, explain:
1. What would need to happen for this outcome to occur?
2. How realistic is this scenario based on company/industry history?
3. What early indicators would suggest we’re trending toward this case?
Format results showing value per share for each scenario and calculate the probability-weighted average if I assign probabilities.”

Advanced Sensitivity Analysis

To understand what really drives your valuation, use a prompt like the following.

“Create a sensitivity table for [Company Name] showing how valuation changes with:
- Terminal growth rates: 1.5%, 2.0%, 2.5%, 3.0%
- WACC: 7%, 8%, 9%, 10%, 11%
Highlight the base case intersection. Then identify which single assumption change has the biggest impact on valuation: terminal growth rate, Year 5 EBITDA margin, or revenue growth in Years 1-3.”

Risk-Based Scenario-Building

To connect the scenarios to actual business risks, use a prompt like this.

“For [Company Name], create scenarios based on these specific risks:
COMPETITIVE THREAT SCENARIO:
- New entrant captures 15% market share over 3 years
- Pricing pressure reduces gross margins by 200 basis points
- Model the valuation impact
ECONOMIC DOWNTURN SCENARIO:
- Customer spending cuts reduce growth by 50% for 2 years
- Margin compression as company maintains investment
- Recovery begins in Year 3
EXECUTION RISK SCENARIO:
- Product development delays push revenue realization out 1 year
- Integration costs increase by 50%
- Market share loss to better-executing competitors
For each scenario, calculate break-even points: At what valuation multiple would the stock be attractive even in the downside case?”

Mastering Multiples and Peer Comparisons

While DCF provides intrinsic value estimates, multiples reflect market sentiment and the relative attractiveness of a company. LLMs can quickly decode multiple relationships and help you understand market expectations.

Comprehensive Peer Analysis

“Compare [Company Name] to its peer group on these metrics:
VALUATION MULTIPLES:
- Forward P/E (next 12 months)
- EV/EBITDA (forward)
- EV/Revenue (forward)
- PEG ratio (P/E divided by expected EPS growth)
OPERATIONAL METRICS:
- Revenue growth (last 3 years average)
- EBITDA margin (current)
- Return on invested capital (ROIC)
- Free cash flow yield
For each metric where [Company] differs significantly from peers:
1. Explain potential reasons for the difference
2. Assess whether the difference is justified by fundamentals
3. Identify what would need to change for convergence
Peers to include: [list 3-5 closest competitors]”

Reverse-Engineering Market Expectations

Use LLMs to understand what growth the market is pricing in.

“[Company Name] currently trades at [X]x forward P/E, compared to the industry average of [Y]x.
Calculate:
1. What EPS growth rate would justify the current P/E assuming a ‘fair’ PEG ratio of 1.0-1.5?
2. How does this required growth compare to:
   - Company’s historical growth rates
   - Management guidance
   - Analyst consensus estimates
   - Industry growth trends
3. What would the stock price be if it traded at:
   - Industry average P/E multiple
   - Its own 5-year average P/E
   - A PEG ratio of 1.0 based on consensus growth estimates
Conclusion: Is the market pricing in realistic or heroic assumptions?”

Quality-Adjusted Multiple Analysis

Not all multiples are created equal. Use this approach to adjust for quality differences.

“Analyze why [Company A] trades at a premium/discount to [Company B]:
QUALITY FACTORS TO CONSIDER:
- Revenue growth consistency (coefficient of variation)
- Margin stability over economic cycles
- Balance sheet strength (debt/equity, interest coverage)
- Return on invested capital trends
- Market position and competitive moats
- Management execution track record
Create a ‘quality score’ for each company and determine if the valuation premium/discount is justified by quality differences. What would Company B need to improve to deserve a similar multiple?”

Portfolio-Level Valuation Analysis

Most investors don’t hold one stock. They manage diversified portfolios of stocks. LLMs can provide portfolio-wide insights that help you understand overall exposure and identify rebalancing opportunities. You can use this template by inserting your parameters for the bracketed placeholders.

Portfolio Valuation Health Check

“Analyze the valuation characteristics of my portfolio:
HOLDINGS:
[List your holdings with current weights]
CALCULATE:
- Weighted average P/E ratio (forward)
- Weighted average PEG ratio
- Weighted average revenue growth (expected)
- Weighted average EBITDA margin
- Percentage of portfolio in each valuation quartile (cheap/fair/expensive/very expensive)
COMPARE TO:
- S&P 500 average multiples
- Sector-specific benchmarks where applicable
IDENTIFY:
- Top 3 most expensive holdings (highest P/E or PEG)
- Top 3 cheapest holdings
- Holdings with highest growth expectations embedded in price
- Concentration in any single valuation style (growth vs. value)”

Rebalancing Scenarios

“Suggest portfolio adjustments to improve risk-adjusted returns:
CURRENT CONCERNS:
- [Specific issue: too much growth exposure, too concentrated, etc.]
PROPOSED CHANGES:
- Trim [overvalued holding] by [X]%
- Increase [undervalued holding] by [Y]%
- Add [new position] for [diversification/value]
For each suggested change:
1. Calculate impact on portfolio valuation metrics
2. Assess impact on sector/style diversification
3. Estimate potential return improvement if valuations normalize
4. Identify risks of the proposed changes
This is not a recommendation to trade, but an analytical framework for understanding portfolio implications.”

Sector Rotation Analysis

“Analyze sector rotation opportunities within my portfolio:
CURRENT SECTOR WEIGHTS:
[List your sector exposures]
EVALUATION CRITERIA:
- Forward P/E relative to historical average
- Sector growth expectations vs. historical norms
- Economic cycle positioning
- Relative performance over past 6-12 months
IDENTIFY:
- Most overvalued sectors in portfolio
- Most undervalued sectors in portfolio
- Sectors with best risk-reward for current economic environment
- Potential swaps within same market cap/style category
Create a ‘sector attractiveness matrix’ ranking sectors by valuation appeal and growth prospects.”

How Not to Use LLMs in Valuation

Most misuse of LLMs stems from overconfidence, not underperformance. These models will do what you tell them—even when what you tell them is absurd.

Don’t feed them fantasy inputs. Asking for a DCF on Tesla Inc. (TSLA) with 50% annual revenue growth for 10 years and a 5% terminal rate doesn’t make you bold—it makes your model meaningless. LLMs won’t question your inputs unless you tell them to.

Don’t assume financial context. If you say “run a DCF” but don’t specify whether to use FCFF or FCFE (free cash flow to equity), or how to treat capital expenditures (capex) and taxes, the model will improvise—sometimes inconsistently. Be explicit.

Don’t use them for real-time data. LLMs do not connect to live feeds. Always verify current financials, share counts and debt levels before running models.

Don’t outsource critical thinking. These tools are meant to simulate, not substitute. Be sure not to copy outputs without interrogating assumptions.

Don’t confuse eloquence with accuracy. LLMs generate clean, articulate answers that sound professional. That doesn’t make them correct. Every output needs validation against business reality.

Don’t ignore the human element. Markets are driven by sentiment, behavioral biases and factors that don’t appear in financial models. Use LLMs for analytical rigor, not market prediction.

Quality Control Checklist

Before acting on any LLM-generated valuation, ask yourself the following questions.

  1. Assumption Reality Check: Could I defend each major assumption to a skeptical investor?
  2. Historical Benchmarking: How do my assumptions compare to the company’s track record?
  3. Peer Comparison: Are my assumptions consistent with how similar companies have performed?
  4. Scenario Testing: Have I modeled realistic downside cases, not just upside dreams?
  5. Sensitivity Analysis: Do I understand which assumptions matter most?
  6. Business Logic: Can I explain the business rationale behind each number?
  7. Independent Verification: Have I checked key inputs against recent filings or earnings calls?

The most important variable in using LLMs for valuation isn’t the model. It’s the prompt. You are building a model one sentence at a time. Every specification matters.

  • Units: Specify millions vs. per-share calculations
  • Methodology: Define FCFF vs. FCFE explicitly
  • Taxes: Clarify corporate tax rates and timing
  • Capital Assumptions: Specify capex, working capital and depreciation treatment
  • Growth Patterns: Distinguish between nominal and real growth rates
  • Output Format: Request tables, sensitivity analysis or Excel-compatible formats

Better prompts yield better models. And better models yield better thinking, if you’re willing to interrogate them. Figure 2 provides a template to help you refine your models.

FIGURE 2

A Template for Complex Analysis

This meta-prompt structure can be used to conduct a comprehensive analysis with artificial intelligence (AI).

“I need a complete valuation analysis for [Company]. Please follow this process:
STEP 1: Data Foundation
- Summarize key financial metrics from the last 3 years
- Identify business model and primary value drivers
- Note any significant one-time items or accounting changes
STEP 2: Assumption Building
- Propose realistic assumptions based on historical performance
- Justify any departures from historical norms
- Flag high-uncertainty assumptions
STEP 3: Base Case Modeling
- Build 5-year DCF with explicit methodology
- Show year-by-year calculations
- Calculate per-share intrinsic value
STEP 4: Scenario Analysis
- Create upside/downside cases with specific risk factors
- Test sensitivity to key assumptions
- Provide probability-weighted valuation range
STEP 5: Peer Comparison
- Compare multiples to relevant competitors
- Identify valuation premium/discount drivers
- Assess relative attractiveness
STEP 6: Investment Thesis
- Synthesize findings into clear investment recommendation
- Identify key risks and catalysts
- Suggest monitoring metrics for thesis validation
For each step, ask me to confirm assumptions before proceeding to the next step.”

Conclusion: Your AI-Powered Edge

Used properly, LLMs compress hours of work into minutes while enhancing clarity, speeding up iteration and surfacing blind spots. They are powerful force multipliers for investors who possess discipline and business judgment.

The key is remembering that LLMs are tools, not advisers. They will execute whatever analysis you request, regardless of whether your assumptions make sense. Your edge comes from asking the right questions, testing realistic assumptions and maintaining intellectual honesty about what you don’t know.

In a world where information is cheap but judgment is rare, your competitive edge will come from the quality of your prompts, the rigor of your assumption-testing and your willingness to challenge your own conclusions. The LLM will reflect—and amplify—how serious you are about becoming a better investor. Use these tools to build better models, ask harder questions and stress-test your conviction. In the end, what separates successful investors from the crowd is the discipline of their thinking.

Start with small positions while you build confidence in your LLM-powered analysis. Test your models against market outcomes. Refine your prompting techniques. Most importantly, never stop asking whether your assumptions reflect business reality or wishful thinking. 

Advanced Prompting Techniques

The quality of your analysis depends entirely on the quality of your prompts. Here are advanced techniques to get better outputs.

The Assumption Documentation Prompt

Always force your LLM to justify its work.

“Before providing the valuation, create an ‘assumption audit trail’ that documents:
1. Each key assumption and its source/rationale
2. How each assumption compares to historical norms
3. What business changes would be required to justify departures from history
4. Which assumptions have highest uncertainty
5. Which assumptions have biggest impact on valuation if wrong
Then rank assumptions by: (Impact if wrong) x (Probability of being wrong)”

The Devil’s Advocate Prompt

Get your LLM to challenge your thinking.

“Play devil’s advocate with this valuation analysis:
1. What are the 3 weakest assumptions in this model?
2. What would a short-seller focus on?
3. What historical parallels suggest caution?
4. What could make the downside case even worse?
5. What am I likely overlooking due to confirmation bias?
Provide specific examples and data points, not just generic risks.”

The Robustness Testing Prompt

Test how sensitive your conclusions are.

“Test the robustness of this investment thesis:
1. At what valuation would this be a clear ‘avoid’ regardless of growth prospects?
2. What’s the minimum growth rate required to justify current prices?
3. How much margin compression could the stock withstand before becoming unattractive?
4. What’s the probability that key assumptions prove too optimistic?
5. What early warning signs would suggest the thesis is breaking down?
Create specific trigger points for re-evaluation.”

Discussion

MANJUNATH S from CA posted about 1 year ago:

Screenshots of Output from ChatGpt would be useful. At least to compare what I am getting.


JOHN L from NJ posted about 1 year ago:

Any evidence this careful ChatGpt analysis leads to market beating results? If not; why bother. Buy a cheap index fund and use the freed up time to enjoy your family and friends!


Wayne T from IL posted about 1 year ago:

@John: Totally fair point—and no, the article doesn’t claim ChatGPT leads to market-beating results. But then, neither does any DCF model or analyst forecast. The real value here is sharper thinking: faster modeling, clearer assumptions, and better discipline. Index funds are a great option for many. But for those who enjoy rolling up their sleeves and testing an investment thesis, LLMs offer real leverage—speed without sacrificing rigor. It’s not about guaranteed alpha. It’s about making smarter decisions with less guesswork.


BARRY J from TX posted about 1 year ago:

John, Wayne, #1 I, too, am struggling with setting a measure to assess the improvement I earn from using the ISS process. John's "market-beating results" are not something the 1985-2024 (40-year) training database period used to calibrate the ISS process could provide as a "proof of concept" since no training portfolio was available for a project 40 years in the future and creating several backtesting portfolios would not tell us anything about its relevance for the broad AAII userbase since AAII does not have access to member portfolios (as far as know). #2 I have decided to measure "value received" from my IIS education by the value my future decisions produce, measured by how well they contribute to my achieving my investing goals (1) market diversification to reduced risk (mean-variance-optimization), (2) allocations that provide "durability" during changing market cycle phases (changes in return), and (3) returns compared to level of risk I accept (return to risk). #3 I am still a bit sketchy on how the 13(?) investor sentiment/market sentiment and market structure indicators INTERACT AND USE the PROBABILITIES provided from prior periods to estimate future probabilities using the Bayes formula. #4 Side note. I see the launch of IIS as propitiously timed to take advantage of expected changes in the current business cycle phase, when interpreting the changes in indicators and their interactions will have increased importance. #5 I came to learn. Let it begin.


You need to log in as a registered AAII user before commenting.
Create an account

Log In

Get your free copy of our special report analyzing the tech stocks most likely to outperform the market.

Download the FREE Report Here: