Information acquisition method and device and electronic equipment

By using the prompt word content and information block subset selection technology of enhanced processing in the large language model, the problem of difficult to balance the efficiency and accuracy of reply information acquisition in the prior art is solved, and an efficient and accurate information acquisition process is achieved.

CN119807356APending Publication Date: 2025-04-11BAIDU COM TIMES TECH (BEIJING) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411845323.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

While improving the efficiency of replies information acquisition of large language models, it is difficult to ensure the accuracy of replies information, and it is often necessary to simplify the structure of the model or reduce the fixed prefix length, affecting performance.

Method used

By obtaining the content of the prompt word that has been enhanced, a subset of information blocks is generated based on multiple search information blocks in the search results, and the target subset is selected according to the number of information blocks. When determining that matching key-value information exists in the key-value cache library, reply information is generated using the large language model.

Benefits of technology

Improve the efficiency of replies information acquisition, ensure the accuracy of replies information, and does not require length reduction of fixed prefixes or structural simplification of large language models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807356A_ABST
    Figure CN119807356A_ABST
Patent Text Reader

Abstract

The invention provides an information acquisition method and device and electronic equipment, and relates to the technical field of artificial intelligence, in particular to the application fields of large language models, generative search, search engines, information retrieval, knowledge questions and answers, intelligent document editing, intelligent assistants, virtual humans and the like. According to the specific implementation scheme, the method comprises the steps of obtaining prompt word content subjected to enhancement processing; wherein the cue word content comprises a fixed prefix, a retrieval result and a variable suffix; obtaining a plurality of information block subsets based on N retrieval information blocks included in the retrieval result; selecting a target subset from the plurality of information block subsets according to the sequence of the number of the included retrieval information blocks from large to small; under the condition that it is determined that first key value information matched with target data obtained based on the fixed prefix and the target subset exists in the key value cache library, reply information for the cue word content is obtained based on the first key value information and the variable suffix; wherein the target data is obtained based on the fixed prefix and the target subset.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to application fields such as large language models, generative search, search engines, information retrieval, knowledge question and answer, intelligent document editing, intelligent assistants, virtual humans, and specifically to an information acquisition method, device, and electronic device. Background Art

[0002] Retrieval enhancement generation processing refers to the process of enhancing the prompt word content using the external knowledge obtained by retrieval. After that, the enhanced prompt word content can be input into the large language model to optimize the response information output by the large language model for the prompt word content. Summary of the invention

[0003] The present disclosure provides an information acquisition method, device and electronic device.

[0004] According to a first aspect of the present disclosure, there is provided an information acquisition method, comprising:

[0005] Obtaining enhanced prompt word content; wherein the prompt word content includes a fixed prefix, a search result, and a variable suffix;

[0006] Based on the N search information blocks included in the search results, a plurality of information block subsets are obtained; wherein N ≥ 2 and is an integer; the information block subsets include at least one search information block among the N search information blocks;

[0007] Selecting a target subset from the plurality of information block subsets in descending order of the number of search information blocks included;

[0008] When it is determined that there is first key value information matching the target data in the key value cache, a large language model is used to obtain reply information for the prompt word content based on the first key value information and a variable suffix; wherein the target data is obtained based on a fixed prefix and a target subset.

[0009] According to a second aspect of the present disclosure, there is provided an information acquisition device, comprising:

[0010] A content acquisition unit, used to acquire the prompt word content after enhanced processing; wherein the prompt word content includes a fixed prefix, a search result and a variable suffix;

[0011] A subset acquisition unit, configured to obtain a plurality of information block subsets based on the N search information blocks included in the search result; wherein N ≥ 2 and is an integer; and the information block subset includes at least one search information block among the N search information blocks;

[0012] A subset selection unit, used to select a target subset from the plurality of information block subsets in descending order of the number of search information blocks included;

[0013] The information acquisition unit is used to obtain reply information for the prompt word content based on the first key value information and the variable suffix by using a large language model when it is determined that there is first key value information matching the target data in the key value cache library; wherein the target data is obtained based on a fixed prefix and a target subset.

[0014] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0015] at least one processor;

[0016] a memory communicatively coupled to the at least one processor;

[0017] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided in the first aspect of the present disclosure.

[0018] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method provided according to the first aspect of the present disclosure.

[0019] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the method provided according to the first aspect of the present disclosure when executed by a processor.

[0020] The present disclosure can improve the efficiency of obtaining reply information while ensuring the accuracy of the reply information.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0023] Figure 1 A flowchart of an information acquisition method provided by an embodiment of the present disclosure;

[0024] Figure 2 An illustration of a complete process example of an information acquisition method provided in an embodiment of the present disclosure;

[0025] Figure 3A schematic diagram of a scenario of an information acquisition method provided by an embodiment of the present disclosure;

[0026] Figure 4 A schematic structural block diagram of an information acquisition device provided in an embodiment of the present disclosure;

[0027] Figure 5 A schematic structural block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0029] As described in the background technology, the retrieval-augmented generation (RAG) process refers to the process of enhancing the prompt word content using the external knowledge obtained by retrieval. After that, the enhanced prompt word content can be input into the large language model to optimize the reply information output by the large language model for the prompt word content. However, in this process, since the input into the large language model is the enhanced prompt word content, the data volume is large and the complexity is relatively high, which will reduce the efficiency of obtaining the reply information. In this regard, at present, it is mainly dealt with in the following ways:

[0030] (1) reducing the length of the fixed prefix included in the enhanced prompt word content;

[0031] (2) Simplify the structure of the large language model. For example, perform pruning, quantization, distillation, etc. on the large language model to reduce the size of the large language model.

[0032] However, the inventors have found that, for the above method (1), on the one hand, the accuracy of the reply information will be reduced; on the other hand, the fixed prefix included in the enhanced prompt word content itself will not be too long. Therefore, by reducing the length of the fixed prefix, it will not provide much optimization space for the efficiency of obtaining the reply information. For the above method (2), it will seriously affect the performance of the large language model, thereby reducing the accuracy of the reply information. Therefore, how to ensure the accuracy of the reply information while improving the efficiency of obtaining the reply information has become a technical problem that needs to be solved in the field of artificial intelligence technology.

