AWS Certified Machine Learning Engineer - Associate (MLA-C02) free question 1 / 10 · Domain 1: Data Preparation for ML and AI
An engineer prepares the table that an Amazon Bedrock knowledge base will use in Aurora PostgreSQL. The knowledge base will use the Titan Text Embeddings v2 model with 1024-dimensional vectors. How should the table be defined?
- With the embedding stored in the text chunks column and a separate column for the source document
- With an embedding column of type vector(1024), a chunks column of type text, and metadata columns
- With the embedding stored in a jsonb column to load vectors of different sizes
- With an embedding column of type vector(1536), the size used for the Titan v2 model by default
Show the answer and explanation
Answer: B
Why this is correct
The page creates the bedrock_kb table with an embedding column of type vector(n), a chunks column of type text, a metadata column of type json, and a custom_metadata column of type jsonb. It tells you to replace n with the dimension of the embedding model, and for the Titan v2 model it lists vector(1024), vector(512), and vector(256). A 1024-dimensional model therefore uses vector(1024).
Why the other options are wrong
"With an embedding column of type vector(1536), the size used for the Titan v2 model by default" … The page assigns vector(1536) to the Titan v1.2 model. For Titan v2 it lists vector(1024), vector(512), or vector(256), and the column size must match the vectors the model returns.
"With the embedding stored in a jsonb column to load vectors of different sizes" … The page's table definition uses the pgvector vector(n) type for the embedding, with n set to the model's dimension. The jsonb type is used for the custom_metadata column.
"With the embedding stored in the text chunks column and a separate column for the source document" … The page defines a text column named chunks for the source text and a separate vector column for the embedding. The embedding is not stored as text.
Key points
The dimension in vector(n) must match the vectors the model returns. For the Titan v1.2 model the page uses vector(1536), and for the Cohere Embed model it uses vector(1024).