Large model conversation method, device, computer equipment and storage medium

By combining fast and slow retrieval methods, the target retrieval vector is determined using the current user intent vector and similarity calculation, which solves the problems of performance degradation and noise signals in large model applications and achieves efficient and accurate memory retrieval.

CN122132401APending Publication Date: 2026-06-02BEIJING QIYI CENTURY SCI & TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING QIYI CENTURY SCI & TECH CO LTD
Filing Date
2026-01-14
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing large-scale model applications, using the entire history of dialogue as context leads to performance degradation and the risk of noise signals. Furthermore, in companion applications, it increases latency and affects the fluency of dialogue.

Method used

The method combines two retrieval methods: a fast retrieval method generates a second retrieval result based on the current dialogue vector, and a slow retrieval method generates a first retrieval result. The target retrieval vector is determined by calculating the current user intent vector and similarity, and then input into a pre-set large model for response.

Benefits of technology

It improves the timeliness and accuracy of memory retrieval without affecting the fluency of the conversation, solving the problem that existing memory retrieval methods cannot guarantee both timeliness and accuracy at the same time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122132401A_ABST
    Figure CN122132401A_ABST
Patent Text Reader

Abstract

This application relates to a large-scale model session method, apparatus, computer device, and storage medium. The method includes: utilizing a first search result generated in the previous search cycle based on a slow search method, and combining it with a second search result generated in the current search cycle based on a fast search method, to quickly determine a target search vector with high accuracy; using the high-accuracy first search result generated in the previous search cycle based on a slow search method, filtering out irrelevant noise in the second search result generated in the current search cycle based on a fast search method, to obtain a target search vector with high timeliness and accuracy. The target search vector is the vector corresponding to the memory search result, thereby achieving memory retrieval that is both reliable and accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of large model sessions, and more particularly to a large model session method, apparatus, computer device, and storage medium. Background Technology

[0002] In large-scale model applications, the "statelessness" of these models is a core pain point. Information needs to be conveyed through context engineering. Directly using all historical dialogues risks exceeding the input content (token) limits of large models and introducing massive amounts of noise. According to relevant research, for dialogues exceeding 100 turns, directly using all past dialogues as context leads to severe performance degradation. Therefore, for large-scale model applications with extremely long dialogues, it is necessary to retrieve the user's memory fragments that best match the current dialogue. Current mainstream frameworks mainly use the current context to simply perform vector retrieval and matching through a vector database. The problem with directly using the context as the query field is the introduction of irrelevant noise. Using a specific model to rewrite the query field before retrieval can effectively re-identify the content that truly needs to be retrieved. However, in certain scenarios, such as companion applications, directly adding query field rewriting during the retrieval process increases latency and affects the smoothness of the dialogue. Summary of the Invention

[0003] This application provides a large-scale model session method, apparatus, computer device, and storage medium to solve the problem that existing memory retrieval methods cannot achieve both timeliness and accuracy in memory retrieval.

[0004] Firstly, this application provides a large-scale model conversation method, the method comprising: When a session instruction initiated by the target session account is received, the current dialogue vector of the target session account in the current retrieval period is obtained, as well as the first retrieval result generated by retrieving the previous dialogue vector in the previous retrieval period according to the first retrieval method. The current dialogue vector is searched in the vector database according to the second search method to determine the second search result, wherein the search speed of the second search method is faster than that of the first search method. The current dialogue vector is retrieved according to the first retrieval method to generate a third retrieval result. In the process of generating the third retrieval result, a current user intent vector is also generated based on the current dialogue vector. The third retrieval result is used to participate in the next retrieval cycle. The target retrieval vector is determined based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result; The target retrieval vector is input into the preset large model as the memory retrieval result, and the output of the preset large model is fed back to the target session account as the response content.

[0005] Secondly, this application provides a large-scale model conversation apparatus, the apparatus comprising: The acquisition module is used to acquire the current dialogue vector of the target session account in the current retrieval period and the first retrieval result generated by retrieving the previous dialogue vector in the previous retrieval period according to the first retrieval method when receiving a session instruction initiated by the target session account. The first retrieval module is used to retrieve the current dialogue vector in the vector database according to the second retrieval method and determine the second retrieval result, wherein the retrieval speed of the second retrieval method is faster than that of the first retrieval method; The second retrieval module is used to retrieve the current dialogue vector according to the first retrieval method and generate a third retrieval result. In the process of generating the third retrieval result, a current user intent vector is also generated based on the current dialogue vector. The third retrieval result is used to participate in the next retrieval cycle. The processing module is used to determine the target retrieval vector based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result; The conversation module is used to input the target retrieval vector as a memory retrieval result into a preset large model, and to feed back the output of the preset large model as a response to the target conversation account.

