AI and ML basics · 12 min
When to use traditional ML, a foundation model or neither?
In this lesson you will learn to decide whether a problem needs ML, whether a traditional model or a foundation model suits it better, where to get that model and who manages it when you use it in production.
Before choosing an AWS service for a problem, you have to decide whether the problem needs ML. The AWS decision guide for choosing an ML service starts right there: first you understand the problem and decide whether ML is what solves it best. If the answer is yes, you then choose what type of model to use, where to get it and who manages it, and those four decisions are what tasks 1.2 and 1.3 of the exam ask of you. For example, a bank that wants to detect purchases made with stolen cards first decides whether ML is the best way to solve it, and only then chooses the model and the AWS service.
When does AI add value?
Objective 1.2.1 of the exam guide gives three reasons why AI adds value:
- Assistance in decision making, which lets you decide with more data than a person could review.
- Scalability, which lets you do the same thing with millions of cases.
- Automation, which takes care of tasks such as classifying documents or transcribing audio.
The three reasons can show up in the same case. For example, a bank receives millions of card purchases a day and nobody could review them by hand: a model reviews each one on the spot (scalability and automation) and sets aside the suspicious ones so a person can decide what to do with them (assistance in decision making).

These reasons show up in the eight real-world applications that objective 1.2.4 lists: computer vision, natural language, speech recognition, recommendations, fraud detection, forecasting, knowledge bases and AI agents. Knowledge bases are collections of a company's documents that the AI consults to answer questions, and AI agents are systems that do tasks on their own to reach a goal. For example, the bank can have an assistant that answers its customers' questions by looking up the answer in its own manuals, which would be a knowledge base.
When is ML not a good fit?

ML is not the best option for every problem, and between the Machine Learning Lens of the AWS Well-Architected Framework and objective 1.2.2 of the exam guide there are four cases in which it is not a good fit:
- Problems that are better solved with simple business rules, which are fixed instructions of the "if this happens, do that" kind. For example, "if the account balance isn't enough, reject the payment".
- Problems where there isn't enough data to apply ML, because a model learns from examples and without examples it has nothing to learn from.
- Cases where the cost-benefit analysis, which compares what the model costs with what it saves or earns for the company, says the model costs more than it delivers.
- Cases where you need a specific outcome instead of a prediction.
For example, calculating at a fixed rate the VAT on an invoice, which is the tax added to the price, is a case of a specific outcome, because there is a formula and only one correct answer, and a model would only add errors the formula doesn't have. Detecting unusual card purchases is the opposite: there is no exact formula and there is a lot of history, so ML adds value.
Is ML a good fit?
0 of 5Tap the correct column for each case.
Calculating the interest on a card with the rate in the contract
Detecting card purchases that are out of the ordinary among millions of transactions
Predicting which customers will cancel, at a company that opened last week
Classifying 50,000 support emails a day by topic
Checking whether a form has all its fields filled in
Traditional ML or a foundation model?
When ML is a good fit, the next step is choosing the type of model, which is what objective 1.2.6 asks for. A traditional ML model does one specific task, such as analyzing sentiment, classifying images or forecasting sales, and you train it with your data. A foundation model (FM), on the other hand, is a very large deep learning network, trained on huge amounts of data, that does very different tasks depending on the prompt, which is the instruction you write to it. For example, the bank trains a traditional model only to detect fraud, while a single FM can summarize a contract, answer a customer's question or draft an email, depending on what you ask it.
That flexibility of an FM comes with challenges. AWS mentions that its answers can be unreliable, sometimes incorrect, and that they carry the bias of its training data. In addition, the same question can give different answers, and it is hard to explain why the model answered what it did. For example, if two customers ask the bank's assistant the same question about a fee, each one can get a different answer, and one of them may be wrong.
Criteria for choosing

