Method for optimizing model, device, medium and program product

By optimizing the sample set, the query model was improved to provide a standardized output format, thus resolving the issue of disordered output format and enhancing the user experience.

WO2026044544A1PCT designated stage Publication Date: 2026-03-05BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

The existing query model has a disordered output format, which makes it difficult for users to accurately understand the source of the query results, making it difficult to trace the source and obtain more information.

Method used

By obtaining an optimized sample set, each sample in the optimized sample set includes a query request sample, a sample query result, and at least one sample reference source, the model is associated with the corresponding part of the sample query result based on a specified output format, and the model is optimized to obtain an optimized model that can provide a standardized output format.

Benefits of technology

This enables the model to provide a standardized output format, making it easier for users to understand the source of query results, allowing users to trace the source and obtain more relevant information, thus improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024115178_05032026_PF_FP_ABST
    Figure CN2024115178_05032026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present disclosure are a method for optimizing a model, a device, a storage medium and a computer program product. The method comprises: acquiring an optimization sample set, each optimization sample in the optimization sample set comprising a query request sample, a sample query result and at least one sample reference source, each sample reference source among the at least one sample reference source being associated with a corresponding part in the sample query result on the basis of a specified output format, and the output format corresponding to the query type of the query request sample; and optimizing a model to obtain an optimized model. The method in the embodiments of the present disclosure enables models to support standard output formats, so as to help users clearly understand where corresponding parts of query results come from, and further help the users trace back to origins and learn more relevant information, thereby improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, apparatus, media, and program products for optimizing models. Technical Field

[0001] This disclosure generally relates to the field of computers, and more specifically to methods for optimizing models, electronic devices, computer-readable storage media, computer program products, and methods, electronic devices, computer-readable storage media, and computer program products for outputting query results. Background Technology

[0002] With the rapid development of artificial intelligence (AI) technology, using AI tools for querying is gradually becoming an important development direction in the search industry. Using AI for querying refers to improving query algorithms and the presentation of query results by leveraging large-scale language model technology, thereby increasing query efficiency and accuracy.

[0003] By combining AI technology, AI-powered queries can more accurately understand and interpret user input, providing more precise search results. Furthermore, when dealing with large and complex datasets, AI-based queries can deliver results more quickly and accurately. Therefore, the application of AI in querying is gaining increasing attention and is becoming a powerful tool for acquiring information and solving problems.

[0004] Summary of the Invention

[0005] According to exemplary embodiments of this disclosure, a method, electronic device, computer-readable storage medium, computer program product for optimizing a model, and a method, electronic device, computer-readable storage medium, and computer program product for outputting query results are provided.

[0006] In a first aspect of this disclosure, a method for optimizing a model is provided, the method comprising: obtaining an optimization sample set, each optimization sample in the optimization sample set including a query request sample, a sample query result, and at least one sample reference source, each of the at least one sample reference source being associated with a corresponding portion of the sample query result based on a specified output format, and the output format corresponding to the query type of the query request sample; and optimizing the model to obtain an optimized model, including: optimizing the model based on the optimization sample set; or optimizing the model using a query request for optimization and system prompts corresponding to the query request for optimization, the system prompts specifying an output format corresponding to the query type of the query request for optimization.

[0007] In a second aspect of this disclosure, a method for outputting query results is provided, the method comprising: in response to receiving a query request, invoking an optimized model to generate system prompt information, wherein the system prompt information specifies an output format corresponding to the query type of the query request; and outputting output information including the query results, wherein the output information is generated by the optimized model based on the query request and the system prompt information, wherein the output information has the output format corresponding to the query type of the query request, and wherein the optimized model is optimized according to the method for optimizing the model described in the first aspect of this disclosure.

[0008] In a third aspect of this disclosure, an electronic device is provided, comprising: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the electronic device to perform a method for optimizing a model as described in a first aspect of this disclosure or a method for outputting query results as described in a second aspect of this disclosure.

[0009] In a fourth aspect of this disclosure, a computer-readable storage medium is provided having machine-executable instructions stored thereon, which, when executed by a device, cause the device to implement the method for optimizing a model as described in the first aspect of this disclosure or the method for outputting query results as described in the second aspect of this disclosure.

[0010] A fifth aspect of this disclosure provides a computer program product including computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the method for optimizing a model as described in the first aspect of this disclosure or the method for outputting query results as described in the second aspect of this disclosure.

[0011] The summary section is provided to introduce a series of concepts in a simplified form, which will be further described in the detailed description below. The summary section is not intended to identify key or essential features of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0012] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0013] Figure 1 shows a schematic diagram of an example system in which embodiments of the present disclosure can be implemented;

[0014] Figure 2 shows a schematic flowchart of a method for optimizing a model according to an embodiment of the present disclosure;

[0015] Figure 3 illustrates an example of an optimized sample according to an embodiment of the present disclosure;

[0016] Figure 4 shows a schematic flowchart illustrating a method for optimizing a model according to another embodiment of the present disclosure;

[0017] Figure 5 shows a schematic flowchart of a method for performing directional adjustments on an optimized model according to an embodiment of the present disclosure;

[0018] Figure 6 shows a schematic flowchart of a method for outputting query results according to an embodiment of the present disclosure;

[0019] Figures 7A-7B show schematic diagrams of query results output by a terminal device using a method for outputting query results according to an embodiment of the present disclosure;

