Ngân hàng đề — AWS Certified Generative AI Developer Pro

Tìm thấy 110 câu.

Câu 101 Foundation Model Integration, Data Management, and Compliance

A financial services company in Europe runs a customer-facing assistant on Amazon Bedrock in the eu-central-1 Region. The model it uses has limited capacity in that Region, and during peak hours the application receives ThrottlingException errors. Regulations require that customer data be processed only within the European Union. The company wants to increase the available throughput with minimal code changes and without paying additional routing charges. Which approach meets these requirements?

  1. A Purchase Provisioned Throughput for the model and invoke it through an EU cross-Region inference profile so that requests are spread across EU Regions.
  2. B Replace the Region-specific model ID in the InvokeModel and Converse calls with the ID of the EU geographic cross-Region inference profile for the same model.
  3. C Replace the model ID with the global cross-Region inference profile for the model to benefit from the approximately 10% lower price and worldwide capacity.
  4. D Deploy copies of the application in several EU Regions and use Amazon Route 53 latency-based routing to distribute user traffic among them.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Bài toán có ba ràng buộc: (1) đang bị throttling vì model có công suất hạn chế trong một Region, (2) dữ liệu khách hàng chỉ được xử lý trong EU, (3) sửa code tối thiểu và không tốn thêm phí định tuyến. Đây đúng là tình huống mà đề cương AIP-C01 nhắc tới ở Skill 1.2.3: dùng Amazon Bedrock Cross-Region Inference cho model có độ sẵn sàng theo Region hạn chế.

✅ Vì sao đáp án đúng là đúng

Cross-Region inference hoạt động qua inference profile. Khi gọi model bằng ID của geographic inference profile (ví dụ tiền tố eu.), Amazon Bedrock tự chọn một Region thương mại trong đúng khu vực địa lý đó để xử lý request, nhờ vậy có thêm công suất từ nhiều Region mà dữ liệu vẫn nằm trong ranh giới EU. Tài liệu AWS nêu rõ: không có phí định tuyến bổ sung, giá tính theo Region nguồn, dữ liệu đi trong mạng AWS và được mã hoá khi truyền. Về code chỉ cần đổi chuỗi modelId, đúng yêu cầu sửa tối thiểu.

❌ Vì sao các phương án còn lại sai

  • Provisioned Throughput: tài liệu ghi rõ inference profile hiện không hỗ trợ Provisioned Throughput, nên không thể kết hợp hai thứ này; ngoài ra Provisioned Throughput tốn chi phí cam kết, không phải cách sửa tối thiểu.
  • Global inference profile: rẻ hơn khoảng 10% nhưng request có thể được xử lý ở bất kỳ Region thương mại nào trên thế giới, vi phạm yêu cầu dữ liệu chỉ ở EU. AWS khuyến nghị chọn Geographic khi có ràng buộc data residency.
  • Route 53 với nhiều bản triển khai: tăng gánh nặng vận hành, phải sửa kiến trúc và vẫn có thể bị throttling ở từng Region; Bedrock đã có cơ chế định tuyến sẵn nên không cần tự dựng.

📌 Điểm cần nhớ

  • Geographic profile (us., eu., apac.) giữ dữ liệu trong khu vực; Global profile ưu tiên chi phí, không đảm bảo địa lý.
  • Không phí định tuyến, không cần bật thủ công Region đích, CloudTrail ghi Region xử lý trong trường additionalEventData.inferenceRegion.
  • Inference profile không dùng được với Provisioned Throughput.
Câu 102 Foundation Model Integration, Data Management, and Compliance

A law firm uses Amazon Bedrock Knowledge Bases with an Amazon S3 data source that contains documents from several practice groups and many years. Each user must receive retrieval results only from the practice group that the user belongs to, and the firm also wants to be able to restrict a query to documents modified after a given date. The solution must require the least operational effort. What should the firm do?

  1. A Create a separate knowledge base for each combination of practice group and year, and have the application choose the knowledge base to query at runtime.
  2. B Upload a fileName.extension.metadata.json file next to each document that defines practice_group and epoch_modification_time attributes, sync the data source, and pass a filter that combines equals and greaterThan operators in the retrievalConfiguration of the Retrieve or RetrieveAndGenerate request.
  3. C Add the practice group name and modification date as the first line of every document so that semantic search naturally ranks matching documents higher.
  4. D Retrieve the maximum number of results for every query and filter the returned chunks in an AWS Lambda function by reading the S3 object tags of each source document.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi thuộc Task 1.4 của đề cương (metadata framework để tăng độ chính xác và kiểm soát ngữ cảnh truy xuất). Yêu cầu là lọc kết quả theo thuộc tính của tài liệu (nhóm hành nghề, thời điểm sửa) với công sức vận hành thấp nhất, trong khi vẫn dùng một knowledge base chung.

