Question and answer optimization method and device, computer equipment, readable storage medium and program product

By quantizing and compressing the business and general layers of the initial question-answering model and optimizing the question-answering process using knowledge graphs, the problem of low efficiency of large language models in professional business scenarios is solved, and an efficient and accurate question-answering system is achieved.

CN121031786APending Publication Date: 2025-11-28CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511158518.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Existing large language models are inefficient in end-to-end processing of user input problems, and have insufficient accuracy and poor generalization ability in professional business scenarios.

Method used

By performing asymmetric quantization on the business layer and symmetric quantization on the general layer of the initial question-answering model, parameter weights are compressed. Combined with knowledge graphs and the target question-answering model, prompt words are determined and target entities and knowledge are obtained, thus optimizing the question-answering process.

Benefits of technology

It improves the processing efficiency and accuracy of the question-and-answer system in professional business scenarios, reduces storage requirements, reduces human intervention, and improves question-and-answer efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121031786A_ABST
    Figure CN121031786A_ABST
Patent Text Reader

Abstract

The invention relates to the field of artificial intelligence, and particularly discloses a question and answer optimization method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the steps of performing asymmetric quantization on a business layer of an initial question and answer large model to obtain a first parameter compression weight; performing symmetric quantization on the universal layer to obtain a second parameter compression weight; performing quantitative compression on the first parameter compression weight and the second parameter compression weight, and determining the target question and answer large model; receiving a question input by a user; selecting a knowledge graph of which the service type is the same as that of the cue word determined based on the question input by the user; inputting the cue word into a knowledge graph to obtain target knowledge of a target entity corresponding to the business type; inputting the target knowledge of the target entity into the target question and answer large model to obtain a target reasoning result corresponding to the question; and obtaining an answer corresponding to the question based on the target reasoning result. The method can improve question-answering efficiency and reduce model storage requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a question-answering optimization method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology

[0002] With the development of artificial intelligence technology, a new paradigm centered on Large Language Models (LLMs) has emerged in the field of natural language processing. Pre-trained models, such as GPT and BERT, have acquired powerful semantic understanding and generation capabilities through training on massive amounts of data, significantly improving the technical level of intelligent question-answering systems. These models demonstrate significant advantages in handling complex tasks such as open-domain dialogue and text generation. However, these models typically contain billions to hundreds of billions of parameters, and their massive computational scale poses a severe challenge to practical deployment, becoming a key factor restricting their widespread adoption.

[0003] In traditional technologies, existing question-answering systems mainly rely on three types of architectures: general-purpose large models (such as BERT / GPT) have basic language capabilities, but they are not optimized for professional business scenarios and their accuracy is insufficient when faced with questions with dense terminology; rule-driven dedicated systems match user questions through predefined templates, which are effective in specific scenarios, but have poor generalization ability and are difficult to adapt to dynamic market changes.

[0004] However, current large models are severely inefficient at end-to-end processing of user input problems. Summary of the Invention

[0005] Therefore, it is necessary to provide an intelligent question-answering method, device, computer equipment, computer-readable storage medium, and computer program product that can improve processing efficiency in response to the above-mentioned technical problems.

[0006] Firstly, this application provides a question-answering optimization method, the method comprising:

[0007] The problem of receiving user input;

[0008] Based on the question input by the user, a prompt word is determined, and a knowledge graph with the same business type as the prompt word is selected;

[0009] The prompt words are input into the knowledge graph to obtain the target knowledge of the target entity corresponding to the business type;

[0010] The target knowledge of the target entity is input into the target question-answering model to obtain the target reasoning result corresponding to the question;

[0011] Based on the reasoning results of the target, the answer corresponding to the question is obtained;

[0012] The method for determining the target question-answering model includes:

[0013] Obtain an initial question-and-answer model, wherein the initial question-and-answer model includes a business layer and a general layer;

[0014] The business layer is subjected to asymmetric quantization to obtain the first parameter compression weight;

[0015] Symmetric quantization is performed on the general layer to obtain the second parameter compression weight;

[0016] The first parameter compression weight and the second parameter compression weight are quantized and compressed to determine the target question-answering model.

[0017] In one embodiment, the method for determining the prompt word includes:

[0018] Information is extracted from the user-input question to obtain the column name and column value to be processed.

[0019] By using different matching methods, the column name to be processed and the column value to be processed are matched with the stored standard column name and standard data respectively to obtain the initial column name corresponding to each matching method;

[0020] Determine the verification logic;

[0021] Based on the verification logic, the target column name is selected from the initial column name;

[0022] The prompt word is determined based on the target column name.

[0023] In one embodiment, the asymmetric quantization of the service layer to obtain the first parameter compression weight includes:

[0024] Receive a list of business entities, which is determined based on the knowledge graph;

[0025] Obtain the range of each business entity in the business entity list;

[0026] Asymmetric quantization parameters are calculated for the range of each business entity to obtain a first scaling factor and a first zero-point value.

[0027] The first initial weight matrix of the business layer is decomposed into a first singular value diagonal matrix, a first singular vector orthogonal matrix, and a second singular vector orthogonal matrix; wherein, the first singular value diagonal matrix is ​​determined based on a first approximate rank; the first approximate rank represents the number of singular values ​​retained by the business layer;

[0028] The first singular value diagonal matrix is ​​quantized using the first scaling factor and the first zero point value to obtain the quantized first singular value diagonal matrix.

[0029] Based on the quantized first singular value diagonal matrix, the first parameter compression weight is obtained.

[0030] In one embodiment, the step of performing symmetric quantization on the general layer to obtain the second parameter compression weight includes:

[0031] The second initial weight matrix of the general layer is subjected to symmetric quantization parameter calculation to determine the second scaling factor and the second zero point value.

[0032] The second initial weight moments are decomposed into a second singular value diagonal matrix, a third singular vector orthogonal matrix, and a fourth singular vector orthogonal matrix; wherein, the second singular value diagonal matrix is ​​determined based on a second approximate rank; the second approximate rank represents the number of singular values ​​retained by the general layer; the second approximate rank is less than the first approximate rank; the first approximate rank represents the number of singular values ​​retained by the business layer;

[0033] The second singular value diagonal matrix is ​​quantized using the second scaling factor and the second zero point value to obtain the quantized second singular value diagonal matrix.

[0034] Based on the quantized second singular value diagonal matrix, the second parameter compression weight is obtained.

[0035] In one embodiment, the knowledge graph is updated in the following ways:

[0036] Obtain the difference target source data by listening to the interface corresponding to the component;

[0037] The differential target source is transformed into triple data, and the triple data is stored; the triple data includes entities;

[0038] Obtain each stored entity, and the decay factor of each entity at different update time intervals;

[0039] The knowledge in the knowledge graph is updated by reasoning based on each entity and a decay factor at different update intervals using a graph neural network.

[0040] In one embodiment, after obtaining the answer corresponding to the question based on the target reasoning result, the method further includes:

[0041] Get the evaluation corresponding to the answer;

[0042] Based on the evaluation, at least one of updating the knowledge graph and adjusting the target question-answering model is performed.