[0020] Figure 8 shows a schematic block diagram of an example apparatus according to some embodiments of the present disclosure;

[0021] Figure 9 shows a schematic block diagram of an example apparatus according to some embodiments of the present disclosure; and

[0022] Figure 10 shows a block diagram of an example device that can be used to implement embodiments of the present disclosure. Detailed Implementation

[0023] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0024] The core process of using AI tools for queries involves the user engaging with an application based on a large language model. The model determines whether a search should be performed based on the user's input. If so, the model invokes a search engine to retrieve relevant query information, processes it, and outputs the results in response to the user's input. Utilizing AI tools for queries provides more personalized and accurate results, thus offering users a completely new search experience.

[0025] Throughout the process of using AI tools for querying, the quality of the model's output directly determines the user experience. One standard for measuring the quality of the model's output is its format. A high-quality output format ensures that the output information tightly integrates the query results with the search source (or reference source), efficiently satisfying users' needs when they trace back to the source.

[0026] However, some current models often produce outputs with inconsistent formats when responding to user queries, resulting in suboptimal output quality. For example, the output format may contain errors such as incorrect index tag placement, incorrect index tag formatting, mismatch between index tags and search sources, mismatch between the number of index tags and search sources, or the search sources not being represented by hyperlinks. Such inconsistent output formats prevent users from accurately identifying the search sources referenced in their query results. Furthermore, when users expect to learn more from the search sources, they struggle to trace the origins, verify the query results, and obtain further information, causing considerable confusion for users.

[0027] In view of this, embodiments of the present disclosure provide a method for optimizing a model. The method may include: obtaining an optimization sample set, each optimization sample in the optimization sample set including a query request sample, a sample query result, and at least one sample reference source, each of the at least one sample reference source being associated with a corresponding portion of the sample query result based on a specified output format, and the output format corresponding to the query type of the query request sample; and optimizing the model to obtain an optimized model, including: optimizing the model based on the optimization sample set; or optimizing the model using a query request for optimization and system prompts corresponding to the query request for optimization, wherein the system prompts specify an output format corresponding to the query type of the query request for optimization.

[0028] By employing the model optimization method according to embodiments of this disclosure, the model can support a standardized output format, making it easy for users to clearly understand the origin of the corresponding parts of the query results, and also facilitating users to further trace the source and learn more relevant information. Furthermore, the model optimization method according to embodiments of this disclosure enables the model to provide standardized output formats for query results of various query types, thereby further improving the user experience.

[0029] The embodiments of the present disclosure will now be described in further detail with reference to the accompanying drawings, wherein FIG1 shows a schematic diagram of an example environment 100 in which the embodiments of the present disclosure can be implemented. The example environment 100 includes a computing device 110 and a terminal device 120. The computing device 110 may be deployed with a model 112 (e.g., an intelligent model), which can determine whether to perform a search based on user input and provide output. If necessary, the model 112 will invoke a search engine to obtain relevant search information, process the search information to obtain query results, and output the query results in response to user input. The terminal device 120 is also shown in FIG1. ​​In some embodiments, the terminal device 120 communicates with the computing device 110 via a network 130. The network 130 may include a wired network, a wireless network, or a combination thereof, for providing communication between the terminal device 120 and the computing device 110. In some embodiments, the terminal device 120 may be connected to the computing device 110 via a data cable; the present disclosure does not limit the connection method between the computing device 110 and the terminal device 120.

[0030] In some embodiments, model 112 in computing device 110 is an optimized model, which can provide output results with a specified output format. Terminal device 120 can receive a user's query request, send the query request to computing device 110 via network 130 to invoke the optimized model 112, so that model 112 processes the query request and sends the output information with the specified output format to terminal device 120 and displays it to the user.

[0031] In some embodiments, the optimized model 112 deployed in computing device 110 may be optimized by computing device 140. Computing device 140 may acquire an optimization sample set. Each optimization sample in the optimization sample set includes a query request sample, a sample query result, and at least one sample reference source, and each of the at least one sample reference sources is associated with a corresponding portion of the sample query result based on a specified output format, and the output format corresponds to the query type of the query request sample. Computing device 140 may optimize the model to obtain an optimized model. In some embodiments, computing device 140 may optimize model 142 based on the optimization sample set to obtain an optimized model. Alternatively, in some embodiments, computing device 140 may optimize the model using a query request for optimization and system prompts corresponding to the query request for optimization, wherein the system prompts specify an output format corresponding to the query type of the query request for optimization.

[0032] In some embodiments, the optimized model can be deployed in computing device 110 as optimized model 112 in computing device 110 to communicate with terminal device 120 and provide output information with a specified output format based on user query requests.

[0033] Furthermore, although Figure 1 shows the use of a computing device 140, different from computing device 110, to optimize the model and the deployment of the optimized model in computing device 110, the method for optimizing the model according to embodiments of this disclosure can also be performed by computing device 110. For example, computing device 110 can optimize a model deployed locally to obtain an optimized model 112. Computing device 110 can then use the optimized model 112 to respond to user query requests and output output information with a specified format.

[0034] Furthermore, although the computing device is shown optimizing a model deployed locally, it is understood that the computing device can also optimize the model remotely to obtain an optimized model. This disclosure does not limit the device specifically performing the method of optimizing the model. For ease of description, the term "device for optimization (hereinafter referred to as 'optimization device')" will be used to refer to the device performing the optimization operation on the model.