[0033] In view of the above problems, the embodiments of the present disclosure provide an information acquisition method, which can be applied to an electronic device. The electronic device can be a server, a workbench, a large computer, a conventional computer (desktop computer, laptop computer, etc.) or other similar computing devices. Figure 1 The flowchart diagram shown illustrates an information acquisition method provided by an embodiment of the present disclosure. It should be noted that although the flowchart diagram shows a logical order, in some cases, the steps shown or described in the flowchart can also be performed in other orders.

[0034] Step S101, obtaining the enhanced prompt word content.

[0035] In one example, RAG processing may be performed on the prompt word content to obtain enhanced prompt word content, which may specifically include a fixed prefix, a search result, and a variable suffix.

[0036] Among them, the fixed prefix may include a prompt word (that is, a prompt word), for example, a role definition for a large language model, etc.; the retrieval result may include the retrieved external knowledge, specifically may include the retrieved external knowledge based on the fixed prefix and / or the variable suffix; the variable suffix may include the current search word (that is, the query word) of this round of question and answer, or, in addition to the current search word of this round of question and answer, the variable suffix may also include at least one of the search instructions and the above content of the current search word, and the embodiments of the present disclosure are not limited to this. Here, the large language model may be a pre-trained neural network model, which has general language knowledge, world knowledge, professional knowledge in various fields, etc., and is stored in the model in the form of parameters. In one example, the large language model may be an autoregressive generative model of the Transformer architecture.

[0037] Step S102: obtaining a plurality of information block subsets based on the N search information blocks included in the search result.

[0038] Wherein, N≥2 and is an integer.

[0039] In addition, it can be understood that in the embodiment of the present disclosure, after obtaining the search results, the search results can be often decomposed (for example, one of word segmentation processing, sentence segmentation processing and segmentation processing) to obtain N search information blocks, and based on the N search information blocks, multiple information block subsets are obtained. Among them, the information block subset includes at least one search information block among the N search information blocks, and specifically, each information block subset among the multiple information block subsets can include at least one search information block among the N search information blocks.

[0040] Step S103: selecting a target subset from the plurality of information block subsets in descending order of the number of search information blocks included.

[0041] In one example, multiple information block subsets may be traversed in descending order of the number of search information blocks included, so as to select a target subset from the multiple information block subsets, and step S104 is executed each time a target subset is selected.

[0042] Step S104, when it is determined that there is first key-value information matching the target data in the key-value cache (KV Cache) library, a large language model is used to obtain reply information for the prompt word content based on the first key-value information and the variable suffix.

[0043] Among them, the KV Cache library can be used to store key-value information collected in advance by developers, and / or to store key-value information accumulated by a large language model during the historical reasoning stage; the first key-value information may include multiple first key-value pairs (ie, Key-Value Pair), and the multiple first key-value pairs may correspond one-to-one to multiple data information blocks obtained by decomposing the target data. In addition, it should be noted that in the embodiments of the present disclosure, the target data may be obtained based on a fixed prefix and a target subset. For example, all retrieval information blocks included in the fixed prefix and the target subset may be collectively used as target data.

[0044] In the case where it is determined that the first key value information matching the target data obtained based on the fixed prefix and the target subset exists in the KV Cache library, the large language model can be used to obtain reply information for the prompt word content based on the first key value information and the variable suffix; in the case where it is determined that the first key value information matching the target data obtained based on the fixed prefix and the target subset does not exist in the KV Cache library, the process can return to step S103 and continue to select a target subset from the multiple information block subsets in the order of the number of search information blocks included from large to small, until the first key value information matching the target data obtained based on the fixed prefix and the target subset exists in the KV Cache library, the large language model is used to obtain reply information for the prompt word content based on the first key value information and the variable suffix; or, until the last information block subset is selected from the multiple information block subsets in the order of the number of search information blocks included from large to small as the target subset, and it is determined that the first key value information matching the target data obtained based on the fixed prefix and the target subset does not exist in the KV Cache library.

[0045] In addition, it should be noted that in the embodiment of the present disclosure, when the last information block subset is selected from multiple information block subsets in order from large to small in terms of the number of retrieval information blocks included, as the target subset, and when it is determined that there is no first key value information in the KV Cache library that matches the target data obtained based on the fixed prefix and the target subset, a large language model can be used to directly obtain reply information for the prompt word content based on the fixed prefix, the retrieval result and the variable suffix.

[0046] The information acquisition method provided by the embodiment of the present disclosure not only applies the KV Cache technology, but also obtains the prompt word content that has been enhanced and includes a fixed prefix, a search result and a variable suffix, and obtains multiple information block subsets based on the N search information blocks included in the search results. Then, a target subset is selected from the multiple information block subsets in order from large to small in the number of search information blocks included, and when it is determined that there is first key value information in the KV Cache library that matches the target data obtained based on the fixed prefix and the target subset, reply information for the prompt word content is obtained based on the first key value information and the variable suffix. In this way, the matching degree between the first key value information retrieved from the KV Cache library and the cacheable part (for example, the fixed prefix and the retrieval result) and the completeness of the first key value information can be improved, thereby reducing the real-time calculation amount of the large language model and improving the efficiency of obtaining the reply information (that is, reducing the output time of the first information block (that is, the first Token) in the reply information), while ensuring the accuracy of the reply information; moreover, this process involves neither reducing the length of the fixed prefix nor simplifying the structure of the large language model, and therefore can further ensure the accuracy of the reply information.

[0047] Further, in the embodiment of the present disclosure, “determining whether there is first key value information matching the target data in the KV Cache library” can be performed in the following manner:

[0048] Convert the target data using a first hash algorithm to obtain a first hash value;

[0049] When the first hash value is used as a key and a plurality of first key-value pairs corresponding to the target data are searched from the KV Cache library, first key-value information is obtained based on the plurality of first key-value pairs.

[0050] Among them, the first hash algorithm can be Message Digest Algorithm-5 (MD-5), Secure Hash Algorithm-1 (Secure Hash Algorithm-1), SHA-1, SHA-256, SHA-512 and other algorithms, which are not limited in the embodiments of the present disclosure.

[0051] In addition, it should be noted that, in the embodiment of the present disclosure, after obtaining multiple first key-value pairs, the multiple first key-value pairs can be collectively used as the first key-value information.

