Intelligent machine common sense reasoning-oriented knowledge learning method

By combining pre-trained models and common sense knowledge learning methods of multi-dimensional features, the difference between combination paradigms and paired sentences is used to solve the problem of insufficient common sense reasoning ability in the existing technology, and the common sense correlation performance of intelligent machines is improved.

CN119272877APending Publication Date: 2025-01-07HAPPYTUK CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411377466.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing technology lacks generalization ability in common sense reasoning. Deep learning models lack reasoning ability when sentences lack semantic information, and supervised models require a large number of manual identification tags, especially when the scale of common sense reasoning data sets is small.

Method used

Combining the pre-trained model, a combination paradigm is constructed through multi-dimensional features and mutually exclusive properties of paired common sense tasks, using the differences between trigger words and referential nouns to capture fine-grained semantic features, constructing a common sense knowledge learning method for multi-dimensional features, and using neutral sentences , forward sentences and reverse sentences capture common sense knowledge of different meanings.

Benefits of technology

The common sense reasoning ability of the model is improved, the ability to distinguish different semantics is enhanced, and the common sense correlation performance of intelligent machines is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272877A_ABST
    Figure CN119272877A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge learning method for intelligent machine common sense reasoning. The method comprises the following steps of 1, normalizing common sense reasoning data; 2, constructing a combination normal form; step 3, multi-dimensional feature common knowledge learning; and 4, model testing and common sense reasoning. According to the method, the problems that a traditional common sense reasoning method only depends on learned shallow semantics, deep common sense semantics contained in sentences are difficult to master and the like can be solved, and common sense knowledge is captured by utilizing a combined normal form and multi-dimensional features, so that the common sense reasoning capability of the model is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a knowledge learning method for common sense reasoning of intelligent machines, belonging to the technical field of Internet and artificial intelligence. Background Art

[0002] Common sense reasoning, as a key technology of intelligent machine learning, is the ability to make judgments about the world based on the common sense implied by humans based on their extensive knowledge and assumptions. This kind of reasoning is crucial for many natural language understanding tasks, such as intelligent IoT, question answering, and dialogue systems. However, common sense reasoning remains a challenging problem for machines because it requires learning and reasoning about entities and events that are not observed or mentioned.

[0003] Traditional common sense reasoning methods are mainly based on known knowledge bases or manually formulated rules. Although they have achieved a certain degree of success, this method is a kind of common sense reasoning driven by humans and lacks generalization ability. Deep learning models perform common sense reasoning by learning the contextual semantic information of sentences, but when sentences lack semantic information, the model's reasoning ability is insufficient. In addition, supervised deep learning models require a large number of manually identified labels, which is not ideal when faced with a small scale of common sense reasoning data sets.

[0004] Since the pre-trained model learns text knowledge from a large-scale corpus, it has a certain amount of implicit common sense knowledge and can provide entity relationship reasoning in common sense sentences. Researchers began to use fine-tuning methods combined with prior knowledge and achieved good results in the representative common sense reasoning task Winograd Schema Challenge, but the fine-tuning-based method only relies on datasets and language tendencies to learn shallow semantic clues, and is very limited in its ability to accurately understand common sense relationships. Based on previous research, we introduced multi-dimensional features into the common sense reasoning task based on the pre-trained model, and used trigger words to learn the deep common sense knowledge of mutually exclusive sentences in common sense reasoning problems, thereby improving the model's reasoning ability.

[0005] Therefore, the present invention introduces a new knowledge learning method for common sense reasoning of intelligent machines. This method combines the powerful encoding ability of the pre-trained model, combines multi-dimensional features with the mutually exclusive attributes of paired common sense tasks to construct a combination paradigm, and captures fine-grained semantic features through the differences between trigger words and pronouns. After obtaining the semantic features, a common sense knowledge learning method of multi-dimensional features is proposed, which uses neutral sentences, positive sentences, and reverse sentences to capture the common sense knowledge contained in different word meanings, thereby improving the common sense reasoning ability of the model. Summary of the invention