[0035] Any of the computing devices 110, 140 and terminal devices 120 may include, but is not limited to, personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, personal digital assistants (PDAs), media players, etc.), multiprocessor systems, consumer electronics, wearable electronic devices, smart home devices, minicomputers, mainframe computers, edge computing devices, distributed computing systems including any one of the above systems or devices, etc.

[0036] Furthermore, it is understood that although Figure 1 shows the optimized model 112 fully deployed in the computing device 110, the optimized model 112 can be split into multiple sub-models according to actual needs, and each sub-model can be deployed in a corresponding computing device to achieve distributed deployment, such as to support the application of large-scale models.

[0037] Furthermore, although Figure 1 shows the optimized model 112 and the terminal device 120 deployed separately, it is understood that with the lightweighting of the optimized model 112, the optimized model 112 can also be deployed on the terminal device 120, thereby enabling a faster response to user query requests and providing output information with a specified output format.

[0038] Furthermore, the optimized model deployed on the terminal device 120 can also be optimized by the terminal device 120 using the method for optimizing the model according to the embodiments of this disclosure, or by a device such as computing device 110 or 140 using the method according to the embodiments of this disclosure. This can be understood with reference to the description above, and for the sake of brevity, it will not be repeated here.

[0039] Furthermore, the optimization and training methods according to embodiments of this disclosure use optimization and training data with legitimate sources that comply with legal requirements. Moreover, the search reference sources obtained by the model during the search process and the model's output information according to embodiments of this disclosure both comply with legal regulations.

[0040] The method for optimizing a model according to embodiments of this disclosure enables the model to support a standardized output format, allowing users to clearly understand the origin of the relevant parts of the query results and facilitating further tracing and understanding of related information. Furthermore, the method for optimizing a model according to embodiments of this disclosure enables the model to provide corresponding standardized output formats for query results of various query types, thereby further improving the user experience.

[0041] The block diagram above, with reference to FIG1, illustrates an example environment 100 in which embodiments of the present disclosure can be implemented. The method for optimizing a model according to an embodiment of the present disclosure is described below with reference to FIG2. FIG2 shows a flowchart of a method 200 for optimizing a model according to an embodiment of the present disclosure. Method 200 can be executed in an optimization device. Taking FIG1 as an example, when computing device 110 executes method 200, the optimization device can be computing device 110; when computing device 140 executes method 200, the optimization device can be computing device 140; when terminal device 120 executes method 200, the optimization device can be terminal device 120. For simplicity, the term "optimization device" will be used hereinafter to describe the execution of method 200.

[0042] It should be understood that the numbers in the flowchart of method 200 do not indicate the order in which these steps are performed. Some or all of these steps may be performed in parallel, or the order of execution may be interchanged, and this disclosure does not limit this. Furthermore, method 200 in FIG2 may also include additional steps not shown and / or the steps shown may be omitted, and the scope of this disclosure is not limited in this respect.

[0043] In box 202, the optimization device can obtain an optimization sample set, each optimization sample in the optimization sample set including a query request sample, a sample query result and at least one sample reference source, each of the at least one sample reference sources being associated with a corresponding part of the sample query result based on a specified output format, and the output format corresponding to the query type of the query request sample.

[0044] In some embodiments, the optimization device may obtain an optimization sample set, which includes multiple optimization samples, and each optimization sample includes a query request sample, sample query results, and at least one sample reference source. The query request sample has a corresponding query type, such as news, Q&A, academic, educational, shopping, product, entertainment, medical, travel, healthy living, or sports. The sample reference source is the source from which the sample query results are obtained. The sample query results may be generated based on information provided by at least one sample reference source. In some embodiments, each of the at least one sample reference source is associated with a corresponding portion of the sample query results based on a specified output format, and the output format corresponds to the query type of the query request sample.

[0045] In some embodiments, it is desired that the optimized model can output output information with a specified output format. For example, it is desired that the optimized model can output output information with an output format corresponding to the query type of the query request. The output information may include query results and at least one reference source. The reference source is the source from which the query results were obtained. Based on each of the at least one reference source, a corresponding portion of the query results can be obtained.

[0046] In some embodiments, the specified output format corresponding to the query type of the query request includes the format of the index tags and the position of the index tags. In some embodiments, the index tags have a specific format and appropriate placement. Specifically, the index tags can be displayed in combination with symbols. For example, the index tags can be tags that enclose the index in parentheses or other symbols. The index tags can be located after the corresponding part of the query result, that is, the index tags can be placed at the end of the corresponding part of the query result. Furthermore, each index tag is also placed before each reference source. Thus, the reference source can be associated with the corresponding part of the query result via the index tags. In other words, each of at least one reference source is associated with the corresponding part of the query result via the index tags. The corresponding part of the query result is the corresponding part of the query result obtained through the reference source identified via the index tags.

[0047] In some embodiments, specifying the output format may further include the format of the reference sources. Specifically, each of the at least one reference source is in the form of a hyperlink and displays the title information of that reference source. Furthermore, each reference source may also display its URL or application name.

[0048] In addition, specifying the output format may include: the format of paragraphs, lists, tables and citations in the query results; the separation method between different parts of the query results; and / or the line break method, etc.

