Abstract

The use of generative artificial intelligence (AI) agents in various applications can be affected by the underlying models exhibiting hallucinations and/or vulnerability to prompt injection attacks. In customer-facing applications, such as taking orders for quick service restaurants (QSR) or drive-through restaurants, model hallucinations can create a risk of brand damage and/or bad publicity. This disclosure describes techniques that constrain the output of generative AI agents using deterministic control to reduce off-topic or inappropriate responses in structured conversational contexts such as order-taking in a quick service restaurant. A deterministic control module includes a state machine whose states are the current context. Given its current state, the state machine can transition to one of a few predetermined successor states. In a single reasoning step, the LLM generates both an intent (state), e.g., a category for its response, and a suggested response. The next response generated by the LLM is constrained to belong to one of the allowed successor states. The techniques strike a balance between the natural language flexibility of LLMs and the deterministic logic of state machines to ensure that varied conversational inputs can be handled while keeping the conversation on track.

Creative Commons License

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.

Share

COinS