[0006] Thirdly, this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described large model session method.

[0007] Fourthly, this application also provides a computer storage medium storing computer-executable instructions for executing the aforementioned large model session method.

[0008] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application, upon receiving a session instruction initiated by a target session account, obtains the current dialogue vector of the target session account in the current retrieval period, and a first retrieval result generated in the previous retrieval period by retrieving the previous dialogue vector according to a first retrieval method; it then retrieves the current dialogue vector in the vector database according to a second retrieval method to determine a second retrieval result, wherein the retrieval speed of the second retrieval method is faster than that of the first retrieval method; it retrieves the current dialogue vector according to the first retrieval method to generate a third retrieval result, wherein, in the process of generating the third retrieval result, a current user intent vector is also generated based on the current dialogue vector, and the third retrieval result is used to participate in the next retrieval period; based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result, a target retrieval vector is determined; the target retrieval vector is input as a memory retrieval result into a preset large model, and the output content of the preset large model is fed back to the target session account as response content.

[0009] Based on the above method, the first search result generated by the slow search method in the previous search cycle is combined with the second search result generated by the fast search method in the current search cycle to quickly determine a target search vector with high accuracy. The first search result generated by the slow search method in the previous search cycle with high accuracy is used to filter out irrelevant noise in the second search result generated by the fast search method in the current search cycle, so as to obtain a target search vector with high timeliness and high accuracy. The target search vector is the vector corresponding to the memory search result, thus realizing memory retrieval that has both timeliness and accuracy. In the process of determining the target search vector, there is no need to directly use the context as the search field or add a search field rewriting process, which will not affect the fluency of the dialogue. It also solves the problem that memory retrieval with both timeliness and accuracy cannot be performed based on existing memory retrieval methods. Attached Figure Description

[0010] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0011] 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, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0012] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0013] Figure 1 An application environment diagram of a large model conversation method provided in this application embodiment; Figure 2 A flowchart illustrating a large-model session method provided in an embodiment of this application; Figure 3 A structural block diagram of a large-scale conversation device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0016] Figure 1 This is a diagram illustrating the application environment of a large-model session method in one embodiment. (Refer to...) Figure 1 This large-model session method is applied to a large-model session system. The large-model session system includes a terminal 110 and a server 120. The terminal 110 and server 120 are connected via a network. The terminal 110 can be a desktop terminal or a mobile terminal; the mobile terminal can be at least one of a mobile phone, tablet, or laptop. The server 120 can be a standalone server or a server cluster consisting of multiple servers, and the large model is deployed on the server 120.

[0017] In one embodiment, Figure 2 This is a flowchart illustrating a large-model session method in one embodiment, with reference to... Figure 2 This provides a large-model session method. This embodiment mainly applies this method to the above-mentioned... Figure 1 Taking server 120 as an example, the large model session method specifically includes the following steps: Step S210: When receiving a session instruction initiated by the target session account, obtain the current dialogue vector of the target session account in the current retrieval period, and the first retrieval result generated by retrieving the previous dialogue vector in the previous retrieval period according to the first retrieval method.

[0018] Specifically, the current dialogue vector indicates the dialogue content between the target session account and the large model within the current retrieval period. The duration of the retrieval period can be customized according to actual application needs, such as 5 minutes, 10 minutes, 1 day, etc. The previous retrieval period generates the first retrieval result by retrieving the previous dialogue vector according to the first retrieval method. The first retrieval result includes multiple retrieval vectors, which indicate the historical session content related to the previous dialogue vector, that is, the memory content related to the previous dialogue vector that has been retrieved. The current dialogue vector contains part or all of the dialogue content corresponding to the previous dialogue vector.

[0019] Step S220: Search the current dialogue vector in the vector database according to the second search method to determine the second search result, wherein the search speed of the second search method is faster than that of the first search method.

[0020] Specifically, since the first retrieval method is slower than the second retrieval method, in order to avoid the slower retrieval speed of the first retrieval method delaying the memory retrieval response speed, the second retrieval method, which has a faster retrieval speed, is used to perform real-time retrieval processing on the current dialogue vector to obtain the second retrieval result. The retrieval field of the second retrieval method is the current dialogue content corresponding to the current dialogue vector. The second retrieval method directly uses the context as the retrieval field, so the second retrieval result may bring noise from irrelevant information.

