Choose ML and AI modeling approaches
Choosing a modeling approach by output and build effort
For example, suppose an insurer wants the claim number, date, and total from scanned invoices: one engineer proposes training a document model, and another proposes calling the AnalyzeExpense operation of Amazon Textract, which extracts relevant data from almost any invoice or receipt[1]. Both may deliver the fields, but only the first needs labeled examples and a training job. Two questions settle choices like this one: what must the model output, and what is the lowest build effort that meets the quality, latency, and cost requirements?
Choosing among traditional machine learning (ML), generative AI, and AWS AI services is Task 2.1, 'Choose appropriate modeling approaches for ML and AI solutions'[2], in the AWS MLA-C02 exam guide's ML Model and Foundation Model (FM) Development domain (24%). The same domain lists 'Task 2.2: Train, fine-tune, and customize models for ML and AI solutions'[2] as a separate task; see Train and customize ML and AI models. Amazon Bedrock defines model customization as providing training data to a model[3], so customization here means changing weights through training, not changing what a request carries (prompts, inference parameters, retrieved passages); retrieval is a separate way to supply knowledge.
Question 1: the required output
The output requirement helps eliminate unsuitable candidates. Outputs such as a discrete category, a continuous number, a group of similar records, a future value, a bounding box, a pixel mask, a vector, or a generated paragraph each point to a different family of models; the sections below map them to AWS options.
Question 2: the lowest build-effort level
The options fall into four build-effort levels, a grouping that is not AWS terminology but follows AWS guidance: Amazon SageMaker AI (formerly Amazon SageMaker) documentation orders its implementation options by increasing levels of effort[4] (pre-trained models, then built-in algorithms, then your own code in a supported framework, then a custom container image), and the AWS decision guide describes a progressive journey[5] that starts with Amazon Bedrock prompt engineering and Retrieval Augmented Generation (RAG), moves to customization when model behavior must change, and reaches training jobs when you need full infrastructure control.
- Level 1, task-specific AWS AI service: a pre-trained API for one job, such as Amazon Textract for documents, Amazon Rekognition for images and video, Amazon Comprehend for text, or Amazon Transcribe for speech. Comprehend, for example, uses a pre-trained model, so there is no need for you to provide training data[6]. Custom features that train on your examples, such as Amazon Comprehend Custom (custom classification and custom entity recognition), which builds customized models on your behalf[6], still count as Level 1 (see AWS AI services).
- Level 2, FM used as-is: a large pre-trained model called through Amazon Bedrock, given task instructions in the prompt and current knowledge through RAG, which retrieves relevant source passages and adds them to the prompt at request time. A pre-trained Amazon SageMaker JumpStart model deployed without further training also sits here: SageMaker AI describes pre-trained models as ready to deploy, or to fine-tune and deploy, using SageMaker JumpStart[4].
- Level 3, customized FM: the same kind of model with its weights (the parameters it learned in training) changed by supervised fine-tuning, reinforcement fine-tuning, distillation, or continued pre-training. Fine-tuning a JumpStart model or applying LoRA in SageMaker AI[7] (Low-Rank Adaptation, which trains a small set of added weights while the base model weights stay frozen; see Customizing a foundation model) is also FM customization.
- Level 4, model you train yourself: a model trained on your data in Amazon SageMaker AI, using no-code Amazon SageMaker Canvas, automated Amazon SageMaker Autopilot, a built-in algorithm, your own training script (script mode), or a custom container.
Move to the next level only when a stated requirement fails at the current one: the AI service, including its custom features, cannot produce your business-specific categories, the FM cannot hold a required format, a prediction depends on your own tabular history, or you need control over training and hosting. The figure below orders the levels by build effort, following AWS's increasing levels of effort[4], with a failed requirement on each arrow.
The takeaway: name the output, start at the lowest level that can produce it, and let a failed requirement, not habit, move you to the next level.
AWS AI services: pre-trained APIs for common tasks
The lowest build-effort level is a task-specific AWS AI service: a pre-trained API that returns a finished result for one kind of input. When its output matches the requirement and its quality is good enough, use the service. Its pre-trained capabilities need no training data from you, and its custom features build models on your behalf using your data; custom training outside the service earns its extra effort only when the service, including its custom features, cannot produce what is needed. Amazon SageMaker Canvas exposes several of these services as Ready-to-use models, powered by Amazon Rekognition, Amazon Textract, and Amazon Comprehend[8]. They need no model building, which also means they are not the Canvas feature for training a predictor on your own data; that is a Canvas custom model, described in How much to build below.
Amazon Textract: documents
Textract splits document work by how much structure you need back:
| Requirement | Textract capability |
|---|---|
| Lines and words only | Text detection (DetectDocumentText) |
| Form fields, table cells, signatures | Document analysis (AnalyzeDocument) with the forms, tables, or signatures feature |
| Specific facts asked as questions | Document analysis with the Queries feature |
| Invoice and receipt fields | Expense analysis (AnalyzeExpense) |
Document analysis[9] returns five categories of extraction: text, forms, tables, query responses, and signatures. Forms come back as key-value pairs (the key Name: linked to the value Jane Doe). Text detection does not supply that relationship: it is generic optical character recognition (OCR), which converts an image of text into a machine-readable text format[10], and its lines and words are enough only when the application never needs those relationships. With Queries you pass a question such as What is the customer's SSN? and Textract returns the answer in its own response structure, so the application does not have to inspect every extracted word. Custom Queries adapt this pre-trained capability by training an adapter on your own annotated sample documents. Invoices and receipts are handled through a separate process, expense analysis, rather than generic document analysis, so assembling invoice fields from text detection output and custom parsing rebuilds something Textract already provides.
The processing mode follows the document. The synchronous operations work on single-page documents[11] and return results in near real time; they include DetectDocumentText, AnalyzeDocument, and AnalyzeExpense. Multipage documents need the asynchronous operations, such as StartDocumentAnalysis for asynchronous document analysis.
Amazon Rekognition: images and video
Rekognition label detection finds common labels[12], such as cars, tomatoes, and basketballs, without training a model. When the categories are specific to your business, such as your logo, your products on a shelf, or particular machine parts, use Amazon Rekognition Custom Labels: you supply a small set of training images, typically a few hundred or less, and it trains a model that classifies whole images or detects object locations with bounding boxes. Like Textract Custom Queries above and Comprehend custom classification and custom entity recognition below, Custom Labels trains on your examples yet stays at Level 1 of the build-effort levels, because the service selects the right machine learning algorithms and trains a model[12] for you.
Content moderation is a separate capability. DetectModerationLabels[13] detects inappropriate, unwanted, or offensive content in images, and StartContentModeration does the same asynchronously for video. Each result carries a label from a three-level category taxonomy plus a confidence score; labels detected below the MinConfidence threshold you set are not returned, and without a setting the threshold is 50 percent. Your application applies its own review policy to those labels and scores. Ordinary label detection does not answer the moderation question, and text sentiment analysis cannot inspect an image at all.
Amazon Comprehend: text
Amazon Comprehend[6] returns insights from a pre-trained model, including entities, key phrases, personally identifiable information (PII), dominant language, sentiment, targeted sentiment, and syntax. Sentiment and targeted sentiment differ in scope, and custom classification and custom entity recognition differ in output:
- Sentiment returns the dominant sentiment of a whole document (positive, neutral, negative, or mixed). Targeted sentiment returns the sentiment associated with each specific entity mentioned. A review that praises one product and criticizes another needs targeted sentiment, because one document-level label collapses the two opinions into a single result.
- Custom classification organizes whole documents into your own categories. Custom entity recognition finds your specific terms and noun-based phrases inside the text. A document's category and the entities it mentions are different outputs, so choose the custom model type by the output the application needs.
Comprehend offers two processing styles: real-time analysis for small workloads, and asynchronous analysis jobs for large document sets. An interactive feature that needs an answer per request uses real-time analysis; a large corpus goes to an asynchronous job instead of being forced through interactive calls one document at a time.
Amazon Transcribe: speech
Amazon Transcribe[14] converts speech to text from two kinds of input. Media files already stored in an Amazon S3 bucket use batch transcription; a live media stream uses streaming transcription. The two follow different rules: supported media formats differ, and streaming is not supported for every language, so confirm the language before choosing streaming. A batch job over stored files cannot serve a live captioning requirement.
The takeaway: when an AWS AI service already returns the output you need, the decision becomes which operation or mode to call, not which model to train.
Selecting a foundation model in Amazon Bedrock
Choosing an FM (Level 2 of the build-effort levels) runs in two passes: the model card's hard constraints remove models that cannot do the job, and a task evaluation picks among the survivors. A model card is the per-model specification page in the Bedrock documentation; it lists one model's input and output modalities, context window, maximum output tokens, and supported features. It is not Amazon SageMaker Model Cards[15], the SageMaker AI feature for documenting your own ML models for governance and reporting.
Pass 1: hard constraints from the model card
Modalities: check input and output separately
Input and output modalities (the kinds of data a model takes in and produces, such as text, image, or video) are listed separately, and image input is not image output. The Amazon Nova Lite model card[16] lists text, image, and video as inputs but text as the only output: Nova Lite can describe a photo, not create one. The Stable Image Ultra model card[17] lists text input and image output, which is what an image-generation requirement needs.
Embedding models versus generative models
The output check also separates embedding models: an embedding model returns numbers, not prose. Amazon Titan Text Embeddings V2[18] takes text and outputs a vector (1,024 dimensions by default) that represents its meaning, and the similarity search itself is performed by your vector database, not by the embedding model. An application that needs semantic search therefore stores embedding vectors in a vector index, and a separate generative model writes the answer from the retrieved text. Storing generated prose in place of those vectors leaves the index nothing it can compare by meaning.
Context window and maximum output: two separate limits
A request must fit two separate limits on the model card: check the context window[19] against the input context the request needs, and check the maximum output tokens, which separately cap how many tokens the model can generate, against the required response length. The Nova Lite card lists a 300K-token context window but 10K maximum output tokens, so it can read a very long document and still cannot return a response longer than its output limit. A requirement such as turning a very long contract into a long, detailed brief must fit both numbers.
Features: one model and version, not a family
The Nova Lite card lists response streaming and the Converse API as supported, while the Stable Image Ultra card lists the Converse API as not supported and the Invoke API as supported. Customization support varies the same way: the Amazon Bedrock FAQ[20] describes continued pre-training for Amazon Titan models, not for every model in Bedrock. Before committing, check the exact model ID for every feature the design depends on (streaming, the intended API, a customization method) rather than assuming that a sibling model's support carries over.
Pass 2: measured quality, latency, and cost
A model card's capability labels, such as its modality support, prove compatibility; they do not prove that a model is accurate on your domain. Amazon Bedrock evaluations[21] run candidate models against a custom prompt dataset tailored to your use case (or a built-in dataset) and score the responses with computed metrics, with a second model acting as judge, or with human workers. Run the shortlist on prompts representative of the real task and compare the scores; supporting text generation only makes a model eligible.
Then weigh quality, latency, and cost together. Bedrock offers models at different price-performance points; the Nova Lite card, for example, describes it as Amazon's low-cost multimodal model. If a smaller, faster model passes the same evaluation, it meets the requirement at lower cost and latency; a more capable model is justified when the task needs capability the smaller one measurably lacks. The AWS MLA-C02 exam guide lists 'Evaluate cost implications of using FMs for inference in production' under Task 4.2[22]; see Optimize ML and AI costs and performance.
Where the model runs: Amazon Bedrock or Amazon SageMaker AI
Where the model runs is a separate decision, made after both passes. Bedrock is a fully managed, serverless service: you call FMs through an API and do not manage any infrastructure[20]. Amazon SageMaker AI is for building, training, and deploying models with more control; the AWS decision guide[5] recommends it when you need access to the container or orchestration layer to manage cost, latency, and throughput tradeoffs directly. For fine-tuning, the Bedrock FAQ recommends Bedrock for a managed, API-driven approach with fewer hyperparameters (settings fixed before training), and SageMaker AI for advanced techniques, for both full fine-tuning (sometimes called full-rank fine-tuning) and parameter-efficient fine-tuning (training a small set of added weights rather than all model weights[7]; see Full fine-tuning versus LoRA below), and for customizing the training recipe. Building your own serving stack for a model Bedrock already offers adds hosting work the requirement did not ask for.
The takeaway: filter by the model card, decide by your own evaluation, and pay for more capability only when a measured requirement needs it.
Customizing a foundation model: picking the method
One rule settles most customization questions: RAG supplies knowledge, customization changes behavior. When answers depend on private or changing information, a knowledge base retrieves it at request time, which removes the need to continually train your model to use your private data[23]; fine-tuning a model every time a product catalog changes turns each content update into a training job. Customization (Level 3) is for changing how the model responds, or how much it costs to run, when prompting and retrieval are not enough.
Four methods, chosen by the data you hold
Amazon Bedrock documents supervised fine-tuning, reinforcement fine-tuning, and distillation[3] on its customization page, and continued pre-training in the Bedrock FAQ[20]. Each needs a different kind of training data, so the data you hold usually picks the method; the comparison table Knowledge versus behavior after the last section lines the four up against RAG, and the paragraphs below give each one's mechanism.
Supervised fine-tuning trains on labeled examples (input-output pairs) so the model learns which outputs to generate for which inputs, with its parameters adjusted toward them. It fits a well-defined style, format, or task behavior that prompting alone cannot hold. With only unlabeled prompts and no target responses, it has nothing to learn from.
Reinforcement fine-tuning replaces labeled pairs with reward functions that evaluate response quality; the model learns iteratively from the feedback scores, and you can write the reward functions in AWS Lambda. Choose it when you can grade a response but cannot write the one correct answer in advance.
Distillation transfers knowledge from a larger teacher model to a smaller, faster, more cost-efficient student model: Bedrock generates the teacher's responses to your use-case prompts and uses them to fine-tune the student. The result is a new, separately trained student, so evaluate its task quality rather than assuming it inherits everything the teacher can do. Choosing between existing models request by request (intelligent prompt routing, described on the next page) never produces such a student.
Continued pre-training continues training an Amazon Titan base model on large amounts of unlabeled data, adapting it from a general corpus to a domain such as medicine, law, or finance while preserving most of its base capabilities. The FAQ notes that you can then fine-tune the adapted model for downstream tasks with significantly fewer labeled records. It adapts the model to a domain corpus; distillation instead learns from a teacher's responses rather than directly from raw documents.
Full fine-tuning versus LoRA
Within a fine-tuning workflow you also choose how many weights change. Full fine-tuning updates all of the model's weights. LoRA (Low-Rank Adaptation)[7], a parameter-efficient option in SageMaker AI, trains a small set of low-rank matrices (adapters) while the base model weights stay frozen. Here adapter means LoRA's low-rank matrices for an FM you fine-tune, not the Textract Custom Queries adapter from AWS AI services. SageMaker AI documents LoRA as reaching near full fine-tuning quality at significantly lower cost, with faster training and smaller output artifacts; the adapter still needs the base model at inference unless you merge the two. When the compute budget covers only adapter training, full fine-tuning is the wrong commitment.
Training cost grows with every epoch
Bedrock charges model training by the tokens processed: the tokens in the training corpus multiplied by the number of epochs[3], plus monthly storage for each custom model. An epoch is one full pass over the training data, so doubling the epochs doubles the training tokens even when the dataset is unchanged. Choose the epoch count from validation results and the budget, rather than treating extra passes as free quality.
The takeaway: route knowledge to RAG, let the training data you actually hold choose among the four customization methods, and budget for every epoch.
RAG architecture patterns in Bedrock Knowledge Bases
For example, suppose an assistant must answer from manuals in Amazon S3, from tables in an Amazon Redshift data warehouse, and from contracts that reference each other, and one team wants the retrieved chunks while another wants a finished answer: Amazon Bedrock Knowledge Bases[20] supplies a managed retrieval pattern for each case. Once RAG is the answer, the patterns differ in where the data lives and in who assembles the answer.
The managed pipeline for documents
For unstructured documents, a knowledge base automates the pipeline you would otherwise build. The common practice it implements[23] is to convert the data to text, split it into manageable pieces (chunks), convert each chunk to an embedding, and write the embeddings to a vector index while keeping a mapping from every chunk back to its original document. At runtime an embedding model converts the user's query to a vector, the vector index returns the chunks most similar to it, and the prompt is augmented with those chunks before it goes to the model. Knowledge bases can ingest content from Amazon S3[20], the web, and other sources, so an existing document repository in S3 needs no custom document-to-vector pipeline. Extraction services such as Textract are a different layer: they turn a page into text and fields but provide no vector retrieval.
Retrieve or RetrieveAndGenerate
Knowledge Bases exposes the runtime path at two depths. Retrieve[24] returns the most relevant source chunks as an array and stops there, which suits an application that composes the answer with its own prompt and model logic. RetrieveAndGenerate joins Retrieve with model invocation and returns a natural-language answer that includes citations to the source chunks. Choose by who composes the answer: calling RetrieveAndGenerate in a retrieval-only component generates an answer the application then has no use for. The figure below traces both depths over the same pipeline.
Structured data stores
When reference data sits in a supported structured store and the task needs SQL queries, consider querying it directly rather than exporting every row to text for embedding. A knowledge base can connect to structured data sources such as an Amazon Redshift data warehouse or the AWS Glue Data Catalog[20] and convert natural-language questions into SQL queries against the existing schema. The GenerateQuery operation performs only that conversion, returning a query in a form suitable for the structured store, for applications that want to inspect or run the query themselves; RetrieveAndGenerate uses it automatically when the knowledge base is connected to a structured store, as described on the retrieval operations page[24].
GraphRAG for answers that span documents
Some answers depend on relationships: a contract references an amendment, which names a supplier described in a third document. Plain vector search returns passages that are individually similar to the question and can miss the connecting ones. GraphRAG with Amazon Neptune Analytics[25] runs an initial vector search, then retrieves the graph nodes or chunk identifiers linked to the retrieved chunks and traverses the graph to expand the context. It fits questions whose facts must be connected across multiple documents, and it supports only Amazon S3 as the data source.
The takeaway: consider a vector knowledge base for documents in S3, a structured knowledge base for tables, or GraphRAG for cross-document relationships; then choose Retrieve or RetrieveAndGenerate by who writes the answer.
Traditional ML: the target decides the problem type
When no AI service or FM produces the required prediction, for example churn predicted from your own customer history, you train a model on your data (Level 4). The first decision is the problem type, and it comes from the target, the column you want to predict, not from the input columns.
Labeled data: supervised learning
If each training record includes a target value, the problem is supervised[4]. A categorical (mathematically discrete) target makes it classification, binary or multiclass; a mathematically continuous target makes it regression. Numbers can hide categories: a column that stores 1, 2, and 3 for bronze, silver, and gold tiers is still a categorical target, so the task is classification even though every value is numeric. SageMaker AI built-in algorithms such as Linear Learner and XGBoost[26] handle both classification and regression, so you configure the training objective for the target's type.
Forecasting is supervised too, but its target is the future of a sequence. DeepAR[26] is a supervised algorithm for forecasting scalar (one-dimensional) time series, the built-in choice when you must predict future behavior from historical data, such as sales of a product. Assigning a category to today's record and predicting next month's values are different outputs, so a forecasting requirement calls for a forecasting algorithm.
Unlabeled data: unsupervised learning
In this comparison, unsupervised learning discovers structure without supplied targets. Cluster analysis finds groupings whose members are as similar as possible to one another, and K-Means[26] is the built-in choice, for example to find high-, medium-, and low-spending customers from transaction histories when no segment labels exist. A supervised classifier cannot be trained on that data, because nothing tells it what the categories are, and clustering in turn groups records rather than forecasting a future sequence.
Anomaly detection finds the records that differ from the rest. Random Cut Forest (RCF)[27] is an unsupervised algorithm that associates an anomaly score with each data point: low scores mean normal and high scores indicate an anomaly, with scores beyond three standard deviations from the mean score commonly treated as anomalous. The score measures unusualness, not a business outcome. A high-scoring transaction is a candidate for investigation, not confirmed fraud; a supervised fraud classifier learns from labeled outcomes.
SageMaker AI lists a built-in algorithm for each of these problem types[26], and the figure below arranges them as a decision. The takeaway: check for labels first, then let the target's type (category, number, future value) or the unsupervised goal (groups, unusual records) pick the algorithm.
Text and image algorithms: match the output's shape
When you train on your own data in SageMaker AI (Level 4), text and image problems follow the same output-first rule as tabular ones, with more possible shapes: a discovered theme, a known category, a generated sequence, a set of object locations, or a class for every pixel. Each shape has its own SageMaker AI built-in algorithm. First check the options in AWS AI services: Rekognition Custom Labels[12] classifies whole images or detects objects with bounding boxes, and Comprehend custom classification[6] sorts documents into your own categories.
Text: discover topics, assign categories, or generate a sequence
- Topic modeling discovers themes. The built-in Latent Dirichlet Allocation (LDA) and Neural Topic Model (NTM)[26] algorithms are unsupervised: they organize documents into topics that are not known in advance. Discovered topics need not match the categories your business uses, so topic modeling is the wrong choice when the requirement is a defined label set.
- Text classification assigns predefined categories learned from labeled examples, for example sorting library books into academic disciplines; BlazingText and Text Classification - TensorFlow are the built-in options.
- Sequence-to-sequence generates a new sequence. The SageMaker AI Sequence-to-Sequence algorithm[28] is supervised: the input is a sequence of tokens and the output is another sequence of tokens, as in machine translation, text summarization, and speech-to-text. A text classifier assigns one or more categories from a fixed set, so it cannot express an arbitrary translated sentence.
BlazingText[29] has two modes with different outputs, so the mode matters as much as the algorithm. Its text classification mode is supervised and assigns documents to categories. Its Word2vec mode is unsupervised and maps words to vectors (word embeddings) that place semantically similar words close together; those vectors are representations for other models to use, not category predictions. Pick the mode by the output the application needs.
Images: image-level labels, boxes, or every pixel
The three built-in image approaches differ in how fine-grained the answer is. Image classification labels the image as a whole; object detection returns a bounding box and label for each object[26] it finds; semantic segmentation tags every pixel of the image with a category, which captures object shapes that a rectangle cannot, as the figure below shows, coarsest to finest. Choose the coarsest output that satisfies the requirement: a whole-image label when that is all the application uses, boxes when it must locate objects, and segmentation when it needs pixel boundaries.
The takeaway: in text and vision, ask whether the output is a discovered theme, a known category, a generated sequence, a location, or a per-pixel class, and the algorithm follows.
How much to build: Canvas, Autopilot, built-in algorithms, or code
When a model must be trained on your own data in SageMaker AI (Level 4), the next choice is how much of the work you do yourself. First check whether a pre-trained Amazon SageMaker JumpStart model already fits: JumpStart provides pre-trained models, pre-built solution templates, and examples[26] for popular problem types, and pre-trained models are ready to deploy, or to fine-tune and deploy[4], which is Level 2 or Level 3 in Choosing a modeling approach above. Within Level 4, AWS offers options from no code to fully custom code; pick the least effort that still gives the control the requirement needs. The options, in roughly increasing effort:
- Amazon SageMaker Canvas[8] builds a custom model without code: you import your data, build a model, evaluate its performance, and generate predictions. Its custom model types are numeric prediction (regression), categorical prediction for 2 or 3+ categories (binary and multiclass classification), time series forecasting, single-label image prediction, and multi-category text prediction. Canvas Ready-to-use models, by contrast, are the pre-trained AWS AI services from earlier and do not train on your data.
- Amazon SageMaker Autopilot[30] automates model development (automated machine learning, AutoML): it analyzes and preprocesses the data, explores a variety of algorithms, searches for optimal hyperparameters, trains and evaluates the candidates, and ranks them by performance on a validation set. As of November 30, 2023, AWS described Autopilot's user interface as migrating into SageMaker Canvas as part of the updated Studio experience, and its AutoML API remains available through the SDKs. Automatic model tuning searches hyperparameters for the algorithm configurations you supply, including multiple algorithms in one tuning job; it is not a substitute for Autopilot's end-to-end preprocessing and model-development workflow.
- A SageMaker AI built-in algorithm needs no training code: the only inputs are the data, hyperparameters, and compute resources[4]. When a built-in algorithm fits the data and task, reimplementing it in a framework script adds development work without adding capability.
- Script mode runs your own training script in a supported framework, such as scikit-learn, TensorFlow, or PyTorch, for an algorithm no built-in covers. A custom container image is the highest-effort option, for packages outside the supported frameworks.
The SageMaker AI implementation guidance rates the effort of these code paths. The ratings compare the paths with each other, all within Level 4 of the build-effort levels, so Low means low within Level 4, not Level 1; AWS's Level of effort column is not a build-effort level number. The same algorithm implementation guidance[4] also rates Spark ML, open-source XGBoost (the XGBoost framework run with your own training script[31], which is separate from the built-in XGBoost algorithm in Traditional ML), MXNet, and Chainer, which the table below leaves out:
| Implementation | Requires code | Level of effort |
|---|---|---|
| Built-in algorithm | No | Low |
| Scikit-learn | Yes | Medium |
| TensorFlow or PyTorch | Yes | Medium-high |
| Custom image | Yes | High |
The takeaway: check for a fitting JumpStart model first; within Level 4, start from Canvas or Autopilot when they cover the task, use a built-in algorithm when you already know the algorithm, and write code only for logic none of them supplies.
Criteria beyond accuracy: interpretability and compute
The most accurate candidate is not always the right one. Interpretability and compute support also bear on the choice: whether people must understand how the model reaches a prediction, and which training resources the algorithm can actually use.
Interpretability
Some requirements, such as a credit decision that must be justified to a customer or regulator, call for decision logic a person can read directly. AWS guidance notes that simple models are considered more interpretable[32], because the effect of each input on the output is easier to understand: in a linear regression model, the magnitudes of the coefficients give a global feature importance, and a feature's contribution to one prediction is its coefficient times the feature's value. When readable decision logic is a stated requirement, an inherently interpretable model can be the right choice even if a more complex candidate scores somewhat higher, provided the simple model still meets the required predictive performance.
Feature attribution methods (SHAP is a common one) explain an already trained, complex model by assigning each input an importance score for a prediction. That helps, but it does not make the model's internal logic simple, and the same guidance warns that feature importance scores can be misleading and should be verified, ideally with subject matter experts.
Compute support
The algorithm you pick also fixes which hardware can shorten training. SageMaker AI built-in algorithms come with parallelization across multiple compute instances and GPU support for applicable algorithms[4], but some algorithms are excluded by inherent limitations, so check the algorithm's own page before sizing the training job. The Sequence-to-Sequence and BlazingText algorithm pages, for example, document limits of this kind:
- The Sequence-to-Sequence algorithm[28] supports only GPU instance types and trains on a single machine, although it can use an instance with multiple GPUs. Adding training instances does not distribute it.
- BlazingText[29] text classification runs on a single CPU instance or on a single GPU instance using one GPU; only its batch skip-gram Word2vec mode spreads across multiple CPU instances.
Managed training runs what the algorithm supports; it does not add distribution the algorithm lacks. For an FM, the epoch count discussed in Customizing a foundation model above affects training tokens and cost.
The takeaway: a stated interpretability requirement can outrank a small accuracy gain, and an algorithm's documented compute support decides which training resources are supported.
Matching requirements to AWS modeling approaches
The AWS MLA-C02 exam guide asks you to evaluate tradeoffs between custom solutions, managed services, pre-trained models, and FMs to meet business needs[2] (Skill 2.1.4) under Task 2.1, "Choose appropriate modeling approaches for ML and AI solutions," and the table below applies that skill: it pairs each requirement with a modeling approach and an alternative ruled out, and names in italics the section that explains it.
| Requirement | Modeling approach | Alternative ruled out, and why |
|---|---|---|
| Extract totals and vendor names from receipts | Textract AnalyzeExpense | Text detection plus custom parsing: rebuilds the purpose-built expense analysis (AWS AI services) |
| Process 40-page PDF files | Textract asynchronous operations | Synchronous calls: they handle single-page documents (AWS AI services) |
| Opinions about each product in one review | Comprehend targeted sentiment | Document sentiment: one label collapses opinions about different entities (AWS AI services) |
| Detect our own logo in photos | Rekognition Custom Labels | Label detection: its pre-trained labels cover common objects, not your logo (AWS AI services) |
| Live captions for a meeting | Transcribe streaming | Batch transcription: it expects media files already stored in S3 (AWS AI services) |
| Generate product images from text | An FM whose model card lists image output | A multimodal model with image input only: it returns text (Selecting a foundation model) |
| Long, detailed briefs from very long documents | A model whose context window and output limit both fit | Choosing on context window alone: the output limit is separate (Selecting a foundation model) |
| Answers must reflect a catalog updated daily | RAG with a knowledge base | Repeated fine-tuning: every update becomes a training job (Customizing a foundation model) |
| Teacher-level quality at lower cost | Distillation | Prompt routing: it chooses between existing models and trains no student (Customizing a foundation model) |
| Responses can be scored, but no single correct answer | Reinforcement fine-tuning | Supervised fine-tuning: it needs a target response for each input (Customizing a foundation model) |
| App composes answers with its own prompt | Knowledge base Retrieve | RetrieveAndGenerate: it generates an answer the app does not use (RAG architecture patterns) |
| Segment customers; no segment labels exist | K-Means | A supervised classifier: there are no labels to train on (Traditional ML) |
| Flag unusual transactions | Random Cut Forest | Treating the score as confirmed fraud: it measures unusualness (Traditional ML) |
| Outline each defect's exact shape | Semantic segmentation | Object detection: a box does not classify each pixel (Text and image algorithms) |
| Train a churn model with no coding | Canvas custom model | Canvas Ready-to-use models: pre-trained, not trained on your data (How much to build) |
| Decision logic must be readable | A simple interpretable model that meets the accuracy bar | The most accurate complex model plus attributions: its logic stays complex (Criteria beyond accuracy) |
The takeaway: find the phrase that fixes the output, the data, or the timing, and the right approach usually follows from one of the sections above.
Knowledge versus behavior: RAG vs supervised fine-tuning vs reinforcement fine-tuning vs distillation vs continued pre-training
| Decision factor | RAG | Supervised fine-tuning | Reinforcement fine-tuning | Distillation | Continued pre-training |
|---|---|---|---|---|---|
| What you supply | Documents or a data store queried at request time | Labeled input-output pairs | Prompts plus a reward function that scores responses | Use-case prompts, a teacher model, and a student model | A large body of unlabeled domain text |
| What changes | Only the prompt context; model weights stay as they are | Model weights, toward the demonstrated responses | Model weights, toward higher-scoring responses | The student's weights, toward the teacher's responses | Model weights, toward the domain's vocabulary and writing patterns |
| Choose it when | Answers need private or frequently changing facts | Examples exist for a well-defined style, format, or task behavior | Quality can be scored but no single correct answer exists | A teacher meets quality but is too slow or costly for the workload | The base model lacks the domain's terminology and a large unlabeled corpus exists |
| Wrong choice when | A persistent output style or format must be learned | Only unlabeled prompts exist, with no target responses | No measurable success criterion can score response quality | A new domain corpus must be learned from raw documents | Facts change often, because every refresh means another training job |
Decision tree
Sharp facts the exam loves — give these one last read before exam day.
Cheat sheet
Sharp facts the exam loves — scan these before test day.
- A foundation model must support both the required input and output modalities
Choose a foundation model by checking input and output modalities separately. A model that understands images and produces text can describe an image but is not thereby an image generator. For image creation, select a model explicitly supporting image output, such as Stability AI Stable Image Ultra in Amazon Bedrock.
Trap Choosing a multimodal understanding model for image generation because image input support is mistaken for image output support.
3 questions test this
- A company is reviewing four proposed Amazon Bedrock model assignments before development starts. Each assignment must be confirmed against both the input and the output modalities listed on the chosen
- An interior design app lets customers upload a photo of a room and then shows a newly generated image of the redesigned room. The ML engineer plans a two-step flow on Amazon Bedrock: one model describ
- A software company's support assistant uses Amazon Nova Micro through the Amazon Bedrock Converse API. Customers can now attach screenshots of error dialogs, and every request that includes a screensh
- Context window and maximum output tokens are separate model constraints
A foundation model's context window and maximum output tokens constrain different parts of a request. When processing long documents, compare the model card's context window and maximum output tokens with the required input context and response length; a large context window does not imply equally long generated responses. Choose a model that satisfies both constraints.
Trap Selecting solely by context-window size when the required response exceeds the model's separate output limit.
3 questions test this
- A software company wants one Amazon Bedrock request to turn a 20,000-token codebase summary into a detailed migration plan of about 45,000 tokens. A developer proposes the model with the largest conte
- A law firm needs an Amazon Bedrock model that reads contracts of up to 250,000 tokens in one request and writes a detailed review of up to 40,000 tokens. The ML engineer compares the published model c
- A legal team uses Amazon Nova Pro in Amazon Bedrock to write detailed minutes from hearing transcripts of about 150,000 tokens. The Nova Pro model card lists a 300K token context window and 10K max ou
- Task-specific evaluation distinguishes foundation models better than model card capability labels alone
When several Amazon Bedrock models support the task, evaluate their responses on prompts representative of that task. Use the relevant quality metrics and compare results before selecting a model. Supporting text generation establishes compatibility, not that a model meets a particular domain's accuracy or response-quality requirement.
Trap Selecting from the model card's modality support alone, which establishes supported inputs and outputs rather than measured task quality.
3 questions test this
- A company must decide whether to keep its fine-tuned model hosted on a SageMaker AI endpoint or move to Amazon Nova Pro in Amazon Bedrock. Both models must be compared on the same 400 prompts taken fr
- A property management company must choose between two Amazon Bedrock text models to summarize its lease agreements. Both model cards list text input and text output, and both models fit the budget. Mo
- A company's assistant uses an Amazon Bedrock knowledge base and must choose between Amazon Nova Pro and Anthropic Claude Haiku 4.5 as the response generator. Retrieval quality is already acceptable. T
- A lower-cost model is appropriate when it meets the measured quality and latency requirements
Choose among foundation models using task quality, latency, and cost together. Amazon Bedrock offers model variants with different capability and price-performance profiles, so a simpler text task can be served by a faster, lower-cost option if it passes the required evaluation. More capable models remain appropriate when the task requires the additional capability.
Trap Choosing the most capable model for every request without checking whether the additional capability is needed within the latency and cost budgets.
3 questions test this
- A retailer classifies short customer emails into eight routing categories by using a model in Amazon Bedrock. An evaluation on 2,000 labeled emails shows Amazon Nova Micro and Amazon Nova Pro both exc
- A financial analytics team evaluated Amazon Nova Lite and Amazon Nova Pro on 300 representative multi-step reasoning prompts about quarterly filings. Nova Lite missed the accuracy target by a wide mar
- A company runs two Amazon Bedrock features: extracting fields from short shipping notices, and multi-step reasoning over carrier contracts. An evaluation on representative prompts shows that Amazon No
- An embedding model produces vectors for retrieval rather than conversational answers
When the application needs semantic representations for a vector index, use an embedding model such as Amazon Titan Text Embeddings. It returns numeric vectors; the vector database performs similarity search. A separate generative model can use the retrieved text to compose an answer.
Trap Using a text-generation response as the vector-index value, because generated prose is not the embedding representation the index searches.
3 questions test this
- A company wants to group 50,000 customer complaints by meaning so that analysts can find recurring issues. Analysts must be able to compute a numeric similarity between any two complaints and adjust t
- A developer built a retrieval prototype by asking an Amazon Bedrock text model to write a one-line description for each document chunk, storing those descriptions in the index, and matching user queri
- A company is building semantic search over 200,000 support articles. Each article chunk must be stored in an Amazon OpenSearch Serverless vector index, and user queries must be compared against the ch
- Foundation model features must be checked for the exact model and version
Amazon Bedrock model capabilities are not uniform across a family or across versions. Check the chosen model's support for required features such as streaming, fine-tuning, and the intended API before committing to it. A model can support inference while lacking a customization feature available on another member of its family.
Trap Choosing a model by family name and inheriting another family member's fine-tuning support, which is specified per model.
3 questions test this
- A company in us-east-1 calls Amazon Nova Pro for text and Stability AI Stable Image Ultra 1.0 for images. Peak traffic exceeds in-Region capacity, so the platform team plans to move every model to a U
- A company wants an Amazon Bedrock intelligent prompt router in us-east-1 that sends simple requests to a cheaper Amazon Nova model and complex requests to a more capable one. A developer proposes Amaz
- A bank must fine-tune a small text model in Amazon Bedrock on labeled examples, and its data residency policy requires the fine-tuning job to run in us-east-1. The team shortlisted Meta Llama 3.1 8B I
- Supervised fine-tuning learns a task's desired behavior from labeled examples
When prompting is insufficient for a well-defined output style, format, or task behavior, consider supervised fine-tuning with representative input-output pairs. Training adjusts model parameters toward the demonstrated responses. The technique is a behavior-customization choice rather than the default mechanism for supplying continually changing reference information.
Trap Choosing retrieval alone to teach a persistent output style, because retrieved reference passages supply context rather than parameter updates from demonstrations.
3 questions test this
- A claims company uses an Amazon Bedrock foundation model to turn adjuster notes into a fixed JSON summary with company-specific field names and phrasing. Detailed prompt instructions and examples stil
- An ML engineer is choosing a customization method in Amazon Bedrock for a ticket-triage model. The engineer has 8,000 historical support tickets, and each ticket is paired with the human-written triag
- A retailer's assistant answers product questions by using Amazon Bedrock Knowledge Bases over its catalog. Answers are factually correct, but they ignore the brand's required tone, sentence length, an
- LoRA fine-tuning updates adapters instead of all model parameters
When a supported customization workflow must adapt a model on a compute budget that covers only adapter training, consider LoRA, a parameter-efficient fine-tuning method. It trains small adapter matrices while the base model weights stay frozen, which SageMaker AI documents as lower cost, faster training, and smaller artifacts. Full fine-tuning updates all model weights and is a different resource commitment.
Trap Choosing full fine-tuning for an adapter-only resource budget, because it updates all model weights.
3 questions test this
- A software company needs separately customized versions of one foundation model for 30 enterprise customers, each trained on that customer's examples. Hosting 30 full copies of the model is too expens
- A startup wants to customize an open-weight foundation model with SageMaker AI model customization for a support-ticket summarization task. The team has a modest GPU budget, a few thousand labeled exa
- A pharmaceutical company plans a large domain shift for a foundation model by using a very large, high-quality proprietary dataset. Maximum customization depth is required, and the team does not want
- Reinforcement fine-tuning uses scored feedback when a single target response is unsuitable
When response quality can be scored but there is no single desired answer for each input, consider supported reinforcement fine-tuning in Amazon Bedrock. Reward functions evaluate generated responses and supply feedback for iterative learning. Supervised fine-tuning instead learns from labeled input-output demonstrations.
Trap Choosing supervised fine-tuning with only unlabeled prompts and no target responses, which omits the demonstrations that supervised training needs.
3 questions test this
- A logistics company uses Amazon Nova 2 Lite in Amazon Bedrock to draft delivery-route plans. Many different plans can be acceptable for one request, and an existing validator program scores any plan f
- An ML engineer plans reinforcement fine-tuning in Amazon Bedrock for a model that must produce structured incident reports. A baseline evaluation with the planned reward function shows rewards that ar
- A developer-tools company wants a foundation model to write SQL queries that pass the company's automated test suites. For many prompts, several different queries are equally valid, so no single corre
- Distillation transfers task behavior through teacher-generated training responses
When a capable teacher model meets quality requirements but is too expensive or slow for the target workload, evaluate Amazon Bedrock Model Distillation with a supported student. Bedrock generates teacher responses for use-case prompts and fine-tunes the student on those responses. Evaluate the resulting student's task quality rather than assuming it inherits all of the teacher's capabilities.
Trap Using a prompt router when a separately trained student is required, because routing selects among existing models without transferring teacher behavior.
3 questions test this
- An insurer has called a large teacher model through the Amazon Bedrock Converse API for months, and CloudWatch Logs invocation logging stored the prompts and responses in Amazon S3. The insurer wants
- A media company uses Amazon Nova Premier for a headline-writing task and is satisfied with its quality. To cut cost, an architect proposes an intelligent prompt router that sends easier requests to No
- An insurer used Amazon Bedrock invocation logging for six months while serving claims questions with Amazon Nova Pro, so the logs hold prompts and Nova Pro responses. Nova Pro missed the quality targe
- Additional fine-tuning epochs increase the volume of training tokens processed
Amazon Bedrock customization training charges depend on the tokens processed during training, including repeated passes through the training corpus. Increasing the epoch count therefore increases training work even when the dataset is unchanged. Choose training duration from validation results and the budget rather than treating additional epochs as free quality improvement.
Trap Budgeting training from the corpus size alone, which ignores repeated token processing across epochs.
3 questions test this
- An ML engineer runs a monthly supervised fine-tuning job for an Amazon Nova Lite model in Amazon Bedrock on a 25-million-token dataset with 2 epochs. Finance will approve only a change that leaves the
- A team runs supervised fine-tuning of an Amazon Nova Lite model in Amazon Bedrock on a 30-million-token dataset for 2 epochs, and the budget covers exactly that volume of processed training tokens. Th
- An ML engineer runs a monthly supervised fine-tuning job for an Amazon Nova Micro model in Amazon Bedrock with 3 epochs. An audit finds that 12 million of the dataset's 40 million training tokens are
- Continued pre-training adapts an existing foundation model using unlabeled domain text
When an existing foundation model needs deeper familiarity with domain terminology and writing patterns and a substantial unlabeled corpus is available, consider supported continued pre-training. It continues training the existing model on raw domain documents rather than requiring input-output demonstrations, and you can then fine-tune the adapted model for downstream tasks with significantly fewer labeled records. Supervised fine-tuning instead teaches demonstrated task responses, while RAG supplies current reference material at inference time without retraining the model whenever that material changes.
Trap Using model distillation to introduce a new domain corpus, although distillation transfers a teacher's task behavior through generated responses rather than learning directly from unlabeled documents.
3 questions test this
- An ML team completed continued pre-training of an Amazon Nova model on a large corpus of unlabeled maintenance manuals. The model now uses equipment terminology fluently, but when technicians ask it q
- A utility company has about 3 billion tokens of unlabeled maintenance logs and engineering manuals. It wants an Amazon Nova model to use its equipment terminology and writing patterns fluently. The do
- An energy regulator wants an assistant that writes in its specialized technical language and also answers from policy bulletins that change every month. It has a large archive of unlabeled technical r
- The prediction target determines whether a supervised task is classification or regression
For labeled tabular data, choose classification when the required output is a discrete category and regression when it is a continuous value. Amazon SageMaker AI algorithms such as Linear Learner and XGBoost support these problem families. Configure the learning objective for the target rather than inferring it from whether the input columns are numeric.
Trap Choosing regression for numeric class codes, because a numeric encoding does not turn categorical outcomes into continuous targets.
3 questions test this
- An ML engineer is configuring the Amazon SageMaker AI Linear Learner algorithm to predict whether a subscriber will cancel within 30 days. The label column contains 0 for stays and 1 for cancels. A te
- An insurer trains models on labeled claims data in Amazon SageMaker AI. One model must estimate each claim's payout in dollars and cents. A second model must assign each claim to one of four handling
- A telecom company has a labeled tabular dataset of past customers. The target column records which of five service plans each customer chose, stored as the integer codes 1 through 5 because the source
- K-means discovers groups when category labels are not supplied
When the task is to group customers by similar measured behavior without predefined segment labels, consider the Amazon SageMaker AI K-Means algorithm. Clustering discovers groupings from feature similarity. Supervised classification is appropriate when labeled examples define the categories to predict.
Trap Choosing a supervised classifier for an unlabeled segmentation dataset, which supplies no target categories for supervised training.
3 questions test this
- A media company wants viewer segments for content planning. A data scientist proposes training an XGBoost multiclass classifier on viewing-history features to produce segments. The company has never d
- A retail bank wants to group its credit card customers by similar spending behavior, such as monthly spend, merchant mix, and transaction frequency. No segment labels exist, and the marketing team wan
- A logistics company trained an Amazon SageMaker AI K-means model on unlabeled shipment features to find shipment groups. A manager expects the model to return named categories such as Express or Bulk
- Random Cut Forest identifies unusual observations without requiring anomaly labels
For an unlabeled dataset where the objective is to flag observations that differ from normal patterns, consider Amazon SageMaker AI Random Cut Forest. It is an unsupervised anomaly-detection algorithm. Its anomaly scores identify unusual observations for investigation rather than directly establishing a business label such as confirmed fraud.
Trap Treating an anomaly score as a confirmed fraud classification, which substitutes unusualness for a labeled business outcome.
4 questions test this
- A manufacturer streams readings from 30 sensors on each production line. There are no labels marking failures, but engineers want the system to flag readings that diverge from normal patterns so that
- An insurer trained Amazon SageMaker AI Random Cut Forest on two years of auto claims. None of the claims in the training data was ever labeled as fraud or legitimate. The claims director now proposes
- A utility collects hourly electricity load for 400 related substations and has two years of history with no labels of any kind. Operators need two outputs. They need an alert for any hour whose load b
- A manufacturer scores unlabeled vibration readings with an Amazon SageMaker AI Random Cut Forest model. Engineers must decide which readings to send to technicians for inspection, and no labeled failu
- DeepAR matches forecasting tasks that predict future time-series values
When the required prediction is future behavior from historical time-series observations, consider Amazon SageMaker AI DeepAR. Forecasting differs from assigning a category to the current record. Select and evaluate the forecasting approach against the future values the application must predict.
Trap Choosing K-Means to produce future numeric forecasts, because clustering groups observations rather than predicting a future sequence.
3 questions test this
- A hospital supply team must forecast daily usage of 600 related consumables for the next 21 days. Purchasing sets safety stock from the 90th percentile of expected usage, so it needs a range of likely
- A grocery chain has three years of daily sales history for 2,000 related products across its stores. It needs to predict each product's daily sales for the next 28 days to plan replenishment. The ML e
- A utility collects hourly electricity load for 400 related substations and has two years of history with no labels of any kind. Operators need two outputs. They need an alert for any hour whose load b
- Topic modeling discovers document themes rather than predicting predefined labels
When a document corpus has no topic labels and the requirement is to discover themes, use an unsupervised topic model such as LDA or Neural Topic Model. Use supervised text classification when the required categories are already defined and labeled examples are available. The distinction is whether topics are discovered or supplied as targets.
Trap Choosing an unsupervised topic model for exact business-category prediction, because discovered topics need not correspond to the required labels.
3 questions test this
- An insurer ran Amazon SageMaker AI LDA with 8 topics on claim notes, expecting each topic to match one of its 8 official claim types. Reviewers found that topics mix several claim types and that one c
- A software company has 1.5 million unlabeled support tickets. Product managers want to learn which recurring themes appear across the tickets; no category list exists yet, and nobody knows in advance
- A news publisher must tag each new article with one of 14 editorial sections that the newsroom has already defined. It has 200,000 past articles that editors tagged with these sections. An analyst pro
- Object detection returns locations that image classification does not provide
When an application must locate multiple objects within an image, choose object detection rather than image-level classification. Supported Amazon SageMaker AI object-detection models return bounding boxes and labels. Image classification is appropriate when a label for the image as a whole satisfies the task.
Trap Choosing image classification for a bounding-box requirement, because image-level labels do not locate individual objects.
3 questions test this
- A parking operator wants to process camera images of its lots and return the location of every car in each image so that it can count cars and identify occupied bays. Each image can contain dozens of
- An electronics manufacturer is preparing training data for an Amazon SageMaker AI Object Detection model that must find and locate solder defects on circuit board images. A contractor proposes labelin
- A shipping company runs an Amazon SageMaker AI Image Classification model that labels each conveyor photo as containing or not containing a damaged package. A robotic arm must now pick out every damag
- Semantic segmentation is appropriate when every image pixel needs a category
For a computer-vision task requiring pixel-level category assignments, select semantic segmentation. Amazon SageMaker AI provides a built-in semantic-segmentation algorithm for this fine-grained output. Bounding-box detection is sufficient when approximate object locations, rather than pixel boundaries, meet the requirement.
Trap Choosing object-detection boxes for a pixel-mask requirement, because a rectangle does not classify each enclosed pixel.
3 questions test this
- A warehouse wants to count pallets in overhead camera images and know roughly where each pallet sits so that forklifts can be dispatched. Exact pallet outlines are not needed. An ML engineer proposes
- A medical imaging startup needs a model that marks the exact boundary of a tumor in each MRI slice by assigning every pixel to tumor or healthy tissue. Clinicians will measure tumor area from the resu
- A flood-response agency analyzes aerial images to estimate how many square meters of farmland are underwater. The current Object Detection model draws boxes around flooded areas, but irregular flood s
- BlazingText supports efficient supervised text classification
When labeled documents must be assigned to predefined categories, Amazon SageMaker AI BlazingText provides an optimized text-classification implementation. It also offers Word2vec functionality, but that mode produces word representations rather than category predictions. Choose the mode that matches the required output.
Trap Selecting BlazingText's Word2vec mode for direct document-category predictions, because word embeddings are representations rather than classification outputs.
3 questions test this
- An ML engineer trained Amazon SageMaker AI BlazingText on 2 million product reviews, each labeled with one of 15 defect categories, to tag new reviews automatically. The training file uses the __label
- A legal-tech company wants word embeddings that capture semantic relationships in its legal vocabulary. It plans to use the embeddings as input features for several downstream models built later by ot
- A publisher has 400,000 articles, each labeled with one or more of 30 predefined subject tags. A new tagging service must suggest the three most likely tags for each new article, with a probability fo
- Sequence-to-sequence models fit supervised transformations between token sequences
When paired examples map an input sequence to an output sequence, consider a sequence-to-sequence approach. Amazon SageMaker AI's built-in algorithm supports tasks such as translation and summarization. This differs from text classification, which selects a category instead of generating a new sequence.
Trap Using a text classifier for translation, because its category output cannot express an arbitrary translated sentence.
3 questions test this
- A utility company has 250,000 pairs of technician shorthand notes and the full standardized sentences that office staff later wrote from them. It wants a model that converts each new shorthand note in
- A medical device maker has a parallel corpus of 400,000 English sentences from its manuals paired with approved German translations. A developer proposes training a text classifier in which each Germa
- A research institute has 90,000 long technical reports, each paired with an abstract written by its authors. It wants a model that reads a new report and produces a new abstract in the same style. An
- Explanation requirements can justify choosing an inherently interpretable model
When a requirement calls for directly understandable decision logic, choose an inherently interpretable candidate, such as a simple linear model or small decision tree, if it meets the required predictive performance. Its weights or decision rules expose how inputs determine predictions, which can justify accepting lower accuracy than a more complex candidate. Post-hoc feature attribution explains aspects of an already trained model's behavior; it does not make that model's internal decision logic inherently simple.
3 questions test this
- An insurer's pricing committee requires that underwriting decisions follow rules the committee can read and audit directly. The data science team wants to deploy a deep neural network and attach Amazo
- A regional lender must give regulators a model whose decision logic loan officers can read and explain directly. On the validation set, a linear model with a small set of features reaches 0.84 AUC, wh
- A payments company's chargeback-risk model must reach a precision of at least 0.75. On validation data, the best logistic regression and shallow decision tree candidates reach 0.61 precision, while an
- A built-in algorithm avoids implementing the training algorithm yourself
When an Amazon SageMaker AI built-in algorithm fits the data and prediction task, supply data, hyperparameters, and compute configuration to run training. The algorithm implementation is already provided. This reduces development effort compared with writing an equivalent training implementation in a framework script.
Trap Reimplementing an available built-in algorithm in a framework script when the sole requirement is equivalent training with minimal custom code.
3 questions test this
- A data science team trains a demand-forecasting model and must optimize a custom asymmetric loss function that penalizes under-forecasting more than over-forecasting. The team also needs a third-party
- A company trained a linear regression model on premises with an open-source library and recorded the hyperparameter values that worked best. It now wants to retrain the model on much larger data in Sa
- A retail company wants to predict whether each loyalty member will churn next quarter by using a labeled tabular dataset in Amazon S3. Gradient-boosted trees are already known to work well for this pr
- SageMaker JumpStart provides reusable pretrained models and solution templates
When a supported pretrained model or solution template already fits the application task, use Amazon SageMaker JumpStart as a starting point. It offers reusable options for tasks such as text analysis and computer vision. This avoids implementing and training a comparable model from scratch while preserving the need to evaluate it on the intended workload.
Trap Starting a new model-training implementation for a task already satisfied by a suitable pretrained model, which adds development and training work.
3 questions test this
- An ML engineer selected a pretrained question answering model in SageMaker JumpStart for an internal help desk. The model card shows strong results on public benchmarks. Leadership asks for evidence t
- A startup needs an image classification model for a mobile app that sorts photos into common categories such as food, pets, and landscapes. A suitable pretrained open-source model already performs thi
- A platform team deploys ML models only through an automated CI/CD pipeline that runs Python code; engineers do not use Amazon SageMaker Studio. The team wants to start a new text summarization service
- Amazon Bedrock provides managed foundation model access without operating model hosts
When the existing application needs supported foundation models through a managed service, choose Amazon Bedrock rather than building model-serving infrastructure. Bedrock exposes foundation-model capabilities through APIs and supplies associated customization and evaluation features. Amazon SageMaker AI remains appropriate when the workflow requires greater control over custom model development and training.
Trap Building a custom model-serving stack for a supported Bedrock model when the requirement is managed API access with minimal hosting operations.
3 questions test this
- A product team is prototyping a summarization feature and wants to compare foundation models from several providers before committing to one. After launch, the team expects to switch to newer models a
- A company is adding a feature that drafts replies to customer emails by using a foundation model. The required model is available in Amazon Bedrock. The company's two-person engineering team cannot ma
- An internal tool uses a foundation model to classify a few hundred support tickets per day, with long idle periods overnight and on weekends. The model is available in Amazon Bedrock. Finance wants to
- A task-specific AWS AI API can remove the need to train a general model
When a business task matches a pretrained AWS AI capability, use the task-specific service if it meets the required quality and customization needs. Services such as Amazon Textract and Amazon Comprehend expose document-analysis functions directly. A custom training workflow earns its additional effort when the managed capability does not satisfy the task.
Trap Training a custom model solely to reproduce an adequate pretrained API, which adds model-development work without satisfying an additional requirement.
3 questions test this
- A bank must remove customer names, credit card numbers, and postal addresses from English chat transcripts before analysts can read them. The bank has no annotated transcripts and no ML staff, and it
- An accounting firm wants to extract printed and handwritten text and table data from scanned client tax forms. A proposal suggests training a custom object detection and character recognition model in
- A global retailer receives about 50,000 customer emails each day in more than 30 languages. Each email must be routed to the support queue for its language within seconds of arrival. The company has n
- Built-in algorithm scaling support must be checked before selecting training resources
Amazon SageMaker AI built-in algorithms do not all support the same CPU, GPU, or multi-instance training configurations. Select resources supported by the chosen algorithm rather than assuming every managed algorithm distributes automatically. For example, the built-in sequence-to-sequence algorithm supports GPU training on a single machine, including supported multi-GPU instances.
Trap Adding multiple training instances to an algorithm documented for single-machine training, because managed execution does not override algorithm support.
3 questions test this
- A company must retrain a tabular binary classification model every night on 2 TB of data, and the job must finish within a short window by distributing training across several instances. The team is c
- An ML engineer trains a translation model with the SageMaker AI built-in Sequence-to-Sequence algorithm on a single GPU instance, and each run takes too long. A teammate proposes increasing the traini
- A team trains the SageMaker AI built-in Semantic Segmentation algorithm on aerial images. Training on the current GPU instance is slower than the project schedule allows. The team lead suggests either
- SageMaker Autopilot automates model development rather than only running a chosen algorithm
When a supported prediction task needs automated model development with minimal manual experimentation, use Amazon SageMaker Autopilot. Its AutoML workflow performs data analysis and preprocessing, explores algorithms, searches hyperparameters, trains candidates, and ranks them using validation performance. Manually selecting a built-in algorithm is appropriate when the algorithm is already chosen, while a custom training script provides control over training logic that the automated workflow does not supply.
Trap Using automatic model tuning alone as a replacement for an AutoML workflow, although tuning optimizes the supplied training configuration rather than supplying the whole preprocessing and candidate-development process.
3 questions test this
- A utility wants daily demand forecasts for 3,000 substations from two years of history stored as CSV files in Amazon S3. The team has not chosen a forecasting algorithm and wants SageMaker AI to explo
- A lender has a 60 MB tabular dataset in Amazon S3 for a loan-default classifier and has not chosen an algorithm. The team wants SageMaker AI to train several model types, such as LightGBM, CatBoost, a
- A lender must build a credit-default classifier from tabular data but has not chosen an algorithm. Compliance reviewers require a report of each feature's importance for the selected model. They also
- SageMaker Canvas supports custom predictive modeling through a no-code interface
When users need to build, evaluate, and use a custom predictive model without writing code, choose Amazon SageMaker Canvas for a supported prediction task. Its interface lets users import their data, build a model trained on that data, evaluate its performance, and generate predictions. Supported custom-model tasks include regression, classification, and time series forecasting, so the selection depends on both the required prediction type and the need for a no-code workflow.
Trap Using Canvas Ready-to-use models for a requirement to train a custom predictor on the user's data, because those models provide pretrained AI capabilities rather than that custom training workflow.
- RAG supplies private or changing knowledge at inference time
When answers need current private reference information, use RAG to add relevant source material to the prompt. The model can use this context without being retrained whenever the information changes. Fine-tuning is better suited to changing learned task behavior than to maintaining a frequently updated reference corpus.
Trap Repeatedly fine-tuning solely to refresh a changing reference catalog, which turns content updates into training jobs.
3 questions test this
- A company's Amazon Bedrock assistant answers employee questions about internal benefits rules that the HR team updates in Amazon S3 every week. A manager proposes fine-tuning the model after each upda
- A media monitoring company wants an Amazon Bedrock assistant that answers analysts' questions from about 4 billion tokens of private news summaries stored in Amazon S3. Hundreds of summaries are added
- A hospital network wants an assistant that answers staff questions from internal clinical procedures. The procedures are private, were never part of any model's training data, and are revised every fe
- Bedrock Knowledge Bases manages semantic retrieval over documents in Amazon S3
For an existing document repository in Amazon S3, Amazon Bedrock Knowledge Bases can manage ingestion, chunking, embedding, and retrieval for a RAG application. It maintains the relationship between indexed chunks and their sources. This supplies a managed retrieval layer rather than requiring a custom document-to-vector pipeline.
Trap Using Amazon Textract as the semantic-search index, because document extraction does not provide the vector-retrieval layer.
3 questions test this
- An engineering firm stores 80,000 design specifications as PDF and Word files in Amazon S3 and wants semantic retrieval for a RAG assistant on Amazon Bedrock. The firm has no staff to choose, provisio
- An engineering company has thousands of scanned maintenance manuals in Amazon S3. An architect proposes running Amazon Textract on every manual and using the stored Textract JSON output as the search
- A consulting firm stores 60,000 reports as PDF and Word files in an Amazon S3 bucket. It wants a RAG application on Amazon Bedrock that finds relevant passages for user questions. The team has no time
- Retrieve separates source retrieval from answer generation
When an application needs retrieved passages for its own downstream generation logic, use the Retrieve operation of Amazon Bedrock Knowledge Bases. RetrieveAndGenerate combines retrieval with model invocation and returns a generated answer with source citations. Choose according to whether the application or the managed operation should compose the answer.
Trap Calling RetrieveAndGenerate for a retrieval-only component, which adds answer generation that the application intends to control separately.
3 questions test this
- An insurance company's claims application already has its own prompt templates, its own model invocation, and output validation logic. It needs only the most relevant passages from an Amazon Bedrock k
- A small HR team wants an internal Q&A tool over its Amazon Bedrock knowledge base. It has no prompt templates or generation code of its own and wants one managed API call that returns a natural-langua
- A bank runs a RAG assistant over an Amazon Bedrock knowledge base of product policies. Compliance permits only the bank's own fine-tuned model, hosted on a SageMaker AI endpoint, to generate answer te
- A structured knowledge base can query existing tables without first embedding every row
When the reference data already resides in a supported structured store, Amazon Bedrock Knowledge Bases can translate natural-language questions into suitable queries and retrieve the results. GenerateQuery provides query conversion separately when the application needs that control. This pattern uses the existing schema rather than requiring an unstructured-document vector workflow.
Trap Exporting every table row to text solely to enable retrieval, despite a supported structured-store connection that can query the data directly.
2 questions test this
- A retailer keeps several years of sales data as Parquet tables in Amazon S3, cataloged in the default AWS Glue Data Catalog. Managers want Amazon Bedrock Knowledge Bases to answer natural-language que
- A retail company keeps sales, inventory, and store data in Amazon Redshift tables with a well-defined schema. Managers want to ask natural-language questions such as total sales by region last quarter
- GraphRAG retrieves related context when answers depend on connections across documents
When a RAG workload needs facts connected through multiple document relationships, consider Amazon Bedrock Knowledge Bases GraphRAG with Amazon Neptune Analytics. It expands initial vector-search results by traversing related graph nodes or chunks. This is useful when independently similar passages omit relationships needed for a complete answer.
2 questions test this
- A manufacturer's Amazon Bedrock knowledge base uses vector-only retrieval over documents in Amazon S3: product manuals, part catalogs, supplier contracts, and quality incident reports. The ML engineer
- A pharmaceutical company's RAG assistant must answer questions that link trial reports, supplier records, and recall notices stored as documents in Amazon S3. A vector-only knowledge base returned ind
- Textract document analysis preserves form and table structure
When a document workflow needs form fields or table cells rather than just recognized text, choose Amazon Textract document analysis. Its form and table capabilities extract structured relationships from the document. Text detection (
DetectDocumentText) is sufficient when words and lines alone satisfy the requirement.Trap Choosing text detection (
DetectDocumentText) for structured form extraction, because recognized words alone do not supply form and table relationships.3 questions test this
- An insurance company receives scanned claim forms as single-page PNG images in Amazon S3. Each form contains labeled fields such as policy number, claimant name, and incident date, plus several checkb
- A hotel chain scans single-page guest surveys. Each survey contains a grid in which every row is a service topic and every column is a rating, and guests tick one checkbox per row. An ML engineer must
- A logistics company digitizes its own customs declaration forms, which arrive as single-page scans in Amazon S3. Each form has labeled fields and a goods table, and the layout is unique to the company
- Textract asynchronous operations support multipage document processing
When a workflow must process multipage documents, choose an appropriate asynchronous Amazon Textract operation. Synchronous processing is suited to supported single-page documents when immediate response latency matters. Select the processing mode from document structure and response timing together.
Trap Selecting synchronous document processing for a multipage input, which exceeds the documented single-page scope of that mode.
3 questions test this
- A company stores signed supplier contracts in Amazon S3 as PDF files of 20 to 60 pages. An ML engineer must extract the key-value pairs and tables from every page of each contract. The extraction runs
- A mortgage company receives loan packages as single PDF files of 80 to 150 pages. Each package mixes pay stubs, bank statements, tax forms, and identity documents in no fixed order. An ML engineer mus
- A research archive holds scanned historical newspapers as multipage TIFF files in Amazon S3. The archive needs only the lines and words on each page, with their positions, to build a keyword index. Th
- Textract expense analysis targets invoices and receipts
When the application needs invoice or receipt information, use Amazon Textract AnalyzeExpense rather than assembling equivalent extraction from text detection. The specialized analysis is designed for these document types. Generic document analysis remains suitable for other forms and tables.
Trap Using only text detection and custom parsing for standard expense extraction, which discards the purpose-built invoice and receipt capability.
3 questions test this
- A retailer processes scanned receipts from small vendors. Many receipts show the vendor name only inside a logo at the top of the page, with no printed vendor label beside it. The current pipeline use
- An accounts-payable workflow receives two kinds of single-page documents in Amazon S3: supplier invoices and the company's own vendor-onboarding forms. For invoices, it needs the vendor, invoice numbe
- A company's expense app receives receipt photos from thousands of different merchants. An ML engineer must extract the vendor name, transaction date, tax, and total from every receipt into fixed datab
- Textract Queries extracts requested information from documents
When a document workflow needs specific information expressed as questions, use the Queries feature in Amazon Textract document analysis. It targets the requested information rather than requiring the application to inspect every extracted word. Custom Queries can adapt this pretrained capability to a particular document use case.
3 questions test this
- A healthcare provider scans single-page referral forms. The intake system needs the full medication table from each form. It also needs two specific values that appear in free text: the referring phys
- A clinic digitizes vaccination record cards, each scanned as a single-page image. A reporting job needs one value from each card: the date on which the second dose was administered. The value sits in
- An insurer receives 12-page policy documents as PDF files from many carriers. A claims system needs only three values from each document: the policy number, the insured's name, and the coverage end da
- Rekognition Custom Labels recognizes business-specific visual categories
When generic image labels do not cover proprietary products or logos, use Amazon Rekognition Custom Labels with examples of the required categories. It supports custom visual classifiers without requiring a from-scratch vision implementation. General label detection is appropriate when the pretrained categories already meet the requirement.
Trap Relying on generic label detection to distinguish proprietary product categories that its pretrained label set does not define.
3 questions test this
- A manufacturer uses an Amazon Rekognition Custom Labels model to inspect circuit-board photos. The model was trained with image-level labels and reports only whether a board contains a defective compo
- A food processor wants to grade photos of apples on a conveyor as ripe, unripe, or rotten. Amazon Rekognition label detection recognizes apples but does not report their quality grade. The company has
- A beverage company wants to audit store-shelf photos to count how often each of its 40 proprietary bottle designs appears. Amazon Rekognition DetectLabels returns generic labels such as Bottle and Bev
- Rekognition content moderation identifies unsafe visual content with confidence scores
For image or video moderation, use Amazon Rekognition content-moderation capabilities. They return unsafe-content categories and confidence information that an application can apply to its review policy. This is different from ordinary object labeling or detecting sentiment in text.
3 questions test this
- A social media startup must screen user-uploaded profile photos for explicit or violent content before the photos are published. The trust-and-safety team wants to block photos above a confidence leve
- An online marketplace calls Amazon Rekognition DetectModerationLabels on listing photos. Photos with very high confidence for an unsafe label are removed automatically. The policy team wants photos wh
- A company that sells medical training content runs Amazon Rekognition DetectModerationLabels on its course images. Anatomy illustrations are often flagged as unsafe, and some company-specific prohibit
- Targeted sentiment distinguishes opinions about different entities in the same document
When a review praises one product but criticizes another, use Amazon Comprehend targeted sentiment to associate sentiment with individual entities. Document-level sentiment summarizes the overall text and can obscure these differences. Choose the scope of sentiment analysis to match the business question.
Trap Using a single document sentiment label for entity-specific feedback, which collapses different opinions into an overall result.
3 questions test this
- A hotel booking app lets guests type a short English review after checkout. Before the guest leaves the page, the app must show which mentioned items, such as the room, the pool, or the staff, were de
- An electronics retailer collects English product reviews in which customers often praise one product and criticize another in the same review. The product team must report, for each product mentioned,
- A streaming service asks viewers to leave a short English comment after each episode. A churn model needs exactly one overall sentiment value for each comment, stored in a single column with a confide
- Custom classification and custom entity recognition produce different outputs
Use Amazon Comprehend custom classification to assign documents to your own categories. Use custom entity recognition to locate domain-specific terms and noun phrases within text. A document's category and the entities mentioned inside it are separate outputs, so select the custom model type accordingly.
Trap Choosing a document classifier to locate occurrences of domain-specific entities, because category assignment does not extract entity spans.
3 questions test this
- An aircraft maintenance company stores free-text English maintenance logs. Engineers need every internal part number and fault code mentioned in each log extracted with its position in the text so tha
- A retailer wants to find mentions of its own product codes in plain-text customer chat transcripts. It has a list of about 3,000 valid product codes and many unannotated transcripts, but no documents
- A software company receives thousands of English support emails each day. Each email must be routed to one of 12 support queues that the company has defined, such as billing, licensing, and installati
- Comprehend offers real-time analysis and asynchronous processing for different workload sizes
For small interactive document-analysis workloads, use Amazon Comprehend real-time operations where supported. For large document sets, use asynchronous analysis jobs. The processing choice should reflect the required response timing and workload rather than forcing a large corpus through an interactive workflow.
Trap Submitting an asynchronous corpus-analysis job for an immediate per-request response, because completion occurs through the job workflow.
3 questions test this
- An insurance company trained an Amazon Comprehend custom classifier that assigns English claim letters to the company's own 15 claim categories. Every Sunday, about 50,000 new letters are written as t
- A customer-support chat application must show agents the sentiment of each incoming English message while the conversation is in progress. Messages arrive one at a time, and the sentiment must appear
- A bank trained an Amazon Comprehend custom classifier that assigns incoming English complaint messages to the bank's own complaint categories. A new web form must show the predicted category to the cu
- Transcribe streaming handles live audio while batch transcription handles stored recordings
When an application needs text from live audio, use Amazon Transcribe streaming for a supported language and Region. For recordings already stored in Amazon S3, use batch transcription. Both convert speech to text, but their input delivery and response timing fit different workloads.
Trap Choosing batch transcription of S3 recordings for a live transcription requirement, because the workflow expects stored media rather than the ongoing stream.
3 questions test this
- A training company runs live English webinars and must display captions to attendees while the presenter is speaking. The audio is captured from the presenter's microphone as PCM audio. Captions that
- A contact center wants supervisors to be alerted while a call is still in progress whenever a customer says a phrase such as 'cancel my account'. The center also wants sentiment for each speech segmen
- A financial firm must transcribe 3 years of archived English advisory calls for a compliance review. The recordings are WAV files already stored in Amazon S3. There are more files than the account can
Also tested in
References
- https://docs.aws.amazon.com/textract/latest/dg/invoices-receipts.html
- https://docs.aws.amazon.com/aws-certification/latest/machine-learning-engineer-associate-02/machine-learning-engineer-associate-02-domain2.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/algorithms-choose.html
- https://docs.aws.amazon.com/decision-guides/latest/decision-guides/bedrock-or-sagemaker.html
- https://docs.aws.amazon.com/comprehend/latest/dg/what-is.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/customizing-models-lora.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/canvas.html
- https://docs.aws.amazon.com/textract/latest/dg/how-it-works-analyzing.html
- https://aws.amazon.com/what-is/ocr/
- https://docs.aws.amazon.com/textract/latest/dg/sync.html
- https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/what-is.html
- https://docs.aws.amazon.com/rekognition/latest/dg/moderation-api.html
- https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-amazon-nova-lite.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-stability-ai-stable-image-ultra-1-0.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/titan-embedding-models.html
- https://docs.aws.amazon.com/nova/latest/userguide/prompting-long-context.html
- https://aws.amazon.com/bedrock/faqs/
- https://docs.aws.amazon.com/bedrock/latest/userguide/evaluation.html
- https://docs.aws.amazon.com/aws-certification/latest/machine-learning-engineer-associate-02/machine-learning-engineer-associate-02-domain4.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/kb-how-it-works.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/kb-how-retrieval.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-graphs.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/randomcutforest.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/seq-2-seq.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/blazingtext.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/xgboost.html
- https://docs.aws.amazon.com/prescriptive-guidance/latest/ml-model-interpretability/overview.html