|
Getting your Trinity Audio player ready...
|
What if, instead of simply telling AI what you want, you could show it what a good answer looks like?
That is the basic idea behind one-shot and few-shot prompting.
For investors, this can be particularly useful. Financial analysis often follows repeatable patterns: evaluating profitability, comparing companies, classifying businesses, interpreting financial ratios, summarizing annual reports, or assessing investment risks.
Instead of repeatedly explaining the exact analytical style you want, you can provide one or more examples and ask the AI to apply the same pattern to a new company.
This can make AI-assisted investment research more consistent, structured and aligned with your analytical framework.
But there is an important catch:
AI learns patterns from your examples—including bad patterns.
So examples must be chosen carefully.
Let’s understand how one-shot and few-shot prompting work and how investors can use them effectively.
What Is Zero-Shot Prompting? 🎯
Before understanding one-shot and few-shot prompting, we need to understand zero-shot prompting.
Zero-shot means you give the AI a task without providing an example of the desired result.
For example:
Analyze ICICI Bank as a long-term investment.
Evaluate:
- Business quality
- Profitability
- Growth
- Asset quality
- Valuation
- Risks
The AI has to determine how to approach the task based entirely on your instructions and its learned knowledge.
This can work very well for many tasks.
But sometimes your instructions leave room for interpretation.
For example, what exactly does:
“Assess profitability”
mean?
Should the AI look at:
- ROE?
- ROA?
- NIM?
- Net profit margin?
- Profit growth?
- Capital efficiency?
You may know what you mean, but the model has to infer it.
That’s where examples can help.
What Is One-Shot Prompting? 1️⃣
One-shot prompting means providing one example before asking the AI to perform the actual task.
The example demonstrates what you consider a good result.
For instance:
Example:
Company: ABC Bank
ROE: 18%
ROA: 2.1%
Asset Quality: Strong
Valuation: Reasonable
Assessment:
ABC Bank demonstrates strong profitability, healthy asset quality
and a reasonable valuation. Overall, the company appears financially
strong for a long-term investor.
Now analyze ICICI Bank using the same framework and style.
The example gives the AI additional information that a conventional instruction might not communicate easily.
It demonstrates:
- What metrics matter
- How the metrics should be interpreted
- What the assessment should look like
- How concise or detailed the answer should be
You aren’t merely saying:
“Analyze ICICI Bank.”
You’re effectively saying:
“Here is an example of how I want this type of analysis performed. Now apply the same pattern.”
What Is Few-Shot Prompting? 🔢
Few-shot prompting takes the same idea one step further.
Instead of providing one example, you provide multiple examples.
For instance:
Example 1:
Company: ABC Bank
ROE: 19%
ROA: 2.2%
Asset Quality: Strong
Valuation: Reasonable
Assessment:
Strong profitability and asset quality combined with reasonable
valuation make this an attractive candidate for further research.
Example 2:
Company: XYZ Bank
ROE: 11%
ROA: 0.9%
Asset Quality: Weakening
Valuation: Expensive
Assessment:
Lower profitability, weaker asset quality and an expensive valuation
create significant concerns.
Example 3:
Company: PQR Bank
ROE: 18%
ROA: 1.9%
Asset Quality: Strong
Valuation: Expensive
Assessment:
The business appears high quality, but valuation reduces its
investment attractiveness.
Now analyze ICICI Bank using the same framework.
Now the AI has several examples from which it can identify a pattern.
The examples communicate not only what to analyze, but also how different combinations of characteristics should influence the assessment.
Google’s current prompting guidance describes prompts without examples as zero-shot and prompts containing examples as few-shot, noting that examples can help regulate formatting, phrasing, scope and response patterns. It also recommends specific and varied examples and consistent formatting across examples.
One-Shot vs Few-Shot vs Zero-Shot 📊
| Technique | Examples Provided | Best Used For | Complexity |
|---|---|---|---|
| Zero-shot | 0 | Straightforward tasks | Low |
| One-shot | 1 | Demonstrating a desired pattern | Low–Medium |
| Few-shot | 2–5+ | Complex patterns and classifications | Medium–High |
| Fine-tuning | Large training dataset | Repeated specialized behavior | High |
The important point is that few-shot prompting is not the same as training or fine-tuning a model.
You are not permanently changing the AI.
You are providing examples within the current prompt or interaction to guide the response.
Why Examples Can Be Powerful 💡
Instructions tell the model what you want.
Examples show the model what that looks like.
Consider the difference.
Instruction only
Classify Indian companies as Strong, Average or Weak based on financial quality.
That’s ambiguous.
What constitutes “Strong”?
Now provide examples:
ROE 22%, ROCE 24%, strong FCF, low debt
→ Strong
ROE 14%, ROCE 15%, moderate FCF, moderate debt
→ Average
ROE 7%, weak FCF, high debt
→ Weak
The AI now has a pattern to work with.
This doesn’t mean the AI has discovered an objective definition of financial quality.
It means you have communicated your framework more explicitly.
That distinction is extremely important.
The Hidden Power of Examples: They Communicate Multiple Instructions at Once
Suppose you want an AI to write an investment assessment that is:
- analytical
- concise
- balanced
- evidence-based
- cautious about valuation
You could spend several paragraphs explaining those requirements.
Or you could demonstrate them.
Example:
Business Quality: High
Financial Strength: Strong
Growth: Moderate
Valuation: Expensive
Assessment:
The company has strong underlying business quality and financial
strength. However, the current valuation leaves limited room for
execution disappointments. The business may warrant further research,
but valuation discipline is important.
One example has communicated:
structure + tone + level of detail + analytical approach + conclusion style.
That is why examples can be so useful.
The Investor’s Zero-Shot → One-Shot → Few-Shot Progression 📈
Let’s take a realistic investment task.
Stage 1: Zero-Shot
Analyze Tata Consumer Products as a long-term investment.
The AI has considerable freedom.
Stage 2: One-Shot
Example:
Company: Example FMCG Company
Revenue Growth: Strong
Operating Margin: Expanding
ROE: 21%
Debt: Low
Valuation: High
Assessment:
The company demonstrates strong business quality and improving
profitability. However, the elevated valuation reduces the margin
of safety.
Now analyze Tata Consumer Products using the same framework.
Now the AI understands your preferred format.
Stage 3: Few-Shot
Example 1:
Strong growth + strong margins + reasonable valuation
→ Attractive
Example 2:
Strong business + weak balance sheet + expensive valuation
→ Cautious
Example 3:
Moderate growth + strong cash generation + reasonable valuation
→ Attractive
Example 4:
Weak growth + declining margins + expensive valuation
→ Unattractive
Now evaluate Tata Consumer Products using the same framework.
Now the model has multiple examples covering different situations.
That is much closer to teaching an analytical classification framework.
Few-Shot Prompting Is Especially Useful for Classification 🎯
One of the strongest applications is classification.
Imagine you want to classify companies into:
🟢 High Quality
🟡 Watchlist
🔴 Low Quality
Instead of simply defining these categories, provide examples.
<examples>
<example>
ROE: 22%
ROCE: 25%
FCF: Strong
Debt: Low
Assessment: High Quality
</example>
<example>
ROE: 15%
ROCE: 16%
FCF: Moderate
Debt: Moderate
Assessment: Watchlist
</example>
<example>
ROE: 8%
ROCE: 9%
FCF: Weak
Debt: High
Assessment: Low Quality
</example>
</examples>
Then:
Evaluate the following company using the same framework:
ROE: 19%
ROCE: 21%
FCF: Strong
Debt: Low
The AI can infer the classification pattern from the examples.
But Here Is the Big Problem ⚠️
Examples Can Teach the AI the Wrong Lesson
Suppose your examples are:
ROE > 20% → Good company
ROE > 20% → Good company
ROE > 20% → Good company
You may unintentionally teach the AI:
High ROE = good investment.
That’s obviously incomplete.
A company can have a high ROE because of:
- high leverage
- a small equity base
- aggressive financial engineering
- cyclical earnings
- temporary profitability
And even a genuinely excellent company can be a poor investment if the valuation is excessive.
This is why few-shot prompting doesn’t eliminate analytical judgment.
It transfers some of that judgment into the examples.
The Three Rules of Good Financial Examples 📚
1️⃣ Examples should be representative
Don’t provide only your favorite type of company.
Include different situations.
For example:
High quality + reasonable valuation
High quality + expensive valuation
Weak business + cheap valuation
Strong growth + high risk
This helps the AI understand the distinctions.
2️⃣ Examples should be accurate
This is particularly important in financial applications.
If your example contains an incorrect interpretation, the AI may reproduce the same pattern.
Bad example → bad pattern → bad output.
Your examples are effectively part of the prompt’s analytical specification.
3️⃣ Examples should be consistent
If Example 1 uses:
Company
ROE
ROCE
Debt
FCF
Assessment
then Example 2 shouldn’t suddenly use:
Business Quality
Management
Valuation
Conclusion
without a reason.
Consistent formatting makes the intended pattern clearer.
Google specifically recommends consistent formatting across few-shot examples, including consistent tags, spacing, line breaks and example separators.
One-Shot Prompting for Financial Statement Analysis 📊
This is where the technique becomes particularly interesting for investors.
Suppose you want AI to interpret financial ratios.
You could provide an example:
Example:
ROE: 24%
ROCE: 27%
Debt/Equity: 0.20
FCF: Positive for 8 consecutive years
Revenue Growth: 12% CAGR
Interpretation:
The company demonstrates strong capital efficiency, low leverage
and consistent cash generation. The combination suggests strong
financial quality, although valuation must be assessed separately.
Now analyze:
ROE: 18%
ROCE: 20%
Debt/Equity: 0.35
FCF: Positive for 5 consecutive years
Revenue Growth: 10% CAGR
The AI now has a model for how you interpret the numbers, rather than simply being given a list of ratios.
That can be extremely useful when building repeatable financial-analysis workflows.
Few-Shot Prompting for Comparing Companies 🏦
Suppose you’re comparing Indian banks.
Instead of asking:
Compare HDFC Bank and ICICI Bank.
you could show the model how you want bank comparisons performed.
Example:
Company A:
ROE: 17%
ROA: 2.0%
Asset Quality: Strong
Growth: Strong
Valuation: Premium
Company B:
ROE: 15%
ROA: 1.7%
Asset Quality: Strong
Growth: Moderate
Valuation: Reasonable
Assessment:
Company A has superior profitability and growth, but its premium
valuation reduces the margin of safety. Company B has somewhat lower
growth but offers a more reasonable valuation.
Now compare:
HDFC Bank vs ICICI Bank
using the same analytical framework.
The example establishes the comparison logic, not merely the format.
Few-Shot Prompting for Annual Reports 📄
Another excellent use case is document analysis.
Imagine you are reading annual reports from multiple companies.
You want the AI to identify:
- strategic priorities
- major risks
- capital allocation
- management commentary
- changes in competitive position
You could give it an example:
<example>
Management Statement:
"We intend to expand manufacturing capacity by 30% over the
next three years."
Investor Interpretation:
The company expects significant capacity expansion, which may
support future growth but could also increase capital expenditure
and execution risk.
</example>
<task>
Identify similar management statements in the following annual report
and explain their potential investor implications.
</task>
This is powerful because you’re teaching the AI what kind of interpretation you want.
A Practical Investor Framework: EVALUATE 🎯
A useful way to build few-shot examples for investment research is:
E — Economics
How does the business make money?
V — Value Creation
Does it generate attractive returns on capital?
A — Advantages
Does it have durable competitive advantages?
L — Leverage
How strong or risky is the balance sheet?
U — Underlying Growth
Is growth sustainable?
A — Allocation
How effectively does management allocate capital?
T — Total Valuation
What price are investors paying?
E — Exposure to Risk
What could permanently impair the investment?
You could then create examples showing how these factors interact.
The AI isn’t being told:
“Buy companies with ROE above 20%.”
Instead, you’re teaching it to evaluate multiple dimensions simultaneously.
That is a much more useful application of few-shot prompting.
An Important Distinction: Analysis vs Pattern Matching
This is perhaps the most important lesson for investors.
Few-shot prompting can make AI better at following your analytical pattern.
But that doesn’t automatically mean it is producing better investment decisions.
For example:
Example:
High ROE + low debt → Attractive
If the next company has:
High ROE + low debt
the AI may classify it as attractive.
But it might miss:
- a collapsing industry
- accounting concerns
- promoter issues
- regulatory risk
- excessive valuation
- deteriorating competitive advantage
Therefore:
Few-shot prompting should teach the framework—not replace the framework.
Investor Scenario: Ravi Uses Few-Shot Prompting 👨💼
Ravi is a busy IT professional investing for the long term.
He wants AI to help him understand companies but doesn’t want generic “buy/sell” answers.
He creates three examples.
Example 1
Strong business + strong balance sheet + reasonable valuation → Attractive
Example 2
Strong business + expensive valuation → Watchlist
Example 3
Weak business + low valuation → Avoid
He then asks AI to evaluate a new company.
This approach is much more useful than simply asking:
“Is this stock good?”
Because Ravi has communicated how he wants investment quality to be assessed.
Investor Scenario: Anjali Builds a Research Assistant 👩💼
Anjali actively analyzes Indian stocks.
She wants AI to produce a standardized preliminary assessment for every company.
She provides several examples:
Company A:
Strong ROE
Strong FCF
Low Debt
Reasonable Valuation
Assessment:
High Quality
Company B:
Strong ROE
Weak FCF
High Debt
Expensive Valuation
Assessment:
High profitability but elevated financial and valuation risk.
Company C:
Moderate ROE
Strong FCF
Low Debt
Reasonable Valuation
Assessment:
Moderate profitability but strong financial discipline.
She then feeds the AI another company.
The output becomes much more consistent with her intended analytical style.
This is where few-shot prompting becomes especially valuable:
It can turn a personal analytical framework into a reusable AI-assisted workflow.
How Many Examples Should You Use? 🔢
There is no universal number.
A common mistake is assuming:
More examples = better AI performance.
That’s not necessarily true.
Google’s current guidance recommends experimenting with the number of examples: too few may fail to communicate the pattern, while too many can cause the model to overfit to the examples.
A practical starting point is:
| Task | Starting Point |
|---|---|
| Simple formatting | 1 example |
| Basic classification | 2–3 examples |
| Complex classification | 3–5 examples |
| Nuanced analytical framework | Several carefully chosen examples |
| Highly repetitive production workflow | Test and optimize empirically |
The key isn’t the number.
It’s the quality and diversity of the examples.
The Best Examples Cover Edge Cases ⚠️
Suppose you want AI to classify investments.
Don’t give it five examples where:
Strong business + reasonable valuation = Buy.
Instead, deliberately include cases such as:
Strong business + expensive valuation
→ Watchlist
Weak business + cheap valuation
→ Avoid
Strong business + temporary earnings decline
→ Investigate further
High growth + high leverage
→ High risk
Moderate growth + exceptional cash generation
→ Potentially attractive
These examples teach the AI that investment decisions involve trade-offs.
That’s much closer to real investing.
Few-Shot Prompting + XML Tags = A Powerful Combination 🤖
The two techniques you’ve now learned about can work together.
For example:
<role>
Act as a long-term equity research analyst.
</role>
<framework>
Evaluate:
- Business quality
- Profitability
- Cash generation
- Balance sheet
- Growth
- Competitive advantage
- Valuation
- Risk
</framework>
<examples>
<example_1>
Strong business + strong cash flow + reasonable valuation
→ Attractive
</example_1>
<example_2>
Strong business + expensive valuation
→ Watchlist
</example_2>
<example_3>
Weak business + cheap valuation
→ Avoid
</example_3>
</examples>
<task>
Evaluate the following Indian listed company using the framework
and patterns demonstrated above.
</task>
<output_format>
Provide:
1. Business Quality
2. Financial Quality
3. Growth
4. Valuation
5. Risks
6. Final Assessment
</output_format>
Now you have:
Structure → XML
Framework → Explicit criteria
Examples → Few-shot guidance
Output → Defined format
This is considerably more sophisticated than simply asking an AI to analyze a stock.
Common Misconception ⚠️
“Few-shot prompting means the AI learns my investment strategy permanently.”
No.
Few-shot prompting is generally contextual guidance, not permanent model training.
The examples influence the response because they are part of the current prompt/context.
They don’t necessarily become a permanent part of the model’s knowledge.
If you start a new interaction without those examples, you may need to provide them again.
This is one reason reusable prompt templates can be valuable.
Risks and Limitations ⚠️
1. Bad examples produce bad patterns
Your examples are effectively part of your instructions.
If they are wrong, the model may reproduce the error.
2. Examples can introduce bias
If all your examples favor large-cap companies, the model may implicitly learn a framework that works poorly for small-cap companies.
If all examples come from banks, the framework may not transfer well to manufacturing or technology companies.
3. Overfitting is possible
Too many highly similar examples can encourage the model to mimic the examples instead of generalizing the underlying pattern.
4. Financial analysis is domain-specific
A framework that works for banks may not work for:
- FMCG
- IT services
- capital goods
- pharmaceuticals
- commodity companies
- NBFCs
For example, debt-to-equity has a very different meaning for a bank than for a manufacturing company.
Therefore, your examples should be sector-aware.
5. AI can still hallucinate
Few-shot prompting doesn’t turn AI into a verified financial database.
For important investment decisions, financial figures, corporate actions, regulatory information and valuation data should be independently verified.
A Practical Checklist for Investors 📋
Before using one-shot or few-shot prompting, ask:
1. Is the task repetitive?
If yes, examples may help.
2. Is the desired output difficult to describe?
If yes, show an example.
3. Is consistency important?
If yes, few-shot prompting can be useful.
4. Are the examples representative?
If not, improve them.
5. Are the examples accurate?
If not, don’t use them.
6. Have you included edge cases?
If not, add them.
7. Are you confusing pattern matching with analysis?
If yes, strengthen your underlying framework.
A Simple Decision Tree 🎯
Is the task simple?
/ \
YES NO
↓ ↓
Zero-shot Is the desired
output easy to
describe?
/ \
YES NO
↓ ↓
One-shot Few-shot
↓
Are there multiple
possible outcomes?
/ \
NO YES
↓ ↓
2–3 examples Diverse
examples
+ edge cases
The exact choice isn’t a rigid rule.
Test the approach and compare outputs.
Prompt engineering is empirical.
Structured Prompting + Few-Shot Prompting: The Bigger Picture 📊
We’ve now looked at two related techniques:
Structured prompting
Organizes the request.
Role
↓
Context
↓
Task
↓
Constraints
↓
Output
Few-shot prompting
Demonstrates the desired behavior.
Example 1
↓
Example 2
↓
Example 3
↓
New Input
Combine them:
STRUCTURED PROMPT
│
┌────────────┴────────────┐
↓ ↓
INSTRUCTIONS EXAMPLES
│ │
Role / Task / What good
Constraints output looks like
│ │
└────────────┬────────────┘
↓
NEW INVESTMENT
ANALYSIS
This is where prompt engineering starts becoming genuinely useful for professional workflows.
From Prompt to Investment Workflow 🚀
The ultimate goal isn’t to create clever prompts.
It’s to create repeatable processes.
For example:
Annual Report
↓
Extract Financial Information
↓
Analyze Business Quality
↓
Evaluate Financial Strength
↓
Assess Competitive Advantage
↓
Analyze Valuation
↓
Identify Risks
↓
Generate Investment Assessment
A structured prompt can define the workflow.
Few-shot examples can demonstrate how each stage should be handled.
The result is potentially much more consistent than asking an AI a series of unrelated questions.
One Important Lesson for Investors 💡
AI should not be used to replace your investment framework.
It should help you apply your framework more consistently.
That distinction is critical.
Suppose your framework says:
Business quality + financial strength + competitive advantage + valuation + risk = investment assessment
You can use AI to process large amounts of information against that framework.
But the framework itself still needs to make sense.
Few-shot prompting can help AI follow your methodology.
It cannot make a poor methodology good.
The Bottom Line 📈
One-shot and few-shot prompting are simple ideas with surprisingly powerful applications.
Zero-shot:
Tell AI what to do.
One-shot:
Tell AI what to do and show it one example.
Few-shot:
Tell AI what to do and show it several examples.
For investors, the real value lies in using examples to communicate analytical patterns, classification rules, output formats and decision frameworks.
But examples must be accurate, representative and diverse.
The goal isn’t to make AI blindly copy your examples.
The goal is to help it understand:
“This is how I want this type of problem approached.”
That makes one-shot and few-shot prompting particularly useful when building repeatable AI-assisted investment research workflows.
And when combined with structured prompts, XML tags, clear constraints and a well-designed investment framework, these techniques can turn AI from a simple question-answering tool into a much more useful research assistant.
For investors, that’s where the real opportunity lies. 🤖📊
Key Takeaways
- Zero-shot prompting gives the AI instructions without examples.
- One-shot prompting provides one example to demonstrate the desired pattern.
- Few-shot prompting provides multiple examples and is useful for more complex patterns.
- Examples can communicate format, tone, scope and analytical logic more effectively than instructions alone.
- Good examples are critical—bad examples can teach AI the wrong investment framework.
- Few-shot prompting works best when combined with a sound investment methodology, clear structure and independent verification.
Frequently Asked Questions
What is the difference between zero-shot and few-shot prompting?
Zero-shot prompting provides no examples. Few-shot prompting provides several examples to demonstrate the desired task or output pattern.
Is one-shot prompting better than zero-shot prompting?
Not always. For simple tasks, zero-shot prompting may be perfectly adequate. One-shot prompting becomes useful when an example communicates something that would be difficult to explain through instructions alone.
How many examples should I provide?
There is no universal number. Start with one for simple tasks and several diverse examples for complex tasks. Test the results rather than assuming that more examples are always better.
Can investors use few-shot prompting for stock analysis?
Yes. It can be useful for standardizing tasks such as financial-ratio interpretation, company classification, annual-report analysis, peer comparisons and investment-research summaries.
Can few-shot prompting predict stock prices?
No. Few-shot prompting can help structure an analytical approach, but examples do not provide reliable predictive power. Market outcomes depend on uncertain future events, and investment decisions require independent analysis.
Can few-shot prompting replace financial expertise?
No. It can help apply a framework more consistently, but the quality of the framework and the accuracy of the underlying data remain critical.
Can few-shot prompting be combined with XML tags?
Yes. XML-style tags can organize the examples and clearly separate them from the instructions and new task. This can make complex prompts easier to understand and maintain.
Explore More AI & Investing Insights
AI is becoming an increasingly useful tool for investors—but the quality of the output depends heavily on the quality of the framework, examples and data supplied to it.
Explore more practical AI and investing insights on Smart Investing India.
Invest smartly, India! 🇮🇳📈
Related
Discover more from Smart Investing India
Subscribe to get the latest posts sent to your email.
