SnowPro Specialty: Gen AI Question 260
Single answerMinimize tokensA retail company uses Snowflake Cortex AI_COMPLETE to generate short product summaries from product descriptions stored in a table. Costs have risen because prompts include full product records, long formatting instructions, and repeated examples in every request. The team must reduce token usage without changing the business task or significantly lowering output quality. Which approach is the BEST choice?
- A
Rewrite the prompt to include only the fields required for summarization, shorten the instructions, and remove repeated few-shot examples unless they are necessary for quality
- B
Increase the model temperature so the model generates shorter outputs and therefore uses fewer input tokens
- C
Add more detailed role and policy text to every prompt so the model can infer which input fields to ignore
- D
Duplicate the product description in the prompt to reinforce the important details and improve token efficiency
Show answer and explanation
Correct answer: A
Explanation
The best answer is to reduce prompt payload to only what is needed for the task. In Snowflake Cortex workloads, token usage affects both cost and latency, so prompt design should avoid unnecessary columns, excessive instruction text, and repeated few-shot examples unless they materially improve results. Best practices for LLM applications include using concise instructions, limiting context to relevant data, and constraining outputs to the required format and length. For a summarization task in AI_COMPLETE, this usually means passing only the product text and a short directive such as producing a brief summary in a specified format. Temperature tuning is about response variability, not token minimization, and adding or duplicating text increases token consumption rather than reducing it.
- A. Correct.
Correct. Minimizing tokens primarily means reducing unnecessary prompt and completion content while preserving task performance. In this scenario, the largest savings come from trimming the input: sending only the columns needed for summarization, simplifying verbose instructions, and avoiding repeated examples when zero-shot or fewer examples are sufficient. This aligns with prompt engineering best practices for Snowflake Cortex and LLM usage generally: keep prompts concise, relevant, and structured around only the required context.
- B. Incorrect.
Incorrect. Temperature affects randomness and style of generation, not the number of input tokens sent to the model. While output length can sometimes be influenced by prompting or token limits, increasing temperature is not a reliable or recommended method for minimizing token usage, and it may reduce consistency.
- C. Incorrect.
Incorrect. Adding more role or policy text increases prompt size and therefore increases input token consumption. Although clear instructions are useful, the scenario already indicates the prompts are overly verbose. The misconception is that more instruction automatically improves efficiency; in practice, unnecessary instruction text raises cost.
- D. Incorrect.
Incorrect. Repeating the same product description increases token count directly and does not improve efficiency. Duplication is the opposite of token minimization. A candidate might choose this if they assume repetition improves model focus, but for cost-sensitive production prompting, redundant context should be removed.