Event memory and pattern guided dialogue recommendation method and system
Patent Information
- Application Number
- CN202611057793.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-08-18
AI Technical Summary
当前对话推荐系统普遍面临以下问题:1)用户偏好信息稀疏的困境,用户往往仅提供简短、不完整的偏好陈述
1、本发明通过将历史推荐行为构建为可检索的推荐事件记忆库,并从训练推荐事件中自动归纳可解释的推荐策略模式,通过策略路由建模当前对话的高层推荐意图,使得对话系统能够在推理阶段显式检索与当前情境高度相似的历史案例,并根据当前对话上下文动态检索并加载最适配的策略模式作为软策略提示。这一机制将过往经验直接转化为当前决策的依据,并能够根据用户的不同意图灵活调整推理路径,彻底克服了传统方法中策略僵化、无法随情境变化而自适应调整的缺陷。
Smart Images

Figure CN122594451A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and more specifically to a dialogue recommendation method and system based on event memory and pattern guidance. Background Technology
[0002] Dialogue recommendation systems aim to acquire user preferences in real time and provide personalized recommendations through multi-turn natural language interactions. Current dialogue recommendation systems generally face the following problems: 1) The dilemma of sparse user preference information: users often only provide brief and incomplete preference statements. When users or items lack historical interaction records, the system struggles to provide accurate recommendations. 2) Most existing dialogue recommendation systems adopt stateless or weakly stateful design paradigms, with each recommendation decision relying primarily on the current dialogue context, failing to systematically extract and accumulate reusable experiential knowledge from historical recommendation behaviors. 3) Current LLM-based re-ranking methods mainly rely on zero-shot hints or simple user preference retrieval to drive ranking decisions, lacking structured utilization of historical recommendation experience. While LLM performs well in semantic understanding and reasoning, its re-ranking results are often unstable without sufficient contextual guidance, and it is difficult to integrate historically validated recommendation patterns into the current decision-making process.
[0003] Therefore, how to consider historical recommendation experience, automatically summarize strategy patterns, and guide LLM reordering accordingly is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] In view of the above problems, the present invention proposes a dialogue recommendation method and system based on event memory and pattern guidance, so as to overcome the above problems or at least partially solve the above problems.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides a dialogue recommendation method based on event memory and pattern guidance, comprising the following steps: S1. Organize the historical recommendation behaviors in the training set into a searchable recommendation event memory; S2. Automatically summarize recommendation strategy patterns from the recommendation event memory based on user feedback tags; S3. During the reasoning phase, the most relevant recommended strategy pattern is retrieved based on the current dialogue context and used as a soft strategy hint. S4. Retrieve historical recommended events from the event memory bank that are most similar to the current dialogue context, identify candidate entities and sort them to obtain the event memory sorting list; S5. Identify the mentioned entities from the current dialogue context as anchor entities; calculate the final candidate score for each candidate entity based on the historical co-occurrence relationship between candidate entities and anchor entities, and select the top K candidate entities with the highest final candidate scores to form a candidate pool. S6. Input the current dialogue context, soft policy hints, and candidate pool into the large language model, reorder each candidate entity in the candidate pool to obtain a context-aware sorted list; based on the context-aware sorted list and the event memory sorted list, perform a comprehensive sorting of each candidate entity to obtain the final recommendation list.
[0007] Furthermore, S1 includes: S11. Treat each recommendation action in the training set as a recommendation event, denoted as... ,in, Indicates the context before the recommendation. , representing the set of entities recommended in this round. This indicates user feedback after the recommendation; S12. Encode each recommendation event as a vector, represented as follows: ; S13. Construct a recommendation event memory from all recommended events, represented as follows: , This indicates the total number of recommended events.
[0008] Furthermore, S2 includes: S21. Divide recommended events into positive event sets based on user feedback tags. and negative / transition event set ; S22, For each positive seed event Retrieve semantically similar positive and negative / transitional events from the event vector space to construct a comparison set. ,in, Indicates a positive seed event A set of successful recommendation events with similar semantics. Indicates a positive seed event A set of events that are semantically similar but fail to elicit feedback or experience a shift in interest; S23. For each pair of events in the comparison set, use the large language model to compare the differences between successful recommendation events and failed or interest-shifting events to obtain the original recommendation strategy pattern instance. S24. Normalize and merge the original recommendation strategy pattern instances to obtain the normalized pattern, and represent the normalized pattern as a vector prototype. .
[0009] Furthermore, S24 includes: S241. Perform a validity check on the original recommendation strategy pattern instances output by the large language model, and map the names and subtypes of the original recommendation strategy pattern instances to a unified canonical label space to obtain normalized keys. :
[0010] in, This represents an instance of the original recommendation strategy pattern. This represents the function for normalizing the pattern name. Indicates the normalization function for the pattern subtype; S242. Merge instances of original recommendation strategy patterns with the same normalization key into a single normalized pattern. , is represented as: , This indicates a merge function. This represents the normalized key-value pair; S243, Define the same specification schema The set of positive support events is as follows:
[0011] S244, For the same specification model The average of the recommendation event vectors in the positive support event set is calculated and then normalized to obtain the canonical pattern. vector prototype .
[0012] Furthermore, S3 includes: S31. During the reasoning phase, the current dialogue context is encoded as a vector: , Represent the current dialogue context, i.e., the test sample; calculate the current dialogue context vector. Cosine similarity between the vector prototype and the corresponding vector for each canonical pattern; S32. Select the M canonical patterns with the highest cosine similarity scores as soft policy cues for the current dialogue context.
[0013] Furthermore, S4 includes: S41. Calculate the vector of the current dialogue context. Vectors of historical events in the recommended event memory Cosine similarity between Select the top-ranked events by cosine similarity from the recommended event memory database. Recommended events are arranged in order to construct a set of similar events. ; S42. Select recommended entities that have appeared in the set of similar events as candidate entities and aggregate them into a candidate entity set; S43. For each candidate entity in the candidate entity set, consider the semantic similarity between historical events and the current dialogue context, as well as the similarity of the recommended event in the set of similar events. The relative position in the memory score defines the event memory score as:
[0014] in, Indicates historical recommended events In similar event sets The ranking in It is a smoothing constant; Indicates historical recommended events The collection of recommended items recommended in the past; This is an indicator function, representing if the candidate entity Appeared in historical recommended events Recommended items set If the value is 1, then the value is 1; otherwise, the value is 0. S44. Sort each candidate entity in the candidate entity set in descending order according to the event memory score to obtain the event memory sorted list.
[0015] Furthermore, S5 includes: S51. Identify mentioned entities from the current dialogue context as anchor entities, and construct an anchor set from the identified anchor entities. ; S52, For any anchor point entity and any candidate entity Calculate the co-occurrence frequency of the two:
[0016] in, Indicates the recommended event memory. Indicates the first A historical recommended event, Indicates the first Recommended historical events The context before the recommendation Indicates the first Recommended historical events The recommended set of candidate entities, This is an indicator function that takes the value 1 when the condition is true and 0 otherwise. S53, Calculate candidate entities In the current dialogue context Anchor point enhancement score obtained below The calculation formula is:
[0017] in, Weighting coefficients to control the strength of co-occurring signals at anchor points; S54. Add the event memory score and the anchor point enhancement score to get the final candidate score of the candidate entity. Sort the candidate entities in descending order according to the final candidate score and select the top K candidate entities to construct the candidate pool.
[0018] Furthermore, S6 includes: S61. Change the current dialogue context Soft strategy tips and candidate pool Input a large language model, reorder the candidate entities, and obtain a context-aware sorted list. Context-aware sorted list The highest confidence level in the top Candidate entities ; S62, Context-Aware Sorted List The remaining candidate entity list and the event memory sorting list are merged and sorted to obtain the ranking list of the remaining candidate entities. ; S63, Before Candidate entities Ranking list of remaining candidate entities The data is then merged to obtain the final recommendation list. , is represented as: .
[0019] Furthermore, in S62, for the context-aware sorted list... For any remaining candidate entity in the dataset, its fusion score is:
[0020] in, Indicates candidate entities In a context-aware sorted list The ranking in This indicates the rank of candidate entity y in the event memory sorting list. and These are the weights that control the two types of sorting signals. For smoothing parameters; Context-aware ranking list based on fusion score The remaining candidate entities are sorted in descending order to obtain a ranking list of the remaining candidate entities. .
[0021] Secondly, the present invention provides a dialogue recommendation system based on event memory and pattern guidance, comprising: The dialogue event modeling module is used to organize historical recommendation behaviors in the training set into a searchable recommendation event memory. The module for summarizing and representing recommendation strategy patterns is used to automatically summarize recommendation strategy patterns from the recommendation event memory based on user feedback tags; The recommended strategy pattern routing module is used to retrieve the most relevant recommended strategy pattern based on the current dialogue context during the inference phase, as a soft strategy hint. The event memory candidate recall module is used to retrieve the historical recommended events that are most similar to the current dialogue context from the event memory database, identify candidate entities and sort them to obtain the event memory sorted list. The anchor co-occurrence candidate enhancement module is used to identify mentioned entities from the current dialogue context as anchor entities; based on the historical co-occurrence relationship between candidate entities and anchor entities, the final candidate score of each candidate entity is calculated, and the top K candidate entities with the highest final candidate scores are selected to form a candidate pool. The fusion ranking module takes the current dialogue context, soft policy hints, and candidate pool as inputs to the large language model, re-ranks the candidate entities in the candidate pool, and obtains a context-aware ranked list. Based on the context-aware ranked list and the event memory ranked list, the module performs a comprehensive ranking of the candidate entities to obtain the final recommendation list. As can be seen from the above technical solution, compared with the prior art, the present invention has the following beneficial effects: 1. This invention constructs a searchable recommendation event memory from historical recommendation behaviors and automatically summarizes interpretable recommendation strategy patterns from training recommendation events. By modeling the high-level recommendation intent of the current dialogue through policy routing, the dialogue system can explicitly retrieve historical cases highly similar to the current context during the reasoning stage, and dynamically retrieve and load the most suitable policy pattern as a soft policy prompt based on the current dialogue context. This mechanism directly transforms past experience into the basis for current decisions and can flexibly adjust the reasoning path according to different user intents, completely overcoming the shortcomings of traditional methods such as rigid policies and the inability to adaptively adjust to changes in context.
[0022] 2. This invention utilizes event memory and anchor co-occurrence relationships to construct a candidate pool within the dataset. It uses the historical co-occurrence frequency of anchor entities and candidate entities to perform score weighting, which can filter out a large number of noisy candidates and accurately select the top K entities that both conform to historical experience and meet the current context constraints. This provides a high-quality, low-noise candidate pool for the final ranking and significantly reduces the processing burden of large language models.
[0023] 3. This invention uses a large language model to perform restricted re-ranking of the candidate pool, and performs fusion ranking by combining the event memory ranking list and the large model re-ranking results, thus combining contextual fine ranking capabilities and recommendation recall capabilities. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0025] Figure 1 This is a flowchart of a dialogue recommendation method based on event memory and pattern guidance provided in an embodiment of the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] like Figure 1 As shown in the figure, this invention discloses a dialogue recommendation method based on event memory and pattern guidance, including the following steps: S1. Organize the historical recommendation behaviors in the training set into a searchable recommendation event memory; S2. Automatically summarize recommendation strategy patterns from the recommendation event memory based on user feedback tags; S3. During the reasoning phase, the most relevant recommended strategy pattern is retrieved based on the current dialogue context and used as a soft strategy hint. S4. Retrieve historical recommended events from the event memory bank that are most similar to the current dialogue context, identify candidate entities and sort them to obtain the event memory sorting list; S5. Identify the mentioned entities from the current dialogue context as anchor entities; calculate the final candidate score for each candidate entity based on the historical co-occurrence relationship between candidate entities and anchor entities, and select the top K candidate entities with the highest final candidate scores to form a candidate pool. S6. Input the current dialogue context, soft policy hints, and candidate pool into the large language model, reorder each candidate entity in the candidate pool to obtain a context-aware sorted list; based on the context-aware sorted list and the event memory sorted list, perform a comprehensive sorting of each candidate entity to obtain the final recommendation list.
[0028] The specific implementation methods of the above steps will be further explained below.
[0029] S1. Organize the historical recommendation behaviors in the training set into a searchable recommendation event memory, specifically including: S11. Treat each recommendation action in the training set as a recommendation event. Given a training dialogue, construct recommendation events when recommending entities in a certain round. Each recommendation event is represented as follows: ,in, Indicates the context preceding the recommendation (i.e., the history of the conversation); , representing the set of entities recommended in this round; This indicates user feedback after a recommendation; it is a weak feedback tag based on preferred keywords and mentions in the recommended content. Specifically, These represent positive and approving, having seen and approving, having seen but with a positive view, having seen but with a negative view, rejecting and requesting a change of direction, and no obvious signal.
[0030] S12. Encode each recommendation event as a vector, represented as follows: ; This indicates the encoder.
[0031] S13. Construct a recommendation event memory from all recommended events, represented as follows: , This indicates the total number of recommended events.
[0032] In this step, this event-based modeling approach transforms the raw dialogue recommendation data into a unified structure of "context, recommendation action, and feedback signal," enabling subsequent recommendation strategy induction, event retrieval, and candidate generation to share the same process across different datasets such as ReDial and TG-ReDial.
[0033] S2. Automatically summarizing recommendation strategy patterns from the recommendation event memory based on user feedback tags: Relying solely on similar event retrieval makes it difficult to explicitly characterize the high-level decision-making logic behind recommendation behavior. For example, in movie recommendation, the model needs to distinguish whether the current recommendation is based on the user's favorite movie continuation, genre matching, sentiment matching, actor preference, series continuation, or whether the direction is switched after the user rejects it. To address this, this invention automatically summarizes recommendation strategy patterns (schemas) from recommendation events in the training set and represents them as vector prototypes that can be used for routing during the inference stage. Specifically, this includes: S21. Divide recommended events into positive event sets based on user feedback tags. and negative / transition event set :
[0034]
[0035] in, This indicates a successful recommendation signal, such as acceptance, continued request, or positive feedback. These indicate rejection, negative feedback, or a shift in interest, indicating a failed recommendation.
[0036] S22. To highlight the difference between successful and unsuccessful recommendation behaviors, and to ensure that the inductive recommendation strategy schema describes not only "what was recommended" but also "why this recommendation behavior is more likely to succeed," the recommendation strategy schema represents a transferable recommendation behavior pattern inductively derived from training events, such as preference continuation, type matching, and reversal after rejection. For each positive seed event... Retrieve semantically similar positive and negative / transitional events from the event vector space to construct a comparison set. ,in, Indicates a positive seed event A set of successful recommendation events with similar semantics. Indicates a positive seed event A set of events that are semantically similar but fail to elicit feedback or experience a shift in interest.
[0037] S23. For each pair of events in the comparison set, use a large language model to compare the differences between successful recommendation events and failed or interest-shifting events, and summarize a reusable recommendation pattern, i.e., the original recommendation strategy pattern instance (schema). :
[0038] in, This is for constructing prompt words.
[0039] S24. To obtain a stable and compact recommendation strategy pattern library, this invention further refines the original recommendation strategy pattern instances. Normalization and merging are performed to obtain the canonical schema, which is then represented as a vector prototype. Specifically, this includes: S241, Example of the original recommendation strategy pattern output by a large language model Perform a legality check and then use the original recommendation strategy pattern instance. The names and subtypes are mapped to a unified canonical label space to obtain normalized keys. :
[0040] in, This represents an instance of the original recommendation strategy pattern. This represents the function for normalizing the pattern name. Indicates the normalization function for the pattern subtype; S242. Merge instances of the original recommendation strategy schemas with the same normalization key into a single canonical schema. , is represented as:
[0041] This indicates a merge function. This represents the normalized key-value pair; S243. To enable the recommendation strategy schema to be used for routing during the inference phase, each recommendation strategy schema is further associated with a set of supporting events. If an event contributes as a positive sample during the recommendation strategy schema induction phase, then that positive sample is considered a supporting event of that recommendation strategy schema and is defined using the same canonical schema. The set of positive support events is as follows:
[0042] S244, Using the same specification model The schema prototype is defined as the average of the recommendation event vectors in the positive support event set, and is calculated using the following formula:
[0043] in, Recommended events ; Then, the average value conduct Normalization process yields the standard model. vector prototype :
[0044] Finally, by summarizing all the canonical patterns and their vector prototypes, we obtain the recommendation pattern bank, represented as:
[0045] Where K is the total number of canonical patterns.
[0046] S3. During the reasoning phase, the most relevant recommended strategy pattern is retrieved based on the current dialogue context as a soft strategy cue, specifically including: S31. During the reasoning phase, the current dialogue context is encoded as a vector: , Represent the current dialogue context, i.e., the test sample; calculate the current dialogue context vector. Cosine similarity between the vector prototypes corresponding to each canonical pattern:
[0047] S32. Select the M canonical patterns with the highest cosine similarity scores as soft policy cues for the current dialogue context, denoted as:
[0048] It's important to note that these canonical patterns are not used as hard classification labels, nor do they directly generate candidate recommendations. Instead, they serve as soft policy hints input into the subsequent large language model. In other words, canonical patterns primarily function in the candidate re-ranking stage, providing the large language model with a high-level recommendation intent for the current dialogue, enabling the model to arrange entities more rationally within the candidate pool.
[0049] S4. In conversational recommendation, the current user's needs can usually be found in similar recommendation contexts within historical conversations. Based on this, the event memory is retrieved from the event memory repository to identify and rank the historical recommendation events most similar to the current conversation context, resulting in a ranked event memory list. The role of event memory candidate recall is to expand the recommendation space from the complete recommendation repository. Narrowing the pool to a candidate pool highly relevant to the current context, while ensuring that candidate recommendations come from recommendation behaviors that have actually occurred in the training data. Specifically, this includes: S41. During the candidate generation stage, retrieve the historical recommended event most similar to the current dialogue context from the event memory, and calculate the vector of the current dialogue context. Vectors of historical events in the recommended event memory Cosine similarity between :
[0050] Select the top cosine similarity scores from the recommended event memory database. Recommended events are arranged in order to construct a set of similar events. , is represented as:
[0051] in, This indicates a recommended event memory.
[0052] S42. Select recommended entities that have appeared in the set of similar events as candidate entities and aggregate them into a candidate entity set; S43. For each candidate entity in the candidate entity set, consider the semantic similarity between historical events and the current dialogue context, as well as the similarity of the recommended event in the set of similar events. The relative position in the memory score defines the event memory score as:
[0053] in, Indicates historical recommended events In similar event sets The ranking in It is a smoothing constant; Indicates historical recommended events The collection of recommended items recommended in the past; This is an indicator function, representing if the candidate entity Appeared in historical recommended events Recommended items set If the value is 1, then the value is 1; otherwise, the value is 0. S44. Sort the candidate entities in the candidate entity set in descending order according to their event memory scores to obtain the event memory sorted list, as follows:
[0054] in, Indicates according to candidate entities Sort the scores in descending order.
[0055] S5. Event memory retrieval primarily relies on the overall semantic similarity between the current dialogue context and historical recommended events. However, in conversational recommendation scenarios, user preferences are often explicitly expressed through specific item entities. These mentioned entities typically constitute important references for understanding user needs. In this step, item entities that have already appeared in the current dialogue context are referred to as anchor entities.
[0056] When using only the overall context vector for event retrieval, the model may overlook the entity-level historical association between anchor entities and candidate entities. That is, even if two dialogue contexts are not entirely similar in overall semantics, as long as they revolve around the same or similar entity anchors, historical recommendation behavior can still provide valid evidence for the current recommendation. Based on this motivation, this invention introduces an anchor co-occurrence candidate enhancement mechanism to supplement entity-level recommendation signals in event memory recall. Specifically, it includes: S51. Identify mentioned entities from the current dialogue context as anchor entities, and construct an anchor set from the identified anchor entities. , is represented as:
[0057] in, Represents the anchor point entity. This indicates a complete set of recommended entity libraries. Representing entities The normalized name appears in the context middle; S52. In order to utilize the entity-level recommendation patterns in the training data, the historical co-occurrence relationship between anchor entities and candidate entities is statistically analyzed. Specifically, for any anchor entity... and any candidate entity Calculate the co-occurrence frequency of the two:
[0058] in, Indicates the recommended event memory. Indicates the first A historical recommended event, Indicates the first Recommended historical events The context before the recommendation Indicates the first Recommended historical events The recommended set of candidate entities, This is an indicator function that takes the value 1 when the condition is true and 0 otherwise. S53, Regarding the current dialogue context If multiple anchor entities are identified Then candidate entities Co-occurrence evidence can be obtained from multiple anchor points. This invention defines candidate entities. In the current dialogue context Anchor point enhancement score obtained below for:
[0059] in, Weighting coefficients to control the strength of co-occurring signals at anchor points; S54. Anchor co-occurrence enhancement does not replace event memory recall, but is added as a complementary signal to the candidate generation stage. The final candidate score of a candidate entity is defined as the sum of the event memory score and the anchor enhancement score, expressed as:
[0060] Then, based on the final candidate scores Sort the candidate entities in descending order and select the top K candidate entities to construct a candidate pool, as follows: .
[0061] S6. After the candidate pool is constructed, the Prefix-RRF fusion strategy is used to generate the final recommendation list, which includes: S61. Using a large language model as a restricted reorderer, for the i-th test sample, its corresponding current dialogue context is... Soft strategy tips and candidate pool Combination And input it into a large language model; The goal of large language models is not to generate arbitrary entities freely, but to perform context-aware reordering of candidate entities based on a candidate pool, resulting in a context-aware ranked list. :
[0062] Then, retain the context-aware sorted list. The highest confidence level in the top Candidate entities ; S62. After LLM, a context-aware sorted list is obtained. Meanwhile, S4 provides an event memory ranking list based on historical recommendation evidence. These two lists are complementary. The ranking provided by LLM is better at using dialogue context for fine-grained preference judgments, while the event memory ranking list is closer to the training data distribution and usually provides more stable candidate recall. Therefore, this invention fuses these two lists to perform a comprehensive ranking of candidate entities; this process is called Prefix-RRF fusion.
[0063] For context-aware sorted lists For any remaining candidate entity in the dataset, its fusion score is:
[0064] in, Indicates candidate entities In a context-aware sorted list The ranking in This indicates the rank of candidate entity y in the event memory sorting list. and These are the weights that control the two types of sorting signals. For smoothing parameters; Context-aware sorted list based on fusion score from highest to lowest The remaining candidate entities are ranked to obtain a ranking list of the remaining candidate entities. .
[0065] S63, Before Candidate entities Ranking list of remaining candidate entities The data is then merged to obtain the final recommendation list. , is represented as: ,in, This indicates a list concatenation operation.
[0066] In other embodiments, the present invention provides a dialogue recommendation system based on event memory and pattern guidance, comprising: The dialogue event modeling module is used to organize historical recommendation behaviors in the training set into a searchable recommendation event memory. The module for summarizing and representing recommendation strategy patterns is used to automatically summarize recommendation strategy patterns from the recommendation event memory based on user feedback tags; The recommended strategy pattern routing module is used to retrieve the most relevant recommended strategy pattern based on the current dialogue context during the inference phase, as a soft strategy hint. The event memory candidate recall module is used to retrieve the historical recommended events that are most similar to the current dialogue context from the event memory database, identify candidate entities and sort them to obtain the event memory sorted list. The anchor co-occurrence candidate enhancement module is used to identify mentioned entities from the current dialogue context as anchor entities; based on the historical co-occurrence relationship between candidate entities and anchor entities, the final candidate score of each candidate entity is calculated, and the top K candidate entities with the highest final candidate scores are selected to form a candidate pool. The fusion ranking module is used to input the current dialogue context, soft policy hints, and candidate pool into the large language model, re-rank the candidate entities in the candidate pool to obtain a context-aware ranking list; and then perform a comprehensive ranking of the candidate entities based on the context-aware ranking list and the event memory ranking list to obtain the final recommendation list.
[0067] Next, the performance of this invention will be verified on the datasets TG-ReDial and ReDial.
[0068] 1) Evaluation Metrics: Recommendation performance was evaluated using Recall@K, MRR@K, and NDCG@K, where... .
[0069] Recall@K indicates the value before measurement. The proportion of recommendations that cover real target entities is calculated using the following formula:
[0070] MRR@K represents the location where the first hit target entity appears, and the calculation formula is:
[0071] in, It is the ranking of the first entity to be hit.
[0072] NDCG@K represents a measure of ranking quality, specifically the ranking quality of the hit position. The earlier the hit position, the higher the score. The calculation formula is:
[0073]
[0074]
[0075] All metrics are averaged across the test set samples.
[0076] 2) Main experiment: The performance of the method of this invention was compared with that of the traditional method. The comparison results are shown in Table 1: Table 1 Main Experiment Results
[0077] On the TG-ReDial dataset, the method of this invention achieves state-of-the-art results across all metrics. Traditional methods such as KBRD, KGSF, and UniCRS on this dataset have Recall@20 scores of 0.0174, 0.0249, and 0.0236, respectively, indicating that relying solely on knowledge graphs, semantic matching, or general pre-trained recommendation frameworks is insufficient to fully capture fine-grained recommendation intentions within the context. Compared to the strongest baseline, MemoCRS, the method of this invention improves Recall@20 from 0.0323 to 0.0481, MRR@20 from 0.0112 to 0.0209, and NDCG@20 from 0.0158 to 0.0252. This demonstrates that the method of this invention can more effectively capture user preferences in Chinese dialogues and prioritize relevant recommendations.
[0078] On the ReDial dataset, the proposed method also demonstrates strong competitiveness. It achieves a Recall@5 score of 0.1479, surpassing the previous best, MemoCRS's, of 0.1361, indicating a higher hit rate in the first five recommendation positions. On Recall@10 and Recall@20, the proposed method achieves scores of 0.2093 and 0.2769, respectively, slightly lower than MemoCRS's 0.2151 and 0.2857. Nevertheless, the proposed method comprehensively outperforms all baselines in both MRR and NDCG metrics, particularly achieving an MRR@20 score of 0.1051, an improvement of approximately 20.7% compared to MemoCRS's 0.0871; and an NDCG@20 score of 0.1408, an improvement of approximately 7.6% compared to MemoCRS's 0.1308.
[0079] Further observation of different types of metrics reveals that the advantage of the method in this invention lies primarily in ranking quality rather than simply expanding recall. The proposed method achieves optimal results on MRR@5, MRR@10, MRR@20, and NDCG@5, NDCG@10, and NDCG@20, demonstrating that this invention can more effectively advance highly relevant recommendations. This also validates the rationale behind the method's approach of using event memory for candidate coverage and LLM for contextual ranking.
[0080] 3) Ablation experiments: This invention conducted ablation experiments on the recommended strategy pattern guidance process (corresponding to S2-S3), the anchor point co-occurrence enhancement mechanism (corresponding to S5), and the Prefix-RRF fusion ranking (corresponding to S6). The experimental results are shown in Table 2: Table 2 Ablation Experiment Results
[0081] After removing the recommendation strategy pattern guidance process, Recall@20 decreased from 0.2769 to 0.2706, MRR@20 decreased from 0.1051 to 0.0955, and NDCG@20 decreased from 0.1408 to 0.1366. This indicates that the recommendation strategy pattern guidance can provide effective high-level recommendation intent for the re-ranking process, especially helping to improve ranking quality. After removing the anchor co-occurrence enhancement mechanism, Recall@20 decreased significantly to 0.2262, and NDCG@20 decreased to 0.1287, indicating that anchor co-occurrence enhancement is particularly important for candidate recall. This result shows that movie entities appearing in the dialogue can provide key preference clues, which helps to expand the candidate movies related to user interests. After removing the Prefix-RRF fusion ranking, all indicators showed the largest decrease, with Recall@20 decreasing to 0.2381 and NDCG@20 decreasing to 0.1223. This demonstrates that relying solely on a single path for ranking results makes it difficult to simultaneously ensure both recall and ranking quality. Prefix-RRF, on the other hand, effectively combines the complementary advantages of LLM reordering and event memory ranking. 4) Parameter analysis: This experiment is used to verify the impact of different schema number settings on ReDial performance.
[0082] Without a schema, the model's Recall@20 is 0.2509, MRR@20 is 0.0943, and NDCG@20 is 0.1379. Adding a Top-1 schema improves Recall@5, Recall@10, and MRR@20, indicating that even providing only the most relevant single schema helps the model more accurately identify the recommendation strategy for the current dialogue. However, the Top-1 schema only slightly improves Recall@20 and NDCG@20, suggesting that a single schema is insufficient to cover the multiple preference cues that may coexist in complex dialogues. When the number of schemas increases to Top-3, the model achieves optimal results across all metrics, with Recall@20 reaching 0.2769, MRR@20 reaching 0.1051, and NDCG@20 reaching 0.1408. This result demonstrates that an appropriate number of schemas can provide complementary policy information, allowing the model to consider multiple recommendation factors such as preference continuation, anchor similarity, and attribute constraints simultaneously, thus achieving more stable ranking results. Increasing the number of schemas further to the Top-5 actually led to a performance decrease, with Recall@20 dropping to 0.2696 and NDCG@20 to 0.1365. This indicates that too many schemas can introduce noise or conflicting policy cues, weakening the LLM's ability to determine the core user intent. Therefore, more schemas are not necessarily better; excessive policy information can lead to a distraction during the reordering phase.
[0083] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0084] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A dialogue recommendation method based on event memory and pattern guidance, characterized in that, Includes the following steps: S1. Organize the historical recommendation behaviors in the training set into a searchable recommendation event memory; S2. Automatically summarize recommendation strategy patterns from the recommendation event memory based on user feedback tags; S3. During the reasoning phase, the most relevant recommended strategy pattern is retrieved based on the current dialogue context and used as a soft strategy hint. S4. Retrieve historical recommended events from the event memory bank that are most similar to the current dialogue context, identify candidate entities and sort them to obtain the event memory sorting list; S5. Identify the mentioned entities from the current dialogue context as anchor entities; calculate the final candidate score for each candidate entity based on the historical co-occurrence relationship between candidate entities and anchor entities, and select the top K candidate entities with the highest final candidate scores to form a candidate pool. S6. Input the current dialogue context, soft policy hints and candidate pool into the large language model, and reorder the candidate entities in the candidate pool to obtain a context-aware sorted list. The candidate entities are comprehensively sorted based on context-aware sorted lists and event memory sorted lists to obtain the final recommendation list.
2. The dialogue recommendation method based on event memory and pattern guidance as described in claim 1, characterized in that, S1 includes: S11. Treat each recommendation action in the training set as a recommendation event, denoted as... ,in, Indicates the context before the recommendation. , representing the set of entities recommended in this round. This indicates user feedback after the recommendation; S12. Encode each recommendation event as a vector, represented as follows: ; S13. Construct a recommendation event memory from all recommended events, represented as follows: , This indicates the total number of recommended events.
3. The dialogue recommendation method based on event memory and pattern guidance as described in claim 1, characterized in that, S2 include: S21. Divide recommended events into positive event sets based on user feedback tags. and negative / transition event set ; S22, For each positive seed event Retrieve semantically similar positive and negative / transitional events from the event vector space to construct a comparison set. ,in, Indicates a positive seed event A set of successful recommendation events with similar semantics. Indicates a positive seed event A set of events that are semantically similar but fail to elicit feedback or experience a shift in interest; S23. For each pair of events in the comparison set, use the large language model to compare the differences between successful recommendation events and failed or interest-shifting events to obtain instances of the original recommendation strategy pattern. : in, To construct prompt words; S24. Normalize and merge the original recommendation strategy pattern instances to obtain the normalized pattern, and represent the normalized pattern as a vector prototype. .
4. The dialogue recommendation method based on event memory and pattern guidance as described in claim 3, characterized in that, S24 includes: S241. Perform a validity check on the original recommendation strategy pattern instances output by the large language model, and map the names and subtypes of the original recommendation strategy pattern instances to a unified canonical label space to obtain normalized keys. : in, This represents an instance of the original recommendation strategy pattern. This represents the function for normalizing the pattern name. Indicates the normalization function for the pattern subtype; S242. Merge instances of original recommendation strategy patterns with the same normalization key into a single normalized pattern. , is represented as: , Represented as a merge function, This represents the normalized key-value pair; S243, Define the same specification schema The set of positive support events is as follows: S244, For the same specification model The average of the recommendation event vectors in the positive support event set is calculated and then normalized to obtain the canonical pattern. vector prototype .
5. The dialogue recommendation method based on event memory and pattern guidance as described in claim 3, characterized in that, S3 include: S31. During the reasoning phase, the current dialogue context is encoded as a vector: , Represent the current dialogue context, i.e., the test sample; calculate the current dialogue context vector. Cosine similarity between the vector prototype and the corresponding vector for each canonical pattern; S32. Select the M canonical patterns with the highest cosine similarity scores as soft policy cues for the current dialogue context.
6. The dialogue recommendation method based on event memory and pattern guidance as described in claim 1, characterized in that, S4 include: S41. Calculate the vector of the current dialogue context. Vectors of historical events in the recommended event memory Cosine similarity between Select the top-ranked events by cosine similarity from the recommended event memory database. Recommended events are arranged in order to construct a set of similar events. ; S42. Select recommended entities that have appeared in the set of similar events as candidate entities and aggregate them into a candidate entity set; S43. For each candidate entity in the candidate entity set, consider the semantic similarity between historical events and the current dialogue context, as well as the similarity of the recommended event in the set of similar events. The relative position in the memory score defines the event memory score as: in, Indicates historical recommended events In similar event sets The ranking in It is a smoothing constant; Indicates historical recommended events The collection of recommended items recommended in the past; This is an indicator function, representing if the candidate entity Appeared in historical recommended events Recommended items set If the value is 1, then the value is 1; otherwise, the value is 0. S44. Sort each candidate entity in the candidate entity set in descending order according to the event memory score to obtain the event memory sorted list.
7. The dialogue recommendation method based on event memory and pattern guidance as described in claim 6, characterized in that, S5 include: S51. Identify mentioned entities from the current dialogue context as anchor entities, and construct an anchor set from the identified anchor entities. ; S52, For any anchor point entity and any candidate entity Calculate the co-occurrence frequency of the two: in, Indicates the recommended event memory. Indicates the first A historical recommended event, Indicates the first Recommended historical events The context before the recommendation Indicates the first Recommended historical events The recommended set of candidate entities, This is an indicator function that takes the value 1 when the condition is true and 0 otherwise. S53, Calculate candidate entities In the current dialogue context Anchor point enhancement score obtained below The calculation formula is: in, Weighting coefficients to control the strength of co-occurring signals at anchor points; S54. Add the event memory score and the anchor point enhancement score to get the final candidate score of the candidate entity. Sort the candidate entities in descending order according to the final candidate score and select the top K candidate entities to construct the candidate pool.
8. The dialogue recommendation method based on event memory and pattern guidance as described in claim 1, characterized in that, S6 include: S61. Change the current dialogue context Soft strategy tips and candidate pool Input a large language model, reorder the candidate entities, and obtain a context-aware sorted list. Context-aware sorted list The highest confidence level in the top Candidate entities ; S62, Context-Aware Sorted List The remaining candidate entity list and the event memory sorting list are merged and sorted to obtain the ranking list of the remaining candidate entities. ; S63, Before Candidate entities Ranking list of remaining candidate entities The data is then merged to obtain the final recommendation list. , is represented as: .
9. The dialogue recommendation method based on event memory and pattern guidance as described in claim 8, characterized in that, In S62, for context-aware sorted lists For any remaining candidate entity in the dataset, its fusion score is: in, Indicates candidate entities In a context-aware sorted list The ranking in This indicates the rank of candidate entity y in the event memory sorting list. and These are the weights that control the two types of sorting signals. For smoothing parameters; Context-aware ranking list based on fusion score The remaining candidate entities are sorted in descending order to obtain a ranking list of the remaining candidate entities. .
10. A dialogue recommendation system based on event memory and pattern guidance, characterized in that, include: The dialogue event modeling module is used to organize historical recommendation behaviors in the training set into a searchable recommendation event memory. The module for summarizing and representing recommendation strategy patterns is used to automatically summarize recommendation strategy patterns from the recommendation event memory based on user feedback tags; The recommended strategy pattern routing module is used to retrieve the most relevant recommended strategy pattern based on the current dialogue context during the inference phase, as a soft strategy hint. The event memory candidate recall module is used to retrieve the historical recommended events that are most similar to the current dialogue context from the event memory database, identify candidate entities and sort them to obtain the event memory sorted list. The anchor co-occurrence candidate enhancement module is used to identify mentioned entities from the current dialogue context as anchor entities; based on the historical co-occurrence relationship between candidate entities and anchor entities, the final candidate score of each candidate entity is calculated, and the top K candidate entities with the highest final candidate scores are selected to form a candidate pool. The fusion ranking module is used to input the current dialogue context, soft policy hints and candidate pool into the large language model, and re-rank the candidate entities in the candidate pool to obtain a context-aware ranking list. The candidate entities are comprehensively sorted based on context-aware sorted lists and event memory sorted lists to obtain the final recommendation list.