[0049] For each optimized sample in the optimized sample set, each optimized sample has a specified output format, and the specified output format corresponds to the query type of the corresponding query request. In some embodiments, each optimized sample can be labeled to have a specified output format.

[0050] In some embodiments, each of the at least one sample reference source is associated with a corresponding portion of the sample query result via an annotated index tag. The corresponding portion is a portion of the sample query result obtained through the sample reference source identified via the index tag.

[0051] The tagged index markers conform to the format of the index markers included in the specified output format. That is, the tagged index markers can be displayed in combination with symbols and are located after the corresponding part of the sample query results (e.g., at the end). Furthermore, each tagged index marker appears before each sample reference source. Each sample reference source in at least one sample reference source is a hyperlink and displays its title information. Additionally, each sample reference source may also display its URL or application name.

[0052] In some embodiments, the optimized samples in the optimized sample set include optimized samples of multiple query types. Each optimized sample includes a query request sample, a sample query result, and at least one sample reference source, and each sample reference source is associated with a corresponding portion of the sample query result based on a specified output format. In some embodiments, the output format corresponds to the query type of the query request sample.

[0053] In some embodiments, the output format can be determined by: acquiring multiple negative samples of the model output (e.g., multiple samples whose output format does not meet the requirements), processing the multiple negative samples (e.g., determining which parts of each negative sample do not meet the requirements), and determining the output format corresponding to each query type based on the processing results. Alternatively, in some embodiments, the output format can also be determined by: acquiring multiple positive samples whose output format meets the requirements, and determining the output format corresponding to each query type based on the query type of the query requests in the multiple positive samples. Furthermore, the output format corresponding to each query type can be determined in other ways, which are not limited in this disclosure.

[0054] Figure 3 illustrates an example of an optimized sample according to an embodiment of the present disclosure. The optimized sample in Figure 3 shows the sample output results for a query request sample such as "What are the precautions for watching a meteor shower?". This exemplary optimized sample 300 includes a sample query result 310 and a sample reference source 320.

[0055] Optimized sample 300 has a specified output format corresponding to the query type of the query request sample. For example, the three sample reference sources exemplarily shown in sample reference source 320 are identified by index tags “[1]”, “[2]”, and “[3]”, respectively. Each index tag is enclosed in parentheses. Each index tag appears at the end of the corresponding part of the sample query result. Each index tag also appears before each sample reference source. Thus, each sample reference source is associated with the corresponding part of the sample query result through the labeled index tags. Each sample reference source has a hyperlink and displays the title information of the sample reference source.

[0056] In some embodiments, the index marker is located at the end of the corresponding part of the query result 310, indicating that the corresponding part is a query result obtained based on the sample reference source identified by the index marker. For example, in Figure 3, the index marker "[1]" is marked at the end of the first item "1. Choose a suitable observation location" and the third item "3. Keep warm" in the query result 310, indicating that these two parts are obtained based on the sample reference source "Meteor Shower Viewing Guide" identified by the index marker [1]. Similarly, the index marker "[2]" is marked at the end of the second item "2. Pay attention to safety" in the query result 310, indicating that this part is obtained based on the sample reference source "Points to note when viewing meteor showers" identified by the index marker [2]. Similarly, the index marker "[3]" is marked at the end of the fourth item "4. Give your eyes time to adjust" and the fifth item "5. Be patient" in the query result, indicating that these two parts are obtained based on the sample reference source "How to photograph meteor showers" identified by the index marker [3].

[0057] The above description, in conjunction with Figure 3, illustrates an example of an optimized sample with a specified output format. In some embodiments, the optimized samples in the optimized sample set include optimized samples of multiple query types. These multiple query types may include, but are not limited to, news, Q&A, academic, educational, shopping, product, entertainment, medical, travel, healthy living, and sports types. It is understood that the continuous enrichment and increase of query types in response to user input queries allows for continuous iterative training and optimization of the model, thereby enabling a continuously improving query process that meets user needs.

[0058] Returning to Figure 2, after obtaining an optimized sample set containing multiple optimized samples of various query types, the optimization device can optimize the model in box 204 to obtain an optimized model. That is, the optimization device can optimize the model based on the optimized sample set to obtain an optimized model.

[0059] The optimization device can optimize the model based on an optimization sample set, using a preset loss function to optimize the model, thereby obtaining an optimized model. Alternatively, the optimization model can also be optimized using a query request for optimization and system prompts corresponding to the query request. In some embodiments, the system prompts may specify an output format corresponding to the query type of the query request for optimization. For example, the optimization device can input the query request for optimization and system prompts corresponding to the query type of the query request into the model to specify the output format that the model can output for the query type of the query request, and this output format is specified in the system prompts.

[0060] By employing the model optimization method shown in Figure 2, a model capable of supporting standardized output formats can be obtained. This allows users to clearly understand the origin of the relevant parts of the query results and facilitates further tracing and understanding of related information. Furthermore, the model optimization method according to embodiments of this disclosure enables the model to provide standardized output formats for query results of various query types, thereby further enhancing the user experience.

[0061] To enable the optimized model to support query requests of various query types and provide corresponding query results, the optimized sample set includes optimized samples for multiple query types. Since the difficulty of generating query results for different query types varies, optimizing the model using an optimized sample set containing multiple optimized samples for different query types may result in the following situation: the model converges well for optimized samples of one or more query types, but converges relatively poorly for optimized samples of another or more query types. Therefore, after obtaining the optimized model in Figure 2, the method for optimizing the model according to embodiments of this disclosure can further determine whether to perform targeted adjustments on the optimized model using test data to obtain a more convergent model for the corresponding query type, thereby providing higher quality output results for query requests of that corresponding query type.