[0052] It should also be noted that in the embodiment of the present disclosure, since the diversity and variability of the fixed prefix are both low, in most cases, the KV Cache library may store the second key value information matching the fixed prefix, so that after obtaining the enhanced prompt word content, multiple information block subsets can be obtained directly based on the N search information blocks included in the search results, and the target subset is selected from the multiple information block subsets in the order of the number of search information blocks included from large to small, and then when it is determined that there is a first key value information matching the target data obtained based on the fixed prefix and the target subset in the KV Cache library, the large language model is used to obtain the reply information for the prompt word content based on the first key value information and the variable suffix. However, it is not ruled out that in some cases, the KV Cache library does not store the second key value information matching the fixed prefix. Based on this, in some optional implementations, step S102, that is, "obtaining multiple information block subsets based on the N search information blocks included in the search results" may include:

[0053] When it is determined that the second key value information matching the fixed prefix exists in the KV Cache library, multiple information block subsets are obtained based on the N search information blocks included in the search result.

[0054] The second key-value information may include at least one second key-value pair, and the at least one second key-value pair may correspond one-to-one to at least one prefix information block obtained by decomposing the fixed prefix.

[0055] Further, in the embodiment of the present disclosure, “determining whether there is second key value information matching the fixed prefix in the KV Cache library” can be performed in the following manner:

[0056] The fixed prefix is ​​converted by a second hash algorithm to obtain a second hash value;

[0057] When the second hash value is used as a key and at least one second key-value pair corresponding to the fixed prefix is ​​queried from the KV Cache library, the second key-value information is obtained based on the at least one second key-value pair.

[0058] The second hash algorithm may be MD-5, SHA-1, SHA-256, SHA-512, etc., which is not limited in the embodiments of the present disclosure. In addition, it should be noted that in the embodiments of the present disclosure, after obtaining multiple second key-value pairs, the multiple second key-value pairs may be used together as the second key-value information.

[0059] It should also be noted that in the embodiment of the present disclosure, when it is determined that there is no second key value information matching the fixed prefix in the KV Cache library, a large language model can be used to directly obtain reply information for the prompt word content based on the fixed prefix, search results and variable suffix.

[0060] Through the above manner, in the embodiment of the present disclosure, only when it is determined that the second key value information matching the fixed prefix exists in the KV Cache library, multiple information block subsets are obtained based on the N search information blocks included in the search results, and the target subset is selected from the multiple information block subsets in descending order of the number of search information blocks included. Then, when it is determined that the first key value information matching the target data obtained based on the fixed prefix and the target subset exists in the KV Cache library, the large language model is used to obtain reply information for the prompt word content based on the first key value information and the variable suffix, so as to avoid executing some redundant steps (for example, obtaining multiple information block subsets based on the N search information blocks included in the search results, and selecting the target subset from the multiple information block subsets in descending order of the number of search information blocks included), when the second key value information matching the fixed prefix does not exist in the KV Cache library, thereby further improving the efficiency of obtaining the reply information.

[0061] Further, in some optional implementations, “obtaining multiple information block subsets based on the N search information blocks included in the search results” may include:

[0062] Exhaustively enumerate the N search information blocks included in the search results in a combination manner to obtain a plurality of original subsets; wherein the original subset includes at least one search information block among the N search information blocks;

[0063] Based on the multiple original subsets, multiple information block subsets are obtained.

[0064] In an example, each of the plurality of original subsets may include at least one retrieval information block among the N retrieval information blocks.

[0065] Exemplarily, the value of N is 3, that is, there are 3 search information blocks, and the 3 search information blocks include A1, A2 and A3. Then, by exhaustively enumerating the combinations of the 3 search information blocks, multiple original subsets can be obtained:

[0066] {A1, A2, A3};

[0067] {A1, A2}, {A1, A3}, {A2, A3};

[0068] {A1}, {A2}, {A3}.

[0069] After obtaining multiple original subsets, multiple information block subsets can be obtained based on the multiple original subsets. In one example, the multiple original subsets can be directly used as multiple information block subsets, that is, the multiple original subsets are used as multiple information block subsets in a one-to-one correspondence. In another example, multiple information block subsets can be obtained based on the multiple original subsets in the following manner:

[0070] Determine a plurality of first original subsets and a plurality of second original subsets from the plurality of original subsets; wherein the first original subset includes one retrieval information block among the N retrieval information blocks; and the second original subset includes a plurality of retrieval information blocks among the N retrieval information blocks;

[0071] The plurality of search information blocks included in the subset to be processed are arranged in an exhaustive manner to obtain a plurality of derived subsets; wherein the subset to be processed is each second original subset in the plurality of second original subsets;

[0072] Based on the multiple first original subsets and the multiple derived subsets, multiple information block subsets are obtained.

[0073] In a specific example, each of the plurality of first original subsets may include one retrieval information block among the N retrieval information blocks; and each of the plurality of second original subsets may include multiple retrieval information blocks among the N retrieval information blocks.

[0074] Continuing with the previous example, there are multiple original subsets:

[0075] {A1, A2, A3};

[0076] {A1, A2}, {A1, A3}, {A2, A3};

[0077] {A1}, {A2}, {A3}.

[0078] The plurality of first original subsets include {A1}, {A2} and {A3}, and the plurality of second original subsets include {A1, A2, A3}, {A1, A2}, {A1, A3} and {A2, A3}.

[0079] When the second original subset {A1, A2, A3} is used as the subset to be processed, multiple retrieval information blocks included in the subset to be processed are arranged in an exhaustive manner to obtain multiple derived subsets:

[0080] {A1, A2, A3}, {A1, A3, A2}, {A2, A1, A3}, {A2, A3, A1}, {A3, A1, A2}, {A3, A2, A1}.

[0081] Similarly, each second original subset except the second original subset {A1, A2, A3} in the plurality of second original subsets can be used as a subset to be processed, and the plurality of search information blocks included in the subset to be processed are arranged in an exhaustive manner to obtain a plurality of derived subsets:

[0082] {A1, A2}, {A2, A1}, {A1, A3}, {A3, A1}, {A2, A3}, {A3, A2}.

[0083] Finally, multiple information block subsets can be obtained based on multiple first original subsets and multiple derived subsets. For example, multiple first original subsets and multiple derived subsets corresponding to each second original subset in multiple second original subsets can be used as multiple information block subsets, that is, multiple information block subsets can be obtained:

[0084] {A1, A2, A3}, {A1, A3, A2}, {A2, A1, A3}, {A2, A3, A1}, {A3, A1, A2}, {A3, A2, A1};

[0085] {A1, A2}, {A2, A1}, {A1, A3}, {A3, A1}, {A2, A3}, {A3, A2};