[0043] Secondly, this application provides a question-answering optimization device, the device comprising:

[0044] The receiving module is used to receive user input questions;

[0045] The first determining module is used to determine the prompt words based on the question input by the user, and select a knowledge graph with the same business type as the prompt words;

[0046] The second determining module is used to input the prompt words into the knowledge graph to obtain target knowledge of the target entity corresponding to the business type;

[0047] The reasoning result determination module is used to input the target knowledge of the target entity into the target question-answering model to obtain the target reasoning result corresponding to the question;

[0048] The answer determination module is used to obtain the answer corresponding to the question based on the target reasoning result;

[0049] The device further includes a target model determination module, the target model determination module comprising:

[0050] An acquisition unit is used to acquire an initial question-and-answer model, wherein the initial question-and-answer model includes a business layer and a general layer;

[0051] The first quantization unit is used to perform asymmetric quantization on the business layer to obtain the first parameter compression weight;

[0052] The second quantization unit is used to perform symmetric quantization on the general layer to obtain the second parameter compression weight;

[0053] The first determining unit is used to quantize and compress the first parameter compression weight and the second parameter compression weight to determine the target question-answering model.

[0054] In one embodiment, the device further includes a prompt word determination module, the prompt word determination module comprising:

[0055] The information extraction unit is used to extract information from the user-input question to obtain the column name and column value to be processed.

[0056] The matching unit is used to match the column name to be processed and the column value to be processed with the stored standard column name and standard data respectively through different matching methods to obtain the initial column name corresponding to each matching method;

[0057] The second determining unit is used to determine the verification logic;

[0058] The selection unit is used to select a target column name from the initial column names based on the verification logic;

[0059] The third determining unit is used to determine the prompt word based on the target column name.

[0060] In one embodiment, the first quantization unit is specifically configured to: receive a list of business entities, the list of business entities being determined based on the knowledge graph; obtain the range of each business entity in the list of business entities; perform asymmetric quantization parameter calculation on the range of each business entity to obtain a first scaling factor and a first zero-point value; decompose the first initial weight matrix of the business layer into a first singular value diagonal matrix, a first singular vector orthogonal matrix, and a second singular vector orthogonal matrix; wherein the first singular value diagonal matrix is ​​determined based on a first approximate rank; the first approximate rank represents the number of singular values ​​retained by the business layer; quantize the first singular value diagonal matrix using the first scaling factor and the first zero-point value to obtain a quantized first singular value diagonal matrix; and obtain the first parameter compression weight based on the quantized first singular value diagonal matrix.

[0061] In one embodiment, the second quantization unit is specifically used to perform symmetric quantization parameter calculation on the second initial weight matrix of the general layer to determine the second scaling factor and the second zero-point value; decompose the second initial weight matrix into a second singular value diagonal matrix, a third singular vector orthogonal matrix, and a fourth singular vector orthogonal matrix; wherein, the second singular value diagonal matrix is ​​determined based on a second approximate rank; the second approximate rank represents the number of singular values ​​retained by the general layer; the second approximate rank is less than the first approximate rank; the first approximate rank represents the number of singular values ​​retained by the service layer; quantize the second singular value diagonal matrix using the second scaling factor and the second zero-point value to obtain the quantized second singular value diagonal matrix; and obtain the second parameter compression weight based on the quantized second singular value diagonal matrix.

[0062] In one embodiment, the apparatus further includes a knowledge graph updating module, the knowledge graph updating module comprising:

[0063] The acquisition module is used to obtain the difference target source data by listening to the interface corresponding to the component;

[0064] A transformation module is used to transform the differential target source into triple data and store the triple data; the triple data includes entities;

[0065] A storage module is used to obtain each entity stored, and the decay factor of each entity at different update time intervals;

[0066] An update module is used to update the knowledge in the knowledge graph by reasoning based on each entity and a decay factor at different update time intervals using a graph neural network.

[0067] In one embodiment, the device further includes:

[0068] An adjustment module is used to obtain the evaluation corresponding to the answer; and based on the evaluation, to perform at least one of updating the knowledge graph and adjusting the target question-answering model.

[0069] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.

[0070] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0071] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0072] The aforementioned question-answering optimization method, apparatus, computer equipment, computer-readable storage medium, and computer program product firstly employ asymmetric quantization at the business layer. Tasks such as entity recognition are sensitive to parameters (e.g., subtle changes affect entity extraction), and asymmetric quantization minimizes errors to ensure accuracy. Symmetric quantization is used at the general layer, offering high tolerance for quantization noise in general tasks (e.g., word embedding), significantly accelerating model processing and ensuring efficiency. The compressed first and second parameter weights can also effectively reduce storage requirements. Secondly, prompt words are determined based on the user's input question, and a knowledge graph matching the business type of the prompt words is selected to define the business domain. Then, the corresponding target entities and target knowledge are determined through the knowledge graph to further enhance the quality of the prompt words. This allows the quantized and compressed target question-answering model to provide answers based on the business domain, thereby improving question-answering efficiency without requiring user correction of the prompt words, reducing manual intervention and further enhancing efficiency. Attached Figure Description

[0073] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0074] Figure 1 This is a flowchart illustrating a question-answering optimization method in one embodiment;

[0075] Figure 2 This is a flowchart illustrating how the target question-answering model is determined in one embodiment.

[0076] Figure 3 This is a schematic diagram of the asymmetric quantization process in one embodiment;

[0077] Figure 4 This is a schematic diagram of the symmetric quantization process in one embodiment;

[0078] Figure 5 This is a flowchart illustrating a knowledge graph update method in one embodiment;

[0079] Figure 6 This is a schematic diagram of the system architecture of a question-answering optimization method in one embodiment;

[0080] Figure 7 This is a structural block diagram of a question-answering optimization device in one embodiment;

[0081] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0082] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. It should be noted that existing industry solutions such as software, components, and models may be mentioned in the embodiments of this application. These should be considered exemplary and are intended only to illustrate the feasibility of implementing the technical solutions of this application, but do not imply that the applicant has already used or necessarily used such solutions.

[0083] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0084] In one embodiment, such as Figure 1 and Figure 2 As shown, a question-answering optimization method is provided. This embodiment illustrates the method applied to a terminal, but it is understood that the method can also be applied to a server, and to a system including both a terminal and a server, and implemented through the interaction between the terminal and the server. In this embodiment, the method includes steps 102 to 110. Wherein:

[0085] Step 102: Receive user input.

[0086] The questions entered by users can include professional business-related questions as well as general questions. Professional business-related questions include, for example, questions related to financial business or technology business. Examples of financial business-related questions include "Did Company A's net profit in the first quarter of 2023 exceed expectations?" and "What is Company B's price-to-earnings ratio?"

[0087] Optionally, the terminal can receive user input questions, such as "Did Company A's net profit in the first quarter of 2023 exceed expectations?" or other questions.

[0088] Step 104: Determine the prompt words based on the user's input question, and select a knowledge graph with the same business type as the prompt words.