[0021] Step S230: Search the current dialogue vector according to the first search method to generate a third search result. In the process of generating the third search result, a current user intent vector is also generated based on the current dialogue vector. The third search result is used to participate in the next search cycle.

[0022] Specifically, within the current retrieval period, a slower retrieval of the current dialogue vector is performed using the first retrieval method to obtain a more accurate third retrieval result. Since the first retrieval method is relatively slow, to improve the timeliness of memory retrieval, the third retrieval result obtained based on the slower retrieval is applied to the next retrieval period to improve the accuracy of memory retrieval in the next retrieval period. The process of generating the third retrieval result using the first retrieval method involves user intent recognition to identify and generate the current user intent vector.

[0023] Step S240: Determine the target retrieval vector based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result.

[0024] Specifically, since the second search result may contain noise from irrelevant information, in order to improve the accuracy of memory retrieval, the current user intent vector, the previous search cycle of the second search result, and the highly accurate first search result obtained based on the first search method are combined. The highly accurate first search result is used to filter the noise of the second search result, thereby deriving a target retrieval vector that satisfies the current user intent and has high accuracy. The target retrieval vector refers to the memory retrieval content that has the highest matching degree with the current dialogue vector.

[0025] Step S250: Input the target retrieval vector as a memory retrieval result into the preset large model, and feed back the output of the preset large model as the response content to the target session account.

[0026] Specifically, the most accurate target retrieval vector is used to generate response content and send it back to the target session account to respond to session commands. In summary, the first retrieval result generated in the previous retrieval cycle using a slow retrieval method is combined with the second retrieval result generated in the current retrieval cycle using a fast retrieval method to quickly determine a highly accurate target retrieval vector. The highly accurate first retrieval result generated in the previous retrieval cycle using a slow retrieval method is used to filter out irrelevant noise in the second retrieval result generated in the current retrieval cycle using a fast retrieval method, resulting in a target retrieval vector that is both timely and accurate. This target retrieval vector is the vector corresponding to the memory retrieval result, thus achieving memory retrieval that is both timely and accurate. In determining the target retrieval vector, there is no need to directly use the context as a retrieval field or add a retrieval field rewriting process, which does not affect the fluency of the conversation. It also solves the problem that existing memory retrieval methods cannot achieve both timeliness and accuracy.

[0027] In one embodiment, obtaining the current conversation vector of the target session account within the current retrieval period includes: Obtain the multi-turn conversation content corresponding to the target session account; The dialogue content of the preset round closest to the current time in the multi-round dialogue content is spliced ​​together to generate the current dialogue content; The current dialogue content is vectorized to generate the current dialogue vector.

[0028] Specifically, multi-turn dialogue content refers to the multiple interactions between the target conversation account and the large model. If all multi-turn dialogue content is used as a retrieval field, it will bring a huge amount of noise signal, resulting in a serious performance degradation. Therefore, the dialogue content of the most recent preset turn among the multi-turn dialogue content is selected and concatenated according to the timestamp. The preset turn can be determined according to the user-defined threshold, or it can be dynamically determined based on the user's historical dialogue content. In this embodiment, the preset number is set to 10, that is, the ten most recent turns of dialogue content are concatenated as the current dialogue content, and then the vector model server is used to generate the current dialogue vector corresponding to the current dialogue content.

[0029] This processing method significantly improves the accuracy and efficiency of retrieval. First, it avoids the massive noise introduced by using all multi-turn dialogue content as the retrieval field, reducing interference from irrelevant information and greatly increasing the relevance of the retrieved information to the current dialogue. Second, due to the significantly reduced data volume, the server response speed is noticeably faster, avoiding the severe performance degradation caused by processing excessive redundant information, resulting in effective performance improvement. Third, by dynamically determining the preset number of turns based on user-defined thresholds or historical dialogue content, it better adapts to different user habits and various dialogue scenarios, significantly enhancing the server's flexibility and adaptability. The generated current dialogue vector more accurately reflects the semantics and topic of the current dialogue, providing a more reliable foundation for subsequent vector-based retrieval, matching, and recommendation operations, thereby further improving the overall technical performance and user experience of the dialogue server in information retrieval and intelligent question answering.

[0030] In one embodiment, the step of retrieving the current dialogue vector according to the first retrieval method to generate a third retrieval result includes: The current dialogue vector is identified and processed using the preset large model to obtain the current user intent and the current topic; The current search field is generated using the preset large model based on the current user intent, the current topic, and the current dialogue vector; The current search field is vectorized to obtain the current search field vector, wherein the current search field vector or the vectorized result of the current user intent is used as the current user intent vector; The third search result is generated by searching the vector database according to the current search field vector.