[0086] {A1}, {A2}, {A3}.

[0087] Through the above manner, in the embodiment of the present disclosure, the N search information blocks included in the search result can be exhaustively enumerated in a combination manner to obtain multiple original subsets, and multiple information block subsets can be obtained based on the multiple original subsets. For example, multiple first original subsets and multiple second original subsets can be determined from multiple original subsets, and each second original subset in the multiple second original subsets can be used as a subset to be processed, and the multiple search information blocks included in the subset to be processed are exhaustively enumerated in an arrangement manner to obtain multiple derivative subsets, and then multiple information block subsets are obtained based on the multiple first original subsets and the multiple derivative subsets. In this way, more information block subsets can be obtained as much as possible to improve the probability of selecting a target subset from multiple information block subsets in the order of the number of search information blocks included from large to small, and successfully querying the first key value information matching the target data obtained based on the fixed prefix and the target subset from the KV Cache library, thereby reducing the real-time calculation amount of the large language model to a greater extent, so as to further improve the efficiency of obtaining reply information.

[0088] After obtaining multiple information block subsets based on the N search information blocks included in the search results, as a first optional implementation, a target subset can be directly selected from the multiple information block subsets in descending order of the number of search information blocks included.

[0089] Continuing with the above example, the plurality of information block subsets (specifically 15 information block subsets) include:

[0090] {A1, A2, A3}, {A1, A3, A2}, {A2, A1, A3}, {A2, A3, A1}, {A3, A1, A2}, {A3, A2, A1};

[0091] {A1, A2}, {A2, A1}, {A1, A3}, {A3, A1}, {A2, A3}, {A3, A2};

[0092] {A1}, {A2}, {A3}.

[0093] By sorting the 15 information block subsets in descending order of the number of search information blocks they include, we can obtain:

[0094] {A1, A2, A3} = {A1, A3, A2} = {A2, A1, A3} = {A2, A3, A1} = {A3, A1, A2} = {A3, A2, A1}>{A1, A2}={A2, A1}={A1, A3}={A3, A1}={A2, A3}={A3, A2}>{A1}={A2}={A3}.

[0095] Finally, the target subset can be selected from the 15 information block subsets according to the above sequence.

[0096] In the above manner, in the embodiment of the present disclosure, the target subset can be directly selected from multiple information block subsets in the order of the number of search information blocks included from large to small. In this process, no cumbersome calculation process is involved, so the efficiency of obtaining reply information can be further improved.

[0097] After obtaining multiple information block subsets based on the N search information blocks included in the search results, as a second optional implementation, a target subset may also be selected from the multiple information block subsets in the following manner:

[0098] dividing all information block subsets including the same number of search information blocks among the plurality of information block subsets into one information block subset group to obtain a plurality of information block subset groups;

[0099] Selecting a target subset group from the plurality of information block subset groups in descending order of the number of corresponding retrieval information blocks;

[0100] A target subset is selected from the target subset group according to the order of similarity between the included information block subset and the N search information blocks from high to low.

[0101] In one example, for a certain information block subset (hereinafter referred to as the subset to be evaluated for convenience of description), the similarity between it and N search information blocks can be obtained in the following manner:

[0102] Determining the order of each pair of retrieval information blocks in the N retrieval information blocks;

[0103] Based on the order of each pair of retrieval information blocks in the N retrieval information blocks, obtaining the degree of disorder of the order of the subset to be evaluated;

[0104] Based on the degree of disorder of the order of the subset to be evaluated, the similarity between the subset to be evaluated and the N search information blocks is obtained.

[0105] Among them, the degree of disorder of the order of the subset to be evaluated can be characterized as:

[0106] ODI=X1 / X2

[0107] Here, X2 is used to represent the total number of pairs of search information blocks in the subset to be evaluated; X1 is used to represent the total number of pairs of search information blocks in the subset to be evaluated whose order is disrupted.

[0108] After obtaining the degree of order disruption of the subset to be evaluated, a characterization value that is negatively correlated with the degree of order disruption of the subset to be evaluated can be obtained as the similarity between the subset to be evaluated and the N search information blocks. Based on this, it can be understood that in the embodiment of the present disclosure, the greater the degree of order disruption of the subset to be evaluated, the smaller the similarity between the subset to be evaluated and the N search information blocks; the smaller the degree of order disruption of the subset to be evaluated, the greater the similarity between the subset to be evaluated and the N search information blocks.

[0109] Continuing with the above example, the value of N is 3, that is, there are 3 search information blocks, and the 3 search information blocks include A1, A2 and A3. Based on the 3 search information blocks, the obtained multiple information block subsets (specifically 15 information block subsets) include:

[0110] {A1, A2, A3}, {A1, A3, A2}, {A2, A1, A3}, {A2, A3, A1}, {A3, A1, A2}, {A3, A2, A1};

[0111] {A1, A2}, {A2, A1}, {A1, A3}, {A3, A1}, {A2, A3}, {A3, A2};

[0112] {A1}, {A2}, {A3}.

[0113] After all the information block subsets including the same number of search information blocks in the 15 information block subsets are divided into one information block subset group, three information block subset groups can be obtained:

[0114] The first information block subset group (the corresponding number of search information blocks is 3): {A1, A2, A3}, {A1, A3, A2}, {A2, A1, A3}, {A2, A3, A1}, {A3, A1, A2}, {A3, A2, A1};

[0115] The second information block subset group (the corresponding number of search information blocks is 2): {A1, A2}, {A2, A1}, {A1, A3}, {A3, A1}, {A2, A3}, {A3, A2};

[0116] The third information block subset group (the corresponding number of search information blocks is 1): {A1}, {A2}, {A3}.

[0117] After that, the three information block subset groups are sorted in descending order according to the corresponding number of search information blocks, and the following can be obtained:

[0118] The first information block subset group>the second information block subset group>the third information block subset group.

[0119] That is to say, when selecting a target subset group from three information block subset groups, the first information block subset group is preferentially selected as the target subset group, and the target subset is selected from the target subset group in order of the similarity between the included information block subset and the three retrieval information blocks (i.e., A1, A2 and A3) from high to low.

