Information processing device, information processing method, and program
The proposed seq2seq model with forward and reverse systems addresses the limitation of existing seq2seq models by passing and weighing hidden states across processing sequences, enabling bidirectional inference and improving inference accuracy for both data series.
Patent Information
- Application Number
- PCT/JP2023/013240
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2024-10-03
AI Technical Summary
Existing sequence-to-sequence (seq2seq) models with attention mechanisms cannot utilize information from subsequent sequence data in reverse processing, limiting their applicability to applications requiring bidirectional inference.
A proposed information processing device and method that incorporates a forward and reverse system within the seq2seq model, using LSTMs and attention mechanisms to pass and weigh hidden states across both forward and reverse processing sequences, enabling bidirectional inference by passing processing results between systems.
Enables inference results for each data series using processing results from both sequences, enhancing learning and inference accuracy by focusing on important information across both forward and reverse processing directions.
Smart Images

Figure JP2023013240_03102024_PF_FP_ABST
Abstract
Description
Information processing device, information processing method, and program
[0001] The present disclosure relates to an information processing device, an information processing method, and a program.
[0002] The sequence-to-sequence (seq2seq) model is a machine learning model that handles sequential data. Seq2seq is an encoder-decoder model that connects an encoder and a decoder. Seq2seq models often use modules that record information along the flow of sequential data, such as Long Short Term Memory (LSTM). To further improve the learning accuracy of seq2seq models, there are models that incorporate an attention mechanism (Non-Patent Document 1). In this model, hidden state information from all stages of the LSTM in the previous processing sequence (encoder) is passed to the next processing sequence (decoder). At each stage of the next processing sequence, processing is performed while focusing on important information from the set of hidden states in the previous processing sequence.
[0003] Yasutake Saito, "Deep Learning from Scratch 2: Natural Language Processing", O'Reilly Japan, 2018, pp. 325-348
[0004] The attention mechanism can use information resulting from processing previous-stage sequential data in a previous-stage processing series in a subsequent-stage processing series, but it cannot use information resulting from processing subsequent-stage sequential data in a subsequent-stage processing series in the reverse direction, and therefore cannot be applied when an application arises that requires such processing.
[0005] The present disclosure has been made in consideration of the above, and aims to obtain, for a first data series and a second data series, an inference result for each data of the second data series using the processing result of the first data series, and an inference result for each data of the first data series using the processing result of the second data series.
[0006] An information processing device of one embodiment of the present disclosure is an information processing device that inputs two data series and outputs an inferred value for each of the data series, and includes an input unit that accepts input of a first data series and a second data series, and an inference unit that inputs the first data series and the second data series to a model and outputs a first inferred value for each data item of the second data series focusing on the first data series, and a second inferred value for each data item of the first data series focusing on the second data series, wherein the model has a forward order system that infers the first inferred value and a reverse order system that infers the second inferred value, wherein the forward order system passes a processing result of the first data series from an earlier-stage forward order system that processes the first data series to a later-stage forward order system that processes the second data series, thereby inferring the first inferred value, and wherein the reverse order system passes a processing result of the second data series from the later-stage reverse order system that processes the second data series to an earlier-stage reverse order system that processes the first data series, thereby inferring the second inferred value.
[0007] An information processing method of one aspect of the present disclosure is an information processing method that inputs two data series and outputs an inferred value for each of the data series, wherein a computer accepts input of a first data series and a second data series, inputs the first data series and the second data series to a model, and outputs a first inferred value for each data item in the second data series focusing on the first data series, and a second inferred value for each data item in the first data series focusing on the second data series, the model having a forward order system that infers the first inferred value and a reverse order system that infers the second inferred value, the forward order system passes a processing result of the first data series from an earlier-stage forward order system that processes the first data series to a later-stage forward order system that processes the second data series, and infers the first inferred value, and the reverse order system passes a processing result of the second data series from the later-stage reverse order system that processes the second data series to an earlier-stage reverse order system that processes the first data series, and infers the second inferred value.
[0008] According to the present disclosure, for a first data series and a second data series, it is possible to obtain an inference result for each data of the second data series using the processing result of the first data series, and an inference result for each data of the first data series using the processing result of the second data series.
[0009] FIG. 1 is a diagram illustrating an example of the configuration of a machine learning model of this embodiment. FIG. 2 is a diagram illustrating an example of the configuration of an attention mechanism. FIG. 3 is a flowchart illustrating an example of the flow of a learning process. FIG. 4 is a diagram illustrating an example of a data sequence used in the learning process. FIG. 5 is a flowchart illustrating an example of the flow of the learning process. FIG. 6 is a diagram illustrating forward processing in a first-stage forward order system. FIG. 7 is a diagram illustrating forward processing in a second-stage forward order system. FIG. 8 is a diagram illustrating backward processing in a second-stage forward order system. FIG. 9 is a diagram illustrating backward processing in a first-stage forward order system. FIG. 10 is a diagram illustrating first forward processing in a first-stage reverse order system. FIG. 11 is a diagram illustrating forward processing in a second-stage reverse order system. FIG. 12 is a diagram illustrating second forward processing in a first-stage reverse order system. FIG. 13 is a diagram illustrating second backward processing in a first-stage reverse order system. FIG. 14 is a diagram illustrating backward processing in a second-stage reverse order system. FIG. 15 is a diagram illustrating first backward processing in a first-stage reverse order system. FIG. 16 is a flowchart illustrating an example of the flow of an inference process. FIG. 17 is a diagram showing an example of a data sequence used in the inference processing. FIG. 18 is a flowchart showing an example of the flow of the inference processing. FIG. 19 is a diagram for explaining the inference processing of a front-stage forward order system. FIG. 20 is a diagram for explaining the inference processing of a back-stage forward order system. FIG. 21 is a diagram for explaining a first inference processing of a front-stage reverse order system. FIG. 22 is a diagram for explaining the inference processing of a back-stage reverse order system. FIG. 23 is a diagram for explaining a second inference processing of a front-stage reverse order system. FIG. 24 is a diagram showing an example of the configuration of an information processing device. FIG. 25 is a diagram showing an example of the hardware configuration of an information processing device.
[0010] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings.
[0011] [Proposed Model] Fig. 1 is a diagram showing an example of the configuration of a seq2seq model with a mutual attention mechanism proposed in this embodiment. The model shown in the figure is composed of four parts: a front-stage forward system, a back-stage forward system, a front-stage reverse system, and a back-stage reverse system. The front-stage forward system and the back-stage forward system are collectively referred to as the forward system, and the front-stage reverse system and the back-stage reverse system are collectively referred to as the reverse system. The front-stage forward system, the back-stage forward system, the front-stage reverse system, and the back-stage reverse system may also be referred to as the front-stage forward system network, the back-stage forward system network, the front-stage reverse system network, and the back-stage reverse system network, respectively. The front-stage system and the reverse system may also be referred to as the forward system network and the reverse system network, respectively.
[0012] The forward-order system has the same configuration as a conventional seq2seq model with an attention mechanism. Both the forward-order system and the backward-order system include an LSTM (hereafter, the forward-order LSTM will be referred to as LSTM1) that inputs each data in the data sequence and the hidden state from the previous stage and performs calculations. The forward-order system includes an attention mechanism and a learning and inference unit corresponding to each LSTM1.
[0013] An example of the configuration of the attention mechanism is shown in Figure 2. The attention mechanism assigns a score to each hidden state in the set of hidden states in the forward-order system and the hidden state of each LSTM1 in the forward-order system, calculates a weight, and calculates the context vector by weighting each hidden state in the set of hidden states in the forward-order system and finding the sum.
[0014] An example of the weight calculation formula is shown below.
[0015]
[0016] In this formula, a score is given to the pair of hidden state values of the previous and subsequent processing sequences using the score function score, and the value obtained by applying the softmax function to the score function is used as the weight α tj The score function includes a neural network, and the parameters of the neural network are optimized during the learning process.
[0017] An example of the weighted sum calculation is shown in the following equation:
[0018]
[0019] In the attention mechanism, each hidden state h j (e) Weight α tj and calculate the sum, and the context vector c t Generate.
[0020] The learning and inference unit uses the context vector c t During training, the difference between the inferred result and the correct data is calculated and the model parameters are updated by backpropagation.
[0021] During training and inference of the forward-order system, the forward-order system inputs the previous data sequence, and the forward-order system inputs the subsequent data sequence. The forward-order system performs calculations on each data of the previous data sequence in LSTM1, and passes all LSTM1 hidden states (sets of hidden states) to the subsequent forward-order system. The subsequent forward-order system uses an attention mechanism to focus on important information from the set of hidden states of the forward-order system, and infers the results in the learning and inference unit. During training, the learning and inference unit calculates the loss from the inference results and correct data, and updates the model parameters through backpropagation.
[0022] The reverse-order system is an additional component in the proposed model. Both the front-stage reverse-order system and the rear-stage reverse-order system are equipped with an LSTM (hereafter, the reverse-order LSTM will be referred to as LSTM2) that inputs each data point in the data sequence and the hidden state from the previous stage and processes the hidden state. The front-stage reverse-order system is equipped with an attention mechanism and a learning and inference unit corresponding to each LSTM2. The front-stage reverse-order system inputs the same front-stage data sequence as the front-stage forward-order system, and the rear-stage reverse-order system inputs the same rear-stage data sequence as the rear-stage forward-order system. Although the same data sequence is input to both the front-stage and reverse-order systems, the LSTM2 in the reverse-order system is an independent LSTM separate from the LSTM1 in the forward-order system. This is because the optimization achieved by learning differs between the forward-stage and reverse-order systems. The attention mechanism in the front-stage reverse-order system inputs a set of hidden states from the rear-stage reverse-order system. The configuration of the attention mechanism and learning and inference unit in the front-stage reverse-order system is the same as that of the rear-stage forward-order system.
[0023] During training and inference of the reverse-order system, the previous data sequence is input to the previous-stage reverse-order system, and the next data sequence is input to the next-stage reverse-order system. The next-stage reverse-order system performs calculations on each data of the next-stage data sequence using LSTM2, and passes all LSTM2 hidden states (sets of hidden states) to the previous-stage reverse-order system. The previous-stage reverse-order system focuses on important information from the set of hidden states of the next-stage reverse-order system using its attention mechanism, and infers the results in the learning and inference unit. During training, the learning and inference unit calculates the loss from the inference results and correct data, and updates the model parameters through backpropagation.
[0024] Note that instead of LSTM, recurrent neural networks such as recurrent neural networks (RNN) and gated recurrent units (GRU) may be used.
[0025] [Learning Process] Next, an example of the learning process will be described.
[0026] FIG. 3 is a flowchart showing an example of the flow of a learning process performed by the information processing device.
[0027] In the learning process, as shown in FIG. 4, two data series are used as targets, and n le The learning process proceeds in forward and reverse order using data series. Each data series is composed of multiple vector data.
[0028] In step S11, the device initializes the number n of the data series to be processed to 1.
[0029] In step S12, the device determines whether or not all data sequences have been learned.
[0030] If there is a data series to be learned, in step S13 the device performs learning processing using data series n and data series n+1. Details of the learning processing will be described later.
[0031] In step S14, the device increments the number n of the data series to be processed by 1, and returns to step S12 to continue processing.
[0032] The learning process will be described in detail with reference to the flowchart of FIG.
[0033] The learning process consists of a normal order learning process (steps S1301 to S1304) and a reverse order learning process (steps S1305 to S1310).
[0034] In step S1301, the device executes a first-stage normal-order learning forward process. The first-stage normal-order learning forward process is a process using a first-stage normal-order system to which a data sequence n is input.
[0035] The forward learning process of the previous stage normal system will be described with reference to FIG. 6. FIG. 6 illustrates the LSTM1 of the previous stage normal system. The LSTM1 of the previous stage normal system receives input of the first vector data (1) to the m-th vector data (m) of the data series n in order. In other words, in the example of FIG. 6, the data series n consists of m pieces of vector data. The first LSTM1(1) receives input of the vector data (1) and generates the hidden state h1 (e) and the value of the memory cell c1 (e) The second and subsequent LSTM1(i) outputs the vector data (i) and the hidden state h of the previous LSTM1(i-1). i-1 (e) and the value of the memory cell c i-1 (e) inputs its own hidden state h i (e) and the value of the memory cell c i (e) The m-th LSTM1(m) corresponding to the last vector data (m) of the data sequence n outputs its hidden state h m (e) Hand over.
[0036] Furthermore, the pre-stage normal system is a matrix H (e) is passed to the subsequent normal system. H (e) [i]=h i (e) Let's say.
[0037] In step S1302, the device executes a post-stage normal-order learning forward process, which is a process for calculating an error between an inferred value and correct data.
[0038] The forward learning process of the latter-stage normal system will be described with reference to FIG. 7. FIG. 7 illustrates the LSTM1 of the latter-stage normal system. The LSTM1 of the latter-stage normal system receives input of the first vector data (1) to the pth vector data (p) of the data sequence n+1 in order. In other words, in the example of FIG. 7, the data sequence n+1 consists of p vector data. The first LSTM1(1) receives the hidden state h of the former-stage normal system. m (e) and vector data (1) are input, and the hidden state h1 (d) and the value of the memory cell c1 (d) The second and subsequent LSTM1(i) outputs the vector data (i) and the hidden state h of the previous LSTM1(i-1). i-1 (d) and the value of the memory cell c i-1 (d) inputs its own hidden state h i (d) and the value of the memory cell c i (d) Output.
[0039] The latter stage normal system has Attention(i), Affine(i), and Softmax with Loss(i) corresponding to each LSTM1(i). The hidden state h of LSTM1(i) i (d) is also input to Attention(i) and Affine(i). Attention(i) is the hidden state matrix H (e) and the hidden state h of LSTM1(i) i (d) Enter the context vector co i (d) Affine(i) is output. i (d) and co i (d) Enter af i (d) Softmax with Loss(i) is af i (d) and the correct answer data Ans i (d) Input the difference between them and i (d)Output.
[0040] Above, the difference between the inferred value and the correct data at each stage is i (d) The forward processing of normal order learning is carried out until the output is completed.
[0041] In step S1303, the device executes a later-stage normal-order learning backward process. The later-stage normal-order learning backward process is a process for updating parameters of each unit while propagating the error calculated in the forward process in a direction opposite to the transmission direction of each signal in the forward process.
[0042] The backward processing of the normal-order learning in the latter stage will be described with reference to Fig. 8. In each stage, the error information Δaf is propagated from Softmax with loss(i) as a starting point in the direction toward Affine(i) and Attention(i) by the error backpropagation method. i (d) , Δco i (d) , Δh i 2(d) , Δh i 1(d) is propagated.
[0043] In addition, in LSTM1, the error information Δh' of the hidden state is propagated from the p-th LSTM1(p) to the previous LSTM1(i) by the backpropagation method. i (d) and the error information Δc of the memory cell value i (d) is propagated. Note that the error Δh of the hidden state input to LSTM1(i) i (d) is the error information Δh' of the hidden state propagated from LSTM1(i+1). i (d) The error information Δh propagated from Affine(i) to i 2(d) and the error information Δh propagated from Attention(i). i 1(d) The error Δh i (d) The error information Δh' of the hidden state propagated from LSTM1(1) m (e)is propagated to the mth LSTM1(m) in the previous normal system.
[0044] Furthermore, each Attention(i) is the error information ΔH of the hidden states of all LSTM1s in the forward-order system of the previous stage. i (d) The error information ΔH output by each Attention(i) is i (d) ΔH obtained by adding all of the above (e) is propagated to the previous normal system.
[0045] In step S1304, the device executes a first-stage forward-order learning backward process. The first-stage forward-order learning backward process is a process for updating parameters of each unit while propagating the error calculated in the forward process in a direction opposite to the transmission direction of each signal in the forward process.
[0046] The forward learning backward process of the previous stage will be described with reference to Fig. 9. In the forward learning process of the previous stage, the error information Δh' of the hidden state is propagated from the m-th LSTM1(m) to the previous LSTM1(i) by the error backpropagation method. i (e) and the error information Δc of the memory cell value i (e) is propagated. The error Δh of the hidden state input to LSTM1(i) i (e) is the error information Δh' of the hidden state propagated from LSTM1(i+1). i (e) The error information ΔH propagated from the subsequent normal system to (e) [i] is added to the error Δh i (e) However, the error Δh of the hidden state input to LSTM1(m) m (e) is the error information Δh' propagated from the subsequent normal system m (e) Similarly, the error information ΔH (e) [m] is the added error Δh m (e) is.
[0047] Through the above process, normal order learning is performed.
[0048] Next, learning in the reverse order system will be described.
[0049] In step S1305, the device executes a first front-stage reverse-order learning forward process. The first front-stage reverse-order learning forward process is a process using a front-stage reverse-order system to which the same data sequence n as that used in the front-stage forward-order system is input. This process is the same as the front-stage forward-order learning forward process in FIG. 6 except that a reverse-order LSTM2 is used and the set of hidden states is not passed to the rear-stage reverse-order system.
[0050] The first pre-stage reverse-order learning forward process will be described with reference to FIG. 10. FIG. 10 illustrates the LSTM2 of the pre-stage reverse-order system. The LSTM2 of the pre-stage reverse-order system receives input of the first vector data (1) to the m-th vector data (m) of the data sequence n in order. The first LSTM2(1) receives input of the vector data (1) and generates a hidden state h1 (e) and the value of the memory cell c1 (e) The second and subsequent LSTM2(i) outputs the vector data (i) and the hidden state h of the previous LSTM2(i-1). i-1 (e) and the value of the memory cell c i-1 (e) inputs its own hidden state h i (e) and the value of the memory cell c i (e) The LSTM2(m) corresponding to the last vector data (m) of the data sequence n outputs its hidden state h m (e) Hand over.
[0051] In step S1306, the device executes a later-stage reverse-order learning forward process, which is a process using a later-stage reverse-order system to which data sequence n+1 is input.
[0052] The backward-reverse learning forward process will be described with reference to FIG. 11. FIG. 11 illustrates the backward-reverse LSTM2. The backward-reverse LSTM2 receives inputs of the first vector data (1) to the p-th vector data (p) of the data sequence n+1 in order. The first LSTM2(1) receives the hidden state h of the forward-reverse system. m(e) and vector data (1) are input, and the hidden state h1 (d) and the value of the memory cell c1 (d) The second and subsequent LSTM2(i) outputs the vector data (i) and the hidden state h of the previous LSTM2(i-1). i-1 (d) and the value of the memory cell c i-1 (d) inputs its own hidden state h i (d) and the value of the memory cell c i (d) Output.
[0053] Furthermore, the latter stage reverse system is a matrix H (d) is passed to the previous reverse order system. H (d) [i]=h i (d) Let's say.
[0054] The first front-stage reverse-order learning forward process and the second-stage reverse-order learning forward process may be executed in parallel with the front-stage forward-order learning forward process and the second-stage forward-order learning forward process. That is, steps S1301 and S1302 and steps S1305 and S1306 may be executed in parallel.
[0055] In step S1307, the device executes a second front-stage reverse-order learning forward process. The second front-stage reverse-order learning forward process is a process for calculating an error between an inferred value and correct answer data, similar to the second front-stage forward-order process.
[0056] The second pre-stage reverse-order learning forward process will be described with reference to FIG. 12. The pre-stage reverse-order process has Attention(i), Affine(i), and Softmax with Loss(i) corresponding to each LSTM2(i). The hidden state h i (e) is also input to Attention(i) and Affine(i). Attention(i) is the hidden state matrix H (d) and the hidden state h of LSTM2(i) i (e) Enter the context vector co i (e)Affine(i) is output. i (e) and co i (e) Enter af i (e) Softmax with Loss(i) is af i (e) and the correct answer data Ans i (e) Input the difference between them and i (e) Output.
[0057] Above, the difference between the inferred value and the correct data at each stage is i (e) The forward processing of reverse order learning is carried out until the output is completed.
[0058] In step S1308, the device executes a second front-stage reverse-order learning backward process, which corresponds to the second front-stage reverse-order learning forward process and updates parameters of each unit while propagating errors calculated in the forward process in a direction opposite to the transmission direction of each signal in the forward process.
[0059] The second front-stage reverse order learning backward process will be described with reference to Fig. 13. In each stage, the error information Δaf is calculated by the error backpropagation method in the direction from Softmax with loss(i) to Affine(i) and Attention(i). i (e) , Δco i (e) , Δh i 2(e) , Δh i 1(e) is propagated.
[0060] Furthermore, each Attention(i) is calculated by the error information ΔH i (e) The error information ΔH output by each Attention(i) is i (e) ΔH obtained by adding all of the above (d) is propagated to the subsequent reverse order system.
[0061] In step S1309, the device executes a second-stage reverse-order learning backward process, which updates the parameters of each unit while propagating the error calculated in the forward process in a direction opposite to the transmission direction of each signal in the forward process.
[0062] The backward learning process of the latter-stage reverse-order system will be described with reference to Fig. 14. In the latter-stage reverse-order system, the error information Δh' of the hidden state is propagated from the p-th LSTM2(p) to the previous LSTM2(i) by the error backpropagation method. i (d) and the error information Δc of the memory cell value i (d) is propagated. The error Δh of the hidden state input to LSTM2(i) i (d) is the error information Δh' of the hidden state propagated from LSTM2(i+1). i (d) The error Δh is the sum of the error information ΔH(d)[i] propagated from the previous reverse system. i (d) is.
[0063] The error information Δh' of the hidden state propagated from LSTM2(1) m (e) is propagated to the mth LSTM2(m) in the previous reverse order system.
[0064] In step S1310, the device executes a first front-stage reverse-order learning backward process, which corresponds to the first front-stage reverse-order learning forward process, and updates parameters of each unit while propagating errors calculated in the forward process in a direction opposite to the transmission direction of each signal in the forward process.
[0065] The first upstream reverse-order learning backward process will be described with reference to Fig. 15. In the upstream reverse-order process, the error information Δh' of the hidden state is propagated from the m-th LSTM2(m) to the previous LSTM2(i) by the error backpropagation method. i (e) and the error information Δc of the memory cell value i(e) is propagated. The error Δh of the hidden state input to LSTM2(i) i (e) is the error information Δh' of the hidden state propagated from LSTM2(i+1). i (e) The error information Δh propagated from Affine(i) to i 2(e) and the error information Δh propagated from Attention(i). i 1(e) The error Δh i (e) However, the error information Δh of the hidden state input to LSTM2(m) m (e) is the error information Δh' propagated from the subsequent reverse order system m (e) The error information Δh propagated from Affine(m) to m 2(e) and the error information Δh propagated from Attention(m) m 1(e) The error Δh m (e) is.
[0066] Through the above processing, reverse order learning is performed to infer the previous data sequence from the subsequent data sequence. After this, the process returns to step S1301, and normal order learning processing is performed using data sequence n+1 and data sequence n+2.
[0067] [Inference Processing] Next, an example of the inference processing will be described.
[0068] FIG. 16 is a flowchart showing an example of the flow of an inference process performed by the device.
[0069] In the inference process, as shown in FIG. 17, inference is performed while shifting the input data series one by one.
[0070] In step S21, the device initializes the number n of the data series to be processed to 1.
[0071] In step S22, the device determines whether the desired number of data sequences has been inferred.
[0072] If there is a data series to be inferred, in step S23, the device performs inference processing for data series n+1 using data series n, and inference processing for data series n using data series n+1. The details of the inference processing will be described later.
[0073] In step S24, the device increments the number n of the data series to be processed by 1, and returns to step S22 to continue processing.
[0074] The inference process will be described in detail with reference to the flowchart of FIG.
[0075] The inference process consists of forward inference process (steps S2301 to S2302) and reverse inference process (steps S2303 to S2305).
[0076] In step S2301, the device executes a first-stage normal order inference process, which is the same as the first-stage normal order learning forward process during learning.
[0077] The forward-order inference process will be described with reference to FIG. 19. The first vector data (1) to the m-th vector data (m) of the data sequence n are input to the forward-order LSTM1 in the forward-order system of the forward stage in order. The LSTM1(i) uses the vector data (i) and the hidden state h of the previous LSTM1(i-1). i-1 (e) and the value of the memory cell c i-1 (e) inputs its own hidden state h i (e) and the value of the memory cell c i (e) The first LSTM1(1) only inputs vector data (1). The mth LSTM1(m) outputs its own hidden state h m (e) Hand over.
[0078] Furthermore, the pre-stage normal system is a matrix H (e) is passed to the subsequent normal system.
[0079] In step S2302, the device executes a subsequent normal order inference process, which is the same as the subsequent normal order learning forward process during learning.
[0080] The inference process of the later-stage normal system will be described with reference to FIG. 20. The first vector data (1) to the p-th vector data (p) of the data sequence n+1 are input to the LSTM1 of the later-stage normal system in order. The first LSTM1(1) calculates the hidden state h m (e) and vector data (1) are input, and the hidden state h1 (d) and the value of the memory cell c1 (d) The second and subsequent LSTM1(i) outputs the vector data (i) and the hidden state h of the previous LSTM1(i-1). i-1 (d) and the value of the memory cell c i-1 (d) inputs its own hidden state h i (d) and the value of the memory cell c i (d) Output.
[0081] Attention(i) is the matrix H (e) and the hidden state h of LSTM1(i). i (d) Enter the context vector co i (d) Affine(i) is output. i (d) and co i (d) Enter af i (d) Softmax with Loss(i) is af i (d) Enter the inferred value Ans i (d) Output.
[0082] In step S2303, the device executes a first front-stage reverse-order inference process, which is the same as the first front-stage reverse-order learning forward process during learning.
[0083] The first inference process of the first reverse-order system will be described with reference to FIG. 21. The LSTM2 of the reverse-order system of the first stage receives the first vector data (1) to the m-th vector data (m) of the same data sequence n as the forward-order system of the first stage. LSTM2(i) receives the hidden state h of the previous LSTM2(i-1) and the vector data (i). i-1 (e) and the value of the memory cell c i-1 (e) inputs its own hidden state h i (e) and the value of the memory cell c i (e) The first LSTM2(1) only inputs the vector data (1). The mth LSTM2(m) outputs its hidden state h m (e) Hand over.
[0084] In step S2304, the device executes a subsequent reverse-order inference process, which is the same as the subsequent reverse-order learning forward process during learning.
[0085] The inference process of the latter-stage reverse-order system will be described with reference to FIG. 22. The LSTM2 of the latter-stage reverse-order system receives input of the first vector data (1) to the p-th vector data (p) of the data sequence n+1 in order. The first LSTM2(1) generates the hidden state h m (e) and vector data (1) are input, and the hidden state h1 (d) and the value of the memory cell c1 (d) The second and subsequent LSTM2(i) outputs the vector data (i) and the hidden state h of the previous LSTM2(i-1). i-1 (d) and the value of the memory cell c i-1 (d) inputs its own hidden state h i (d) and the value of the memory cell c i (d) Output.
[0086] Furthermore, the latter stage reverse system is a matrix H (d) is passed to the previous reverse order system.
[0087] The first front-stage reverse-order inference process and the second-stage reverse-order inference process may be executed in parallel with the front-stage forward-order inference process and the second-stage forward-order process. That is, steps S2301 and S2302 and steps S2303 and S2304 may be executed in parallel.
[0088] In step S2305, the device executes a second front-stage reverse-order inference process, which is the same as the first front-stage reverse-order learning forward process during learning.
[0089] The second inference process for the first-stage reverse order system will be described with reference to Fig. 23. Attention(i) is the matrix H (e) and the hidden state h of LSTM2(i) i (e) Enter the context vector co i (e) Affine(i) is output. i (e) and co i (e) Enter af i (e) Softmax with Loss(i) is af i (e) Enter the inferred value Ans i (e) Output.
[0090] 24 is a diagram showing an example of the configuration of an information processing device according to this embodiment. The information processing device 10 shown in the figure includes a learning unit 11, an input unit 12, and an inference unit 13. The information processing device 10 may hold a trained model and include only the input unit 12 and the inference unit 13.
[0091] The learning unit 11 holds learning data and executes a learning process to learn a model.
[0092] The input unit 12 receives input of a first data sequence and a second data sequence.
[0093] The inference unit 13 inputs the first data series and the second data series into the trained model, and outputs an inferred value for each data item in the second data series focusing on the first data series, and an inferred value for each data item in the first data series focusing on the second data series.
[0094] The data sequence may be text, audio data, image data, or video data.
[0095] As described above, the information processing device 10 of this embodiment is an information processing device that receives two data series as input and outputs inferred values for each of the data series. The information processing device 10 includes an input unit 12 that accepts input of a first data series and a second data series, and an inference unit 13 that outputs an inferred value for each data item in the second data series focusing on the first data series, and a second inferred value for each data item in the first data series focusing on the second data series. This makes it possible to obtain, for the first and second data series, an inference result for each data item in the second data series using the processing result of the first data series, and an inference result for each data item in the first data series using the processing result of the second data series.
[0096] The inference unit 13 inputs the first data sequence and the second data sequence into the proposed model and outputs an inferred value in the forward direction and an inferred value in the reverse direction. The proposed model has a forward system and a reverse system. The forward system has a front-stage forward system and a rear-stage forward system. The front-stage forward system has an LSTM1 that processes the first data sequence and outputs a hidden state. The rear-stage forward system has an LSTM1 that inputs the hidden states of the front-stage forward system and processes the second data sequence to output a hidden state for each data, Attention that weights each hidden state of each data in the second data sequence for the set of hidden states of the front-stage forward system to focus on important information, and Affine and Softmax with Loss that output an inferred value from the context vector output by Attention. The reverse system has a front-stage reverse system and a rear-stage reverse system. The first-stage reverse-order system includes an LSTM2 that processes the first data sequence and outputs a hidden state, Attention that focuses on important information by weighting each hidden state of each data in the first data sequence for a set of hidden states in the second-stage reverse-order system, and Affine and Softmax with Loss that output an inferred value from the context vector output by Attention. The second-stage reverse-order system includes an LSTM2 that inputs the hidden state of the first-stage reverse-order system, processes the second data sequence, and outputs a hidden state.
[0097] The information processing device 10 includes a learning unit 11 that inputs a plurality of learning data sequences to a model while shifting the sequences one by one, and learns the model.
[0098] The information processing device 10 described above can be, for example, a general-purpose computer system including a central processing unit (CPU) 901, a memory 902, a storage 903, a communication device 904, an input device 905, and an output device 906, as shown in Fig. 25. In this computer system, the information processing device 10 is realized by the CPU 901 executing a predetermined program loaded onto the memory 902. This program can be recorded on a computer-readable non-transitory recording medium such as a magnetic disk, an optical disk, or a semiconductor memory, or can be distributed via a network.
[0099] Information processing device 10 Learning unit 11 Input unit 12 Inference unit 13
Claims
1. An information processing device that inputs two data series and outputs an inferred value for each of the data series, comprising: an input unit that accepts input of a first data series and a second data series; and an inference unit that inputs the first data series and the second data series to a model and outputs a first inferred value for each data of the second data series focusing on the first data series and a second inferred value for each data of the first data series focusing on the second data series, wherein the model has a forward order system that infers the first inferred value and a reverse order system that infers the second inferred value, wherein the forward order system passes a processing result of the first data series from a front-stage forward order system that processes the first data series to a rear-stage forward order system that processes the second data series to infer the first inferred value, and wherein the reverse order system passes a processing result of the second data series from a rear-stage reverse order system that processes the second data series to an front-stage reverse order system that processes the first data series to infer the second inferred value.
2. An information processing device according to claim 1, wherein the forward order system comprises: a first neural network that processes the first data sequence to output a first hidden state; a second neural network that receives the first hidden state and processes the second data sequence to output a second hidden state; a first attention mechanism that assigns weights to each of the second hidden states in the set of first hidden states to focus on important information; and a first inference unit that outputs the first inference value from a context vector output by the first attention mechanism; and the reverse order system comprises: a third neural network that processes the first data sequence to output a third hidden state; a fourth neural network that receives the third hidden state and processes the second data sequence to output a fourth hidden state; a second attention mechanism that assigns weights to each of the third hidden states in the set of fourth hidden states to focus on important information; and a second inference unit that outputs the second inference value from a context vector output by the second attention mechanism. Information processing device.
3. An information processing device according to claim 1, comprising a learning unit that inputs a plurality of learning data sequences to the model while shifting them one by one, to learn the model.
4. An information processing method for inputting two data series and outputting an inferred value for each of the data series, comprising: a computer that receives an input of a first data series and a second data series; inputs the first data series and the second data series into a model; and outputs a first inferred value for each data of the second data series focusing on the first data series, and a second inferred value for each data of the first data series focusing on the second data series; the model has a forward order system for inferring the first inferred value and a reverse order system for inferring the second inferred value, the forward order system passes a processing result of the first data series from a front-stage forward order system that processes the first data series to a rear-stage forward order system that processes the second data series to infer the first inferred value, and the reverse order system passes a processing result of the second data series from a rear-stage reverse order system that processes the second data series to an front-stage reverse order system that processes the first data series to infer the second inferred value.
5. An information processing method according to claim 4, wherein the forward system comprises: a first neural network that processes the first data sequence to output a first hidden state; a second neural network that receives the first hidden state and processes the second data sequence to output a second hidden state; a first attention mechanism that weights each of the second hidden states in the set of first hidden states to focus on important information; and a first inference unit that outputs the first inference value from a context vector output by the first attention mechanism; and the reverse system comprises: a third neural network that processes the first data sequence to output a third hidden state; a fourth neural network that receives the third hidden state and processes the second data sequence to output a fourth hidden state; a second attention mechanism that weights each of the third hidden states in the set of fourth hidden states to focus on important information; a second inference unit that outputs the second inference value from a context vector output by the second attention mechanism.
6. An information processing method according to claim 4, wherein a computer inputs a plurality of learning data sequences to the model while shifting the sequences one by one, thereby learning the model.
7. A program for causing a computer to operate as each part of the information processing device according to any one of claims 1 to 3.
Citation Information
Patent Citations
Neural machine translation model training method and device, and computer program therefor
JP2019149018A
Answer learning device, answer learning method, answer generating device, answer generating method, and program
JP2020061173A