[0006] In order to solve the problems and deficiencies in the prior art, the present invention proposes a knowledge learning method for common sense reasoning of intelligent machines, constructs a combination paradigm, integrates the mutually exclusive characteristics of common sense reasoning tasks, and performs paired semantic encoding on contrasting sentences, so as to better compare the differences between trigger words and referential nouns. In addition, after obtaining the semantic encoding information of paired sentences, multi-dimensional feature common sense knowledge learning is constructed to mine the common sense knowledge between neutral sentences, positive sentences and reverse sentences, and improve the common sense association ability of the model, so that the model can gradually reason and learn, and better distinguish the common sense knowledge contained in different semantics.

[0007] In order to achieve the above object, the technical solution of the present invention is as follows: a knowledge learning method for common sense reasoning of intelligent machines, the method comprising the following steps:

[0008] Step 1: Common sense reasoning data normalization;

[0009] Step 2: Combination paradigm construction;

[0010] Step 3: Multi-dimensional feature common sense knowledge learning;

[0011] Step 4: Model testing and common sense reasoning.

[0012] As an improvement of the present invention, step 1: normalization of common sense reasoning data, firstly, the common sense reasoning data set is obtained by using crawler technology, and then normalized into each data set containing two sentences with pronouns and two candidate words referring to pronouns. Replacing the pronouns in each sentence with candidate words can form different sentence semantics, making it conform to the common sense knowledge logic.

[0013] As an improvement of the present invention, step 2: constructing a combined paradigm, constructing a combined paradigm for the standardized common sense reasoning data, specifically, constructing a sentence pair containing pronouns w Combination input Where l = {1, 2}, which indicates the number of sentence pairs. t = {m, p, n} is a sentence tag combination, where m indicates the tag of the neutral sentence being masked, p indicates the tag of the positive sentence, and n indicates the tag of the negative sentence. It is composed of a collection of sentences. is a neutral sentence formed by replacing the pronoun P with a masking marker; For the positive sentence, it is generated by replacing the pronoun P with the correct candidate word; is a negative sentence formed by replacing the sentence pronoun P with an incorrect candidate word.

[0014] As an improvement of the present invention, step 3: multi-dimensional feature knowledge learning, using the combined paradigm processed in step 2, first use the pre-trained model BERT to perform context encoding representation to obtain the semantic information representation of each group of input. After obtaining the semantic representation of the sentence, the multi-dimensional feature common sense knowledge learning strategy is introduced to perform reasoning learning on the model. The implementation of this step can be divided into the following sub-steps:

[0015] Sub-step 3-1, build the model context encoding layer, use the pre-trained model BERT to convert each word sequence in the normalized combination into a word vector representation, and obtain the mapped question word vector sequence respectively:

[0016]

[0017] in p∈{1,2},t∈{m,p,n},represent neutral sentences, positive sentences and negative sentences respectively. e is the dimension of context embedding representation, and k represents the length of the sentence. Then the BERT encoder is used for context encoding learning:

[0018]

[0019] d h Represents the dimension of each layer. The [CLS] tag output in the hidden layer of the last layer encoding representation is regarded as the context encoding representation of the entire sentence. Therefore, the final encoding information representation of the combination paradigm is obtained:

[0020]

[0021] Sub-step 3-2, multi-dimensional feature common sense knowledge learning. In this implementation, multi-dimensional feature common sense knowledge learning mainly integrates cross entropy loss and multi-dimensional loss for joint learning.

[0022] Cross entropy loss is a widely used loss function in classification tasks, which evaluates the loss by comparing the target category and the predicted category. Its purpose is to improve the classification accuracy by maximizing the probability of the correct category. The mathematical formula of cross entropy loss is as follows:

[0023]

[0024] Where y is the true label, is the predicted probability distribution.

[0025] As a loss function designed for embedding vector space learning, the multidimensional loss function is usually used to measure learning tasks. Its main purpose is to minimize the distance between samples of the same type and maximize the distance between samples of different types, thereby effectively enhancing the robustness and classification accuracy of the model. The corresponding objective function is:

[0026]

[0027] The subscript 2 represents the L2 norm, which is used to normalize the data. I represents the total number of samples. is the i-th neutral sentence, is the ith positive sentence, is the i-th negative sentence.

[0028] Fusion loss. The goal is to optimize the comprehensive objective of the above loss functions:

[0029] L=λ1Loss1+λ2Loss2

[0030] Among them, λ1 and λ2 represent learnable hyperparameters.