✅ Vì sao đáp án đúng là đúng

Amazon Bedrock Knowledge Bases hỗ trợ metadata filtering. Với data source là S3, mỗi tài liệu có thể đi kèm một tệp metadata đặt tên theo mẫu fileName.extension.metadata.json chứa các thuộc tính dạng string, number hoặc boolean. Sau khi sync, các thuộc tính này được lưu cùng vector và có thể lọc lúc truy vấn bằng trường filter trong retrievalConfiguration.vectorSearchConfiguration của Retrieve hoặc RetrieveAndGenerate. Tài liệu AWS liệt kê các toán tử equals, notEquals, greaterThan, lessThan, in, notIn, startsWith, stringContains, listContains và cho phép kết hợp bằng andAll hoặc orAll. Ví dụ trong chính tài liệu là lọc epoch_modification_time lớn hơn một mốc để chỉ lấy tài liệu mới. Chỉ cần một knowledge base, việc lọc do dịch vụ thực hiện ngay tầng vector search.

❌ Vì sao các phương án còn lại sai

  • Tách knowledge base theo từng tổ hợp nhóm và năm: số lượng knowledge base bùng nổ, phải sync và quản lý quyền cho từng cái, trái với yêu cầu ít vận hành.
  • Nhúng thông tin vào dòng đầu tài liệu: semantic search không đảm bảo loại trừ tài liệu nhóm khác, chỉ thay đổi điểm tương đồng; đây không phải cơ chế kiểm soát truy cập.
  • Lọc sau trong Lambda: lãng phí vì kết quả trả về có thể toàn tài liệu không đúng nhóm, dẫn đến trả về rỗng dù dữ liệu tồn tại; đồng thời số kết quả tối đa có giới hạn nên không thể bù bằng cách lấy thật nhiều.

📌 Điểm cần nhớ

  • Metadata đi kèm tài liệu qua tệp .metadata.json; lọc qua retrievalConfiguration ở thời điểm truy vấn.
  • Với OpenSearch Serverless, vector index phải dùng engine faiss để lọc được.
  • Knowledge Bases còn có implicit metadata filtering: model tự sinh filter từ câu hỏi dựa trên schema thuộc tính bạn khai báo.
Câu 103 Foundation Model Integration, Data Management, and Compliance

A company runs a Retrieval Augmented Generation (RAG) application that uses Amazon Bedrock Knowledge Bases with an Amazon OpenSearch Serverless vector store. Users report that generated answers often miss key facts even though the relevant passages exist in the knowledge base. An investigation shows that the relevant chunks are usually ranked between positions 8 and 15 of the 20 chunks retrieved, and the application sends all 20 chunks to the foundation model, which increases cost and latency. The company wants to improve the relevance of the chunks passed to the model and reduce the number of input tokens without re-indexing the documents. Which solution meets these requirements?

  1. A Increase numberOfResults to 50 and raise the maxTokens inference parameter so that the model can read more context.
  2. B Switch to an embeddings model with more dimensions and re-ingest all documents into a new vector index.
  3. C Configure a reranker model such as Amazon Rerank 1.0 in the rerankingConfiguration of the Retrieve or RetrieveAndGenerate request so that chunks are reordered by relevance, and pass only the top-ranked chunks to the model.
  4. D Enable hybrid search and set the temperature parameter to 0 so that the model deterministically selects the correct passage from the 20 chunks.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Triệu chứng là bài toán xếp hạng: chunk đúng có được truy xuất nhưng nằm ở vị trí thấp, nên ứng dụng phải gửi rất nhiều chunk cho model, vừa tốn token vừa làm loãng ngữ cảnh. Ràng buộc là không re-index. Đề cương AIP-C01 nêu trực tiếp ở Skill 1.5.4: kiến trúc tìm kiếm nâng cao với Amazon Bedrock reranker models.

✅ Vì sao đáp án đúng là đúng