[0089] Optionally, the terminal performs entity parsing and mapping based on the user's input question. For example, if Company A is an abbreviation, alias, or acronym, the abbreviation is mapped to the full name of Company A and used as the prompt word, similarly using net profit as the prompt word. The terminal performs compliance verification on the prompt word. If the compliance verification passes, the terminal selects a knowledge graph with the same business type as the prompt word. For example, if the terminal determines the business type of the prompt word to be financial business based on net profit, it selects the knowledge graph for financial business. If the compliance verification fails, manual review is triggered.

[0090] Furthermore, the terminal performs compliance verification on the prompt words, including: if there are sensitive prompt words in the prompt words, then the relevant regulations are forcibly injected to perform compliance verification on the sensitive prompt words using formula (1) to obtain a compliance score. If the compliance score is greater than the compliance score threshold, it indicates that the compliance verification has passed, and the terminal selects a knowledge graph with the same business type as the prompt words. If the compliance score is less than or equal to the compliance score threshold, it indicates that the compliance verification has failed, and then manual review is triggered.

[0091] Formula (1)

[0092] In the formula, Vectors representing sensitive warning words, The vector representing the i-th regulation. Indicates similarity; Represents an exponential function. This represents the attention weight, with a probability value between 0 and 1. This represents the regulatory compliance coefficient.

[0093] Step 106: Input the prompt words into the knowledge graph to obtain the target knowledge of the target entity corresponding to the business type.

[0094] The knowledge graph is updated periodically based on scheduled tasks or triggered by key data obtained through an interface. It performs reasoning and computation based on prompts to obtain target knowledge of the target entity, which serves as a prerequisite answer or enhanced prompt for the user's response.

[0095] Optionally, the terminal first inputs the prompt word into the knowledge graph, and then extracts the associated entities of the prompt word from the knowledge graph and infers the target knowledge corresponding to the associated entities through the graph reasoning chain.

[0096] Step 108: Input the target knowledge of the target entity into the target question-answering model to obtain the target reasoning result corresponding to the question.

[0097] The target question-answering model is obtained by quantizing and compressing a pre-trained initial question-answering model. The target question-answering model can be ChatGLM3, BERT, etc. ChatGLM3 is a deep learning-based natural language processing model specifically designed for understanding and generating natural language text. It is typically pre-trained, capable of capturing deep semantics of language, and used in applications such as chatbots and question-answering systems.

[0098] Optionally, the terminal inputs the target knowledge of the target entity into the target question-answering model. The target question-answering model gains a deeper understanding of the target knowledge and generates more personalized and in-depth answers, that is, target reasoning results corresponding to the question.

[0099] Optionally, before the terminal inputs the target knowledge of the target entity into the target question-answering model, the method for determining the target question-answering model is as follows: Figure 2 As shown, steps 202 to 208 are included. Wherein:

[0100] Step 202: Obtain the initial question-and-answer model, which includes a business layer and a general layer.

[0101] The business layer is used to accurately capture semantic and structural features specific to the business domain. This business layer can be a financial layer, such as identifying financial entities in text, like stock codes or financial institutions. The initial large-scale question-answering model is a pre-trained ChatGLM3, BERT, or GPT model.

[0102] In practical applications, a separate financial layer is set up because financial data is highly specialized, highly standardized, and numerically intensive, making it difficult for the general layer to fully learn these characteristics.

[0103] Optionally, the terminal obtains a pre-deployed initial question-answering model, such as BERT or GPT. Due to the highly specialized nature of the business domain, a general layer and a business layer are deployed in the initial question-answering model. The general layer is used to handle cross-domain general language understanding and generation, while the business layer is used to accurately capture the semantic and structural features specific to the business domain.

[0104] Step 204: Perform asymmetric quantization on the business layer to obtain the first parameter compression weight.

[0105] The first parameter, compression weight, is expressed in matrix form, for example, denoted as Wq1, with dimensions (m_1 * n_1). m_1 is the number of row vectors in the first parameter compression weight, and n_1 is the number of column vectors in the first parameter compression weight.

[0106] Quantization refers to converting the parameters of a model from floating-point numbers to integers in order to reduce the size of the model and speed up the inference process.

[0107] Optionally, the terminal uses QLoRA technology to perform asymmetric quantization on the service layer to obtain the first parameter compression weight Wq1. Among them, Quantized Low-Rank Approximation (QLoRA) is a model fine-tuning method.

[0108] Step 206: Perform symmetric quantization on the general layer to obtain the second parameter compression weight.

[0109] The second parameter, compression weight, is expressed in matrix form, for example, denoted as Wq2, with dimensions (m_2 * n_2). m_2 is the number of row vectors in the second parameter compression weight, and n_2 is the number of column vectors in the second parameter compression weight.

[0110] Optionally, the terminal performs symmetric quantization on the general layer to obtain the second parameter compression weight Wq2.

[0111] Step 208: Quantize and compress the first parameter compression weight and the second parameter compression weight to determine the target question-answering model.

[0112] Optionally, the terminal uses QLoRA technology to quantize and compress the first and second parameter compression weights, and then re-integrates the compressed first and second parameter compression weights into the initial question-answering model to form an optimized compressed model, i.e., the target question-answering model. This optimized model uses the original framework for inference and prediction and has lower storage requirements. The target question-answering model is then deployed to the terminal environment for inference and prediction.

[0113] It should be noted that uncompressed and unaccelerated pre-trained models, such as BERT or GPT, can also be used directly to build question-answering systems. While these models perform well on question-answering tasks, they may require more computational resources and time to process queries.

[0114] Step 110: Obtain the answer corresponding to the question based on the result of the target reasoning.

[0115] Optionally, the terminal uses the target reasoning result as the answer to the question and outputs and displays the answer to the question through the interface.

[0116] In the above question-answering optimization method, firstly, asymmetric quantization is used on the business layer. Tasks such as entity recognition are sensitive to parameters (e.g., subtle changes affect entity extraction), and asymmetric quantization minimizes errors to ensure accuracy. Symmetric quantization is used on the general layer. For general tasks (e.g., word embedding), symmetric quantization has high tolerance for quantization noise and significantly speeds up the process, ensuring efficiency during model processing. The compressed first and second parameter compression weights can also effectively reduce storage requirements. Secondly, prompt words are determined based on the user's input question, and a knowledge graph with the same business type as the prompt words is selected to limit the business domain. Then, the corresponding target entities and target knowledge are determined through the knowledge graph to further enhance the quality of the prompt words. This allows the target question-answering model, after quantization and compression, to answer according to the business domain, thereby improving question-answering efficiency. Furthermore, it eliminates the need for users to correct the prompt words, reducing manual intervention and further improving question-answering efficiency.

[0117] In an exemplary embodiment, the method for determining the prompt word includes: extracting information from the user-input question to obtain the column name and column value to be processed; matching the column name and column value to be processed with stored standard column names and standard data respectively through different matching methods to obtain the initial column name corresponding to each matching method; determining the verification logic; selecting the target column name from the initial column name based on the verification logic; and determining the prompt word based on the target column name.