[0031] Sub-step 3-3, training model loss. The parameters of the encoding phase of this example are determined according to the configuration file of the pre-trained model. The AdamW optimizer is used for gradient backpropagation to update the parameters, and the attenuation operation is performed before the weight parameters are updated. The learning rate is set to 1e-6 linear decay, the dropout rate is set to 0.1, and the batch size is 8. It is worth noting that two different tags are added to each sentence during preprocessing. The [CLS] tag is added at the beginning of the sentence. The [SEP] tag is inserted after the sentence as an indicator of the sentence boundary. The tag embedding dimension of the model is set to 1024 and the hidden layer is 24 using BERT. The length of the sentence is uniformly set to 128. Sequences exceeding this limit will be truncated, and shorter sequences will be padded. The entire model is tested in an experimental environment consisting of a virtual environment. The virtual environment created for testing PyTorch and NumPy versions are 1.12.1 and 1.23.3 respectively.

[0032] As an improvement of the present invention, step 4, model testing and common sense reasoning, uses the model with the minimum loss value trained by the model in step 3 as the best verification model, performs common sense reasoning learning, and uses the accuracy to verify the final performance of the model.

[0033] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the knowledge learning method for common sense reasoning of intelligent machines when executing the program.

[0034] A storage medium stores a computer program, which, when executed by a processor, implements the knowledge learning method for common sense reasoning of intelligent machines.

[0035] Compared with the prior art, the advantages of the present invention are as follows:

[0036] (1) The present invention introduces a knowledge learning method for common sense reasoning of intelligent machines. This technology combines a pre-trained model with powerful encoding learning language features, focuses on the mutually exclusive characteristics of common sense tasks, and introduces a combination paradigm to replace the traditional input form, so that the model is compatible with the pairwise mutually exclusive characteristics of common sense reasoning tasks, thereby improving the common sense reasoning performance of the model.

[0037] (2) The present invention utilizes a novel multi-dimensional feature common sense knowledge learning model to urge the model to learn the loss of neutral sentences and positive examples, exclude the learning of neutral sentences and negative examples, and improve the accuracy of the language model in deeply mining common sense associations, thereby giving the model the ability to accurately capture and use common sense knowledge to distinguish different semantics, further enhancing the performance of intelligent machine learning and distinguishing common sense knowledge. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is an overall model diagram of an embodiment of the present invention;

[0039] Figure 2 The present invention is a flowchart of a method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to deepen the recognition and understanding of the present invention, the present invention is further illustrated below in conjunction with specific embodiments.

[0041] Example 1: A knowledge learning method for common sense reasoning of intelligent machines. The method first normalizes the common sense reasoning data on the Internet. Then, a combination paradigm is constructed to integrate the mutually exclusive characteristics of the common sense reasoning tasks, and the contrasting sentences are semantically encoded in pairs, so as to better compare the differences between trigger words and pronouns. Then, the pre-trained model is used to perform embedded semantic representation on the paired input sentences. After obtaining the semantic coding information of the paired sentences, multi-dimensional feature knowledge learning is constructed, and the common sense knowledge between neutral sentences, positive sentences and reverse sentences is used to improve the common sense association ability of the model, so that the model can gradually reason and learn, and better distinguish the common sense knowledge contained in different semantics.

[0042] For specific models, see Figure 1 , the detailed implementation steps are as follows:

[0043] Step 1: Normalization of common sense reasoning data,First, we use crawler technology to obtain common sense reasoning datasets, and normalize them so that each dataset contains two sentences with pronouns and two candidate words referring to pronouns. Replacing the pronouns in each sentence with candidate words can form different sentence semantics, making it conform to common sense knowledge logic.

[0044] Step 2: Combination paradigm construction, the standardized common sense reasoning data is combined into a combination paradigm. Specifically, the sentence pairs containing pronouns are combined into w Combination input Where l = {1, 2}, which indicates the number of sentence pairs. t = {m, p, n} is a sentence tag combination, where m indicates the tag of the neutral sentence being masked, p indicates the tag of the positive sentence, and n indicates the tag of the negative sentence. It is composed of a collection of sentences. is a neutral sentence formed by replacing the pronoun P with a masking marker; is a positive sentence, generated by replacing the pronoun P with the correct candidate word; is a negative sentence formed by replacing the sentence pronoun P with an incorrect candidate word.