[0120] For example, when the information block subset {A1, A2, A3} is used as the subset to be evaluated, the total number of pairs of retrieved information blocks in the subset to be evaluated is 3 (that is, A1&A2, A1&A3, A2&A3), and the total number of pairs of retrieved information blocks in the subset to be evaluated that are disrupted is 0. Therefore, the degree of disorder in the order of the subset to be evaluated is 0 / 3=0. For another example, when the information block subset {A1, A3, A2} is used as the subset to be evaluated, the total number of pairs of retrieved information blocks in the subset to be evaluated is 3 (that is, A1&A3, A1&A2, A3&A 2), the total number of pairs of retrieval information blocks whose order is disrupted in the subset to be evaluated is 1 (that is, A3&A2), so the degree of order disruption of the subset to be evaluated is 1 / 3; for another example, when the information block subset {A2, A1, A3} is used as the subset to be evaluated, the total number of pairs of retrieval information blocks in the subset to be evaluated is 3 (that is, A2&A1, A2&A3, A1&A3), the total number of pairs of retrieval information blocks whose order is disrupted in the subset to be evaluated is 1 (that is, A2&A1), so the degree of order disruption of the subset to be evaluated is 1 / 3. Similarly, when the information block subset {A2, A3, A1} is used as the subset to be evaluated, the degree of order disruption of the subset to be evaluated is 2 / 3; when the information block subset {A3, A1, A2} is used as the subset to be evaluated, the degree of order disruption of the subset to be evaluated is 2 / 3; when the information block subset {A3, A2, A1} is used as the subset to be evaluated, the degree of order disruption of the subset to be evaluated is 3 / 3.

[0121] After obtaining the degree of disorder of the order of the subset to be evaluated, a characterization value negatively correlated with the degree of disorder of the order of the subset to be evaluated can be obtained as the similarity between the subset to be evaluated and the N search information blocks. Therefore, by sorting the six information block subsets included in the target subset group in the order of the similarity between the included information block subsets and the three search information blocks from high to low, it can be obtained that: {A1, A2, A3}>{A1, A3, A2}={A2, A1, A3}>{A2, A3, A1}={A3, A1, A2}>{A3, A2, A1}.

[0122] Similarly, when the second information block subset group is selected as the target subset group, the six information block subsets included in the target subset group are sorted in descending order of similarity between the included information block subsets and the three search information blocks, and the following can be obtained:

[0123] {A1, A2}={A1, A3}={A2, A3}>{A2, A1}={A3, A1}={A3, A2}

[0124] When the third information block subset group is selected as the target subset group, the three information block subsets included in the target subset group are sorted in descending order of similarity between the included information block subsets and the three search information blocks, and the following can be obtained:

[0125] {A1}={A2}={A3}.

[0126] That is, the target subset can be selected from the 15 information block subsets in the following order:

[0127] {A1, A2, A3}>{A1, A3, A2}={A2, A1, A3}>{A2, A3, A1}={A3, A1, A2}>{A3, A2, A1}>{A1, A2}={A1, A3}={A2, A3}>{A2, A1}={A3, A1}={A3, A2}>{A1}={A2}={A3}.

[0128] Through the above method, in the embodiment of the present disclosure, all information block subsets including the same number of search information blocks in multiple information block subsets can be divided into one information block subset group to obtain multiple information block subset groups, and a target subset group is selected from the multiple information block subset groups in the order of the corresponding number of search information blocks from large to small, and then a target subset is selected from the target subset group in the order of the similarity between the included information block subset and the N search information blocks from high to low. In this way, the matching degree between the first key value information queried from the KV Cache library and the cacheable part (for example, the fixed prefix and the search result) can be further improved, thereby further ensuring the accuracy of the reply information.

[0129] In some optional implementations, step S104, i.e., "using the large language model to obtain reply information for the prompt word content based on the first key value information and the variable suffix" may include:

[0130] In the case where there is at least one remaining information block not included in the target subset in the N search information blocks, using the large language model to obtain supplementary key information based on the first key information and the at least one remaining information block;

[0131] Using a large language model, based on the first key value information, the supplementary key value information and the variable suffix, the reply information for the prompt word content is obtained.

[0132] The supplementary key-value information may include at least one supplementary key-value pair, and the at least one supplementary key-value pair may correspond one-to-one to the at least one remaining information block.

[0133] Exemplarily, at least one residual information block includes a first residual information block and a second residual information block. Then, a large language model can be used to obtain a first supplementary key-value pair corresponding to the first residual information block based on the first residual information block and the first key-value information, and a large language model can be used to obtain a second supplementary key-value pair corresponding to the second residual information block based on the second residual information, the first key-value information and the first supplementary key-value pair, and then the first supplementary key-value pair and the second supplementary key-value pair are used together as supplementary key-value information. For example, using a large language model and applying a computational optimization (Prefilling) technology, a first supplementary key-value pair corresponding to the first residual information block is obtained based on the first residual information block and the first key-value information. Using a large language model and applying a computational optimization technology, a second supplementary key-value pair corresponding to the second residual information block is obtained based on the second residual information, the first key-value information and the first supplementary key-value pair. The first supplementary key-value pair and the second supplementary key-value pair are used together as supplementary key-value information. After that, the large language model can be used to obtain the response information for the prompt word content based on the first key value information, the supplementary key value information and the variable suffix. For example, the large language model can be used to continue to apply the computational optimization technology, based on the first key value information and the supplementary key value information, and the M suffix information blocks obtained by decomposing the variable suffix, to obtain the suffix key value information, and the memory optimization (Decoding) technology can be applied to obtain the response information for the prompt word content based on the first key value information, the supplementary key value information and the suffix key value information. Where M ≥ 2 and is an integer.

[0134] In addition, in the embodiment of the present disclosure, after the supplementary key-value information is obtained, the supplementary key-value information may also be stored in the KV Cache library to achieve expansion of the KV Cache library.

[0135] Through the above manner, in the embodiment of the present disclosure, when there is at least one remaining information block that is not included in the target subset among the N search information blocks, the large language model can be used to obtain supplementary key information based on the first key information and the at least one remaining information block, and the large language model can be used to obtain reply information for the prompt word content based on the supplementary key information and the variable suffix to further ensure the accuracy of the reply information; and after obtaining the supplementary key information, the supplementary key information can also be stored in the KV Cache library to expand the KV Cache library, thereby improving the effectiveness of the information acquisition method in subsequent applications.

[0136] In addition, it should be noted that in the embodiment of the present disclosure, when it is determined that there is first key value information matching the target data in the KV Cache library, and there is no remaining information block in the N search information blocks that is not included in the target subset, a large language model can be used to obtain supplementary key value information directly based on the first key value information and the variable suffix, which will not be elaborated here.