[0118] Optionally, information is extracted from the user-input question to obtain the column names and values ​​to be processed, including: processing the user-input question using a pre-trained pattern extraction model to obtain the column names and values ​​to be processed; the pattern extraction model is trained based on the sample natural language and the corresponding stored standard column names and standard data.

[0119] The pattern extraction model can be a relatively small model (such as Deberta), thus reducing the burden on large models and lowering overhead. It identifies and extracts possible "fake column names" (i.e., the column names to be processed mentioned above), "fake values" (i.e., the column values ​​to be processed mentioned above), and the computational logic relationship between the two from the user's input question.

[0120] The pattern extraction model's task is to extract possible "fake column names," "fake values," and corresponding computational logic from user input expressed in natural language. Training this model relies on large-scale labeled data. Through supervised learning, the model gradually learns to correctly identify the user-mentioned column names and values ​​in various contexts, even if they do not directly correspond one-to-one with stored standard column names and values. The output of the pattern extraction model is a list of possible "fake column names" and "fake values," which serves as input for subsequent matching steps.

[0121] Optionally, the column name to be processed is first matched with the stored standard column name, and the data to be processed is second matched with the stored standard data. Both the first and second matches include multiple matching methods. Each matching method in the first and second matches yields a corresponding initial column name. Based on validation logic, a target column name is selected from the initial column names, and this target column name is used as the standardized prompt word. The validation logic comprises two layers: the first layer processes the initial column names for each matching method in the first and second matches to obtain the first target column name corresponding to the first match and the second target column name corresponding to the second match; the second layer obtains the target column name based on the first target column name from the first match and the second target column name from the second match. The first layer may include at least one of the following methods: selecting the result corresponding to the optimal matching method based on priority, selecting the most supported matching result based on consistency, and outputting unsuccessful matching results through result cross-validation to allow user confirmation. The second layer may also include at least one of the following methods: selecting the result corresponding to the optimal matching method based on priority, selecting the most supported matching result based on consistency, and outputting unsuccessful matching results through result cross-validation to allow user confirmation.

[0122] In the above embodiments, the target column name is determined through multiple matching mechanisms and verification logic, which improves the accuracy of the target column name, so as to standardize the user input question and obtain standardized prompt words, thereby improving the accuracy of model processing.

[0123] In one exemplary embodiment, such as Figure 3As shown, asymmetric quantization is performed on the business layer to obtain the first parameter compression weight, including steps 302 to 310. Wherein:

[0124] Step 302: Receive the list of business entities and obtain the scope of each business entity in the list.

[0125] The list of business entities is determined based on a knowledge graph. The business layer uses the financial layer as an example.

[0126] Optionally, when the terminal initiates the compression task of the initial question-answering model, it obtains a list of business entities, which can be a list of high-frequency entities in the knowledge graph. The terminal then retrieves the range of each business entity in the business entity list from the knowledge graph, such as the stock price fluctuation range, the loan prime rate (LPR) fluctuation range, etc., where the fluctuation range includes the upper limit and the lower limit is denoted as Emin.

[0127] Step 304: Calculate the asymmetric quantization parameters for the range of each business entity to obtain the first scaling factor and the first zero-point value.

[0128] Optionally, the terminal obtains the range of each business entity and defines logical boundaries through the entity range. For example, if there is no entity range to guide interest rate changes, a negative interest rate may be output. By using the entity range, the interest rate is forcibly limited to a reasonable range of [0.1, 20]. The terminal needs to establish a mapping relationship between the maximum and minimum values ​​of the first initial weight and the entity range. Through the mapping relationship, the entity range is mapped to the maximum and minimum values ​​of the first initial weight, and the upper and lower limits of the entity range are mapped to the range between the maximum and minimum values ​​of the first initial weight. The mapped upper limit weight is denoted as WEmax and the mapped lower limit weight is denoted as WEmin.

[0129] Furthermore, the terminal calculates the asymmetric quantization parameters using formula (2) based on the mapped upper limit weight and lower limit weight of the interval, and obtains the first scaling factor. The terminal then determines the first zero-point value using formula (3) based on the mapped lower limit weight. The first scaling factor is used to map the floating-point weights to the integer range, and the first zero-point value represents the integer value corresponding to the floating-point number 0 after quantization. Where N1 is the target bit width for quantization, for example, N1=4 for 4-bit quantization; and N1=8 for 8-bit quantization.

[0130] Formula (2)

[0131] Formula (3)

[0132] Step 306: Decompose the first initial weight matrix of the business layer into a first singular value diagonal matrix, a first singular vector orthogonal matrix, and a second singular vector orthogonal matrix.

[0133] The first singular value diagonal matrix is ​​determined based on the first approximate rank k1; the first approximate rank k1 represents the number of singular values ​​retained by the business layer. For example, k1 is set to 128 to achieve high fidelity.

[0134] Optionally, the terminal uses formula (4) to set the first initial weight matrix. ,and Decomposed into the first singular value diagonal matrix The first singular vector orthogonal matrix Orthogonal matrix of the second singular vector Among them, the first singular value diagonal matrix The shape is k1×k1, used to characterize the importance of features; the first singular vector orthogonal matrix That is, the orthogonal matrix composed of the left singular vectors, with a shape of m×k1, is used to preserve the main characteristic directions; the orthogonal matrix of the second singular vectors That is, an orthogonal matrix composed of right singular vectors, with a shape of n×k1, used to preserve the feature space structure.

[0135] Formula (4)

[0136] Step 308: Quantize the first singular value diagonal matrix using the first scaling factor and the first zero point value to obtain the quantized first singular value diagonal matrix.

[0137] Optionally, the terminal uses formula (5) to quantize the first singular value diagonal matrix based on the first scaling factor s1 and the first zero value z1. Quantization is performed to obtain the first singular value diagonal matrix after quantization. . This represents the quantization function, used for floating-point to integer conversion.

[0138] Formula (5)

[0139] Step 310: Based on the quantized first singular value diagonal matrix, obtain the first parameter compression weight.

[0140] Optionally, the terminal uses formula (6) based on the quantized first singular value diagonal matrix. and the first singular vector orthogonal matrix Orthogonal matrix of the second singular vector This yields the first parameter, compression weight, after quantization and compression.

[0141] Formula (6)

[0142] In this embodiment, through the business layer, especially the financial layer, financial weights may be asymmetric due to domain characteristics. Asymmetric quantization can better preserve these key parameters, improve the robustness of downstream tasks, and determine the boundary through the entity range to prevent truncation errors under extreme market conditions, thereby ensuring the reasonable output of the target question-answering model and guaranteeing accuracy.

[0143] In one exemplary embodiment, such as Figure 4 As shown, symmetric quantization is performed on the general layer to obtain the second parameter compression weight, including steps 402 to 408. Wherein:

[0144] Step 402: Perform symmetric quantization parameter calculation on the second initial weight matrix of the general layer to determine the second scaling factor and the second zero point value.

[0145] The second initial weight matrix is ​​denoted as... .