[0031] Specifically, a pre-defined large model is used to identify and process the current dialogue vector to analyze the current user intent and current topic corresponding to it. The current user intent determines the action direction of the search, such as seeking scientific explanations or finding clues, and determines the choice of verbs in the search keywords. The current topic is used to lock in the category of the search, such as popular science knowledge or adventure exploration, and plays a role in noise reduction. Since the topic and user intent are generated before the search keywords, they become the "preconditions" for the generation of search keywords in the autoregressive sequence, thus ensuring that the generated search fields are highly aligned with the current cognitive state. The current dialogue vector provides specific entity details. The current user intent and current topic are used as preconditions for the input of the pre-defined large model to achieve semantic space convergence, conduct autoregressive guidance, and generate the current search fields together with the current dialogue vector.

[0032] The search field consists of multiple semantic phrases connected by preset delimiters, such as commas, pauses, and spaces. The search field employs a three-layer logical structure, with each layer containing at least one semantic phrase. The first layer is the background layer, containing semantic phrases corresponding to topic types and core themes, corresponding to topic indexes in the vector database. The second layer is the entity layer, containing semantic phrases corresponding to key entities and interaction relationships, corresponding to entity associations in the vector database. The third layer is the dynamic layer, containing semantic phrases describing the event context, corresponding to behavior records in the vector database. This phrase sequence structure preserves keyword matching while also providing semantic association capabilities within the vector space, making it an intermediate data format suitable for hybrid retrieval.

[0033] The vector model server generates the current search field vector corresponding to the current search field. Since the current search field vector is generated based on the current user intent, it can be directly used as the current user intent vector, or the current user intent can be vectorized and then used as the current user intent vector.

[0034] The current search field vector is used to perform a memory search in the vector database to obtain the third search result obtained by the slow search in the current search cycle. The third search result is used together with the search result obtained by the fast search in the next search cycle to obtain the final memory search result, thereby improving the timeliness and accuracy of memory search in the next search cycle.

[0035] In one embodiment, the current dialogue vector is identified using the preset large model to obtain the current user intent and the current topic, including: Obtain the previous search field generated by the target session account in the previous search cycle according to the first search method; The current dialogue content corresponding to the current dialogue vector is concatenated with the previous search field to obtain the reasoning context; The preset large model is used to parse and identify the reasoning context, and generate the current user intent and the current topic.

[0036] Specifically, the previous search field contains structured data about the user's intent and topic from the previous conversation. The current conversation content corresponding to the current conversation vector is concatenated with the previous search field to form the inference context, which includes the context of two rounds of dialogue. Utilizing the predictive capabilities of a pre-defined large model, the user's tone, predicates, and referents in the inference context are parsed and processed in the hidden layer to identify the current user intent and topic in the current retrieval cycle. This significantly improves the accuracy of intent and topic recognition, reducing misjudgments caused by missing information or misunderstandings. When faced with complex user expressions, the large model can more accurately grasp the user's true thoughts based on the information from the two rounds of dialogue context, avoiding misunderstandings. Simultaneously, this technology improves server response efficiency, allowing the server to quickly provide appropriate responses based on accurately identified intents and topics, reducing unnecessary interaction steps and providing users with a smoother and more efficient dialogue experience. It also enhances server adaptability, better handling diverse dialogue scenarios and language styles, enabling the server to stably and accurately identify user intent and topics in different contexts.

[0037] In one embodiment, determining the target retrieval vector based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result includes: Calculate the similarity between the current user intent vector and different search vectors in the first search result and the second search result respectively, and obtain the relevance score between each search vector and the current user intent vector; Based on the weighting coefficients corresponding to the source retrieval methods of each retrieval vector, the relevance scores corresponding to each retrieval vector are weighted and attenuated to obtain the attenuation scores corresponding to each retrieval vector. The deduplication process is performed on the decay scores corresponding to each of the search vectors to obtain the rearranged scores corresponding to each of the search vectors. The search vectors are sorted in descending order according to their rearrangement scores, and multiple search vectors that are ranked before a preset position are selected as target search vectors from the descending sort results.

[0038] Specifically, the first search result is a memory search result obtained based on slow retrieval in the previous search cycle, and the second search result is a memory search result obtained based on fast retrieval in the current search cycle. The memory search result contains multiple search vectors, which are used to indicate historical dialogue content. The similarity between the current user intent vector and each search vector in the first and second search results is calculated. The similarity calculation can be implemented using any one or more of the following algorithms: cosine similarity algorithm, Euclidean distance algorithm, Pearson correlation coefficient algorithm, or Tanimoto coefficient algorithm. For example, the result calculated by one of the similarity algorithms can be selected as the relevance score, or the average similarity calculated by different algorithms can be selected as the final relevance score.

