AWS AI Practitioner AIF-C01 · Fundamentals of Generative AI · medium
You are configuring an Amazon Bedrock foundation model to generate deterministic, factual SQL queries from natural-language prompts, where creativity and randomness must be minimized. How should you set the Temperature inference parameter?
Published · Last updated · checked before publication — how we verify questions
Options
Answer: D. Set temperature to 0 (or near 0) for greedy deterministic output
Temperature controls the randomness of token sampling by scaling the logits before softmax. Setting temperature = 0 (greedy decoding) makes the model consistently select the highest-probability next token, maximizing determinism and factual consistency for code/SQL generation.
Why the other options are wrong
- A. Set temperature to 1.0 to maximize creative token variety — A high temperature (1.0) flattens token probabilities and increases randomness, risking invalid SQL syntax.
- B. Set max_tokens to 1 so the model outputs only one character — Setting max_tokens = 1 truncates the response after a single token, preventing complete SQL query output.
- C. Set top_k to 500 with temperature at 0.95 for diverse sampling — High top_k and high temperature increase output variability rather than making SQL generation deterministic.
More Fundamentals of Generative AI questions
- An organization wants to equip its software engineers with an AI-powered coding assistant inside VS Code and JetBrains…
- As a rule of thumb in English-language Large Language Models (LLMs), roughly 1,000 tokens correspond to ~750 words (1…
- A non-technical product manager wants to experiment with prompt engineering and build a shareable generative AI web…
- A startup launches a prototype customer chatbot on Amazon Bedrock that currently processes 200 requests per day with…
- How do Vector Embeddings enable semantic search in a Retrieval-Augmented Generation (RAG) system?
- Compare the two foundational neural network architectures powering modern Generative AI: Transformer models (such as…
All Fundamentals of Generative AI questions and the topic overview →
AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.