[0146] Optionally, the terminal obtains the second initial weight matrix W2 of the general layer and the maximum value of the absolute value of the second initial weight matrix W2. N2 is the target bit width of quantization. For example, for 4-bit quantization, N2=4; for 8-bit quantization, N2=8. The terminal determines the second scaling factor based on the maximum value of the absolute value of the second initial weight matrix W2 using formula (7). The second zero-point value is fixed at 0 in symmetric quantization, as shown in formula (8). The second scaling factor is used to map floating-point numbers to the integer range, and the second zero-point value is used to align the floating-point 0 value position.

[0147] Formula (7)

[0148] Formula (8)

[0149] Step 404: Decompose the second initial weight matrix into a second singular value diagonal matrix, a third singular vector orthogonal matrix, and a fourth singular vector orthogonal matrix.

[0150] Among them, the second singular value diagonal matrix It is determined based on the second approximation k2; the second approximation rank represents the number of singular values ​​retained by the general layer; the second approximation rank k2 is less than the first approximation rank k1; the first approximation rank represents the number of singular values ​​retained by the business layer.

[0151] Optionally, the terminal uses formula (9) to convert the second initial weight matrix. ,and Decomposed into a second singular value diagonal matrix Third singular vector orthogonal matrix Orthogonal matrix of the fourth singular vector Among them, the second singular value diagonal matrix The shape is k2×k2, used to characterize the importance of features; the third singular vector orthogonal matrix That is, the orthogonal matrix composed of the left singular vectors, with a shape of m×k2, is used to preserve the main characteristic directions; the orthogonal matrix of the fourth singular vector. That is, the right singular vector orthogonal matrix, with a shape of n×k2, is used to preserve the characteristic space structure.

[0152] Formula (9)

[0153] Step 406: Quantize the second singular value diagonal matrix using the second scaling factor and the second zero point value to obtain the quantized second singular value diagonal matrix.

[0154] Optionally, the terminal uses a quantization function based on the second scaling factor s2 and the first zero-point value z2 on the second singular value diagonal matrix via formula (10). Quantization is performed to obtain the first singular value diagonal matrix after quantization. . This represents the quantization function, used for floating-point to integer conversion.

[0155] Formula (10)

[0156] Step 408: Based on the quantized second singular value diagonal matrix, obtain the second parameter compression weight.

[0157] Optionally, the terminal uses formula (11) based on the quantized second singular value diagonal matrix. and the third singular vector orthogonal matrix Orthogonal matrix of the fourth singular vector The first parameter after quantization and compression, the compression weight, is obtained. .

[0158] Formula (11)

[0159] It's important to note that due to the uneven distribution of financial data, asymmetric quantization is used for the business layer, including the financial layer, while symmetric quantization is used for the general layer. Furthermore, the bit width of the business layer is smaller than that of the general layer, meaning N1 is smaller than N2, requiring a higher compression ratio for the business layer. k1 is greater than k2 because the business layer needs to retain more features.

[0160] In this embodiment, in general layers (such as ordinary fully connected or convolutional layers), the weights are usually distributed close to zero center. Symmetric quantization can maintain acceptable accuracy with low overhead. Symmetric quantization maximizes inference performance while maintaining reasonable accuracy.

[0161] In one exemplary embodiment, such as Figure 5 As shown, the knowledge graph update method includes steps 502 to 508. Wherein:

[0162] Step 502: Obtain the difference target source data through the interface corresponding to the listening component.

[0163] Optionally, the terminal obtains external source data through the interface corresponding to the listening component in the LangChain framework; it then compares the external source data with the data in the knowledge graph to obtain the target source data showing the differences. For example, the terminal obtains the PDF file of Company A's fourth quarter 2023 financial report through the interface corresponding to the listening component in the LangChain framework.

[0164] Step 504: Convert the difference target source into triple data and store the triple data; the triple data includes entities.

[0165] Optionally, the terminal parses Company A's Q4 2023 financial report PDF file and extracts key data, such as revenue and net profit. The terminal converts this key data into triplet data, for example: (Company A, Quarterly Revenue, {Year: 2023, Quarter: Q4, Value: xxxx billion yuan}) (Company A, Quarterly Net Profit, {Year: 2023, Quarter: Q4, Value: yyyy billion yuan}), where the triplet data includes the entity (also called the head entity). ,relation And attribute values ​​(also called tail entities) , corresponding to be denoted as "Company A" is the head entity, or entity; "Quarterly Net Profit" is the relation, representing the entity attribute; "{Year: 2023, Quarter: Q4, Value: yyyy billion yuan}" represents the tail entity, or attribute value. The terminal stores the triplet data into the knowledge graph, such as... .

[0166] Step 506: Obtain each stored entity and the decay factor of each entity at different update intervals.

[0167] The decay factor is used to reduce the weight of the data before the update.

[0168] Optionally, the terminal obtains each entity and its decay factor. For example, for the same entity, Company A, the knowledge graph already contains triplet data for Company A's Q3 2023 financial report. The terminal obtains the update time interval between Q4 and Q3. For example, 90 days, to obtain the decay coefficient. ,For example The default value is 0.01, and the terminal is based on the update interval. and attenuation coefficient The attenuation factor of each entity is determined by formula (12). .

[0169] Formula (12)

[0170] It should be noted that different times can also refer to the Q4 and Q2 update intervals. .

[0171] Step 508: Infer the knowledge in the knowledge graph by using a graph neural network to reason based on each entity and a decay factor at different update time intervals.

[0172] Optionally, the terminal acquires the entity. The eigenvector at time t and attribute values The eigenvector at time t The graph neural network (GNN) is used based on the feature vector of each entity at time t through formula (13). and decay factor at different times By reasoning, the entity is obtained. The eigenvector at time t+1 To update the knowledge in the knowledge graph.

[0173] Formula (13)

[0174] In the formula, This represents the complete set of knowledge graphs.

[0175] It should be noted that using knowledge graphs to store specialized business knowledge and retrieving answers through traditional graph query languages ​​(such as SPARQL) does not involve complex graph neural networks, and therefore may have limited reasoning capabilities, resulting in low accuracy of the reasoning results.

[0176] In this embodiment, by introducing a time decay formula and calculating a more detailed knowledge graph through graph neural network reasoning, intelligent weighting of dynamic knowledge is realized to solve the problems after the knowledge graph is updated, thereby improving the response speed.

[0177] In an exemplary embodiment, after obtaining the answer corresponding to the question based on the target reasoning result, the method further includes: obtaining the evaluation corresponding to the answer; and performing at least one of updating the knowledge graph and adjusting the target question-answering big model based on the evaluation.

[0178] Optionally, the terminal obtains the evaluation corresponding to the answer. If the evaluation indicates that the professional business is due to an interpretation error or a numerical calculation deviation caused by the accumulation of quantification errors, the rank of the business layer and the general layer of the target question-answering model is adjusted. If the evaluation indicates a lack of knowledge, the knowledge graph is updated. If the evaluation includes at least one of the following: the professional business is due to an interpretation error or a numerical calculation deviation caused by the accumulation of quantification errors, and also includes a lack of knowledge, the knowledge graph is updated while the target question-answering model is adjusted.