[0039] The source retrieval method for each retrieval vector refers to either the first retrieval method or the second retrieval method, indicating whether the retrieval vector was generated based on a slow retrieval or a fast retrieval. Different retrieval methods correspond to different weighting coefficients. The relevance score of each retrieval vector is weighted and attenuated according to the weighting coefficient corresponding to its source retrieval method, resulting in an attenuation score for each retrieval vector. Finally, the attenuation scores of each retrieval vector are deduplicated to obtain a rearrangement score. Duplicate retrieval vectors refer to historical dialogue content retrieved from the vector database using different retrieval methods. Deduplicating duplicate historical dialogue content requires readjusting the attenuation score of the retrieval vector to obtain a rearrangement score, thereby reducing redundant information.

[0040] The retrieval vectors are sorted in descending order according to their reordering scores, and the top K retrieval vectors are selected as target retrieval vectors, i.e., the preset position is K+1, in order to extract historical memory content that is strongly related to the current user's intent and to avoid exceeding the token limit when inputting into the preset large model.

[0041] In one embodiment, the step of performing weighted attenuation processing on the relevance scores corresponding to each search vector based on the weighting coefficients corresponding to the source search methods of each search vector, to obtain the attenuation scores corresponding to each search vector, includes: Based on the weighting coefficients corresponding to the source retrieval methods of each retrieval vector, the relevance scores of each retrieval vector are weighted to obtain the weighted similarity of each retrieval vector. Based on the original ranking of each retrieval vector under the source retrieval method, the corresponding weighted similarity is attenuated to obtain the attenuation score for each retrieval vector.

[0042] Specifically, the relevance score of each retrieval vector is weighted according to the weighting coefficient corresponding to the source retrieval method of each retrieval vector, thereby obtaining the weighted similarity of each retrieval vector. That is, the weighted similarity of a retrieval vector is the product of the weighting coefficient corresponding to the source retrieval method of the retrieval vector and the relevance score of the retrieval vector.

[0043] The original ranking results are obtained by sorting the search vectors retrieved using the same source retrieval method in descending order based on their relevance scores. The original ranking of the search vector under the source retrieval method indicates its ranking in the original ranking results. For example, the original ranking of each search vector in the first search result, sorted in descending order by relevance score, is the ranking of that original ranking results.

[0044] The formula for calculating the attenuation fraction is: Here, X represents the weighted similarity, and P represents the original ranking, which is used to attenuate the weighted similarity of each search vector. The formula for calculating the attenuation score further optimizes the search results. As the original ranking increases, the denominator in the attenuation score calculation formula gradually increases, resulting in a gradual decrease in the attenuation score. This means that the weighted similarity of search vectors with lower rankings will be attenuated to a greater extent, avoiding excessive interference from low-relevance search vectors in the final results.

[0045] This attenuation process effectively balances the importance of different retrieval methods from different sources, as well as the importance of retrieval vectors with different rankings within the same source. The weighting process ensures that the influence of different retrieval methods is reasonably reflected. Different retrieval methods may have varying degrees of reliability and accuracy; by assigning appropriate weighting coefficients, more reliable and accurate retrieval methods can occupy a larger proportion of the final results, thereby improving the overall quality of the search results.

[0046] For search vectors from the same source and using the same retrieval method, the descending order based on relevance scores and the introduction of the original ranking provide a clear basis for subsequent attenuation processing. The original ranking reflects the relative importance of the search vector within that source and retrieval method; search vectors with higher rankings are generally more relevant to the query. Overall, this approach makes the search results more focused on content highly relevant to the query, improving the accuracy and efficiency of the search.

[0047] In one embodiment, the step of deduplicating the decay scores corresponding to each of the retrieval vectors to obtain the rearranged scores corresponding to each of the retrieval vectors includes: When the number of occurrences of the retrieval vector is one, the decay score of the retrieval vector is used as the rearrangement score; When the number of occurrences of the search vector is greater than one, and the source search methods of the multiple repeated search vectors are different, the decay scores of the multiple repeated search vectors are aggregated to obtain the rearrangement score corresponding to the search vector.