Amazon Bedrock cung cấp reranker models (Amazon Rerank 1.0, Cohere Rerank). Reranker nhận câu truy vấn và danh sách chunk, tính điểm liên quan của từng chunk với câu hỏi rồi sắp xếp lại. Tài liệu AWS nói rõ lợi ích: trả về ít kết quả hơn nhưng liên quan hơn, từ đó giảm chi phí và độ trễ khi đưa vào foundation model. Với Knowledge Bases, chỉ cần khai báo reranker trong rerankingConfiguration của Retrieve hoặc RetrieveAndGenerate; kết quả rerank sẽ ghi đè thứ hạng mặc định. Không cần đụng tới index hay embeddings, nên thoả yêu cầu không re-index. Ngoài ra còn có API Rerank độc lập để dùng với nguồn dữ liệu ngoài Knowledge Bases.

❌ Vì sao các phương án còn lại sai

  • Tăng numberOfResults lên 50 và tăng maxTokens: đi ngược mục tiêu giảm token, càng làm ngữ cảnh loãng hơn; maxTokens chỉ giới hạn đầu ra chứ không giúp chọn chunk.
  • Đổi embeddings model: bắt buộc re-ingest toàn bộ tài liệu, vi phạm ràng buộc; cũng chưa chắc giải quyết được bài toán xếp hạng.
  • Hybrid search và temperature 0: hybrid search có thể giúp nhưng không trực tiếp tái xếp hạng theo câu hỏi; temperature chỉ ảnh hưởng độ ngẫu nhiên khi sinh chữ, không giúp model đọc đúng chunk giữa 20 chunk nhiễu.

📌 Điểm cần nhớ

  • Reranker là bước hai giai đoạn: truy xuất rộng bằng vector, rồi xếp hạng lại chính xác bằng model chuyên biệt.
  • Chỉ áp dụng cho dữ liệu văn bản; có phí riêng theo Amazon Bedrock pricing.
  • Dùng trong Knowledge Bases qua rerankingConfiguration hoặc gọi thẳng API Rerank.
Câu 104 Implementation and Integration

An enterprise has built AI agents with Strands Agents and LangGraph. The agents must call more than 40 internal REST APIs that are documented with OpenAPI specifications, plus several existing AWS Lambda functions. Each backend uses its own OAuth client or API key. The development team wants to expose all of these as Model Context Protocol (MCP) tools through one endpoint, enforce inbound authentication of the calling agent, inject the correct outbound credential for each tool, and let agents search for the most relevant tool so that prompts do not grow with every new tool. The solution must minimize custom code. Which AWS service should the team use?

  1. A Build a custom MCP server on Amazon ECS that wraps every API and Lambda function, store the credentials in AWS Secrets Manager, and implement a tool search index in Amazon OpenSearch Service.
  2. B Create an Amazon Bedrock AgentCore Gateway with OpenAPI and Lambda targets, configure inbound and outbound authorization, and enable semantic tool search.
  3. C Put Amazon API Gateway with Lambda authorizers in front of every REST API and register each endpoint as an action group of an Amazon Bedrock agent.
  4. D Use AWS AppSync to merge all REST APIs into a single GraphQL schema and have the agents query the GraphQL endpoint directly with a shared API key.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Đây là bài toán tích hợp công cụ cho agent (Task 2.1 của đề cương, đặc biệt Skill 2.1.7 về MCP server). Các yêu cầu then chốt: biến API OpenAPI và Lambda thành công cụ MCP qua một điểm vào, xác thực chiều vào, chèn thông tin đăng nhập chiều ra cho từng công cụ, tìm công cụ theo ngữ nghĩa, và ít code tự viết nhất.

✅ Vì sao đáp án đúng là đúng

Amazon Bedrock AgentCore Gateway là dịch vụ được quản lý hoàn toàn, nhận các target kiểu OpenAPI, Smithy và Lambda rồi chuyển chúng thành công cụ tương thích MCP sau một endpoint duy nhất. Tài liệu AWS mô tả đúng từng khả năng được hỏi: Security Guard quản lý OAuth cho xác thực chiều vào; Secure Credential Exchange chèn credential riêng cho từng công cụ ở chiều ra; Semantic Tool Selection cho phép agent tìm công cụ phù hợp trong hàng nghìn công cụ để giảm kích thước prompt và độ trễ; hạ tầng serverless có sẵn observability. Gateway cũng tương thích với Strands Agents, LangGraph, CrewAI, LlamaIndex, đúng bộ framework mà doanh nghiệp đang dùng. AWS nhấn mạnh đây là giải pháp cung cấp cả ingress và egress authentication trong một dịch vụ quản lý.

