Course menuMLA-C02

Exams / MLA-C02 / Study guide / Prompt engineering and fine-tuning

Prompt engineering and fine-tuning: MLA-C02 study notes and practice questions

What to know about Prompt engineering and fine-tuning for the MLA-C02 exam, from the ML Model and Foundation Model (FM) Development domain (24% of the exam guide), then 1 free question to test it. Part of the MLA-C02 study guide.

Last verified against current AWS documentation ·How we write our questions

What to know for the exam

These questions describe a gap between what a model does and what the business wants, and ask for the lightest approach that closes it.

Start with prompts

  • Clear instructions and a system prompt that sets role, tone and rules.
  • Few-shot examples show the expected format.
  • Chain-of-thought asks the model to reason step by step for complex tasks.
  • Structured output: ask for JSON with a schema, or use tool definitions.
  • Prompt templates with variables; Bedrock Prompt Management stores and versions them.
  • Prompt optimization in Bedrock rewrites prompts for a chosen model.

Inference parameters

Parameter Effect
Temperature Higher is more varied and creative; lower is more consistent
Top P / Top K Limit the choice of next tokens
Max tokens Caps response length and cost
Stop sequences End output at a marker

When prompts aren’t enough

Need Approach
Up-to-date or private facts, with citations RAG with a knowledge base
Consistent style, format or domain task behavior Supervised fine-tuning
Deep domain vocabulary Continued pre-training
A cheaper, faster model with similar quality Distillation

Customized Bedrock models are served with provisioned throughput or on-demand for supported models, so check cost.

Fine-tuning settings

  • Epochs, learning rate and batch size are the main hyperparameters.
  • Watch validation loss for overfitting.
  • Catastrophic forgetting of general skills is reduced by mixing in general examples and using a lower learning rate or fewer epochs.
  • LoRA and other parameter-efficient methods train small adapter weights instead of the whole model (SageMaker AI and JumpStart).

Common traps

  • Fine-tuning first when a better prompt would do.
  • Fine-tuning to teach facts that change weekly.
  • High temperature for factual answers.

Try the 1 practice question

Question 1

Harder · choose 2 ·Link to this question (question 1)

A dental chain fine-tuned a foundation model in Amazon Bedrock on 5,000 examples of patient-support replies. The tuned model now writes accurate replies, but its summaries of general health articles have become noticeably worse than the base model's.

The chain wants to keep the patient-support behavior and regain general summarization quality. It cannot collect more patient-support examples, and it has budget for only one more fine-tuning run.

Which TWO changes should the team make to the next fine-tuning run? (Choose two.)

Choose two answers.

  1. A. Train for more epochs on the 5,000 patient-support examples only, so the model fits this domain more strongly.
  2. B. Add a set of general-purpose summarization examples to the training data, mixed with the patient-support examples.
  3. C. Replace the fine-tuning with a much larger learning rate, so the model adapts quickly and forgets less of its earlier training.
  4. D. Use a lower learning rate and fewer epochs, so that the model's weights change less from the base model.
  5. E. Delete the base model from the account, so that the team can focus only on the tuned version of the model.
Show the answer and explanation

Answers: B, D

  • A. Wrong: More epochs on one narrow dataset deepen the specialization and make the forgetting worse. The stem asks the model to keep its general skills.
  • B. Right: Correct. Mixing general examples into fine-tuning data keeps the model practicing skills outside the narrow task, which reduces catastrophic forgetting. The team still gets its domain behavior.
  • C. Wrong: A larger learning rate usually overwrites more of the base model's behavior, so it increases forgetting. The option works against the goal.
  • D. Right: Correct. Smaller updates and fewer passes over the data keep the weights closer to the base model, which limits catastrophic forgetting. The domain behavior is still learned from the examples. Learn more: Custom model hyperparameters (opens in a new tab)
  • E. Wrong: Deleting the base model does not change how the tuned model behaves, and it does not restore general skills. The option is unrelated to the forgetting problem.

Explanation

Catastrophic forgetting happens when fine-tuning overwrites general skills. Mixing general examples into the training data and using a lower learning rate with fewer epochs keep the weights closer to the base model, so the tuned model keeps its domain behavior and regains general ability.

Study

Want more on Prompt engineering and fine-tuning? The 5 full-length practice sets have 6 more Prompt engineering and fine-tuning questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets

Study Prompt engineering and fine-tuning

More ML Model and Foundation Model (FM) Development topics