[0045] Step 3: Multi-dimensional feature knowledge learning. Using the combined paradigm processed in step 2, first use the pre-trained model BERT to perform context encoding representation to obtain the semantic information representation of each group. After obtaining the semantic representation of the sentence, the multi-dimensional feature common sense knowledge learning strategy is introduced to perform reasoning learning on the model. The implementation of this step can be divided into the following sub-steps:

[0046] Sub-step 3-1, build the model context encoding layer, use the pre-trained model BERT to convert each word sequence in the normalized combined input into a word vector representation, and obtain the mapped question word vector sequence respectively:

[0047]

[0048] in p∈{1,2},t∈{m,p,n},represent neutral sentences, positive sentences and negative sentences respectively. e is the dimension of context embedding representation, and k represents the length of the sentence. Then the BERT encoder is used for context encoding learning:

[0049]

[0050] d hRepresents the dimension of each layer. The [CLS] tag output in the hidden layer of the last layer encoding representation is regarded as the context encoding representation of the entire sentence. Therefore, the final encoding information representation of the combined input is obtained:

[0051]

[0052] Sub-step 3-2, multi-dimensional feature common sense knowledge learning. In this implementation, multi-dimensional feature common sense knowledge learning mainly integrates cross entropy loss and multi-dimensional loss for joint learning.

[0053] Cross entropy loss is a widely used loss function in classification tasks, which evaluates the loss by comparing the target category and the predicted category. Its purpose is to improve the classification accuracy by maximizing the probability of the correct category. The mathematical formula of cross entropy loss is as follows:

[0054]

[0055] Where y is the true label, is the predicted probability distribution.

[0056] As a loss function designed for embedding vector space learning, the multidimensional loss function is usually used to measure learning tasks. Its main purpose is to minimize the distance between samples of the same type and maximize the distance between samples of different types, thereby effectively enhancing the robustness and classification accuracy of the model. The corresponding objective function is:

[0057]

[0058] The subscript 2 represents the L2 norm, which is used to normalize the data. I represents the total number of samples. is the i-th neutral sentence, is the ith positive sentence, is the i-th negative sentence.

[0059] Fusion loss. The goal is to optimize the comprehensive objective of the above loss functions:

[0060] L=λ1Loss1+λ2Loss2

[0061] Among them, λ1 and λ2 represent learnable hyperparameters.

[0062] Sub-step 3-3, training model loss. The parameters of the encoding phase of this example are determined according to the configuration file of the pre-trained model. The AdamW optimizer is used for gradient backpropagation to update the parameters, and the attenuation operation is performed before the weight parameters are updated. The learning rate is set to 1e-6 linear decay, the dropout rate is set to 0.1, and the batch size is 8. It is worth noting that two different tags are added to each sentence during preprocessing. The [CLS] tag is added at the beginning of the sentence. The [SEP] tag is inserted after the sentence as an indicator of the sentence boundary. The tag embedding dimension of the model is set to 1024 and the hidden layer is 24 using BERT. The length of the sentence is uniformly set to 128. Sequences exceeding this limit will be truncated, and shorter sequences will be padded. The entire model is tested in an experimental environment consisting of a virtual environment. The virtual environment created for testing PyTorch and NumPy versions are 1.12.1 and 1.23.3 respectively.

[0063] Step 4: Model testing and common sense reasoning. The model with the minimum loss value trained by the model in step 3 is used as the best verification model. Common sense reasoning learning is performed, and the accuracy is used to test the final performance of the model.

[0064] Based on the same inventive concept, the present invention describes a knowledge learning method and device for common sense reasoning of intelligent machines, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, it implements the above-mentioned knowledge learning method for common sense reasoning of intelligent machines.

[0065] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention. It should be understood that the embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. After reading the present invention, various equivalent modifications to the present invention by those skilled in the art fall within the scope defined by the claims of this application.

Claims

1. A knowledge learning method for common sense reasoning of intelligent machines, characterized in that: The method comprises the following steps: Step 1: Normalize common sense reasoning data; Step 2: Combination paradigm construction; Step 3: Multi-dimensional feature common sense knowledge learning; Step 4: Model testing and common sense reasoning.