[0137] The following will be combined Figure 2 , a complete process example of an information acquisition method provided by an embodiment of the present disclosure is described.

[0138] First, the enhanced prompt word content can be obtained.

[0139] In one example, RAG processing may be performed on the prompt word content to obtain enhanced prompt word content, which may specifically include a fixed prefix, a search result, and a variable suffix.

[0140] Among them, the fixed prefix may include a prompt word, for example, a role definition for a large language model, etc.; the retrieval result may include retrieved external knowledge, specifically may include retrieved external knowledge based on the fixed prefix and / or variable suffix; the variable suffix may include the current search term for this round of question and answer, or, in addition to the current search term for this round of question and answer, may also include at least one of the search instruction and the above content of the current search term, and the embodiments of the present disclosure are not limited to this.

[0141] Thereafter, the search results may be decomposed (e.g., one of word segmentation, sentence segmentation, and segmentation) to obtain N search information blocks, and the variable suffix may be decomposed to obtain M suffix information blocks. Exemplarily, the fixed prefix is ​​a; the value of N is 3, and the 3 search information blocks include b, c, and d; the value of M is 2, and the 2 suffix information blocks include e and f.

[0142] In the disclosed embodiment, since the diversity and variability of the fixed prefix are relatively low, in most cases, the KV Cache library may store second key value information matching the fixed prefix. This allows, after obtaining the enhanced prompt word content and decomposing the search results to obtain N search information blocks, to obtain multiple information block subsets directly based on the N search information blocks included in the search results, and to select a target subset from the multiple information block subsets in descending order of the number of search information blocks included.

[0143] Continuing with the above example, N search information (specifically 3 search information blocks) include b, c and d. Based on these 3 search information blocks, the obtained multiple information block subsets (specifically 7 information block subsets) may include {b, c, d}, {b, c}, {b, d}, {c, d}, {b}, {c} and {d}. By sorting the 7 information block subsets in descending order of the number of search information blocks included, we can obtain:

[0144] {b,c,d}>{b,c}={b,d}={c,d}>{b}={c}={d}.

[0145] For example, if the current selection is for the first round of 7 information block subsets, {b, c, d} can be selected from the 7 information block subsets as the target subset; for another example, if the current selection is for the second round of 7 information block subsets, {b, c} can be selected from the 7 information block subsets as the target subset; for another example, if the current selection is for the third round of 7 information block subsets, {b, d} can be selected from the 7 information block subsets as the target subset.

[0146] Each time a target subset is selected, the target data is obtained based on the fixed prefix and the target subset. Thereafter, when it is determined that the first key value information matching the target data exists in the KV Cache library, the large language model can be used to obtain response information for the prompt word content based on the first key value information and the variable suffix (specifically, when there is at least one remaining information block not included in the target subset in the N retrieval information blocks, the large language model can be used to obtain supplementary key value information based on the first key value information and at least one remaining information block, and the large language model can be used to obtain response information for the prompt word content based on the first key value information, the supplementary key value information and the variable suffix); when it is determined that the first key value information matching the target data does not exist in the KV Cache library, the next round of selection for multiple information block subsets can be performed, that is, the target subset can be selected from multiple information block subsets in the order of the number of retrieval information blocks included from large to small, until the KV is determined. In the case where there is first key value information matching the target data obtained based on the fixed prefix and the target subset in the Cache library, the large language model is used to obtain the reply information for the prompt word content based on the first key value information and the variable suffix; or, until the last information block subset is selected from multiple information block subsets in the order of the number of search information blocks included from large to small as the target subset, and it is determined that there is no first key value information matching the target data obtained based on the fixed prefix and the target subset in the KV Cache library. It should be noted that in the embodiment of the present disclosure, in the case where the last information block subset is selected from multiple information block subsets in the order of the number of search information blocks included from large to small as the target subset, and it is determined that there is no first key value information matching the target data obtained based on the fixed prefix and the target subset in the KV Cache library, the large language model can be used to directly obtain the reply information for the prompt word content based on the fixed prefix, the search result and the variable suffix.

[0147] Continuing with the above example, assume that, in the first round of selection for the 7 information block subsets, {b, c, d} is selected from the 7 information block subsets as the target subset, and, after obtaining the target data {a, b, c, d} based on the fixed prefix a and the target subset {b, c, d}, it is determined that the first key value information matching the target data {a, b, c, d} does not exist in the KV Cache library. Therefore, a second round of selection for the 7 information block subsets is required, that is, {b, c} is selected from the 7 information block subsets as the target subset, and the target data {a, b, c} is obtained based on the fixed prefix a and the target subset {b, c}.

[0148] Assume again that there is first key value information matching the target data {a, b, c} in the KV Cache library. Then, since there is at least one remaining information block not included in the target subset {b, c} in the three retrieval information blocks, that is, d, the large language model can be used to obtain supplementary key value information based on the first key value information and at least one remaining information block (that is, d), and the large language model can be used to obtain reply information for the prompt word content based on the first key value information, the supplementary key value information and the variable suffix. Specifically, a large language model can be used and computational optimization technology can be applied to obtain a first supplementary key-value pair corresponding to the remaining information block d as supplementary key-value information based on the remaining information block d and the first key-value information; a large language model can be used and computational optimization technology can be applied to obtain a first suffix key-value pair based on the first key-value information, the supplementary key-value information, and the suffix information block e obtained by decomposing the variable suffix; a large language model can be used and computational optimization technology can be applied to obtain a second suffix key-value pair based on the first key-value information, the supplementary key-value information, the first suffix key-value pair, and the suffix information block f obtained by decomposing the variable suffix; the first suffix key-value pair and the second suffix key-value pair are used together as suffix key-value pair information; and memory optimization technology can be applied to obtain reply information for the prompt word content based on the first key-value information, the supplementary key-value information, and the suffix key-value information.

[0149] In addition, in the embodiment of the present disclosure, after the supplementary key-value information is obtained, the supplementary key-value information may also be stored in the KV Cache library to achieve expansion of the KV Cache library.