❌ Vì sao các phương án còn lại sai

  • Tự dựng MCP server trên ECS: làm được nhưng là chính thứ Gateway thay thế; phải tự viết wrapper cho 40+ API, tự xử lý OAuth refresh, tự xây tìm kiếm công cụ, trái yêu cầu tối thiểu code.
  • API Gateway + action group: action group gắn với Amazon Bedrock Agents chứ không phải agent Strands hay LangGraph tự xây; không cung cấp MCP, không có tìm công cụ ngữ nghĩa.
  • AppSync gộp GraphQL: đổi giao thức chứ không giải quyết MCP, xác thực theo từng công cụ hay tìm kiếm công cụ; dùng chung một API key còn làm yếu mô hình phân quyền.

📌 Điểm cần nhớ

  • AgentCore Gateway: OpenAPI, Smithy, Lambda, MCP server và passthrough (kể cả A2A) thành công cụ MCP qua một endpoint.
  • Có inbound auth, outbound auth, semantic tool search, tích hợp 1-click với Salesforce, Slack, Jira, Zendesk.
  • Framework và model agnostic.
Câu 105 Implementation and Integration

A company built a research agent with Strands Agents. The agent performs multi-step tasks that can run for several hours, and each user's session must be strictly isolated from every other session. The company wants a serverless hosting option that charges only for the resources actually consumed, works with the existing framework without rewriting the agent, and provides built-in tracing of the agent's reasoning steps and tool invocations. Which option meets these requirements?

  1. A Package the agent as an AWS Lambda function with the maximum timeout and use AWS Step Functions to chain invocations when a task runs longer than one invocation.
  2. B Deploy the agent to Amazon Bedrock AgentCore Runtime and invoke it with a session identifier for each user.
  3. C Run the agent on Amazon ECS with AWS Fargate, launching one dedicated task per user and keeping it running for the duration of the session.
  4. D Recreate the agent's logic as action groups in Amazon Bedrock Agents and enable agent tracing.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi kiểm tra kiến thức về nơi chạy agent sản xuất (Skill 2.1.1 và 2.5.5: Strands Agents và điều phối native trên AWS). Bốn yêu cầu: phiên dài nhiều giờ, cách ly tuyệt đối giữa người dùng, serverless trả theo mức dùng, giữ nguyên framework, có tracing suy luận của agent.

✅ Vì sao đáp án đúng là đúng

Amazon Bedrock AgentCore Runtime là môi trường lưu trữ serverless chuyên cho agent. Theo tài liệu AWS: framework agnostic (Strands, LangGraph, CrewAI hoặc agent tự viết) và model agnostic; mỗi phiên người dùng chạy trong một microVM riêng với CPU, bộ nhớ, filesystem tách biệt và bị huỷ sạch khi phiên kết thúc; phiên trên microVM kéo dài tới 8 giờ (lên tới 14 ngày nếu dùng compute type Instances); giá theo mức tiêu thụ, thường không tính CPU trong lúc chờ phản hồi LLM; có observability tích hợp ghi lại bước suy luận, lời gọi công cụ và tương tác model. Chuyển agent local lên Runtime chỉ cần vài dòng code, không phải viết lại.

❌ Vì sao các phương án còn lại sai

  • Lambda + Step Functions: Lambda giới hạn 15 phút mỗi lần chạy nên phải cắt tác vụ nhiều giờ thành các bước và tự quản lý trạng thái, tức là viết lại agent; tracing suy luận không có sẵn.
  • ECS Fargate một task mỗi người dùng: phải tự quản lý vòng đời task, trả tiền trong suốt thời gian task chạy kể cả khi chờ LLM, không có tracing dành riêng cho agent; cách ly ở mức task cũng không tự dọn trạng thái như microVM.
  • Bedrock Agents với action group: bắt buộc tái tạo logic theo mô hình của Bedrock Agents, vi phạm yêu cầu không viết lại và không giữ được framework Strands.

📌 Điểm cần nhớ

  • AgentCore Runtime: microVM mỗi phiên, tối đa 8 giờ, payload 100 MB, hỗ trợ MCP và A2A, streaming hai chiều.
  • Tính tiền theo tài nguyên thực dùng, không cần right-sizing.
  • Phân biệt với Gateway (công cụ) và Memory (trí nhớ ngắn và dài hạn).
Câu 106 Implementation and Integration