[0048] Specifically, if a search vector appears only once, it means that the search vector is not repeated, and its decay score is directly used as the rearrangement score. If a search vector appears more than once, it means that the search vector is repeated. Repeated search vectors correspond to different decay scores depending on the search method they were generated from, meaning that repeated search vectors correspond to multiple decay scores. Therefore, the decay scores of repeated search vectors need to be aggregated. Specifically, the average of the multiple decay scores corresponding to repeated search vectors is calculated, or a weighted average or weighted sum is performed on the corresponding decay scores according to the weighting coefficients corresponding to the source search method. This yields a unique rearrangement score for the repeated search vector, thus merging the scores of the same search vector from different search sources.

[0049] The above-described method of calculating the re-ranking score effectively integrates information from the same search vector under different retrieval scenarios. This approach significantly improves the accuracy of search result re-ranking. For search vectors that do not repeat, the decay score is directly used as the re-ranking score, avoiding unnecessary complex calculations, improving processing efficiency, and enabling the system to quickly evaluate individual search vectors. For search vectors that repeat, whether using the mean or weighted average aggregation method, the decay scores under different retrieval methods are comprehensively considered, reducing the potential bias of a single retrieval method. For example, in some retrieval scenarios, different retrieval methods may have their own advantages and disadvantages; some methods are more accurate on certain types of data, while others have a wider coverage. Through aggregation, the advantages of these different retrieval methods can be combined, making the final re-ranking score more reflective of the true value of the search vector in the overall retrieval environment. Furthermore, this method of merging scores of the same search vector from different retrieval sources helps eliminate score bias caused by differences in retrieval sources, making the re-ranking results more fair and reasonable, and providing more targeted and high-quality retrieval results for large models.

[0050] Figure 2 This is a flowchart illustrating a large-model session method in one embodiment. It should be understood that, although... Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0051] In one embodiment, such as Figure 3 As shown, a large-scale conversational device is provided, including: The acquisition module 310 is used to acquire, when receiving a session instruction initiated by the target session account, the current dialogue vector of the target session account in the current retrieval period, and the first retrieval result generated by retrieving the previous dialogue vector in the previous retrieval period according to the first retrieval method; The first retrieval module 320 is used to retrieve the current dialogue vector in the vector database according to the second retrieval method and determine the second retrieval result, wherein the retrieval speed of the second retrieval method is faster than that of the first retrieval method; The second retrieval module 330 is used to retrieve the current dialogue vector according to the first retrieval method and generate a third retrieval result. In the process of generating the third retrieval result, a current user intent vector is also generated based on the current dialogue vector. The third retrieval result is used to participate in the next retrieval cycle. Processing module 340 is used to determine the target retrieval vector based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result; The conversation module 350 is used to input the target retrieval vector as a memory retrieval result into a preset large model, and to feed back the output of the preset large model as a response to the target conversation account.

[0052] In one embodiment, the acquisition module 310 is further configured to: Obtain the multi-turn conversation content corresponding to the target session account; The dialogue content of the preset round closest to the current time in the multi-round dialogue content is spliced ​​together to generate the current dialogue content; The current dialogue content is vectorized to generate the current dialogue vector.

[0053] In one embodiment, the second retrieval module 330 is further configured to: The current dialogue vector is identified and processed using the preset large model to obtain the current user intent and the current topic; The current search field is generated using the preset large model based on the current user intent, the current topic, and the current dialogue vector; The current search field is vectorized to obtain the current search field vector, wherein the current search field vector or the vectorized result of the current user intent is used as the current user intent vector; The third search result is generated by searching the vector database according to the current search field vector.

[0054] In one embodiment, the second retrieval module 330 is further configured to: Obtain the previous search field generated by the target session account in the previous search cycle according to the first search method; The current dialogue content corresponding to the current dialogue vector is concatenated with the previous search field to obtain the reasoning context; The preset large model is used to parse and identify the reasoning context, and generate the current user intent and the current topic.

[0055] In one embodiment, the processing module 340 is further configured to: Calculate the similarity between the current user intent vector and different search vectors in the first search result and the second search result respectively, and obtain the relevance score between each search vector and the current user intent vector; Based on the weighting coefficients corresponding to the source retrieval methods of each retrieval vector, the relevance scores corresponding to each retrieval vector are weighted and attenuated to obtain the attenuation scores corresponding to each retrieval vector. The deduplication process is performed on the decay scores corresponding to each of the search vectors to obtain the rearranged scores corresponding to each of the search vectors. The search vectors are sorted in descending order according to their rearrangement scores, and multiple search vectors that are ranked before a preset position are selected as target search vectors from the descending sort results.