[0179] Furthermore, if the evaluation indicates a professional business error, it suggests insufficient entity identification at the business layer, and the rank k of the business layer is increased. If the evaluation indicates numerical calculation bias due to accumulated quantization errors, the rank of the general layer is decreased. If the evaluation indicates a knowledge gap, an update to the knowledge graph is triggered.

[0180] In this embodiment, closed-loop optimization is achieved through QLoRA rank adjustment driven by user feedback to optimize question answering, thereby improving the efficiency and accuracy of question answering.

[0181] In one exemplary embodiment, such as Figure 6As shown. The preparation phase includes: First, acquiring an untrained question-answering model, such as ChatGLM3. ChatGLM3, after pre-training, can capture the deep semantics of language, resulting in a pre-trained model, i.e., the initial question-answering model, which includes a business layer and a general layer. The business layer is asymmetrically quantized to obtain the first parameter compression weights, including: When the terminal starts the compression task of the initial question-answering model, it acquires a list of business entities, which can be a list of high-frequency entities in the knowledge graph. It obtains the range of each business entity in the business entity list from the knowledge graph, such as the stock price fluctuation range, the loan prime rate (LPR) fluctuation range, etc. The fluctuation range includes the upper limit and the lower limit is denoted as Emin. The terminal acquires the range of each business entity and defines logical boundaries through the entity range. For example, if there is no entity range to guide interest rate changes, a negative interest rate may be output. The entity range forces the interest rate to be limited to a reasonable range of [0.1, 20]. The terminal needs to establish a mapping relationship between the maximum and minimum values ​​of the first initial weights and the entity ranges. The entity range is mapped to the maximum and minimum values ​​of the first initial weight through the mapping relationship. The upper and lower limits of the entity range are mapped to the range between the maximum and minimum values ​​of the first initial weight, resulting in the upper limit weight after mapping, denoted as WEmax, and the lower limit weight after mapping, denoted as WEmin. The terminal calculates the asymmetric quantization parameters based on the upper and lower limits of the mapped range using formula (2) to obtain the first scaling factor. The terminal determines the first zero point value based on the upper and lower limits of the mapped range using formula (3). The first scaling factor is used to map the floating-point weights to the integer range. The first zero point value represents the integer value corresponding to the floating-point number 0 after quantization. N1 is the target bit width of quantization. For example, for 4-bit quantization, N1=4; for 8-bit quantization, N1=8. The terminal calculates the first initial weight matrix using formula (4). ,and Decomposed into the first singular value diagonal matrix The first singular vector orthogonal matrix Orthogonal matrix of the second singular vector Among them, the first singular value diagonal matrix The shape is k1×k1, used to characterize the importance of features; the first singular vector orthogonal matrix That is, the orthogonal matrix composed of the left singular vectors, with a shape of m×k1, is used to preserve the main characteristic directions; the orthogonal matrix of the second singular vectors That is, the orthogonal matrix composed of the right singular vectors has a shape of n×k1 and is used to preserve the feature space structure. The terminal uses the quantization function based on the first scaling factor s1 and the first zero value z1 to quantize the first singular value diagonal matrix using formula (5). Quantization is performed to obtain the first singular value diagonal matrix after quantization. The terminal uses formula (6) to calculate the first singular value diagonal matrix after quantization. and the first singular vector orthogonal matrix Orthogonal matrix of the second singular vector This yields the first parameter, compression weight, after quantization and compression.

[0182] Symmetric quantization is performed on the general layer to obtain the second parameter compression weight, including: the terminal obtains the second initial weight matrix W2 of the general layer and obtains the maximum value of the absolute value of the second initial weight matrix W2. N2 is the target bit width of quantization. For example, for 4-bit quantization, N2=4; for 8-bit quantization, N2=8. The terminal determines the second scaling factor based on the maximum value of the absolute value of the second initial weight matrix W2 using formula (7). The second zero value is fixed at 0 in symmetric quantization, as shown in formula (8). The second scaling factor is used to map floating-point numbers to the integer range, and the second zero value is used to align the floating-point 0 value position. The terminal uses formula (9) to compress the second initial weight matrix W2. ,and Decomposed into a second singular value diagonal matrix Third singular vector orthogonal matrix Orthogonal matrix of the fourth singular vector Among them, the second singular value diagonal matrix The shape is k2×k2, used to characterize the importance of features; the third singular vector orthogonal matrix That is, the orthogonal matrix composed of the left singular vectors, with a shape of m×k2, is used to preserve the main characteristic directions; the orthogonal matrix of the fourth singular vector. That is, the right singular vector orthogonal matrix, with a shape of n×k2, is used to preserve the feature space structure. The terminal uses the quantization function based on the second scaling factor s2 and the first zero value z2 to quantize the second singular value diagonal matrix using formula (10). Quantization is performed to obtain the first singular value diagonal matrix after quantization. The terminal uses formula (11) based on the quantized second singular value diagonal matrix. and the third singular vector orthogonal matrix Orthogonal matrix of the fourth singular vector The first parameter after quantization and compression, the compression weight, is obtained. Because financial data is unevenly distributed, asymmetric quantization is used for the business layer, including the financial layer, while symmetric quantization is used for the general layer. Furthermore, the bit width of the business layer is smaller than that of the general layer, meaning N1 is smaller than N2, requiring a higher compression ratio for the business layer. K1 is greater than k2 because the business layer needs to retain more features.

[0183] The terminal uses QLoRA technology to quantize and compress the first and second parameter compression weights. These compressed weights are then reintegrated into the initial question-answering model, forming an optimized compressed model—the target question-answering model. This optimized model uses the original framework for inference and prediction, while requiring less storage. The target question-answering model is then deployed to the terminal environment for inference and prediction.

[0184] On the other hand, the terminal obtains external source data through the interface corresponding to the listening component in the LangChain framework; it then compares the external source data with the data in the knowledge graph to obtain the target source data with discrepancies. For example, the terminal obtains the PDF file of Company A's Q4 2023 financial report through the interface corresponding to the listening component in the LangChain framework. The terminal parses the PDF file of Company A's Q4 2023 financial report and extracts key data, such as revenue and net profit. The terminal converts this key data into triple data, such as (Company A, Quarterly Revenue, {Year: 2023, Quarter: Q4, Value: xxxx billion yuan}) (Company A, Quarterly Net Profit, {Year: 2023, Quarter: Q4, Value: yyyy billion yuan}), where the triple data includes entities (also called head entities). ,relation And attribute values ​​(also called tail entities) , corresponding to be denoted as "Company A" is the head entity, or entity; "Quarterly Net Profit" is the relation, representing the entity attribute; "{Year: 2023, Quarter: Q4, Value: yyyy billion yuan}" represents the tail entity, or attribute value. The terminal stores the triplet data into the knowledge graph, such as... The terminal obtains each entity and its decay factor. For example, for the same entity, Company A, the knowledge graph already contains triplet data for Company A's Q3 2023 financial report. The terminal obtains the update time interval between Q4 and Q3. For example, 90 days, to obtain the decay coefficient. ,For example The default value is 0.01, and the terminal is based on the update interval. and attenuation coefficient The attenuation factor of each entity is determined by formula (12). Terminal obtains entity The eigenvector at time t and attribute values The eigenvector at time t The graph neural network (GNN) is used based on the feature vector of each entity at time t through formula (13). and decay factor at different times By reasoning, the entity is obtained. The eigenvector at time t+1 To update the knowledge in the knowledge graph.