[0062] Figure 4 shows a flowchart of a method 400 for optimizing a model according to another embodiment of the present disclosure. The optimization device can continue executing method 400 after executing block 204 of method 200 to determine whether directional adjustments to the optimized model are needed. It should be understood that the numbers in the flowchart of method 400 do not indicate the order in which these steps are performed; some or all of these steps can be performed in parallel, or their order can be interchanged, and the present disclosure does not limit this. Furthermore, method 400 in Figure 4 may also include additional steps not shown and / or the steps shown may be omitted, and the scope of the present disclosure is not limited in this respect.

[0063] At box 402, the optimization device can acquire a set of test query requests, which includes multiple test query requests of various query types. In some embodiments, the query types included in the set of test query requests are consistent with the query types included in the optimized sample set used at box 202. In some embodiments, each test query request in the set of test query requests can be a query request with a corresponding query type. Based on the query request, the optimized model can output an output result corresponding to the corresponding query type. For example, for a query request with the test query request being "knowledge question answering type", the optimized model can output an output result of "knowledge question answering type".

[0064] In box 404, the optimization device can use the optimized model to generate multiple test results corresponding to multiple test query requests, each with its own output format.

[0065] The optimization device can perform operations on the optimized model based on the output format of at least one of the multiple test results output in box 404. Specifically, each test result has a corresponding test query request, and the corresponding test query request has a corresponding specified output format. As shown in Figure 4, in box 406, the optimization device can determine whether the output format of any test result does not match the corresponding specified output format. For example, the optimization device can compare the output format of each test result with the corresponding specified output format and determine whether the output format of the test result matches the corresponding specified output format based on the comparison result.

[0066] If no test result output format mismatches with the corresponding specified output format, the optimization device determines at box 408 that the optimization of the optimized model is complete. In other words, in response to the output format of each of the multiple test results matching the corresponding specified output format, the optimization device determines at box 408 that the optimization of the optimized model is complete. If it is determined that the output format of any test result does not match the corresponding specified output format, the optimization device performs orientation adjustment on the optimized model at box 410. In other words, in response to the output format of at least one of the multiple test results not matching the specified output format, the optimization device performs orientation adjustment on the optimized model and determines the orientation-adjusted model as the optimized model.

[0067] As described above, specifying the output format includes the format and position of the index tags. That is, the index tags have a specific format and appropriate placement. For example, index tags can be enclosed in parentheses or other symbols. The index tags are placed at the end of the corresponding portion of the query results in the output information, and each index tag appears before each reference source. In some embodiments, each reference source is associated with a corresponding portion of the query results via an index tag, and this corresponding portion is the portion of the query results obtained through the reference source identified by the index tag.

[0068] In some embodiments, specifying the output format may further include the format of the reference sources. Specifically, each of the at least one reference source is in the form of a hyperlink and displays the title information of that reference source. Furthermore, each reference source may also display its URL or application name.

[0069] In addition, specifying the output format may include: the format of paragraphs, lists, tables and citations in the query results; the separation method between different parts of the query results; and / or the line break method, etc.

[0070] In some embodiments, determining whether the output format of the test result matches the corresponding specified output format may include determining whether the following items in the output format of the test result meet the requirements of the corresponding items in the specified output format: whether the format and placement of the index markers in the output format meet the requirements of the specified output format, and whether the format of each reference source meets the requirements of the specified output format. In response to any of the above items not meeting the requirements of the specified output format, the optimization device may determine that the output format of the corresponding test result does not match the corresponding specified output format; otherwise, the optimization device may determine that the output format of the corresponding test result matches the corresponding specified output format.

[0071] The specific process of performing orientation adjustments on the optimized model will be described below with reference to Figure 5. Figure 5 shows a schematic flowchart of a method 500 for performing orientation adjustments on an optimized model according to an embodiment of the present disclosure. Method 500 may be a specific implementation of the orientation adjustment of the optimized model in block 410 of Figure 4. It should be understood that the numbers in the flowchart of method 500 do not indicate the order in which these steps are performed. Some or all of these steps may be performed in parallel, or the order of execution may be interchanged, and the present disclosure does not limit this. In addition, method 500 in Figure 5 may also include additional steps not shown and / or the steps shown may be omitted, and the scope of the present disclosure is not limited in this respect.

[0072] At box 502, the optimization device can determine the query type of the test query request corresponding to the mismatched output format. Based on the determination operation in box 406, the optimization device can determine the query type of the test query request corresponding to the mismatched output format.

[0073] At box 504, the optimization device can obtain a set of targeted adjustment samples with that query type. For example, assuming that at box 502, the optimization device determines that the output format of the test query request for "travel travel type" does not match the corresponding specified output format, the optimization device can obtain a set of targeted adjustment samples with that "travel travel type" query type at box 504. This targeted adjustment sample set may include multiple targeted adjustment samples, and each targeted adjustment sample has the query type "travel travel type". The format of this targeted adjustment sample may be the same as the format of the optimized sample in the optimized sample set obtained in box 202 of method 200. This can be understood with reference to the example in Figure 3; for simplicity, it will not be elaborated further here.

