QuestionQ74

VerifiedImplement generative AI and agentic solutions

You have a Microsoft Foundry project containing a customer support agent that is built on a deployed chat model.

The agent's responses are validated by an automated testing system that compares the generated answers against stored expected outputs. Identical prompts must produce consistent responses so that the automated tests do not fail.

You need to reduce the variability of the model's responses, without changing the prompt or reducing factual accuracy.

What should you do for the model?

Explanation

The temperature parameter controls how much randomness is introduced when the model samples the next token: higher values increase diversity and unpredictability of output, while lower values make the model favor the most probable tokens, producing more deterministic and repeatable responses for the same input prompt. Lowering (decreasing) the temperature therefore reduces response variability across repeated calls with identical prompts, satisfying the automated testing requirement, without requiring any change to the prompt text and without degrading factual accuracy—in fact, low temperature settings are commonly recommended for accuracy-sensitive, deterministic use cases such as RAG and conversational Q&A validation. Changing max_tokens only affects response length limits, and removing stop sequences only affects where generation is cut off; neither controls sampling randomness.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!