[0185] The usage phase includes: the terminal receives user input questions, such as "Did Company A's net profit in the first quarter of 2023 exceed expectations?" or other questions. The terminal performs entity parsing and entity mapping based on the user input questions. For example, if Company A is an abbreviation, alias, or acronym, the abbreviation Company A is mapped to the full name based on the entity mapping and used as a prompt word. Similarly, net profit is used as a prompt word. If there are sensitive prompt words in the prompt words, the regulations are forcibly injected to perform compliance verification on the sensitive prompt words using formula (1) to obtain a compliance score. If the compliance score is greater than the compliance score threshold, it indicates that the compliance verification is passed. The terminal selects a knowledge graph with the same business type as the prompt words based on the prompt words. The terminal selects a knowledge graph with the same business type as the prompt words based on the prompt words. For example, if the terminal determines that the business type of the prompt words is financial business based on net profit, the terminal selects the knowledge graph for financial business. If the compliance score is less than or equal to the compliance score threshold, it indicates that the compliance verification is not passed, and manual review is triggered. The terminal first inputs the prompt words into the updated knowledge graph. The terminal extracts the associated entities of the prompt words from the knowledge graph and obtains the target knowledge corresponding to the associated entities through graph reasoning chain. The terminal inputs the target knowledge of the target entity into the target question-answering model. This model, through a deeper understanding of the target knowledge, generates more personalized and in-depth answers—that is, the target reasoning result corresponding to the question. The terminal uses this reasoning result as the answer to the question and outputs and displays the answer through the interface. If the evaluation indicates a professional business interpretation error, it signifies insufficient entity recognition at the business layer, and the rank k of the business layer is increased. If the evaluation indicates numerical calculation bias due to accumulated quantization errors, the rank of the general layer is decreased. If the evaluation indicates a knowledge gap, an update to the knowledge graph is triggered.

[0186] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0187] Based on the same inventive concept, this application also provides a question-answering optimization device for implementing the question-answering optimization method described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more question-answering optimization device embodiments provided below can be found in the limitations of the question-answering optimization method above, and will not be repeated here.

[0188] In one exemplary embodiment, such as Figure 7 As shown, a question-answering optimization device is provided, including: a receiving module 701, a first determining module 702, a second determining module 703, a reasoning result determining module 704, an answer determining module 705, and a target model determining module 706, wherein:

[0189] The receiving module 701 is used to receive user input.

[0190] The first determining module 702 is used to determine the prompt word based on the question input by the user, and select a knowledge graph with the same business type as the prompt word.

[0191] The second determining module 703 is used to input the prompt words into the knowledge graph to obtain target knowledge of the target entity corresponding to the business type.

[0192] The reasoning result determination module 704 is used to input the target knowledge of the target entity into the target question-answering big model to obtain the target reasoning result corresponding to the question.

[0193] The answer determination module 705 is used to obtain the answer corresponding to the question based on the target reasoning result.

[0194] The device also includes a target model determination module 706, which includes: an acquisition unit for acquiring an initial question-and-answer large model, wherein the initial question-and-answer large model includes a business layer and a general layer; a first quantization unit for performing asymmetric quantization on the business layer to obtain a first parameter compression weight; a second quantization unit for performing symmetric quantization on the general layer to obtain a second parameter compression weight; and a first determination unit for quantizing and compressing the first parameter compression weight and the second parameter compression weight to determine the target question-and-answer large model.

[0195] In one embodiment, the device further includes a prompt word determination module, which includes:

[0196] The information extraction unit is used to extract information from the user's input question to obtain the column name and column value to be processed; the matching unit is used to match the column name and column value to be processed with the stored standard column name and standard data respectively through different matching methods to obtain the initial column name corresponding to each matching method; the second determination unit is used to determine the validation logic; the selection unit is used to select the target column name from the initial column names based on the validation logic; and the third determination unit is used to determine the prompt word based on the target column name.

[0197] In one embodiment, the first quantization unit is specifically configured to: receive a list of business entities, the list of business entities being determined based on a knowledge graph; obtain the range of each business entity in the list of business entities; perform asymmetric quantization parameter calculation on the range of each business entity to obtain a first scaling factor and a first zero-point value; decompose the first initial weight matrix of the business layer into a first singular value diagonal matrix, a first singular vector orthogonal matrix, and a second singular vector orthogonal matrix; wherein the first singular value diagonal matrix is ​​determined based on a first approximate rank; the first approximate rank represents the number of singular values ​​retained by the business layer; quantize the first singular value diagonal matrix using the first scaling factor and the first zero-point value to obtain a quantized first singular value diagonal matrix; and obtain a first parameter compression weight based on the quantized first singular value diagonal matrix.

[0198] In one embodiment, the second quantization unit is specifically used to calculate symmetric quantization parameters for the second initial weight matrix of the general layer, and determine the second scaling factor and the second zero-point value; decompose the second initial weight matrix into a second singular value diagonal matrix, a third singular vector orthogonal matrix, and a fourth singular vector orthogonal matrix; wherein the second singular value diagonal matrix is ​​determined based on the second approximate rank; the second approximate rank represents the number of singular values ​​retained by the general layer; the second approximate rank is less than the first approximate rank; the first approximate rank represents the number of singular values ​​retained by the business layer; quantize the second singular value diagonal matrix using the second scaling factor and the second zero-point value to obtain the quantized second singular value diagonal matrix; and obtain the second parameter compression weight based on the quantized second singular value diagonal matrix.

[0199] In one embodiment, the apparatus further includes a knowledge graph updating module, which includes:

[0200] The acquisition module is used to obtain the difference target source data by listening to the interface corresponding to the component.

[0201] The transformation module is used to transform the differential target source into triple data and store the triple data; the triple data includes entities.

[0202] The storage module is used to obtain each entity in the storage, as well as the decay factor of each entity at different update intervals.

[0203] The update module is used to update the knowledge in the knowledge graph by reasoning based on each entity and a decay factor at different update intervals through a graph neural network.

[0204] In one embodiment, the apparatus further includes: an adjustment module for obtaining an evaluation corresponding to the answer; and performing at least one of updating the knowledge graph and adjusting the target question-answering model based on the evaluation.

[0205] Each module in the aforementioned question-answering optimization device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0206] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores question-and-answer data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a question-and-answer optimization method.

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

[0208] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0209] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0210] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0211] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0212] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0213] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A question-answering optimization method, characterized in that, The method includes: The problem of receiving user input; Based on the question input by the user, a prompt word is determined, and a knowledge graph with the same business type as the prompt word is selected; The prompt words are input into the knowledge graph to obtain the target knowledge of the target entity corresponding to the business type; The target knowledge of the target entity is input into the target question-answering model to obtain the target reasoning result corresponding to the question; Based on the reasoning results of the target, the answer corresponding to the question is obtained; The method for determining the target question-answering model includes: Obtain an initial question-and-answer model, wherein the initial question-and-answer model includes a business layer and a general layer; The business layer is subjected to asymmetric quantization to obtain the first parameter compression weight; Symmetric quantization is performed on the general layer to obtain the second parameter compression weight; The first parameter compression weight and the second parameter compression weight are quantized and compressed to determine the target question-answering model.