[0074] At block 506, the optimization device may perform orientation adjustment on the optimized model based on the orientation adjustment sample set to obtain an orientation-adjusted model. In some embodiments, the optimization device may perform adjustment on the optimized model according to the procedure in block 204 of method 200 to obtain an orientation-adjusted model, and use the orientation-adjusted model as the optimized model.

[0075] In some embodiments, to obtain a model with good convergence, the optimization device may iteratively execute the processes in boxes 504 and 506 multiple times for the query type of the test query request corresponding to the mismatched output format, thereby obtaining a model with improved accuracy. For example, the optimization device may each time obtain a set of targeted adjustment samples with that query type and use the obtained set of targeted adjustment samples each time to adjust the model. The optimization device may perform the above operations multiple times to obtain a model with improved accuracy.

[0076] In some embodiments, in response to the fact that the output formats of test query requests for multiple query types determined in block 502 do not match the corresponding specified output format, the optimization device may perform the operations of blocks 504 and 506 for each determined query type to perform targeted adjustments for the test query request of that query type. Furthermore, after performing the steps in block 506 for a test query request of one query type, the optimization device may continue to perform the operations in blocks 504 and 506 for the next test query request of the next query type, and so on.

[0077] Furthermore, in some embodiments, after the orientation adjustment operation in execution block 506, the optimization device may re-execute method 400 to determine whether there are other query types whose output format does not match the specified output format, and if not, continue to execute method 500 to perform orientation adjustment for the mismatched query type.

[0078] By performing targeted adjustments on the query types corresponding to test query requests whose output formats do not match the specified output formats, the model can be made compatible with query types of varying search difficulty. This allows the model to obtain satisfactory output information for various query types, thereby improving the user experience.

[0079] In some embodiments, as shown in FIG204, during the optimization process of the model, the optimization device may also receive a query request for optimization and a system prompt corresponding to the query request. The system prompt may include format instructions specifying an output format corresponding to the query type of the query request. As described above, the output format may include the format and placement of index tags, and / or the format of the reference source.

[0080] The formatting directives in the system prompts can specify the format and placement of index tags. The formatting directives in the system prompts can also specify the format of the reference source. Furthermore, the formatting directives can include examples of correct output formats, thus providing the model with positive samples for learning by inputting the query request used for optimization along with this system information.

[0081] For example, formatting instructions in system prompts can take the following form:

[0082] "-Please enclose the index in parentheses at the end of the corresponding sentence, for example, 'The density of ice is less than that of water. [1][2]'. Please do not create a false index at the end of the same sentence or reuse the same index at the end of the same sentence."

[0083] - There is no space between the last word or symbol and the index, and the index is always enclosed in parentheses.

[0084] - Paragraphs, lists, tables, and citations are formatted in Markdown format.

[0085] - Use level 2 and level 3 headings to separate parts of the query results, such as '##Header'.

[0086] Lists use single-line wrapping, paragraphs use double-line wrapping.

[0087] Formatting directives specify the output format, including: the format and placement of index tags; the format of paragraphs, lists, tables, and citations in the query results; the separation method between different parts of the query results; and the line break method, etc.

[0088] Furthermore, in some embodiments, the system prompt information may also include a first prompt instruction and a second prompt instruction. The first prompt instruction instructs the model to perform a search operation and provide the query results in the output information. The second prompt instruction instructs a constraint instruction to constrain the generation of the query results.

[0089] For example, the first prompt instruction might indicate that the model is performing a search operation and provides the query results in the output based on the information obtained from the search operation. The second prompt instruction provides constraints on the generation of the query results. For example, the second prompt information might indicate how the model should process the query results and which operations should be avoided. The following example illustrates the second prompt information.

[0090] Example of a second prompt message:

[0091] - For the given question, write a concise and accurate answer.

[0092] - The answer should be provided by the information in the provided "query results".

[0093] - The answer must be written in the same language as the question.

[0094] - Answers must be accurate and of high quality.

[0095] It is understood that the example of the second prompt message above is merely illustrative and for purposes of explanation. Depending on the requirements for generating query results, users can set other constraint instructions through the prompt message, and this disclosure does not limit this.

[0096] In some embodiments, after receiving a query request for optimization and a system prompt message corresponding to the query request, the optimization device may execute method 200 in FIG2 to input the query request for optimization and the system prompt message corresponding to the query request into the model to optimize the model.

[0097] Figure 6 shows a flowchart of a method 600 for outputting query results according to an embodiment of the present disclosure. Method 600 can be executed in a terminal device. Taking Figure 1 as an example, the method in Figure 6 can be executed at terminal device 120. It should be understood that the numbers in the flowchart of method 600 do not indicate the order in which these steps are executed; some or all of these steps can be executed in parallel, or the execution order can be interchanged, and the present disclosure does not limit this. Furthermore, method 600 in Figure 6 may also include additional steps not shown and / or the steps shown may be omitted, and the scope of the present disclosure is not limited in this respect.

[0098] At box 602, in response to receiving a query request, terminal device 120 can invoke an optimized model to generate system prompt information. The generated system prompt information may specify an output format corresponding to the query type of the query request. In some embodiments, terminal device 120 may send the query request via network 130 to the optimized model 112 to invoke the optimized model 112 to generate system prompt information corresponding to the query request. The optimized model 112 can generate output information including query results based on the query request and the system prompt information. In some embodiments, the optimized model 112 may be implemented by an optimization device using the methods described above.

