How Large Language Models Power Multi‑Turn Dialogue for Smart Marketing
This article presents a comprehensive technical analysis of using large language models to build a task‑oriented multi‑turn dialogue system for intelligent marketing, detailing architecture, intent detection, slot extraction, prompt design, dialogue management, practical experience, and future research directions.
Introduction
This document describes a task‑oriented dialogue system for intelligent marketing that uses large language models (LLMs) to conduct multi‑turn conversations and generate personalized product recommendations.
System Architecture
The end‑to‑end pipeline consists of the following stages (see Figure 1): user input → intent recognition → intent‑jump detection → slot extraction & update → follow‑up slot selection → prompt construction → LLM response generation → dialogue manager. The architecture is lightweight and can be deployed with quantized LLMs.
Core Modules
Intent Recognition Implemented as a hybrid of LLM‑based classification and rule‑based fallback. The LLM prompt includes:
You are an intent‑recognition expert. The system supports the following intent categories:
{CATEGORY_LIST}
For each new user utterance, perform the following steps:
1. Understand the intent definitions.
2. Apply few‑shot examples.
3. Use chain‑of‑thought reasoning to select the most likely intent.
4. Output the intent label.Few‑shot examples and explicit reasoning improve accuracy; rule‑based logic provides a safety net for ambiguous cases.
Slot Extraction & Update Each intent has a predefined slot schema (e.g., "直播终端数量", "直播间数量"). The LLM extracts slot values from the current utterance. Extracted values overwrite previous values for the same intent, ensuring the slot store always reflects the latest user information.
Intent‑Jump Detection Two complementary criteria are used:
Semantic similarity between the current utterance and the previous one (cosine similarity in the embedding space). A threshold of 0.5 determines whether the intents are related.
Direct comparison of intent labels from the intent recognizer. If the labels differ, a jump is assumed.
If a jump is detected, the dialogue manager resets the session state and starts a new round.
Follow‑up Question Generation If any required slot for the current intent remains empty, the system selects the most critical missing slot and generates a natural‑language follow‑up using a template such as:
We still need to know {MISSING_SLOT}. Could you provide that information?The LLM fills the template, producing a user‑friendly clarification request.
Prompt Construction for Response Generation The final prompt sent to the LLM contains several sections (see Figure 2):
Role‑play instruction (e.g., "You are a marketing assistant").
Task description (product recommendation).
Product knowledge base (RAG‑style) limited to the products relevant to the detected intent.
Marketing strategy few‑shots specific to the intent.
User‑derived slot description (merged current and historical slots).
Follow‑up requirement flag.
Output constraints (format, mandatory fields, prohibited content).
Dialogue Management
The dialogue manager maintains a session object with:
Current intent and its slot map.
History of slot values for each intent.
List of slots already asked to avoid duplicate follow‑ups.
Timeout handling (default 1800 seconds of inactivity).
Session termination occurs when the user explicitly signals the end, clicks an "End Session" button, or the inactivity timeout expires. Upon termination the state is cleared and ready for a new conversation.
Implementation Details
Flow Diagram (Figure 1) illustrates the sequential processing:
Key steps:
User utterance is fed to the intent recognizer.
If intent jump is detected, the session state is re‑initialized.
Slot extraction updates the slot store; historical slots are merged to keep the most recent values.
Missing slots trigger the follow‑up module, which selects one slot and creates a clarification prompt.
The merged slot description and marketing strategy are assembled into the final LLM prompt.
LLM generates the marketing reply, which is returned to the user and logged for the next turn.
Key Findings from Deployment
Intent detection accuracy improves markedly when few‑shot examples and chain‑of‑thought reasoning are combined with rule‑based fallback.
Product recommendation precision benefits from dynamically selecting only the relevant product knowledge and marketing strategy for the current intent, reducing prompt length and inference latency.
Slot rendering as templated natural language guides the LLM to produce coherent, user‑friendly replies.
Controlled LLM output (limited to classification, slot filling, and response generation) yields reliable and interpretable results, especially with quantized models.
Historical context handling uses recent turns for multi‑intent slot extraction while masking irrelevant history to avoid noise.
Future Outlook
Anticipated developments include more mature open‑source multi‑agent dialogue frameworks, richer auxiliary tools for complex query handling, and advanced techniques for leveraging historical conversation without interference.
References
OpenAI, “A Survey of Techniques for Maximizing LLM Performance,” 2023.
Zihao Yi, “A Survey on Recent Advances in LLM‑Based Multi‑turn Dialogue Systems,” 2024.
Hongru Wang, “A Survey of the Evolution of Language Model‑Based Dialogue Systems,” 2015.
Minlie Huang, “Challenges in Building Intelligent Open‑domain Dialog Systems,” 2020.
Hongru Wang, “Cue‑CoT: Chain‑of‑Thought Prompting for In‑depth Dialogue Questions with LLMs,” 2023.
Hongru Wang, “Large Language Models as Source Planner for Personalized Knowledge‑grounded Dialogues,” 2023.
How to Design and Implement Task‑oriented Dialogue Agents, https://cloud.tencent.com/developer/article/2408175
AsiaInfo Technology: New Tech Exploration
AsiaInfo's cutting‑edge ICT viewpoints and industry insights, featuring its latest technology and product case studies.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