2. The method according to claim 1, characterized in that, The method for determining the prompt words includes: Information is extracted from the user-input question to obtain the column name and column value to be processed. By using different matching methods, the column name to be processed and the column value to be processed are matched with the stored standard column name and standard data respectively to obtain the initial column name corresponding to each matching method; Determine the verification logic; Based on the verification logic, the target column name is selected from the initial column name; The prompt word is determined based on the target column name.

3. The method according to claim 1, characterized in that, The asymmetric quantization of the business layer to obtain the first parameter compression weight includes: Receive a list of business entities, which is determined based on the knowledge graph; Obtain the range of each business entity in the business entity list; Asymmetric quantization parameters are calculated for the range of each business entity to obtain a first scaling factor and a first zero-point value. The first initial weight matrix of the business layer is decomposed into a first singular value diagonal matrix, a first singular vector orthogonal matrix, and a second singular vector orthogonal matrix; wherein, the first singular value diagonal matrix is ​​determined based on a first approximate rank; the first approximate rank represents the number of singular values ​​retained by the business layer; The first singular value diagonal matrix is ​​quantized using the first scaling factor and the first zero point value to obtain the quantized first singular value diagonal matrix. Based on the quantized first singular value diagonal matrix, the first parameter compression weight is obtained.

4. The method according to claim 1, characterized in that, The step of performing symmetric quantization on the general layer to obtain the second parameter compression weight includes: The second initial weight matrix of the general layer is subjected to symmetric quantization parameter calculation to determine the second scaling factor and the second zero point value. The second initial weight moments are decomposed into a second singular value diagonal matrix, a third singular vector orthogonal matrix, and a fourth singular vector orthogonal matrix; wherein, the second singular value diagonal matrix is ​​determined based on a second approximate rank; the second approximate rank represents the number of singular values ​​retained by the general layer; the second approximate rank is less than the first approximate rank; the first approximate rank represents the number of singular values ​​retained by the business layer; The second singular value diagonal matrix is ​​quantized using the second scaling factor and the second zero point value to obtain the quantized second singular value diagonal matrix. Based on the quantized second singular value diagonal matrix, the second parameter compression weight is obtained.

5. The method according to claim 1, characterized in that, The knowledge graph is updated in the following ways: Obtain the difference target source data by listening to the interface corresponding to the component; The differential target source is transformed into triple data, and the triple data is stored; the triple data includes entities; Obtain each stored entity, and the decay factor of each entity at different update time intervals; The knowledge in the knowledge graph is updated by reasoning based on each entity and a decay factor at different update intervals using a graph neural network.

6. The method according to claim 1, characterized in that, After obtaining the answer corresponding to the question based on the target reasoning result, the method further includes: Get the evaluation corresponding to the answer; Based on the evaluation, at least one of updating the knowledge graph and adjusting the target question-answering model is performed.

7. A question-answering optimization device, characterized in that, The device includes: The receiving module is used to receive user input questions; The first determining module is used to determine the prompt words based on the question input by the user, and select a knowledge graph with the same business type as the prompt words; The second determining module is used to input the prompt words into the knowledge graph to obtain target knowledge of the target entity corresponding to the business type; The reasoning result determination module is used to input the target knowledge of the target entity into the target question-answering model to obtain the target reasoning result corresponding to the question; The answer determination module is used to obtain the answer corresponding to the question based on the target reasoning result; The device further includes a target model determination module, the target model determination module comprising: An acquisition unit is used to acquire an initial question-and-answer model, wherein the initial question-and-answer model includes a business layer and a general layer; The first quantization unit is used to perform asymmetric quantization on the business layer to obtain the first parameter compression weight; The second quantization unit is used to perform symmetric quantization on the general layer to obtain the second parameter compression weight; The first determining unit is used to quantize and compress the first parameter compression weight and the second parameter compression weight to determine the target question-answering model.

8. The apparatus according to claim 7, characterized in that, The device further includes a prompt word determination module, the prompt word determination module comprising: The information extraction unit is used to extract information from the user-input question to obtain the column name and column value to be processed. The matching unit is used to match the column name to be processed and the column value to be processed with the stored standard column name and standard data respectively through different matching methods to obtain the initial column name corresponding to each matching method; The second determining unit is used to determine the verification logic; The selection unit is used to select a target column name from the initial column names based on the verification logic; The third determining unit is used to determine the prompt word based on the target column name.

9. The apparatus according to claim 7, characterized in that, The first quantization unit is specifically used for: receiving a list of business entities, the list of business entities being determined based on the knowledge graph; obtaining the range of each business entity in the list of business entities; and performing asymmetric quantization parameter calculation on the range of each business entity to obtain a first scaling factor and a first zero-point value. The first initial weight matrix of the business layer is decomposed into a first singular value diagonal matrix, a first singular vector orthogonal matrix, and a second singular vector orthogonal matrix; wherein, the first singular value diagonal matrix is ​​determined based on a first approximate rank; the first approximate rank represents the number of singular values ​​retained by the business layer; the first singular value diagonal matrix is ​​quantized using the first scaling factor and the first zero point value to obtain the quantized first singular value diagonal matrix; Based on the quantized first singular value diagonal matrix, the first parameter compression weight is obtained.

10. The apparatus according to claim 7, characterized in that, The second quantization unit is specifically used to calculate symmetric quantization parameters for the second initial weight matrix of the general layer, and determine the second scaling factor and the second zero-point value; decompose the second initial weight matrix into a second singular value diagonal matrix, a third singular vector orthogonal matrix, and a fourth singular vector orthogonal matrix; wherein, the second singular value diagonal matrix is ​​determined based on the second approximate rank; the second approximate rank represents the number of singular values ​​retained by the general layer; the second approximate rank is less than the first approximate rank; the first approximate rank represents the number of singular values ​​retained by the service layer; quantize the second singular value diagonal matrix using the second scaling factor and the second zero-point value to obtain the quantized second singular value diagonal matrix; and obtain the second parameter compression weight based on the quantized second singular value diagonal matrix.

11. The apparatus according to claim 7, characterized in that, The device further includes a knowledge graph update module, which includes: The acquisition module is used to obtain the difference target source data by listening to the interface corresponding to the component; A transformation module is used to transform the differential target source into triple data and store the triple data; the triple data includes entities; A storage module is used to obtain each entity stored, and the decay factor of each entity at different update time intervals; An update module is used to update the knowledge in the knowledge graph by reasoning based on each entity and a decay factor at different update time intervals using a graph neural network.

12. The apparatus according to claim 7, characterized in that, The device further includes: An adjustment module is used to obtain the evaluation corresponding to the answer; and based on the evaluation, to perform at least one of updating the knowledge graph and adjusting the target question-answering model.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

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

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.