[0099] At box 604, terminal device 120 can output output information including query results, wherein the output information is generated by an optimized model based on the query request and system prompt information, and wherein the output information has a specified output format corresponding to the query type of the query request. In some embodiments, terminal device 120 can receive output information including query results from optimized model 112 and display the output information including query results on the screen of terminal device for provision to the user. The output information has a specified output format corresponding to the query type of the query request according to embodiments of this disclosure. The specified output format can be understood with reference to the description above, and will not be repeated here for the sake of brevity.

[0100] In some embodiments, after optimization by the optimization device, the optimized model can be deployed to another terminal device, whereby the other terminal device executes the method for outputting query results. Alternatively, after optimization, the optimized model can be executed locally on the optimization device to output query results. This disclosure does not limit this approach.

[0101] Figures 7A-7B illustrate schematic diagrams of query results output by terminal device 120 using the method for outputting query results according to embodiments of the present disclosure. Figure 7A illustrates a schematic diagram of the output information displayed by terminal device 120 using an optimized model in response to a query request for "Please describe the Fibonacci number". The output information includes reference sources 710 and query results 720. Figure 7A shows each reference source in the reference sources collapsed and displayed above the query results 720 on the interface of terminal device 120. An index mark may be displayed at the end of the corresponding part in the query results 720, which associates the corresponding part with the corresponding reference source. In response to a user's trigger operation on the drop-down arrow in reference source 710, terminal device 120 can display each reference source on the interface. As shown in Figure 7B, each reference source in Figure 7B has an index mark in front of it, and each reference source is in the form of a hyperlink, so that in response to a user's trigger operation, the user can jump to the source address of the reference source to facilitate the user to trace the source and view more relevant information.

[0102] Figure 8 shows a schematic block diagram of an example device 800 according to some embodiments of the present disclosure. Device 800 can be implemented by software, hardware, or a combination of both. As shown in Figure 8, device 800 includes an acquisition module 810 and an optimization module 820.

[0103] In some embodiments, the acquisition module 810 can acquire an optimized sample set, each optimized sample in the optimized sample set including a query request sample, a sample query result, and at least one sample reference source. Each sample reference source is associated with a corresponding portion of the sample query result based on a specified output format, and the output format corresponds to the query type of the query request sample. The optimization module 820 can optimize the model to obtain an optimized model. In some embodiments, the optimization module 820 can optimize the model based on the optimized sample set. Furthermore, in some embodiments, the optimization module 820 can optimize the model using a query request for optimization and system prompts corresponding to the query request for optimization, wherein the system prompts specify an output format corresponding to the query type of the query for optimization.

[0104] The apparatus 800 in Figure 8 can be used to implement the process described above in conjunction with Figures 1 to 5, which will not be repeated here for the sake of simplicity.

[0105] Figure 9 shows a schematic block diagram of an example device 900 according to some other embodiments of the present disclosure. Device 900 can be implemented by software, hardware, or a combination of both. As shown in Figure 9, device 900 includes a calling module 910 and an output module 920.

[0106] In some embodiments, the invocation module 910 may, in response to receiving a query request, invoke an optimized model to generate system prompt information, wherein the system prompt information may specify an output format corresponding to the query type of the query request. The output module 920 may output output information including query results, wherein the output information is generated by the optimized model based on the query request and the system prompt information, and wherein the output information has an output format corresponding to the query type of the query request. The optimized model may be optimized based on the methods described above.

[0107] The device 900 in Figure 9 can be used to implement the process described above in conjunction with Figures 6 to 7B, which will not be repeated here for the sake of brevity.

[0108] The division of modules or units in the embodiments of this disclosure is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. Furthermore, the functional units in the disclosed embodiments may be integrated into one unit, exist as separate physical entities, or two or more units may be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional unit.

[0109] Figure 10 shows a block diagram of an example device 1000 that can be used to implement embodiments of the present disclosure. It should be understood that the device 1000 shown in Figure 10 is merely exemplary and should not be construed as limiting the functionality and scope of the implementations described herein. For example, device 1000 may correspond to computing device 140 described herein in conjunction with Figure 1 and can be used to perform the optimization processes described above in Figures 1 to 5. Furthermore, device 1000 may correspond to computing device 120 described herein in conjunction with Figure 1 and can be used to perform the query result output processes described above in Figures 6 to 7B.

[0110] As shown in Figure 10, device 1000 is in the form of a general-purpose computing device. Components of computing device 1000 may include, but are not limited to, one or more processors or processing units 1010, memory 1020, storage device 1030, one or more communication units 1040, one or more input devices 1050, and one or more output devices 1060. Processing unit 1010 may be a physical or virtual processor and is capable of performing various processes according to programs stored in memory 1020. In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of computing device 1000.

[0111] Computing device 1000 typically includes multiple computer storage media. Such media can be any available media accessible to computing device 1000, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 1020 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof). Storage device 1030 can be removable or non-removable media and may include machine-readable media, such as flash drives, disks, or any other media capable of storing information and / or data (e.g., optimized data for optimization) and accessible within computing device 1000.