[0056] In one embodiment, the processing module 340 is further configured to: Based on the weighting coefficients corresponding to the source retrieval methods of each retrieval vector, the relevance scores of each retrieval vector are weighted to obtain the weighted similarity of each retrieval vector. Based on the original ranking of each retrieval vector under the source retrieval method, the corresponding weighted similarity is attenuated to obtain the attenuation score for each retrieval vector.

[0057] In one embodiment, the processing module 340 is further configured to: When the number of occurrences of the retrieval vector is one, the decay score of the retrieval vector is used as the rearrangement score; When the number of occurrences of the search vector is greater than one, and the source search methods of the multiple repeated search vectors are different, the decay scores of the multiple repeated search vectors are aggregated to obtain the rearrangement score corresponding to the search vector.

[0058] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of a device, can operate in environments such as... Figure 1 The hardware environment shown can be implemented either through software or through hardware.

[0059] like Figure 4 As shown, this application provides a computer device including a processor 711, a communication interface 712, a memory 713, and a communication bus 714. The processor 711, the communication interface 712, and the memory 713 communicate with each other through the communication bus 714. The memory 713 is used to store computer programs. When the processor 711 executes the program stored in the memory 713, it implements the large model session method provided in any of the aforementioned method embodiments.

[0060] The memory and processor in the aforementioned electronic devices communicate with each other via a communication bus and a communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc.

[0061] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0062] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0063] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0064] According to another aspect of the embodiments of this application, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of any of the above embodiments.

[0065] In one embodiment, the large-scale model session apparatus provided in this application can be implemented as a computer program, which can be implemented in, for example... Figure 4 It runs on the computer device shown. The computer device's memory can store the various program modules that make up this large model session device, for example, Figure 3 The diagram shows an acquisition module 310, a first retrieval module 320, a second retrieval module 330, a processing module 340, and a session module 350. The computer program comprised of these modules causes the processor to execute the large-scale session methods of the various embodiments of this application described in this specification.

[0066] Figure 4 The computer device shown can be used as follows Figure 3In the large-scale conversational device shown, the acquisition module 310, upon receiving a conversation instruction initiated by a target conversational account, acquires the current dialogue vector of the target conversational account in the current retrieval period, and the first retrieval result generated in the previous retrieval period by retrieving the previous dialogue vector according to a first retrieval method. The computer device can use the first retrieval module 320 to perform a retrieval of the current dialogue vector in the vector database according to a second retrieval method to determine a second retrieval result, wherein the retrieval speed of the second retrieval method is faster than that of the first retrieval method. The computer device can use the second retrieval module 330 to perform a retrieval of the current dialogue vector according to the first retrieval method to generate a third retrieval result, wherein, in the process of generating the third retrieval result, a current user intent vector is also generated based on the current dialogue vector, and the third retrieval result is used in the next retrieval period. The computer device can use the processing module 340 to determine a target retrieval vector based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result. The computer device can use the session module 350 to input the target retrieval vector as a memory retrieval result into a preset large model, and then use the output of the preset large model as a response to the target session account.

[0067] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the large model session method as provided in any of the foregoing method embodiments.

[0068] Optionally, in embodiments of this application, the computer-readable medium is configured to store program code for the processor to perform the following steps: When a session instruction initiated by the target session account is received, the current dialogue vector of the target session account in the current retrieval period is obtained, as well as the first retrieval result generated by retrieving the previous dialogue vector in the previous retrieval period according to the first retrieval method. The current dialogue vector is searched in the vector database according to the second search method to determine the second search result, wherein the search speed of the second search method is faster than that of the first search method. The current dialogue vector is retrieved according to the first retrieval method to generate a third retrieval result. In the process of generating the third retrieval result, a current user intent vector is also generated based on the current dialogue vector. The third retrieval result is used to participate in the next retrieval cycle. The target retrieval vector is determined based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result; The target retrieval vector is input into the preset large model as the memory retrieval result, and the output of the preset large model is fed back to the target session account as the response content.

[0069] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.

[0070] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.

[0071] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0072] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0073] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0074] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0075] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0076] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0077] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a USB flash drive, external hard drive, ROM, RAM, magnetic disk, or optical disk, or other media capable of storing program code, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0078] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also mean including the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that alternatives or substitutions may be used.

[0079] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement 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 present 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 claimed herein.

Claims