A customer support application invokes Amazon Nova Pro on Amazon Bedrock for every request. An analysis shows that about 70 percent of the requests are simple FAQ questions in English that Amazon Nova Lite answers with similar quality at a lower price. The team wants each request to be sent automatically to the cheaper model whenever its predicted response quality is close to that of Nova Pro, through a single serverless endpoint, without writing or maintaining any classification or orchestration logic. Which solution meets these requirements?

  1. A Create an AWS Lambda function that classifies each prompt with a keyword list and calls Nova Lite or Nova Pro based on the result.
  2. B Create an Amazon Bedrock intelligent prompt router that contains Nova Lite as the fallback model and Nova Pro as the other model, set a response quality difference threshold, and invoke the router ARN as the model identifier.
  3. C Use an AWS Step Functions Choice state that routes prompts shorter than 200 characters to Nova Lite and all other prompts to Nova Pro.
  4. D Submit all FAQ requests through Amazon Bedrock batch inference to obtain discounted pricing while keeping Nova Pro as the model.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Đề cương AIP-C01 đưa chủ đề này vào Skill 2.4.4 (intelligent model routing dựa trên chỉ số) và Skill 4.1.2 (dùng model theo tầng tuỳ độ phức tạp). Yêu cầu quan trọng: tự động dự đoán chất lượng để chọn model, một endpoint duy nhất, không tự viết logic phân loại.

✅ Vì sao đáp án đúng là đúng

Amazon Bedrock intelligent prompt routing cung cấp một endpoint serverless duy nhất để định tuyến request giữa các model cùng họ. Với mỗi request, Bedrock phân tích prompt, dự đoán chất lượng phản hồi của từng model trong router rồi chuyển tới model có tổ hợp chất lượng và chi phí tốt nhất. Khi tự cấu hình router, bạn chọn một fallback model làm mốc và đặt response quality difference: router chỉ chuyển sang model còn lại nếu chất lượng dự đoán của nó cao hơn fallback quá ngưỡng đó. Ví dụ trong tài liệu AWS chính là Nova Lite làm fallback và chỉ dùng Nova Pro khi tốt hơn trên 10%. Ứng dụng gọi router ARN như một model ID, phản hồi cho biết model nào đã được dùng. Tài liệu cũng ghi tính năng chỉ được tối ưu cho prompt tiếng Anh, khớp với tình huống.

❌ Vì sao các phương án còn lại sai

  • Lambda với danh sách từ khoá: chính là logic phân loại tự viết và phải bảo trì, chất lượng kém vì từ khoá không phản ánh độ khó thật của câu hỏi.
  • Step Functions theo độ dài prompt: độ dài không tương quan với độ khó; vẫn là orchestration tự dựng, vi phạm yêu cầu.
  • Batch inference: dành cho xử lý bất đồng bộ số lượng lớn, kết quả ghi ra S3, không phù hợp hỗ trợ khách hàng theo thời gian thực và cũng không đổi sang model rẻ hơn.

📌 Điểm cần nhớ

  • Router chỉ ghép model cùng họ (Nova, Llama, Claude...), mỗi router đúng hai model.
  • Có default router dùng ngay và configured router tuỳ chỉnh với fallback model và responseQualityDifference.
  • Giới hạn: tối ưu cho tiếng Anh, không học từ dữ liệu hiệu năng của ứng dụng bạn.
Câu 107 AI Safety, Security, and Governance

An insurance company is deploying a chatbot that answers customer eligibility questions based on a 40-page policy document. The compliance team requires that each answer can be verified against the written policy rules, that the system can explain which rules support a correct answer, and that answers which contradict the policy or rely on unstated assumptions are flagged so the application can rewrite them or ask the user for clarification. All interactions are in English. Which Amazon Bedrock Guardrails capability should the company use?

  1. A A contextual grounding check with the grounding and relevance thresholds set to 0.99 so that any response not derived from the policy text is blocked.
  2. B A denied topics policy that lists every eligibility scenario that the model is not allowed to discuss.
  3. C Automated Reasoning checks: create an Automated Reasoning policy from the policy document, test and refine it, attach it to a guardrail, and inspect the returned findings to decide whether to serve, rewrite, or clarify the response.
  4. D Content filters at Standard tier with the prompt attack category set to HIGH strength to prevent the model from producing incorrect eligibility decisions.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Từ khoá quyết định là: kiểm chứng được theo luật đã viết, giải thích luật nào hỗ trợ câu trả lời, phát hiện mâu thuẫn hoặc giả định chưa nêu, và dùng kết quả để sửa lại câu trả lời. Đây là yêu cầu về chứng minh logic, không phải chấm điểm xác suất. Chủ đề nằm trong Task 3.1 và 3.3 của đề cương (giảm hallucination, tuân thủ quy định).