[0150] The information acquisition method provided by the embodiment of the present disclosure not only applies the KV Cache technology, but also obtains the prompt word content that has been enhanced and includes a fixed prefix, a search result and a variable suffix, and obtains multiple information block subsets based on the N search information blocks included in the search results. Then, a target subset is selected from the multiple information block subsets in order from large to small in the number of search information blocks included, and when it is determined that there is first key value information in the KV Cache library that matches the target data obtained based on the fixed prefix and the target subset, reply information for the prompt word content is obtained based on the first key value information and the variable suffix. In this way, the matching degree between the first key value information retrieved from the KV Cache library and the cacheable part (for example, the fixed prefix and the retrieval result) and the completeness of the first key value information can be improved, thereby reducing the real-time calculation amount of the large language model to improve the efficiency of obtaining the reply information (that is, reducing the output time of the first information block (that is, the first Token) in the reply information) while ensuring the accuracy of the reply information; moreover, this process involves neither reducing the length of the fixed prefix nor simplifying the structure of the large language model, and therefore can further ensure the accuracy of the reply information.

[0151] In addition, in the embodiments of the present disclosure, the electronic device to which the information acquisition method is applied only needs to have more memory space, without the need to increase video memory or have a higher performance graphics processing unit (GPU), and therefore has a lower cost.

[0152] For the specific functions and examples of each step in the embodiments of the present disclosure, please refer to the relevant descriptions of the corresponding steps in the aforementioned information acquisition method embodiments, which will not be repeated here.

[0153] See also Figure 3 , which is a scenario diagram of an information acquisition method provided in an embodiment of the present disclosure.

[0154] As mentioned above, the information acquisition method provided by the embodiment of the present disclosure is applied to an electronic device, wherein the electronic device may be a server, a workbench, a large computer, a conventional computer or other similar computing devices.

[0155] Electronic devices are used for:

[0156] Obtaining prompt word content; wherein the prompt word content includes a fixed prefix, a search result, and a variable suffix;

[0157] Based on the N search information blocks included in the search results, a plurality of information block subsets are obtained; wherein N ≥ 2 and is an integer; the information block subsets include at least one search information block among the N search information blocks;

[0158] Selecting a target subset from the plurality of information block subsets in descending order of the number of search information blocks included;

[0159] When it is determined that there is first key value information matching the target data in the KV Cache library, reply information for the prompt word content is obtained based on the first key value information and the variable suffix; wherein the target data is obtained based on the fixed prefix and the target subset.

[0160] It should be noted that in the embodiments of the present disclosure, Figure 3 The scene diagram shown is only illustrative and not restrictive. Those skilled in the art can Figure 3 Various obvious changes and / or substitutions are made to the examples, and the obtained technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0161] In order to better implement the information acquisition method, the embodiment of the present disclosure also provides an information acquisition device 400, which can be integrated in an electronic device. The electronic device can be a server, a workbench, a large computer, a conventional computer or other similar computing device 400. Figure 4 The schematic structural block diagram shown is used to illustrate an information acquisition device 400 provided in the disclosed embodiment.

[0162] The information acquisition device 400 includes:

[0163] The content acquisition unit 401 is used to acquire the prompt word content after enhanced processing; wherein the prompt word content includes a fixed prefix, a search result and a variable suffix;

[0164] The subset acquisition unit 402 is used to obtain multiple information block subsets based on the N search information blocks included in the search result; wherein N ≥ 2 and is an integer; the information block subset includes at least one search information block among the N search information blocks;

[0165] A subset selection unit 403, configured to select a target subset from the plurality of information block subsets in descending order of the number of search information blocks included;

[0166] The information acquisition unit 404 is used to obtain reply information for the prompt word content based on the first key value information and the variable suffix by using a large language model when it is determined that there is first key value information matching the target data in the KV Cache library; wherein the target data is obtained based on a fixed prefix and a target subset.

[0167] In some optional implementations, the subset acquisition unit 402 is used to:

[0168] When it is determined that the second key value information matching the fixed prefix exists in the KV Cache library, multiple information block subsets are obtained based on the N search information blocks included in the search result.

[0169] In some optional implementations, the subset acquisition unit 402 is used to:

[0170] Exhaustively enumerate the N search information blocks included in the search results in a combination manner to obtain a plurality of original subsets; wherein the original subset includes at least one search information block among the N search information blocks;

[0171] Based on the multiple original subsets, multiple information block subsets are obtained.

[0172] In some optional implementations, the subset acquisition unit 402 is used to:

[0173] Determine a plurality of first original subsets and a plurality of second original subsets from the plurality of original subsets; wherein the first original subset includes one retrieval information block among the N retrieval information blocks; and the second original subset includes a plurality of retrieval information blocks among the N retrieval information blocks;

[0174] The plurality of search information blocks included in the subset to be processed are arranged in an exhaustive manner to obtain a plurality of derived subsets; wherein the subset to be processed is each second original subset in the plurality of second original subsets;

[0175] Based on the multiple first original subsets and the multiple derived subsets, multiple information block subsets are obtained.

[0176] In some optional implementations, the subset selection unit 403 is used to:

[0177] dividing all information block subsets including the same number of search information blocks among the plurality of information block subsets into one information block subset group to obtain a plurality of information block subset groups;

[0178] Selecting a target subset group from the plurality of information block subset groups in descending order of the number of corresponding retrieval information blocks;

[0179] A target subset is selected from the target subset group according to the order of similarity between the included information block subset and the N search information blocks from high to low.

[0180] In some optional implementations, the information acquisition unit 404 is used to:

[0181] In the case where there is at least one remaining information block not included in the target subset in the N search information blocks, using the large language model to obtain supplementary key information based on the first key information and the at least one remaining information block;

[0182] Using a large language model, based on the first key value information, the supplementary key value information and the variable suffix, the reply information for the prompt word content is obtained.

[0183] In some optional implementations, the information acquisition device 400 further includes an information storage unit, which is used to:

[0184] Store the supplementary key-value information in the KV Cache library.

[0185] In the embodiment of the present disclosure, the specific functions and examples of each unit in the information acquisition device 400 can refer to the relevant descriptions of the corresponding steps in the aforementioned information acquisition method embodiment, and will not be repeated here.

[0186] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0187] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0188] Figure 5A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as vehicle-mounted computing devices, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0189] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 to a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0190] A number of components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of renderers, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0191] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a GPU, various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as information acquisition methods. For example, in some embodiments, the information acquisition method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps in the information acquisition method described above may be executed. Alternatively, in other embodiments, the computing unit 501 may be configured as the information acquisition method in any other appropriate manner (eg, by means of firmware).