2. A knowledge learning method for common sense reasoning of intelligent machines according to claim 1, characterized in that: Step 1: Normalization of common sense reasoning data. Specifically, first use crawler technology to obtain the common sense reasoning data set, and normalize it so that each data set contains two sentences with pronouns and two candidate words referring to the pronouns. Replacing the pronouns in each sentence with candidate words can form different sentence semantics to make it conform to the common sense knowledge logic.

3. A knowledge learning method for common sense reasoning of intelligent machines according to claim 1, characterized in that: Step 2: Combination paradigm construction, specifically, the standardized common sense reasoning data is combined into a combination paradigm. Specifically, the sentence pairs containing pronouns are combined into w Combination input Where l = {1, 2}, represents the number of sentence pairs, t = {m, p, n} is a sentence tag combination, where m represents the tag of the neutral sentence being masked, p represents the tag of the positive sentence, and n represents the tag of the negative sentence. It is composed of a collection of sentences. is a neutral sentence formed by replacing the pronoun P with a masking marker; For the positive sentence, it is generated by replacing the pronoun P with the correct candidate word; is a negative sentence formed by replacing the sentence pronoun P with an incorrect candidate word.

4. A knowledge learning method for common sense reasoning of intelligent machines according to claim 3, characterized in that: Step 3: Multi-dimensional feature common sense knowledge learning. Specifically, using the combined paradigm processed in step 2, first use the pre-trained model BERT to perform context encoding representation to obtain the semantic information representation of each group. After obtaining the semantic representation of the sentence, the multi-dimensional feature common sense knowledge learning strategy is introduced to perform reasoning learning on the model. The implementation of this step is divided into the following sub-steps: Sub-step 3-1, build the model context encoding layer, use the pre-trained model BERT to convert each word sequence in the normalized combined input into a word vector representation, and obtain the mapped question word vector sequence respectively: in p∈{1,2},t∈{m,p,n},represent neutral sentences, positive sentences and negative sentences respectively, d e is the dimension of context embedding representation, k represents the length of the sentence, and then the BERT encoder is used for context encoding learning: d h Representing the dimensions of each layer, the [CLS] tag output in the hidden layer of the last layer encoding representation is regarded as the context encoding representation of the entire sentence, thus deriving the combined final encoding information representation: Sub-step 3-2, multi-dimensional feature common sense knowledge learning, multi-dimensional feature common sense knowledge learning is mainly to integrate cross entropy loss and multi-dimensional loss to learn together, The mathematical formula for cross entropy loss is as follows: Where y is the true label, is the predicted probability distribution, As a loss function designed for embedding vector space learning, the multidimensional loss function is usually used to measure learning tasks. Its main purpose is to minimize the distance between samples of the same type and maximize the distance between samples of different types, thereby effectively enhancing the robustness and classification accuracy of the model. The corresponding objective function is: The subscript 2 represents the L2 norm, which is used to normalize the data, and I represents the total number of samples. is the i-th neutral sentence, is the ith positive sentence, is the i-th negative sentence, Fusion loss, the goal is to optimize the comprehensive goal of the above loss functions: L=λ1Loss1+λ2Loss2 Among them, λ1 and λ2 represent learnable hyperparameters, In sub-step 3-3, the parameters of the training model loss and encoding phase are determined according to the configuration file of the pre-trained model. The AdamW optimizer is used to perform gradient back-propagation to update the parameters. By performing a decay operation before the weight parameters are updated, the learning rate is set to 1e-6 linear decay, the dropout rate is set to 0.1, and the batch size is 8.

5. The knowledge learning method for common sense reasoning of intelligent machines according to claim 1, characterized in that: Step 4: Model testing and common sense reasoning. The model with the minimum loss value trained by the model in step 3 is used as the best verification model. Common sense reasoning learning is performed, and the accuracy is used to test the final performance of the model.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the knowledge learning method for common sense reasoning of intelligent machines as described in any one of claims 1 to 6 above is implemented.

7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the knowledge learning method for common sense reasoning of intelligent machines as described in any one of claims 1 to 6 above is implemented.

Citation Information

Cited By

  • Knowledge learning method for commonsense reasoning in intelligent machine

    WO2026067596A1