✅ Vì sao đáp án đúng là đúng

Automated Reasoning checks trong Amazon Bedrock Guardrails dùng logic hình thức để xác thực nội dung ngôn ngữ tự nhiên theo chính sách bạn định nghĩa. Theo tài liệu AWS, nó có thể chứng minh một phát biểu mâu thuẫn với luật (phát hiện sai), chỉ ra giả định chưa nêu khi câu trả lời nhất quán nhưng chưa đủ điều kiện, và đưa ra giải thích kiểm chứng được bằng toán học kèm luật và biến cụ thể. Quy trình đúng như phương án: tải tài liệu nguồn để trích xuất luật và biến, xem fidelity report, viết test, lưu phiên bản bất biến, gắn vào guardrail rồi đọc findings ở runtime qua Converse, InvokeModel hoặc ApplyGuardrail. Automated Reasoning checks hoạt động ở chế độ detect, trả về findings và feedback để ứng dụng quyết định phục vụ, viết lại hay hỏi lại, đúng yêu cầu bài toán. Nó hiện chỉ hỗ trợ tiếng Anh (US), nên tình huống tiếng Anh là phù hợp.

❌ Vì sao các phương án còn lại sai

  • Contextual grounding check: cho điểm grounding và relevance theo mô hình xác suất, không giải thích luật nào được áp dụng, không phát hiện giả định thiếu; ngưỡng 0.99 chỉ làm chặn quá tay.
  • Denied topics: chặn chủ đề, không xác minh tính đúng của câu trả lời về chủ đề được phép.
  • Content filters và prompt attack: bảo vệ trước nội dung độc hại và jailbreak, không liên quan đến độ chính xác theo chính sách.

📌 Điểm cần nhớ

  • Automated Reasoning checks: logic hình thức, findings như VALID, INVALID, SATISFIABLE, TOO_COMPLEX; detect mode, không chặn.
  • Không chống prompt injection, không hỗ trợ streaming, chỉ tiếng Anh, tài liệu tối đa 5 MB và 50.000 ký tự.
  • Nên kết hợp với content filters và topic policies.
Câu 108 Chọn nhiều đáp án AI Safety, Security, and Governance

A healthcare company runs a Retrieval Augmented Generation (RAG) summarization application that uses an open-source model hosted on an Amazon SageMaker AI endpoint, not on Amazon Bedrock. The company must detect generated summaries that are not grounded in the retrieved clinical documents and must mask patient names and phone numbers in every response, while managing these safety policies centrally. Which combination of steps meets these requirements? (Choose two)

  1. A Create an Amazon Bedrock guardrail that enables a contextual grounding check and a sensitive information filter configured to mask the NAME and PHONE entity types.
  2. B Call the ApplyGuardrail API with source set to OUTPUT, passing the retrieved documents with the grounding_source qualifier, the user question with the query qualifier, and the model response as the content to guard.
  3. C Enable Amazon Macie on the S3 bucket that stores the clinical documents so that Macie redacts personally identifiable information from the model responses.
  4. D Add an Automated Reasoning policy to the guardrail and configure it to block any response that contains personally identifiable information.
  5. E Pass the guardrail identifier in the guardrailConfig parameter of the SageMaker InvokeEndpoint API so that the endpoint applies the guardrail automatically.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Điểm mấu chốt là model KHÔNG chạy trên Amazon Bedrock mà trên SageMaker AI endpoint, nhưng công ty vẫn muốn dùng chính sách an toàn tập trung. Hai nhu cầu: phát hiện hallucination so với tài liệu truy xuất và che PII trong câu trả lời. Đề cương nhắc ở Skill 3.1.3 (giảm hallucination) và 3.2.2, 3.2.3 (bảo vệ thông tin nhạy cảm bằng Amazon Bedrock guardrails).

✅ Vì sao đáp án đúng là đúng

