Operation method
A series-connected arithmetic method with unique ID numbers and common weights enhances the accuracy of Transformer-based speech recognition by optimizing calculations in each block, addressing the accuracy limitations of existing methods.
Patent Information
- Application Number
- JP2023054155
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods using a single weighting coefficient in multiple layers of a Transformer-based speech recognition encoder network lack accuracy improvements.
Implementing a series-connected arithmetic method with unique ID numbers and common weights for each calculation block, performing distinct calculations using predetermined formulas, enhancing the encoder network's performance.
Improves accuracy without significantly increasing the number of parameters, thereby optimizing the speech recognition process.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a computation method. [Background technology]
[0002] Transformer is known as a machine learning model for performing speech processing, natural language processing, image processing, etc. Based on Transformer, various attempts have been made to improve accuracy and speed up processing. Non-Patent Document 1 discloses a configuration in which the same weighting coefficients are used for multiple layers of an encoder network for speech recognition based on Transformer. [Prior art documents] [Non-patent literature]
[0003] [Non-Patent Document 1] Tatsuya Komatsu, "Non-autoregressive ASR with self-conditionedFolded Encoders", in Proc. IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2022, pp. 7427-7431 Summary of the Invention [Problem to be solved by the invention]
[0004] The invention described in Non-Patent Document 1 leaves room for improvement in terms of expression accuracy. [Means for solving the problem]
[0005] A computation method according to a first aspect of the present invention is a computation method executed by a computation device having a plurality of computation blocks having the same configuration connected in series, and includes inputting to each of the computation blocks an ID number that differs for each computation block and a weight that is a value common to all of the computation blocks, and performing a different computation for each computation block using a predetermined mathematical formula, the ID number, and the weight. Effect of the Invention
[0006] According to the present invention, it is possible to improve accuracy without significantly increasing the number of parameters. [Brief description of the drawings]
[0007] [Figure 1] Speech recognition system configuration diagram [Diagram 2] Hardware configuration of the voice recognition system [Diagram 3] Encoder network configuration diagram [Figure 4] Encoder block diagram [Diagram 5] Multi-head attention diagram [Figure 6] Head configuration diagram [Figure 7] Configuration diagram of position-by-position encoding unit [Figure 8] Linear conversion block diagram [Figure 9] Flowchart showing the operation of the voice recognition system [Figure 10] Configuration diagram of a linear conversion unit in Modification 1 DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] --First embodiment-- Hereinafter, a first embodiment of a voice recognition system will be described with reference to FIGS.
[0009] FIG. 1 is a configuration diagram of a voice recognition system 1 according to the present invention. The voice recognition system 1 includes a voice input unit 14, a voice recognition unit 10, and a user interface 15. The voice input unit 14 converts voice, such as human speech, into an electrical signal and outputs a voice signal 111 to the voice recognition unit 10. The voice recognition unit 10 processes the voice signal 111 input from the voice input unit 14 to generate a recognized text 114, and outputs the recognized text 114 to the user interface 15. The user interface 15 inputs the recognized text 114 input from the voice recognition unit 10 to any other application. However, the user interface 15 may simply display the input recognized text 114. The configuration and operation of the voice recognition unit 10 will be described in detail below.
[0010] The speech recognition unit 10 includes a vector encoder 112 and an E2E model 130. A speech signal 111 is input to the vector encoder 112. The vector encoder 112 calculates features of the speech signal 111 and outputs speech features 113 to the E2E model 130. The speech features 113 are input to the E2E model 130. The E2E model 130 outputs recognized text 114 to the user interface 15 after undergoing processing described below.
[0011] The E2E model 130 performs end-to-end (E2E) speech recognition. The E2E model 130 includes an encoder network 20, a decoder network 21, a CTC network 22, and a beam search 23. The encoder network 20 receives a speech feature 113 from a vector encoder 112. The encoder network 20 outputs a time-series embedding vector 201 to the decoder network 21 and the CTC network 22 after processing described later.
[0012] The decoder network 21 receives the time-series embedding vector 201 from the encoder network 20. The decoder network 21 outputs the probability of each token to the beam search 23. The CTC network 22 receives the time-series embedding vector 201 from the encoder network 20. The CTC network 22 outputs the probability of each token to the beam search 23. The beam search 23 receives the probability of each token from the decoder network 21 and the CTC network 22. The beam search 23 outputs the recognized text 114 to the user interface 15.
[0013] Fig. 2 is a hardware configuration diagram of the voice recognition system 1. However, the voice recognition system 1 may be realized by a plurality of hardware devices, and the configuration shown in Fig. 2 is one example. The voice recognition system 1 can also be called a "computing device." The voice recognition system 1 includes a CPU 41 which is a central processing unit, a ROM 42 which is a read-only storage device, a RAM 43 which is a readable and writable storage device, a microphone 44 which collects voice signals, and a communication device 45. The CPU 41 deploys a program stored in the ROM 42 into the RAM 43 and executes it to realize the functions of the voice recognition unit 10.
[0014] The voice recognition system 1 may be realized by a field programmable gate array (FPGA), which is a rewritable logic circuit, or an application specific integrated circuit (ASIC), which is an application specific integrated circuit, instead of the combination of the CPU 41, the ROM 42, and the RAM 43. The voice recognition system 1 may be realized by a combination of different configurations, for example, a combination of the CPU 41, the ROM 42, the RAM 43, and an FPGA, instead of the combination of the CPU 41, the ROM 42, and the RAM 43. The microphone 44 realizes the voice input unit 14. The communication device 45 communicates with the outside of the voice recognition system 1 and realizes the user interface 15. The communication by the communication device 45 may be either wired or wireless.
[0015] 3 is a configuration diagram of the encoder network 20. The encoder network 20 includes L encoder blocks 200. Each encoder block 200 is also called a "layer", and the encoder block 200 at the top of the figure can be called the first layer, and the encoder block 200 at the bottom of the figure can be called the Nth layer. The configuration and operation of each encoder block 200 are the same. For convenience, the input and output of each encoder block 200 will be referred to as block input 61 and block output 62 below. Note that the encoder block 200 will also be referred to as an "operation block" below.
[0016] In principle, the input and output of the encoder block 200 are as follows. The block input 61 of the k-th encoder block 200 is the block output 62 of the k-1-th encoder block. The block output 62 of the k-th encoder block 200 is the block input 61 of the k+1-th encoder block 200. Exceptions to the input and output of the encoder block 200 are that the block input 61 of the first encoder block 200 is the speech feature 113, and that the block output 62 of the N-th encoder block 200 is the time-series embedding vector 201 that is the output of the encoder network 20. Next, the configuration of each encoder block 200 will be described.
[0017] FIG. 4 is a configuration diagram of the encoder block 200. The encoder block 200 includes a first layer norm 411, a multi-head attention 421, a first adder 431, a second layer norm 412, a position-by-position encoding unit 422, a second adder 433, an ID output unit 430, a first weight output unit 441, and a second weight output unit 442. The process of the encoder block 200 proceeds from the top to the bottom in FIG. 3. When the process of the encoder block 200 reaches the bottom of FIG. 4, the process of the next encoder block 200 starts. The process is divided into a first half process from the input to the first adder 431, and a second half process after the output of the first adder 431. The first half process and the second half process are similar, and the major difference is which of the first weight 401 and the second weight 402 is used.
[0018] The first layer norm 411 receives the block input 61 and outputs a first output 451. The multi-head attention 421 receives the first output 451 from the first layer norm 411, the first weight 401 from the first weight output unit 441, and the ID 405 from the ID output unit 430. The multi-head attention 421 outputs a second output 452 by a calculation described later. The first adder 431 outputs a third output 453 which is the sum of the block input 61 and the second output 452.
[0019] The second layer norm 412 receives the third output 453 and outputs a fourth output 454. The position-by-position encoding unit 422 receives the fourth output 454 from the second layer norm 412, the second weight 402 from the second weight output unit 442, and the ID 405 from the ID output unit 430. The position-by-position encoding unit 422 outputs a fifth output 455 by a calculation described later. The second adder 432 outputs a block output 62 which is the sum of the third output 453 and the fifth output 455.
[0020] The first weight output unit 441 outputs the first weight 401 to the multi-head attention 421. The second weight output unit 442 outputs the second weight 402 to the position-by-position encoding unit 422. The first weight 401 and the second weight 402 are both one-dimensional arrays of length K. Note that this scalar value K is the product of s and t, which are scalar values described later. The values of the first weight 401 and the second weight 402 are determined by a learning process performed in advance. In the formulas shown below, the first weight 401 is represented by p, and the second weight 402 is represented by q.
[0021] The ID output unit 430 outputs the ID 405 to the multi-head attention 421 and the position-by-position encoding unit 422. The ID 405 is a layer number. For example, when the encoder block 200 including the ID output unit 430 is the k-th layer of the encoder network 20, the ID output unit 430 outputs a numerical value "k". The output of the ID output unit 430 is the same for both the multi-head attention 421 and the position-by-position encoding unit 422.
[0022] 5 is a configuration diagram of the multi-head attention 421. The multi-head attention 421 includes a plurality of heads 4210, a connection unit 4213, and a linear conversion unit 500. The linear conversion unit 500 in this embodiment has a higher level of abstraction than other configurations. For example, the linear conversion unit 500 is also shown in FIG. 6 and subsequent figures, but the input and output are different from those in FIG. 5. The configuration and operation of the linear conversion unit 500 will be described later.
[0023] The output of each head 4210 is input to the connection unit 4213. The output of the connection unit 4213 is input to the linear transformation unit 500. The output of the linear transformation unit 500 in FIG. 5 is the second output 452 which is the output of the multi-head attention 421. Each head 4210 and the linear transformation unit 500 receives the ID 405 from the ID output unit 430 and the first weight 401 from the first weight output unit 441. The processing of the multi-head attention 421 is expressed by the following equation.
[0024]
number
[0025] 6 is a configuration diagram of the head 4210. The head 4210 includes three linear transformation units 500 and an attention block 4215. The linear transformation unit 500 receives the ID 405 from the ID output unit 430 and the first weight 401 from the first weight output unit 441. The processing of the head 4210 is expressed by the following equation.
[0026]
number
[0027] 7 is a configuration diagram of the position-based encoding unit 422. The position-based encoding unit 422 includes two linear transformation units 500. The linear transformation unit 500 receives the ID 405 from the ID output unit 430 and the second weight 402 from the second weight output unit 442.
[0028] FIG. 8 is a configuration diagram of the linear conversion unit 500. Here, the input to the linear conversion unit 500 is defined as x, and the output of the linear conversion unit 500 is defined as z. The ID 405 and the first weight 401 or the ID 405 and the second weight 402 are input to the linear conversion unit 500. Although FIG. 8 shows that both the first weight 401 and the second weight 402 are input to the linear conversion unit 500, only one of the first weight 401 and the second weight 402 is input to one linear conversion unit 500. The ID 405 is input from the ID output unit 430, the first weight 401 is input from the first weight output unit 441, and the second weight 402 is input from the second weight output unit 442. Hereinafter, the first weight 401 and the second weight 402 are collectively referred to as "weight" 400.
[0029] The linear transformation unit 500 includes an extension unit 510a, a weight determination unit 530a, and a projection unit 520a. The extension unit 510a uses the ID 405 to output a calculation function 4211 to the weight determination unit 530a. The calculation function 4211 is f(d;l n ) is expressed as l n is a learnable scalar parameter corresponding to the nth encoder, and may take different values for each linear transformation. The function f is not particularly limited, but may be, for example, the following function. d and D will be described later.
[0030]
number
[0031]
number
[0032]
number
[0033] Weight determination unit 530a uses weights 400 and calculation function 4211 to output weight matrix 4212 to projection 520. Weight matrix 4212 is a matrix with s rows and t columns, and the element in row i and column j of weight matrix 4212 can be calculated as follows. If all elements contained in a two-dimensional array with s rows and t columns are arranged in order, the element in row i and column j will be the (it+j)th element from the beginning. This value was represented by variable d in the above formula. In other words, d=it+j. Also, D is the product of s and t.
[0034]
number
[0035] This formula 6 is the value p of the (it+j)th element with weight 400. it+j f(k;l n ) is multiplied. The weight determination unit 530 repeats the calculation of Equation 6 for all elements of the weight matrix 4212. In other words, the weight determination unit 530 repeats the calculation of Equation 6 while changing the variable k from 1 to K. When the weight determination unit 530 completes the calculation of all elements of the weight matrix 4212, it outputs the weight matrix 4212 for the n-th layer to the projection 520. The projection 520 calculates the product of the input x, which is a vector, and the weight matrix 4212 to obtain the output z, which is a vector. The relationship between x, which is the input to the linear transformation unit 500, and z, which is the output of the linear transformation unit 500, is expressed by the following Equation 7.
[0036] z=W n x...(Formula 7)
[0037] Equation 2 includes many linear transformations, and the process described in FIG. 8 is performed for each of these linear transformations. Equation 2 includes "h+1" linear transformations. That is, "h+1" first weights 401 and second weights 402 are provided. The number of weights is constant regardless of the number L of encoder blocks 200 included in the encoder network 20. This is because, as shown in Equations 3 to 5, the layer number l nThis is because the weighting values are changed according to the first weighting 401 and the second weighting 402. The values of the first weighting 401 and the second weighting 402 are determined by prior learning.
[0038] 9 is a flowchart showing the operation of the speech recognition system 1. In step S801, the speech input unit 14 of the speech recognition system 1 acquires a spoken voice, converts it into a speech signal 111, and outputs it to the speech recognition unit 10. In the following step S802, the vector encoder 112 of the speech recognition unit 10 generates a speech feature 113 and outputs it to the E2E model 130. In the following step S803, the encoder network 20 of the E2E model 130 calculates a time-series embedding vector 201, which is a hidden feature of the speech feature 113, using the first weight 401 and the second weight 402, which are learned parameters.
[0039] In the following step S804, the E2E model 130 outputs the recognized text 114 using the decoder network 21, the CTC network 22, and the beam search 23. In the following step S805, the speech recognition system 1 outputs the recognized text 114 using the user interface 15.
[0040] According to the above-described first embodiment, the following advantageous effects can be obtained. (1) The calculation method executed by the speech recognition system 1 includes inputting, to each of the L encoder blocks 200, an ID number 405 that is a different value for each encoder block 200 and a weight 400 that is a value common to all calculation blocks, and performing a different calculation for each encoder block 200 using predetermined equations shown in Equations 3 to 5, the ID number 405, and the weight 400. Therefore, it is possible to improve accuracy without significantly increasing the number of parameters.
[0041] (2) The encoder block 200 constitutes the encoder network 20.
[0042] (3) The weights 400 include a first weight 401 and a second weight 402. Each of the encoder blocks 200 includes a multi-head attention unit 421 and a per-position encoding unit 422. The first weights 401 are used for the multi-head attention unit 421, and the second weights 402 are used for the per-position encoding unit.
[0043] (Variation 1) The linear transformation in the first embodiment described above does not include a bias term, but the linear transformation may include a bias term.
[0044] 10 is a configuration diagram of the linear transformation unit 500 in the first modification. When the linear transformation includes a bias term, each of the first weight 401 and the second weight 402 is a combination of a one-dimensional array of length K and a one-dimensional array of length s. For example, the first weight 401 is a combination of a one-dimensional array p of length K and a one-dimensional array b of length s. In this case, the one-dimensional array p is used in the same way as in the first embodiment, and the one-dimensional array b is used as follows.
[0045] First, in the second expansion unit 512, the calculation function g(d;l' n ) is output. n is a learnable scalar parameter corresponding to the n-th encoder, and may take a different value for each linear transformation. The function g is defined, for example, in the same manner as in the above-mentioned formulas 3 to 5. The second weight determination unit 532 determines the one-dimensional array b and the calculation function g(d;l') output by the second extension unit 512 as n ) and b as in the following formula 8. n Calculate.
[0046]
number
[0047] This equation 8 is the i-th element of the weight, q i ni g(d;l' n ) is multiplied by the one-dimensional array b nThe length of is s. The projection 520 in this modification calculates the output z as follows.
[0048] z=W n x+b n ...(Formula 9)
[0049] (Variation 2) In the first embodiment described above, the calculation function 4211 is expressed as f(k; ln). However, it may be expressed in other forms, for example, f(k; ln, φn). For example, it may be expressed as the following formula 10.
[0050]
number
[0051] In Equation 10, φn is a scalar parameter that represents the phase, and l n is a learnable parameter similar to
[0052] In each of the above-mentioned embodiments and modifications, the configuration of the functional blocks is merely an example. Some functional configurations shown as separate functional blocks may be integrated, or a configuration shown in one functional block diagram may be divided into two or more functions. In addition, some of the functions of each functional block may be provided by other functional blocks.
[0053] In the above-mentioned embodiments and modifications, the program is stored in the ROM 42, but the program may be stored in a non-volatile storage device (not shown). The voice recognition system 1 may have an input / output interface (not shown), and the program may be read from another device via the input / output interface and a medium available to the voice recognition system 1 when necessary. The medium here refers to, for example, a storage medium that is detachable from the input / output interface, or a communication medium, that is, a network such as a wired, wireless, or optical network, or a carrier wave or digital signal that propagates through the network. Some or all of the functions realized by the program may be realized by a hardware circuit or an FPGA.
[0054] The above-mentioned embodiments and modifications may be combined with each other. Although various embodiments and modifications have been described above, the present invention is not limited to these. Although the present invention has been described using speech recognition as an example, it can also be applied to other applications using a multi-layer Transformer, such as natural language processing and image processing. Other aspects that are conceivable within the scope of the technical idea of the present invention are also included in the scope of the present invention. [Explanation of symbols]
[0055] 1: Voice recognition system 10: Voice recognition section 20: Encoder network 21: Decoder network 22: CTC Network 23: Beam search 61: Block input 62: Block output 111: Audio signal 112: Vector Encoder 113: Audio features 114: Recognized text 130: E2E model 200: Encoder block 401: First weight 402: Second weight 411: 1st layer norm 412: Second layer norm 421: First multi-head attention 422: Second multi-head attention 430: ID output section 431: First adder 432: Second adder 433: Second adder 510: Extension 512: Second extension 520:Projection 530: Weight determination unit 532: Second weight determination unit 4211 : Calculation function 4212: Weight matrix
Claims
1. A computing method executed by a computing device having a plurality of processing blocks having the same configuration connected in series, comprising: inputting, into each of the processing blocks, an ID number that is a different value for each processing block and a weight that is a value common to all of the processing blocks; performing a different calculation for each of the calculation blocks using a predetermined mathematical formula, the ID number, and the weight.
2. 2. The method of claim 1, The calculation block is a calculation method for forming an encoder network.
3. 2. The method of claim 1, the weights include a first weight and a second weight; Each of the computation blocks includes multi-head attention and position-wise coding; A calculation method in which the first weights are used for the multi-head attention and the second weights are used for the position-by-position encoding.
