nerdexam
Databricks

GENERATIVE-AI-ENGINEER-ASSOCIATE · Question #31

A Generative AI Engineer is creating a customer support bot that should respond differently to an end user based on the sentiment in their initial message. For example, if the end user's message was…

The correct answer is D. Create a chain which first uses an LLM to classify sentiment, then changes system prompt for the. The best practice for this use case is a two-step LLM chain: first, use an LLM to classify the sentiment of the user's message (e.g., angry, neutral, happy), then dynamically adjust the system prompt for the response-generating LLM based on that classification (e.g., injecting…

LLM Application Design and Prompt Engineering

Question

A Generative AI Engineer is creating a customer support bot that should respond differently to an end user based on the sentiment in their initial message. For example, if the end user’s message was angry, the bot should try to de-escalate their negative sentiments as it solves the customer query. They want to make sure their approach follows best practices. Which approach will do this?

Options

  • AUse an encoder-only LLM model to both detect sentiment and generate replies based upon the
  • BImplement a RAG architecture for how to respond to users depending on detected sentiment.
  • CUse linear regression model to classify sentiment and feed the result to a system prompt for the
  • DCreate a chain which first uses an LLM to classify sentiment, then changes system prompt for the

How the community answered

(44 responses)
  • A
    2% (1)
  • B
    14% (6)
  • C
    5% (2)
  • D
    80% (35)

Explanation

The best practice for this use case is a two-step LLM chain: first, use an LLM to classify the sentiment of the user's message (e.g., angry, neutral, happy), then dynamically adjust the system prompt for the response-generating LLM based on that classification (e.g., injecting de-escalation instructions when anger is detected). Option A is incorrect because encoder-only models (like BERT) are designed for classification/understanding tasks only and cannot generate text responses. Option B (RAG for sentiment routing) adds unnecessary complexity and is not the right tool for this pattern. Option C uses linear regression, which is an outdated, lower-accuracy approach compared to using an LLM for nuanced sentiment classification. Option D correctly separates concerns into a clean, maintainable chain.

Topics

#Prompt Engineering#LLM Chaining#Sentiment Analysis#Generative AI Architecture

Community Discussion

No community discussion yet for this question.

Full GENERATIVE-AI-ENGINEER-ASSOCIATE Practice