Thứ nhất, guardrail phải được cấu hình với contextual grounding check (chấm điểm grounding và relevance của câu trả lời so với nguồn) và sensitive information filter ở chế độ mask để thay NAME, PHONE bằng nhãn kiểu {NAME} thay vì chặn cả câu. Thứ hai, vì model không được gọi qua Bedrock, cần ApplyGuardrail API: tài liệu AWS nói rõ API này tách khỏi foundation model, đánh giá bất kỳ văn bản nào theo guardrail đã cấu hình mà không cần invoke model trên Bedrock. Với contextual grounding, bạn truyền ba khối: tài liệu truy xuất gắn qualifier grounding_source, câu hỏi gắn qualifier query, và câu trả lời của model làm nội dung cần kiểm tra (tương đương model response). Phản hồi trả về action GUARDRAIL_INTERVENED cùng văn bản đã che hoặc thông báo chặn.

❌ Vì sao các phương án còn lại sai

  • Amazon Macie: quét và phân loại dữ liệu nhạy cảm nằm trong S3, không can thiệp vào phản hồi model theo thời gian thực.
  • Automated Reasoning checks: xác minh logic theo chính sách, chạy ở chế độ detect, không phải công cụ nhận diện hay che PII.
  • guardrailConfig trong SageMaker InvokeEndpoint: tham số này không tồn tại; guardrail của Bedrock chỉ được gắn trực tiếp vào các API của Bedrock (Converse, InvokeModel, Knowledge Bases, Agents), còn mọi nơi khác phải dùng ApplyGuardrail.

📌 Điểm cần nhớ

  • ApplyGuardrail: source INPUT hoặc OUTPUT, dùng được với model bên thứ ba, model tự host hoặc bất kỳ bước nào trong luồng ứng dụng.
  • Contextual grounding cần đủ ba thành phần: grounding source, query, nội dung cần kiểm tra; chỉ kiểm tra được đầu ra.
  • Sensitive information filter có hai hành động: block hoặc mask (anonymize).
Câu 109 Operational Efficiency and Optimization for GenAI Applications

A legal document assistant uses the Amazon Bedrock Converse API with an Anthropic Claude model. Every request contains a 6,000-token system prompt with drafting instructions, 12 tool definitions, and a 30,000-token contract, followed by the user's question. Users typically ask several follow-up questions per minute for about 20 minutes about the same contract. Input token costs are high and time to first token is slow. Which change reduces input token cost and latency with the least modification to the application?

  1. A Add cachePoint blocks after the tool definitions, after the system prompt, and after the contract document, keeping these static sections before the user messages that change on every turn.
  2. B Move the follow-up questions to Amazon Bedrock batch inference so that the contract is processed once for all questions.
  3. C Summarize the contract with a smaller model before each question and send only the summary together with the question.
  4. D Add a single cachePoint block after the user's question at the end of the messages array, and rotate the order of the tool definitions on each request to keep the cache fresh.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Tình huống kinh điển cho prompt caching (Skill 4.1.4 của đề cương): một phần đầu rất dài và lặp lại (system prompt, tool definitions, tài liệu hợp đồng) đi kèm phần thay đổi ngắn (câu hỏi). Người dùng hỏi liên tục trong 20 phút, tức khoảng cách giữa các request ngắn hơn TTL của cache.

✅ Vì sao đáp án đúng là đúng

Prompt caching trong Amazon Bedrock cho phép đánh dấu cache checkpoint (cachePoint trong Converse API) để lưu tiền tố prompt tĩnh. Theo tài liệu AWS, với model Claude có thể đặt tối đa 4 checkpoint trong các trường tools, system và messages, và thứ tự xử lý là tools rồi system rồi messages; nội dung ổn định nên đặt trước, nội dung thay đổi đặt sau, checkpoint đặt ngay sau phần ổn định. Đặt checkpoint sau tool definitions, sau system prompt và sau hợp đồng đúng với khuyến nghị dùng nhiều checkpoint khi các phần thay đổi ở thời điểm khác nhau. Token đọc từ cache được tính giá cache-read thấp hơn và giảm độ trễ vì model không xử lý lại 36.000 token mỗi lượt. TTL mặc định 5 phút và được làm mới sau mỗi cache hit, nên luồng hỏi liên tục giữ cache sống suốt phiên; nếu cần có thể chọn TTL 1 giờ. Thay đổi chỉ là thêm vài khối cachePoint vào request hiện có.

