Ten lessons on where AI is used in finance and how to judge it: data leakage, rare-event metrics, fair lending, return prediction, backtests, model risk and system-wide risk.
A foundations course for students in finance, economics or business using original worked examples with invented numbers. It covers concepts and decision rules, not programming or investment advice.
Basic percentages and probability. No coding needed.
Course outline
Where AI is used in finance
Name the main finance tasks AI is used for and tell prediction from generation.
Data, features and leakage
Spot data problems that make a model look better than it is.
Training, validating and testing
Split data correctly and recognise overfitting, especially with time series.
Evaluating a classifier: base rates matter
Compute precision and recall and see why rare events change the answer.
Credit scoring and fair lending
Explain adverse action notices and why model complexity does not excuse the reasons.
Machine learning for returns
Describe what research finds about predicting stock returns and why gains are small.
Backtests and the multiple testing trap
Show why trying many strategies produces false winners.
Model risk management
Explain how banks govern models using validation and effective challenge.
Generative AI in finance work
Use language models on financial documents safely and know where they fail.
System-wide risk and regulation
Identify market-wide risks from AI and the rules that apply.
Sources and curriculum note
Reviewed October 13, 2026 against the cited sources. Regulations, guidance and research change; check the linked pages for the current text. Numbers in examples are invented, except where a lesson names a published source. Nothing here is investment or legal advice.
Read every lesson below. The interactive reader above contains the same explanations, with visual tools and quizzes.
1. Where AI is used in finance
Learning goal: Name the main finance tasks AI is used for and tell prediction from generation.
Finance has used statistical models for decades, so AI here usually means a more flexible version of the same job. Typical tasks include scoring credit applications, flagging fraudulent card payments, screening for money laundering, forecasting demand or returns, routing customer queries, and reading text such as filings and news. Each task asks a different question and carries a different cost of being wrong.
It helps to separate three kinds of system. A predictive model turns data into a number or label, such as the chance a loan defaults. A detection model looks for unusual patterns, such as an odd transaction. A generative model writes text or other content, such as a summary of an earnings call. The first two usually feed a decision with a threshold. The third produces content that a person must still check.
Ask three questions of any use case: what decision does it feed, who is affected if it is wrong, and who is accountable. A model that ranks emails by urgency has low stakes. A model that denies someone credit has high stakes and falls under consumer protection rules covered later in this course.
Worked example
A model scores 1,000 loan applications. The lender approves any application with a default risk below 8 percent. What is the model's role?
It produces a score. The approval rule and the people who set it make the decision.
Avoid this mistake: Judging a model only by accuracy and not by what a wrong answer costs.
Practice problem and solution
A bank runs 5 AI use cases and 2 feed credit decisions about individuals. How many percent of the use cases feed credit decisions about individuals? Enter a number.
2 / 5 = 0.4, or 40 percent.
Mental model: Know the decision the model feeds.
Common trap: Judging a model only by accuracy and not by what a wrong answer costs.
2. Data, features and leakage
Learning goal: Spot data problems that make a model look better than it is.
A model learns from a table of examples. Each row is a case, such as a loan, and the columns are features, such as income or past late payments. The label is what we want to predict, such as default within a year. Quality of the data limits quality of the model, however clever the method.
Data leakage is the most common cause of results that look excellent in testing and fail in use. It happens when a feature contains information that would not be known at the time of the decision. A field recording collections status is filled in only after a borrower stops paying, so using it to predict default is cheating. Point-in-time data, which records only what was known on each date, prevents this. A related error is look-ahead bias in market data, for example using a company's restated figures that were not published at the time.
Samples can also mislead. Survivorship bias occurs when failed companies or closed funds are left out of the data, so average results look better than real ones. Lending data shows only the outcomes of people who were approved, so a model may know little about those who were rejected. Always ask how the data was collected and who is missing.
Worked example
A default model uses the field collections status, which is set only after a borrower has stopped paying. Why is test accuracy misleading?
The field is known only after the outcome, so the model effectively sees the answer. This is target leakage.
Avoid this mistake: Trusting a test score without checking when each field was created.
Practice problem and solution
A loan model uses a field that is created after the borrower defaults. Enter the one-word name of this problem (two words are accepted).
The field contains information from after the decision, which is data leakage.
Mental model: Use only what was known on the decision date.
Common trap: Trusting a test score without checking when each field was created.
3. Training, validating and testing
Learning goal: Split data correctly and recognise overfitting, especially with time series.
A model should be judged on cases it has not seen. Data is split into a training set used to fit the model, a validation set used to choose settings, and a test set used once at the end for an honest estimate. If you keep adjusting the model after looking at the test set, the test set stops being independent.
Overfitting means the model has learned the noise in the training data as if it were signal. Training error keeps falling as the model becomes more flexible, while error on new data first falls and then rises. The gap between the two is the warning sign. Financial data has a low signal-to-noise ratio, so flexible models overfit very easily.
For data ordered in time, such as returns or monthly defaults, random splits leak the future into training. Use a time-ordered split instead: train on the past, test on later periods. Walk-forward testing repeats this, moving the window forward each time, which mimics how the model would have been used.
Worked example
A model has 5 percent error on its training data and 20 percent error on new data. What does the gap suggest?
It suggests overfitting: the model learned patterns that do not hold on new data.
Avoid this mistake: Tuning on the test set until it looks good.
Practice problem and solution
There are 120 months of data. The first 84 are for training and the last 36 for testing. What percent is the test set? Enter a number.
36 / 120 = 0.30, or 30 percent.
Mental model: Test on data from after the training period.
Common trap: Tuning on the test set until it looks good.
4. Evaluating a classifier: base rates matter
Learning goal: Compute precision and recall and see why rare events change the answer.
Many finance models answer yes or no: is this payment fraud? Two measures matter most. Recall is the share of real fraud cases the model catches. Precision is the share of flagged cases that are really fraud. They answer different questions: recall asks what was missed, precision asks how much of the alert queue is wasted.
Rare events make precision low even for a model that seems accurate. Suppose 0.5 percent of 100,000 payments are fraud, which is 500 cases. A model with 80 percent recall catches 400. If it also wrongly flags 2 percent of the 99,500 normal payments, that is 1,990 false alarms. Of 2,390 alerts, only 400 are fraud, so precision is about 17 percent. Plain accuracy would be above 97 percent and hides this.
The threshold is a choice, not a fact. Lowering it catches more fraud but creates more false alarms, which cost analyst time and annoy customers. Raising it does the opposite. The right setting depends on the cost of a missed fraud versus the cost of a false alarm.
Worked example
Of 2,390 alerts, 400 are real fraud. What fraction of alerts are real fraud?
400 / 2,390 is about 17 percent.
Avoid this mistake: Quoting accuracy for a rare-event problem.
Practice problem and solution
Of 100,000 payments, 0.5 percent are fraud. Recall is 80 percent. The model flags 2 percent of normal payments by mistake. Enter the precision as a percent, rounded to the nearest whole number.
Fraud 500, caught 400. False alarms 2 percent of 99,500 = 1,990. 400 / 2,390 = 16.7, so 17.
Mental model: Rare events make precision low.
Common trap: Quoting accuracy for a rare-event problem.
5. Credit scoring and fair lending
Learning goal: Explain adverse action notices and why model complexity does not excuse the reasons.
Lenders use models to estimate the chance that a borrower repays. Machine learning can find non-linear patterns that simple scorecards miss. In the United States, credit decisions are also governed by the Equal Credit Opportunity Act, which Regulation B implements. Creditors may not discriminate on protected characteristics, and they must tell applicants why they were denied.
Under Regulation B, a creditor that takes adverse action on an application must provide a notice with the specific principal reasons for the action. In Circular 2022-03, the Consumer Financial Protection Bureau stated that creditors using complex algorithms must still give specific and accurate reasons. A creditor cannot rely on a sample checklist of reasons if those do not reflect the real factors the model used, and a model being hard to explain is not a defence.
Fairness has to be tested, not assumed. A model that never uses a protected characteristic can still produce different outcomes for groups if its inputs act as proxies. Lenders compare approval rates and error rates across groups, look for less discriminatory alternatives, and document the results. The rules vary by country, and the EU AI Act classifies AI for assessing the creditworthiness of individuals as high-risk.
Worked example
A lender denies credit using a complex model, and the model's creators say reasons cannot be extracted. What does CFPB Circular 2022-03 say about the notice?
The creditor must still give specific and accurate reasons. Complexity is not an excuse.
Avoid this mistake: Treating a model as exempt because it is hard to explain.
Practice problem and solution
A lender denies credit using an algorithm. Enter the full name of the notice that must state the specific reasons.
Regulation B requires a statement of specific reasons with adverse action.
Mental model: Complex models still need specific reasons.
Common trap: Treating a model as exempt because it is hard to explain.
6. Machine learning for returns
Learning goal: Describe what research finds about predicting stock returns and why gains are small.
Gu, Kelly and Xiu studied whether machine learning could predict monthly stock returns, using hundreds of company characteristics and macro variables, in a paper published in 2020. They compared linear regressions with methods such as regression trees and neural networks. They reported that methods that capture non-linear interactions improved out-of-sample predictions compared with linear models, and that the most useful signals came from groups such as momentum, liquidity and volatility.
The size of the gain is the important lesson. Monthly out-of-sample R squared values in that kind of study are well under one percent. R squared is the share of variance explained, so almost all monthly movement stays unexplained. A small edge can still be economically useful at scale, but only if costs of trading do not erase it.
Return data has a low signal-to-noise ratio, so flexible models overfit easily and relationships change over time. A pattern found in one period may fade after it is published or traded on. Treat any impressive result with caution until it holds on later data, across markets and after realistic trading costs.
Worked example
A model's out-of-sample R squared is 0.4 percent. What share of variance is left unexplained?
99.6 percent. Almost everything is still unexplained.
Avoid this mistake: Reading a tiny R squared as proof of no value or of great value.
Practice problem and solution
A model explains 0.4 percent of monthly return variance. What percent of the variance is left unexplained? Enter a number.
100 - 0.4 = 99.6. Even a working model leaves almost all monthly variance unexplained, which is why gains are measured in fractions of a percent.
Mental model: Small edges, large noise.
Common trap: Reading a tiny R squared as proof of no value or of great value.
7. Backtests and the multiple testing trap
Learning goal: Show why trying many strategies produces false winners.
A backtest runs a trading rule on past data to see how it would have done. It is easy to produce a good backtest and hard to produce a reliable one. Costs, delays, price impact and limits on shorting are often left out, and each of them reduces real returns.
The biggest danger is trying many versions and reporting the best. If one strategy has a 5 percent chance of looking significant by luck, then among 20 independent strategies the chance that at least one looks significant is 1 minus 0.95 to the power 20, about 64 percent. A researcher who tests hundreds of variations will almost certainly find one that looks good by chance.
Defences include fixing the hypothesis before testing, counting every variation that was tried, demanding stronger evidence when many were tried, and holding back a final period that is looked at once. A good economic reason for why the pattern should exist also helps, though it does not replace the tests.
Worked example
Each independent strategy has a 5 percent chance of a lucky significant result. What is the chance that at least one of 20 does?
1 - 0.95^20 is about 64 percent.
Avoid this mistake: Reporting only the winner.
Practice problem and solution
A researcher tries 20 independent strategies, each with a 5 percent chance of a lucky significant result. Enter the chance (percent, whole number) that at least one looks significant.
1 - 0.95^20 = 0.6415, which is about 64 percent.
Mental model: Count every strategy you tried.
Common trap: Reporting only the winner.
8. Model risk management
Learning goal: Explain how banks govern models using validation and effective challenge.
Model risk is the chance of harm from errors in a model or from using it wrongly. The Federal Reserve and the Office of the Comptroller of the Currency issued supervisory guidance on model risk management, SR 11-7, in April 2011. It describes three parts: sound development, implementation and use; independent validation; and governance with clear policies, roles and controls.
A central idea in that guidance is effective challenge: critical analysis by objective and informed people who have the competence and influence to identify the model's limitations and assumptions and to get problems fixed. Validation covers checking the concept, testing the outcomes against real results, and monitoring over time. It should be independent of the people who built the model.
The guidance applies to quantitative methods whatever the technique, so machine learning models fall within it. They raise extra points: more complex methods are harder to explain, depend more on data quality, and can change behaviour when retrained. A firm keeps an inventory of its models, ranks them by importance, documents limits on their use, and sets monitoring triggers for when to review or retire them.
Worked example
A team that built a credit model also approves its own validation. What is wrong?
Validation should be independent of the people who developed the model.
Avoid this mistake: Letting the builder sign off their own model.
Practice problem and solution
SR 11-7 calls for critical analysis by objective, informed parties who can get model problems fixed. Enter the two-word term.
The guidance calls this effective challenge.
Mental model: Independent review with authority.
Common trap: Letting the builder sign off their own model.
9. Generative AI in finance work
Learning goal: Use language models on financial documents safely and know where they fail.
Language models can summarise filings, draft client notes, pull figures into tables and answer questions over documents. Specialised models exist as well: BloombergGPT, described in a 2023 paper, is a 50-billion-parameter language model trained on a large mix of financial and general text. Whether a general or a specialised model is better depends on the task and has to be tested.
The main failures are unsupported numbers and missed qualifiers. A model may state a figure that is not in the document, mix up periods, or drop a phrase like excluding one-off items that changes the meaning. Numbers should be traced to the source line by line. A sample check with a count of errors gives a rough error rate.
Protect information. Client and unpublished data should go only into tools approved by the firm. Keep a record of the prompt, the source and the reviewer. Retrieval from the document and a visible source passage reduce errors, but a person who is accountable must still review anything that reaches a client or a regulator.
Worked example
A model extracts 200 figures and a sample check finds a 3 percent error rate. About how many figures are wrong?
3 percent of 200 is about 6 figures.
Avoid this mistake: Accepting a fluent summary without checking the figures.
Practice problem and solution
A model extracts 200 figures. A sample shows a 3 percent error rate. Estimate the number of wrong figures. Enter a number.
0.03 x 200 = 6.
Mental model: Trace every number to its source.
Common trap: Accepting a fluent summary without checking the figures.
10. System-wide risk and regulation
Learning goal: Identify market-wide risks from AI and the rules that apply.
The Financial Stability Board published a report in November 2024 on the financial stability implications of artificial intelligence. It identified vulnerabilities including dependence on a few third-party providers, correlations in markets if many firms use similar models and data, cyber risks, and model risk, data quality and governance. It also noted that generative AI could increase the risk of misinformation.
Concentration can be measured. The Herfindahl-Hirschman Index adds the squares of each provider's market share in percent. Three providers with shares 50, 30 and 20 percent give 2,500 plus 900 plus 400, which is 3,800. A single provider with 100 percent gives 10,000. A higher index means a failure at one provider would reach more firms.
Rules are developing. The Bank for International Settlements Financial Stability Institute has reviewed how authorities approach AI in the financial sector, and noted that most rely on existing technology-neutral rules while some, such as the EU AI Act, add AI-specific requirements. Firms should expect to explain their models, protect data and show who is accountable. Always check the current text of any rule.
Worked example
Three providers hold 50, 30 and 20 percent of the market. What is the concentration index (sum of squared shares)?
2,500 + 900 + 400 = 3,800.
Avoid this mistake: Judging AI risk firm by firm only.
Practice problem and solution
Three providers hold 50, 30 and 20 percent. Compute the sum of the squared shares. Enter a number.
50^2 + 30^2 + 20^2 = 2,500 + 900 + 400 = 3,800.
Mental model: One shared dependency can hit many firms.