Prompting, RAG or fine-tuning on Amazon Bedrock
A technical comparison of prompt engineering, Bedrock Knowledge Bases and Bedrock model customization, with cost, latency and effort trade-offs.
8 min readBy AI Guru AcademyFacts last checked
By AI Guru Academy
In short
Start with prompt engineering, add retrieval-augmented generation (RAG) through Amazon Bedrock Knowledge Bases when the model needs your data, and customize a model only when the gap is behaviour that prompts and retrieval cannot fix. Each step up costs more effort before launch. Prompting and RAG change what the model sees on each request. Customization changes the model's weights and adds training and storage costs. Training a model from scratch is not a Bedrock option at all.
What are the ways to adapt a foundation model on Amazon Bedrock?
There are three practical levels on Bedrock: change the prompt, give the model retrieved context, or customize the model itself.
- Prompt engineering and in-context learning. You change the text you send. Few-shot prompting, which AWS also calls in-context learning, adds example input-output pairs to the prompt and needs no training.
- RAG with Amazon Bedrock Knowledge Bases. At question time, the knowledge base searches your data and the relevant passages are added to the prompt.
- Model customization. The AWS page for customizing Bedrock models currently lists three methods: supervised fine-tuning, reinforcement fine-tuning and distillation.
Two further options sit outside the Bedrock customization list. AWS's decision guide says full fine-tuning and training from scratch use Amazon SageMaker AI, SageMaker HyperPod or self-managed infrastructure. Bedrock Custom Model Import lets you bring a model you fine-tuned or pre-trained elsewhere, such as in SageMaker AI, and run it in Bedrock.
A note on names: the AIF-C01 exam guide still mentions continuous pre-training, and AWS's decision guide describes continued pre-training as training on your own unlabeled data and still lists it among Bedrock methods. The current Bedrock "Customize your model" page does not list it, so learn the concept but do not assume it is available for your model on Bedrock today.
Why should prompt engineering come first?
Prompt engineering is the cheapest change to test because nothing is trained and nothing new is hosted. AWS's SageMaker guidance on customizing foundation models recommends trying prompt engineering first, noting that it can get the results you want without changing model weights.
The cost of prompting appears on every request. On-demand Bedrock text models are priced per token, with separate input and output rates, so a long prompt full of examples is paid for each time it is sent. Prompt caching can help here: AWS describes it as an optional feature for supported models that reduces response latency and input token costs when long, repeated context is reused. AWS also states that support for prompt caching does not guarantee a cache hit.
Prompting runs out of road when the model lacks facts it was never trained on, or when your instructions grow so long that they are hard to maintain and test.
How does a Bedrock knowledge base work?
A knowledge base turns your documents into searchable vectors ahead of time, then retrieves the closest matches for each query. AWS describes two phases:
- Preprocessing. Documents are split into chunks, converted to embeddings and written to a vector index, keeping a mapping back to the original document.
- Runtime. The user's query is converted to a vector, similar chunks are retrieved, and the prompt is augmented with those chunks before the model generates its answer.
Bedrock offers two kinds of knowledge base. A Managed Knowledge Base, which AWS recommends for retrieval accuracy and a managed experience, has Bedrock handle ingestion, indexing, storage and retrieval. A customer-managed knowledge base lets you run your own pipeline and vector store, for example Amazon OpenSearch Serverless, Amazon Aurora or Amazon Neptune. Knowledge bases can include citations in responses so the source can be checked, and can use reranking models to influence which results are retrieved.
AWS highlights cost-effectiveness: a knowledge base removes the need to keep training a model on private data. The price is an extra retrieval step and larger prompts, because retrieved chunks become input tokens.
What do the Bedrock customization methods change?
All three Bedrock customization methods adjust the model, but they need different training data.
| Method | What you provide | What it is for |
|---|---|---|
| Supervised fine-tuning | Labelled input-output examples | Teaching the model which outputs to produce for which inputs |
| Reinforcement fine-tuning | Prompts plus reward functions that score responses, for example in AWS Lambda | Aligning the model with your use case through feedback scores rather than labelled pairs |
| Distillation | A teacher model, a student model and use-case prompts | Transferring a larger model's skill to a smaller, faster, more cost-efficient model |
For distillation, Bedrock generates the teacher's responses to your prompts and uses them to fine-tune the student. Labelled prompt-response pairs are optional. AWS notes that this data synthesis can add charges for teacher-model inference.
Customization also changes how you pay. AWS states that training is charged on tokens processed (training tokens multiplied by epochs) plus monthly storage per model. To run the result, you can buy Provisioned Throughput, which is billed hourly for a fixed level of throughput until you delete it. For some base models, including certain Amazon Nova models and Meta Llama 3.3 70B Instruct in specific Regions, AWS also supports deploying a custom model for on-demand inference, where you pay only for what you use. Check the current list before you plan around either path.
Not every model can be customized, and support varies by method, model and AWS Region.
How do cost, latency and effort compare?
Compare the approaches on when you pay, what slows each request and how much work happens before launch.
| Approach | Upfront effort | Ongoing cost driver | Effect on each request | Keeping knowledge current |
|---|---|---|---|---|
| Prompt engineering | Low: write and test prompts | Input and output tokens per call | Longer prompts mean more input tokens | Edit the prompt |
| Few-shot (in-context learning) | Low: choose good examples | Examples are re-sent as input tokens | Larger prompt on every call; caching may help | Swap examples |
| RAG with Knowledge Bases | Medium: prepare data, choose chunking and vector store | Ingestion, vector storage, retrieval, larger prompts | An added retrieval step before generation | Re-ingest changed documents |
| Fine-tuning (supervised or reinforcement) | High: curate labelled data or write reward functions, run jobs | Training tokens times epochs, model storage, hosting | Shorter prompts may be possible once behaviour is learned | Retrain when behaviour must change |
| Distillation | Medium to high: pick teacher and student, supply prompts | Training plus teacher inference during synthesis | AWS describes the student as smaller and faster | Repeat when the teacher or task changes |
| Training from scratch | Very high, outside Bedrock | Large-scale compute in SageMaker AI, HyperPod or self-managed | Depends on the model you build | Full retraining |
The extra retrieval step and the shorter prompts after fine-tuning follow from how the techniques work rather than from AWS statements, so measure them on your own workload.
Worked example: one assistant, three upgrades
Illustration only: Harbourline Freight, a fictional logistics company, wants an assistant that answers customs questions for its account managers.
Step 1, prompting. A prompt with a role, a length limit and three example answers gives well-formatted replies, but they miss the company's own procedures, which the model has never seen.
Step 2, RAG. A knowledge base over the procedure manuals, with citations on, fixes that. When a procedure changes, the team re-ingests the document. No model is retrained.
Step 3, distillation. At higher volume the large model is too slow and costly, and a smaller model gets the format wrong. The team distils the large model (teacher) into a smaller one (student), after checking both are supported in its Region. The knowledge base stays, because distillation changes behaviour, not knowledge.
The rule: fix knowledge gaps with retrieval, fix behaviour or cost gaps with customization, and rerun the same test set after every change.
How does this appear on the AIF-C01 exam?
The AIF-C01 exam guide asks candidates to explain the cost trade-offs of FM customization approaches, naming pre-training, fine-tuning, in-context learning, RAG and model distillation. It also covers RAG with Amazon Bedrock Knowledge Bases, the vector stores that hold embeddings, and the key elements of training an FM. Expect scenarios where you must spot which approach changes weights, which needs labelled data, and which adds cost per request rather than per training run.
Key takeaways
- Try prompting first: no training, but every token is paid on every call.
- RAG adds your data at question time through Knowledge Bases, without retraining.
- Bedrock currently lists supervised fine-tuning, reinforcement fine-tuning and distillation as customization methods.
- Customization adds training costs (tokens times epochs), model storage and a hosting choice.
- Training from scratch uses SageMaker AI, HyperPod or self-managed infrastructure, not Bedrock.
FAQ
Is RAG always cheaper than fine-tuning?
Not always. RAG avoids training costs but adds retrieval, vector storage and larger prompts on every request. AWS describes RAG as a more cost-effective way to introduce new data than retraining, which is the usual case for knowledge. Model your own request volume before deciding.
Does reinforcement fine-tuning need labelled data?
No. AWS describes it as using reward functions that score response quality instead of labelled input-output pairs. You can upload training prompts or use existing Bedrock invocation logs.
When is distillation the right choice?
When a large model gives the quality you need but you want a smaller, faster, more cost-efficient model for production. You supply prompts, and Bedrock generates the teacher's responses to fine-tune the student.
Can I combine RAG with a customized model?
Yes. They solve different problems: retrieval supplies current facts, customization shapes behaviour. Add customization only when testing shows a gap that prompts and retrieval do not close.
Sources
- Customize your model (current methods and training charges): https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html
- Model distillation in Amazon Bedrock: https://docs.aws.amazon.com/bedrock/latest/userguide/model-distillation.html
- Amazon Bedrock Knowledge Bases: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html
- How Amazon Bedrock knowledge bases work: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-how-it-works.html
- Deploy a custom model for on-demand inference: https://docs.aws.amazon.com/bedrock/latest/userguide/deploy-custom-model-on-demand.html
- Provisioned Throughput: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html
- Prompt caching: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html
- Prompt engineering concepts (few-shot and in-context learning): https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-engineering-guidelines.html
- Customize foundation models in SageMaker AI: https://docs.aws.amazon.com/sagemaker/latest/dg/jumpstart-foundation-models-customize.html
- AWS Decision Guide, choosing a generative AI service: https://docs.aws.amazon.com/decision-guides/latest/generative-ai-on-aws-how-to-choose/guide.html
- AWS, What is retrieval-augmented generation?: https://aws.amazon.com/what-is/retrieval-augmented-generation/
- Amazon Bedrock pricing: https://aws.amazon.com/bedrock/pricing/
- AIF-C01 exam guide, Domain 3: https://docs.aws.amazon.com/aws-certification/latest/ai-practitioner-01/ai-practitioner-01-domain3.html
Last checked 2026-11-22.
AI Guru Academy is an independent training provider and is not affiliated with or endorsed by Amazon Web Services. AWS service names are trademarks of Amazon.com, Inc. or its affiliates.
Next step: take the free diagnostic at /diagnostic, then see the full AIF-C01 course at /courses/aif-c01-exam-prep.