The guide gives three criteria for choosing between a traditional model and an FM, and when they weigh in a case, they tip the decision toward the traditional model:
- Regulation, which in sectors such as healthcare and finance requires by law showing how an AI system decides, according to the AWS example.
- Explainability, which is being able to show why the model gave an answer, and for which the ML Lens recommends starting with a model that is easy to interpret.
- Operational constraints, which are the limits on latency, on cost per prediction or on where the model has to run. For example, if the bank has to approve or reject each payment in milliseconds, a small, fast model suits it better than a huge one.
The ML Lens also lists among the traditional ML cases the fixed tasks with tabular data, that is, data arranged in rows and columns like a spreadsheet, such as fraud, customer churn or demand forecasting. An FM, for its part, is a good fit when the task is generating content, holding a conversation or summarizing, and also when there are many different tasks and you don't have labeled data for each one.
Traditional or foundation?
A bank approves or rejects loans with data from a table, and the regulator requires it to explain each decision. Which approach fits?
Where does the model come from?

Objective 1.3.2 asks for the sources of a model, which are three:
- A base model from Amazon Bedrock, that is, an FM ready to use, which you call through an API without seeing a server.
- A pre-trained model, that is, one someone has already trained, that is open source, from Amazon SageMaker JumpStart, which you deploy in SageMaker AI and can keep training with your data.
- Your own model, which you train in SageMaker AI.
For a traditional model, training your own is the norm. For an FM almost nobody does it, because according to AWS developing one from scratch costs millions of dollars. For example, the bank can use a base model from Bedrock for its question assistant and train its own model in SageMaker AI to detect fraud with its purchase history.
Who manages the model in production?

To use the model in production, objective 1.3.3 distinguishes between a managed API, where AWS runs the model for you, and a self-hosted API, where you run it. From Amazon Bedrock to Amazon EC2, AWS takes care of fewer and fewer parts:
- With Amazon Bedrock, AWS hosts the model, that is, keeps it running on its own computers, chooses the hardware, scales and charges you by tokens.
- With a SageMaker AI endpoint, which is the address your application sends its requests to, you deploy the model, choose the instance, that is, the computer in the cloud that runs it (or the serverless option), and configure scaling.
- With Amazon EC2, the AWS service that rents you computers in the cloud, everything is yours, operating system included.
The AWS guide "Amazon Bedrock or Amazon SageMaker AI?" sums up the difference between the first two. Bedrock is serverless and charges by input and output tokens, while SageMaker AI gives you control over training and deployment, classic ML included, and charges for compute, that is, for the computers you use. For example, the bank's question assistant on Bedrock costs more the more text it reads and writes, and its fraud model on a SageMaker AI endpoint costs according to the instances it has running.
Which option fits?
A company with no data scientists wants an assistant that summarizes contracts, and it doesn't want to manage servers or choose instances. What does it use?
Can you try it in your account?
Amazon Bedrock and SageMaker AI are in the free plan of the new experience account, which is fixed to the us-east-2 Region for Latin America, and also in a full account. That way you can open both consoles and compare who manages each part in each service.
On the exam
Each of these decisions has its own words in the question:
- The phrases "exact result", "formula" or "rule", which indicate that ML isn't needed.
- The phrases "explain each decision", "regulator" or "tabular data", which point to traditional ML.
- The words "generate", "summarize" or "converse", which point to an FM.
- The phrases "without managing infrastructure" or "no ML experience", which point to Bedrock or to a specialized AI service.
- The phrases "control over training" or "own model", which point to SageMaker AI.
For example, if a question says that a bank needs to "explain each decision" on credit to the regulator, that phrase points to traditional ML even if the options mention newer models.
Review question
In which case is an ML solution not the best option?
Next
- Choosing an AWS machine learning service, the AWS decision guide. It was last updated in May 2024, so some services on its list, such as Amazon Forecast and Amazon Kendra, no longer accept new customers.
- Take a practice exam at /examenes and review your result in domain 1.