[0112] The computing device 1000 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in FIG. 10, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks may be provided. In these cases, each drive may be connected to a bus (not shown) via one or more data media interfaces. The memory 1020 may include a computer program product 1025 having one or more program modules configured to perform various methods or actions of various implementations of this disclosure.

[0113] The communication unit 1040 enables communication with other computing devices via a communication medium. Additionally, the components of the computing device 1000 can function as a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, the computing device 1000 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.

[0114] Input device 1050 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 1060 can be one or more output devices, such as a monitor, speaker, printer, etc. Computing device 1000 can also communicate with one or more external devices (not shown) via communication unit 1040 as needed. These external devices include storage devices, display devices, etc., and can communicate with one or more devices that enable user interaction with computing device 1000, or with any device that enables computing device 1000 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication can be performed via an input / output (I / O) interface (not shown).

[0115] According to an exemplary implementation of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is provided that stores a computer program thereon, which, when executed by a processor, implements the methods described above.

[0116] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0117] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0118] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0120] Various implementations of this disclosure have been described above. The foregoing description is exemplary and not exhaustive, nor is it limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.

Claims

1. A method for optimizing a model, the method comprising: Obtain an optimized sample set, wherein each optimized sample in the optimized sample set includes a query request sample, a sample query result, and at least one sample reference source, wherein each sample reference source is associated with a corresponding part of the sample query result based on a specified output format, and the output format corresponds to the query type of the query request sample; as well as Optimizing the model to obtain an optimized model includes: The model is optimized based on the optimized sample set; or The model is optimized using a query request for optimization and system prompts corresponding to the query request for optimization, wherein the system prompts specify an output format corresponding to the query type of the query request for optimization.

2. The method according to claim 1, wherein the optimized samples in the optimized sample set include optimized samples of multiple query types.

3. The method according to claim 2, further comprising: Obtain a set of test query requests, wherein the set of test query requests includes multiple test query requests of the various query types; The optimized model is used to generate multiple test results corresponding to the multiple test query requests, each of which has its own output format; as well as The optimized model is operated on based on the output format of at least one of the plurality of test results.

4. The method according to claim 3, wherein each test result has a corresponding test query request, and the corresponding test query request has a corresponding specified output format, wherein performing operations on the optimized model includes: The output format of each test result is compared with the corresponding specified output format; as well as In response to a mismatch between the output format of at least one test result and the corresponding specified output format, the optimized model is adjusted accordingly.

5. The method of claim 4, wherein directional adjustment of the optimized model comprises: Determine the query type of the test query request corresponding to the mismatched output format; Obtain a set of targeted adjustment samples with the query type described above; The optimized model is adjusted based on the targeted adjustment sample set to obtain a targeted adjustment model.

6. The method of claim 3, wherein each test result has a corresponding test query request, and the corresponding test query request has a corresponding specified output format, wherein performing operations on the optimized model includes: The output format of each test result is compared with the corresponding specified output format; as well as If the output format of each test result matches the corresponding specified output format, the optimization of the model is considered complete.

7. The method according to claim 1, wherein the output format is used to define the output format of the model's output information, the output information including query results and at least one reference source.

8. The method of claim 7, wherein the output format includes: The format and position of the index tags, and wherein each of the at least one reference source is associated with a corresponding portion of the query result based on the corresponding index tag.

9. The method of claim 8, wherein, based on the output format, the corresponding index mark is located after the corresponding portion and displayed in conjunction with a symbol.

10. The method of claim 8, wherein each of the at least one sample reference sources is associated with a corresponding portion of the sample query result by annotated index tags, and the annotated index tags are consistent with the format of the index tags defined by the output format.

11. The method of claim 7, wherein the output format includes: The format of the at least one reference source.

12. The method according to claim 7, wherein, The system prompt message includes a format instruction, which specifies the output format.

13. The method of claim 12, wherein the system prompt information includes a first prompt instruction and a second prompt instruction, the first prompt instruction instructing the model to perform a query operation and provide query results in the output information, and the second prompt instruction instructing a constraint instruction to constrain the generation of the query results.

14. The method of claim 1, wherein, based on the output format, each of the at least one sample reference source has a hyperlink and displays title information of the sample reference source.

15. A method for outputting query results, comprising: In response to receiving a query request, an optimized model is invoked to generate system prompt information, wherein the system prompt information specifies an output format corresponding to the query type of the query request; as well as The output includes output information of the query results, wherein the output information is generated by the optimized model based on the query request and the system prompt information, wherein the output information has the output format corresponding to the query type of the query request, and wherein the optimized model is optimized based on the method according to any one of claims 1 to 14.

16. An electronic device comprising: At least one processing unit; At least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the electronic device to perform the method for optimizing a model according to any one of claims 1 to 14 or the method for outputting query results according to claim 15.

17. A computer-readable storage medium having a computer program stored thereon, said computer program, when executed by a processor, implementing the method for optimizing a model according to any one of claims 1 to 14 or the method for outputting query results according to claim 15.

18. A computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for optimizing a model according to any one of claims 1 to 14 or the method for outputting query results according to claim 15.

Citation Information

Patent Citations

  • Information processing method and device, computer equipment and storage medium

    CN117056454A

  • Information query expansion method, electronic equipment, storage medium and program product

    CN118535681A

  • System, method, and user interface for a search engine based on multi-document summarization

    US12038958B1

  • Enhanced search result generation using multi-document summarization

    US20240281487A1