❌ Vì sao các phương án còn lại sai

  • Batch inference: bất đồng bộ, ghi kết quả ra S3, không phù hợp hội thoại tương tác; tài liệu còn ghi rõ prompt caching không hỗ trợ batch inference.
  • Tóm tắt hợp đồng trước mỗi câu hỏi: thêm một lời gọi model mỗi lượt (tăng độ trễ và chi phí), làm mất chi tiết pháp lý quan trọng.
  • cachePoint sau câu hỏi và xoay thứ tự tool: câu hỏi thay đổi mỗi lượt nên tiền tố không bao giờ khớp; đổi thứ tự tools còn làm vô hiệu cache của cả system và messages phía sau.

📌 Điểm cần nhớ

  • Tiền tố trước checkpoint phải giữ nguyên tuyệt đối; thay đổi phần trước làm hỏng cache phần sau.
  • Mỗi model có số token tối thiểu cho checkpoint (Claude từ 512 đến 4.096 tuỳ phiên bản); dưới ngưỡng thì vẫn chạy nhưng không cache.
  • Kiểm tra cacheReadInputTokens và cacheWriteInputTokens trong phản hồi để xác nhận cache hit.
Câu 110 Testing, Validation, and Troubleshooting

A company has built two Amazon Bedrock Knowledge Bases over the same set of documents, one with fixed-size chunking and one with hierarchical chunking. Before investing in prompt engineering for response generation, the company wants an objective comparison of which configuration retrieves more relevant and more complete context for a dataset of 200 questions that have ground-truth answers. The comparison must use a managed Amazon Bedrock capability and require minimal effort. What should the company do?

  1. A Create a retrieve-only RAG evaluation job in Amazon Bedrock Evaluations for each knowledge base using the same prompt dataset in Amazon S3, and compare the retrieval metrics such as context relevance and context coverage produced by the evaluator model.
  2. B Create a model evaluation job with automatic metrics such as BERTScore on the generator model and pick the knowledge base used by the job with the higher score.
  3. C Use Amazon SageMaker Clarify to compute bias and explainability metrics on the chunks returned by each knowledge base.
  4. D Have an engineer run 20 sample questions in the knowledge base test window of the console for each configuration and choose the one whose results look better.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Đây là bài toán đánh giá riêng phần truy xuất của RAG (Skill 5.1.5 và 5.1.6 trong đề cương: RAG evaluation, kiểm thử chất lượng retrieval). Yêu cầu so sánh khách quan hai chiến lược chunking trên 200 câu hỏi có đáp án chuẩn, dùng tính năng được quản lý của Bedrock, ít công sức.

✅ Vì sao đáp án đúng là đúng

Amazon Bedrock Evaluations hỗ trợ RAG evaluation với hai kiểu job. Kiểu retrieve-only đánh giá dữ liệu mà knowledge base truy xuất được, phù hợp khi muốn so sánh cấu hình truy xuất độc lập với khâu sinh câu trả lời. Bạn cung cấp bộ prompt (kèm đáp án tham chiếu) trong Amazon S3, chọn knowledge base và một evaluator model (LLM-as-a-judge như Amazon Nova hoặc Anthropic Claude); dịch vụ tính các chỉ số truy xuất như độ liên quan của ngữ cảnh và độ bao phủ của ngữ cảnh so với đáp án chuẩn rồi xuất báo cáo. Chạy cùng một bộ dữ liệu trên hai knowledge base cho phép so sánh trực tiếp, đúng mục tiêu của bài. Tài liệu AWS nêu rõ kết quả RAG evaluation dùng để so sánh nhiều knowledge base và chọn cái tốt nhất cho ứng dụng.

❌ Vì sao các phương án còn lại sai

  • Model evaluation với BERTScore: đánh giá đầu ra của foundation model, không đo chất lượng truy xuất; hai job dùng cùng generator sẽ khó tách bạch ảnh hưởng của chunking.
  • SageMaker Clarify: công cụ đo thiên lệch và giải thích đặc trưng cho model ML truyền thống, không phải công cụ đo độ liên quan của chunk.
  • Kiểm tra tay 20 câu trong console: chủ quan, mẫu nhỏ, không lặp lại được và không phải phương pháp đánh giá có hệ thống như đề cương yêu cầu.

📌 Điểm cần nhớ

  • RAG evaluation có hai kiểu: retrieve-only (đo truy xuất) và retrieve-and-generate (đo cả câu trả lời: correctness, completeness, faithfulness, helpfulness, harmfulness...).
  • Có thể mang dữ liệu phản hồi từ hệ RAG bên ngoài vào đánh giá (bring your own inference response).
  • Evaluator model hỗ trợ cross-Region inference profile.