[0192] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0193] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0194] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM) or a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0195] To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having: a rendering device (e.g., a cathode ray tube (CRT) renderer or a liquid crystal display (LCD)) for rendering information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices are also used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0196] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN), and the Internet.

[0197] The computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0198] The embodiment of the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the information acquisition method.

[0199] The embodiment of the present disclosure also provides a computer program product, including a computer program, which implements the information acquisition method when executed by a processor.

[0200] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in the present disclosure can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and this document is not limited here. In addition, in the present disclosure, relational terms such as "first", "second", "third", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. In addition, "multiple" in the present disclosure can be understood as at least two.

[0201] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for obtaining information, comprising: Acquire the enhanced prompt word content; wherein the prompt word content includes a fixed prefix, a search result, and a variable suffix; Based on the N search information blocks included in the search result, a plurality of information block subsets are obtained; wherein N ≥ 2 and is an integer; the information block subsets include at least one search information block among the N search information blocks; Selecting a target subset from the plurality of information block subsets in descending order of the number of search information blocks included; When it is determined that there is first key-value information matching the target data in the key-value cache, a large language model is used to obtain reply information for the prompt word content based on the first key-value information and the variable suffix; wherein the target data is obtained based on the fixed prefix and the target subset.

2. The method according to claim 1, wherein: The obtaining of a plurality of information block subsets based on the N search information blocks included in the search result includes: In the case where it is determined that the key-value cache contains second key-value information matching the fixed prefix, multiple information block subsets are obtained based on the N search information blocks included in the search result.

3. The method according to claim 1 or 2, wherein: The obtaining of a plurality of information block subsets based on the N search information blocks included in the search result includes: Exhaustively enumerate the N search information blocks included in the search result in a combination manner to obtain a plurality of original subsets; wherein the original subset includes at least one search information block among the N search information blocks; Based on the multiple original subsets, multiple information block subsets are obtained.

4. The method according to claim 3, wherein: The obtaining of a plurality of information block subsets based on the plurality of original subsets comprises: Determine a plurality of first original subsets and a plurality of second original subsets from the plurality of original subsets; wherein the first original subset includes one retrieval information block among the N retrieval information blocks; and the second original subset includes a plurality of retrieval information blocks among the N retrieval information blocks; The plurality of search information blocks included in the subset to be processed are arranged in an exhaustive manner to obtain a plurality of derived subsets; wherein the subset to be processed is each second original subset in the plurality of second original subsets; Based on the plurality of first original subsets and the plurality of derived subsets, a plurality of information block subsets are obtained.

5. The method according to claim 1, wherein: The step of selecting a target subset from the plurality of information block subsets in descending order of the number of search information blocks included includes: dividing all information block subsets including the same number of search information blocks in the plurality of information block subsets into one information block subset group to obtain a plurality of information block subset groups; Selecting a target subset group from the plurality of information block subset groups in descending order of the number of corresponding search information blocks; A target subset is selected from the target subset group according to the order of similarity between the included information block subsets and the N search information blocks from high to low.

6. The method according to claim 1, wherein: The using of the large language model to obtain reply information for the prompt word content based on the first key value information and the variable suffix includes: In the case where there is at least one remaining information block not included in the target subset in the N search information blocks, using a large language model to obtain supplementary key information based on the first key information and the at least one remaining information block; Using a large language model, based on the first key value information, the supplementary key value information and the variable suffix, reply information for the prompt word content is obtained.

7. The method according to claim 6, further comprising: The supplementary key-value information is stored in the key-value cache.

8. An information acquisition device, comprising: A content acquisition unit, used to acquire the prompt word content after enhanced processing; wherein the prompt word content includes a fixed prefix, a search result and a variable suffix; A subset acquisition unit, configured to obtain a plurality of information block subsets based on the N search information blocks included in the search result; wherein N ≥ 2 and is an integer; and the information block subset includes at least one search information block among the N search information blocks; A subset selection unit, configured to select a target subset from the plurality of information block subsets in descending order of the number of search information blocks included; The information acquisition unit is used to obtain reply information for the prompt word content based on the first key-value information and the variable suffix by using a large language model when it is determined that there is first key-value information matching the target data in the key-value cache library; wherein the target data is obtained based on the fixed prefix and the target subset.

9. The device according to claim 8, wherein: The subset acquisition unit is used for: In the case where it is determined that the key-value cache contains second key-value information matching the fixed prefix, multiple information block subsets are obtained based on the N search information blocks included in the search result.

10. The device according to claim 8 or 9, wherein: The subset acquisition unit is used for: Exhaustively enumerate the N search information blocks included in the search result in a combination manner to obtain a plurality of original subsets; wherein the original subset includes at least one search information block among the N search information blocks; Based on the multiple original subsets, multiple information block subsets are obtained.

11. The device according to claim 10, wherein: The subset acquisition unit is used for: Determine a plurality of first original subsets and a plurality of second original subsets from the plurality of original subsets; wherein the first original subset includes one retrieval information block among the N retrieval information blocks; and the second original subset includes a plurality of retrieval information blocks among the N retrieval information blocks; The plurality of search information blocks included in the subset to be processed are arranged in an exhaustive manner to obtain a plurality of derived subsets; wherein the subset to be processed is each second original subset in the plurality of second original subsets; Based on the plurality of first original subsets and the plurality of derived subsets, a plurality of information block subsets are obtained.

12. The device according to claim 8, wherein: The subset selection unit is used for: dividing all information block subsets including the same number of search information blocks in the plurality of information block subsets into one information block subset group to obtain a plurality of information block subset groups; Selecting a target subset group from the plurality of information block subset groups in descending order of the number of corresponding search information blocks; A target subset is selected from the target subset group according to the order of similarity between the included information block subsets and the N search information blocks from high to low.

13. The device according to claim 8, wherein: The information acquisition unit is used for: In the case where there is at least one remaining information block not included in the target subset in the N search information blocks, using a large language model to obtain supplementary key information based on the first key information and the at least one remaining information block; Using a large language model, based on the first key value information, the supplementary key value information and the variable suffix, reply information for the prompt word content is obtained.

14. The device according to claim 13, further comprising an information storage unit, configured to: The supplementary key-value information is stored in the key-value cache.

15. An electronic device, comprising: at least one processor; a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

17. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Method and device for generating question and answer response, storage medium and electronic equipment

    CN120277198A