1. A large-model conversation method, characterized in that, The method includes: When a session instruction initiated by the target session account is received, the current dialogue vector of the target session account in the current retrieval period is obtained, as well as the first retrieval result generated by retrieving the previous dialogue vector in the previous retrieval period according to the first retrieval method. The current dialogue vector is searched in the vector database according to the second search method to determine the second search result, wherein the search speed of the second search method is faster than that of the first search method. The current dialogue vector is retrieved according to the first retrieval method to generate a third retrieval result. In the process of generating the third retrieval result, a current user intent vector is also generated based on the current dialogue vector. The third retrieval result is used to participate in the next retrieval cycle. The target retrieval vector is determined based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result; The target retrieval vector is input into the preset large model as the memory retrieval result, and the output of the preset large model is fed back to the target session account as the response content.

2. The method according to claim 1, characterized in that, The step of obtaining the current conversation vector of the target session account within the current retrieval period includes: Obtain the multi-turn conversation content corresponding to the target session account; The dialogue content of the preset round closest to the current time in the multi-round dialogue content is spliced ​​together to generate the current dialogue content; The current dialogue content is vectorized to generate the current dialogue vector.

3. The method according to claim 1, characterized in that, The step of retrieving the current dialogue vector according to the first retrieval method and generating a third retrieval result includes: The current dialogue vector is identified and processed using the preset large model to obtain the current user intent and the current topic; The current search field is generated using the preset large model based on the current user intent, the current topic, and the current dialogue vector; The current search field is vectorized to obtain the current search field vector, wherein the current search field vector or the vectorized result of the current user intent is used as the current user intent vector; The third search result is generated by searching the vector database according to the current search field vector.

4. The method according to claim 3, characterized in that, The current dialogue vector is processed using the preset large model to obtain the current user intent and current topic, including: Obtain the previous search field generated by the target session account in the previous search cycle according to the first search method; The current dialogue content corresponding to the current dialogue vector is concatenated with the previous search field to obtain the reasoning context; The preset large model is used to parse and identify the reasoning context, and generate the current user intent and the current topic.

5. The method according to claim 1, characterized in that, The step of determining the target retrieval vector based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result includes: Calculate the similarity between the current user intent vector and different search vectors in the first search result and the second search result respectively, and obtain the relevance score between each search vector and the current user intent vector; Based on the weighting coefficients corresponding to the source retrieval methods of each retrieval vector, the relevance scores corresponding to each retrieval vector are weighted and attenuated to obtain the attenuation scores corresponding to each retrieval vector. The deduplication process is performed on the decay scores corresponding to each of the search vectors to obtain the rearranged scores corresponding to each of the search vectors. The search vectors are sorted in descending order according to their rearrangement scores, and multiple search vectors that are ranked before a preset position are selected as target search vectors from the descending sort results.

6. The method according to claim 5, characterized in that, The step of performing weighted attenuation processing on the relevance scores of each retrieval vector based on the weighting coefficients corresponding to the source retrieval methods of each retrieval vector, to obtain the attenuation score of each retrieval vector, includes: Based on the weighting coefficients corresponding to the source retrieval methods of each retrieval vector, the relevance scores of each retrieval vector are weighted to obtain the weighted similarity of each retrieval vector. Based on the original ranking of each retrieval vector under the source retrieval method, the corresponding weighted similarity is attenuated to obtain the attenuation score for each retrieval vector.

7. The method according to claim 5, characterized in that, The step of deduplicating the decay scores corresponding to each of the search vectors to obtain the rearranged scores corresponding to each of the search vectors includes: When the number of occurrences of the retrieval vector is one, the decay score of the retrieval vector is used as the rearrangement score; When the number of occurrences of the search vector is greater than one, and the source search methods of the multiple repeated search vectors are different, the decay scores of the multiple repeated search vectors are aggregated to obtain the rearrangement score corresponding to the search vector.

8. A large-scale model conversation device, characterized in that, The device includes: The acquisition module is used to acquire the current dialogue vector of the target session account in the current retrieval period and the first retrieval result generated by retrieving the previous dialogue vector in the previous retrieval period according to the first retrieval method when receiving a session instruction initiated by the target session account. The first retrieval module is used to retrieve the current dialogue vector in the vector database according to the second retrieval method and determine the second retrieval result, wherein the retrieval speed of the second retrieval method is faster than that of the first retrieval method; The second retrieval module is used to retrieve the current dialogue vector according to the first retrieval method and generate a third retrieval result. In the process of generating the third retrieval result, a current user intent vector is also generated based on the current dialogue vector. The third retrieval result is used to participate in the next retrieval cycle. The processing module is used to determine the target retrieval vector based on the similarity between the current user intent vector and different retrieval vectors in the first retrieval result and the second retrieval result; The conversation module is used to input the target retrieval vector as a memory retrieval result into a preset large model, and to feed back the output of the preset large model as a response to the target conversation account.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.