Multi-Head Decoder for End-to-End Speech Recognition

This paper presents a new network architecture called multi-head decoder for end-to-end speech recognition as an extension of a multi-head attention model. In the multi-head attention model, multiple attentions are calculated, and then, they are integrated into a single attention. On the other hand, instead of the integration in the attention level, our proposed method uses multiple decoders for each attention and integrates their outputs to generate a final output. Furthermore, in order to make each head to capture the different modalities, different attention functions are used for each head, leading to the improvement of the recognition performance with an ensemble effect. To evaluate the effectiveness of our proposed method, we conduct an experimental evaluation using Corpus of Spontaneous Japanese. Experimental results demonstrate that our proposed method outperforms the conventional methods such as location-based and multi-head attention models, and that it can capture different speech/linguistic contexts within the attention-based encoder-decoder framework.


Introduction
Automatic speech recognition (ASR) is the task to convert a continuous speech signal into a sequence of discrete characters, and it is a key technology to realize the interaction between human and machine. ASR has a great potential for various applications such as voice search and voice input, making our lives more rich. Typical ASR systems [1] consist of many modules such as an acoustic model, a lexicon model, and a language model. Factorizing the ASR system into these modules makes it possible to deal with each module as a separate problem. Over the past decades, this factorization has been the basis of the ASR system, however, it makes the system much more complex.
With the improvement of deep learning techniques, end-toend approaches have been proposed [2]. In the end-to-end approach, a continuous acoustic signal or a sequence of acoustic features is directly converted into a sequence of characters with a single neural network. Therefore, the end-to-end approach does not require the factorization into several modules, as described above, making it easy to optimize the whole system. Furthermore, it does not require lexicon information, which is handcrafted by human experts in general.
The end-to-end approach is classified into two types. One approach is based on connectionist temporal classification (CTC) [2][3][4], which makes it possible to handle the difference in the length of input and output sequences with dynamic programming. The CTC-based approach can efficiently solve the sequential problem, however, CTC uses Markov assumptions to perform dynamic programming and predicts output symbols such as characters or phonemes for each frame independently.
Consequently, except in the case of huge training data [5,6], it requires the language model and graph-based decoding [7].
The other approach utilizes attention-based method [8]. In this approach, encoder-decoder architecture [9,10] is used to perform a direct mapping from a sequence of input features into text. The encoder network converts the sequence of input features to that of discriminative hidden states, and the decoder network uses attention mechanism to get an alignment between each element of the output sequence and the encoder hidden states. And then it estimates the output symbol using weighted averaged hidden states, which is based on the alignment, as the inputs of the decoder network. Compared with the CTC-based approach, the attention-based method does not require any conditional independence assumptions including the Markov assumption, language models, and complex decoding. However, non-causal alignment problem is caused by a too flexible alignment of the attention mechanism [11]. To address this issue, the study [11] combines the objective function of the attentionbased model with that of CTC to constrain flexible alignments of the attention. Another study [12] uses a multi-head attention (MHA) to get more suitable alignments. In MHA, multiple attentions are calculated, and then, they are integrated into a single attention. Using MHA enables the model to jointly focus on information from different representation subspaces at different positions [13], leading to the improvement of the recognition performance.
Inspired by the idea of MHA, in this study we present a new network architecture called multi-head decoder for end-toend speech recognition as an extension of a multi-head attention model. Instead of the integration in the attention level, our proposed method uses multiple decoders for each attention and integrates their outputs to generate a final output. Furthermore, in order to make each head to capture the different modalities, different attention functions are used for each head, leading to the improvement of the recognition performance with an ensemble effect. To evaluate the effectiveness of our proposed method, we conduct an experimental evaluation using Corpus of Spontaneous Japanese. Experimental results demonstrate that our proposed method outperforms the conventional methods such as location-based and multi-head attention models, and that it can capture different speech/linguistic contexts within the attentionbased encoder-decoder framework.

Attention-Based End-to-End ASR
The overview of attention-based network architecture is shown in Fig. 1. The attention-based method directly estimates a posterior p(C|X), where X = {x1, x2, . . . , xT } represents a sequence of input features, C = {c1, c2, . . . , cL} represents a sequence of output characters. The posterior p(C|X) is factor- ized with a probabilistic chain rule as follows: where c 1:l−1 represents a subsequence {c1, c2, . . . c l−1 }, and p(c l |c 1:l−1 , X) is calculated as follows: where Eq. (2) and Eq. (5) represent encoder and decoder networks, respectively, a lt represents an attention weight, a l represents an attention weight vector, which is a sequence of attention weights {a l0 , a l1 , . . . , a lT }, a 1:l−1 represents a subsequence of attention vectors {a1, a2, . . . , a l−1 }, ht and q l represent hidden states of encoder and decoder networks, respectively, and r l represents the letter-wise hidden vector, which is a weighted summarization of hidden vectors with the attention weight vector a l . The encoder network in Eq. (2) converts a sequence of input features X into frame-wise discriminative hidden states ht, and it is typically modeled by a bidirectional long short-term memory recurrent neural network (BLSTM): In the case of ASR, the length of the input sequence is significantly different from the length of the output sequence. Hence, basically outputs of BLSTM are often subsampled to reduce the computational cost [8,14]. The attention weight a lt in Eq. (3) represents a soft alignment between each element of the output sequence c l and the encoder hidden states ht.
• DotProductAttention(·) in Eq. (3), which is the most simplest attention [15], is calculated as follows: where Wa represents trainable matrix parameters, and e l represent a sequence of energies {e l1 , e l2 , . . . , e lT } • AdditiveAttention(·) in Eq. (3) is additive attention [16], and the calculation of the energy in Eq. (7) is replaced with following equation: where W * represents trainable matrix parameters, g and b represent trainable vector parameters.
• LocationAttention(·) in Eq. (3) is location-based attention [8], and the calculation of the energy in Eq. (7) is replaced with following equations: where F l consists of the vectors {f l1 , f l2 , . . . , f lT }, and K represents trainable one-dimensional convolution filters.
• CoverageAttention(·) in Eq. (3) is coverage mechanism [17], and the calculation of the energy in Eq. (7) is replaced with following equations: where w represents trainable vector parameters. The decoder network in Eq. (5) estimates the next character c l from the previous character c l−1 , hidden state vector of itself q l−1 and the letter-wise hidden state vector r l , similar to RNN language model (RNNLM) [18]. It is typically modeled using LSTM as follows: where W and b represent trainable matrix and vector parameters, respectively. Finally, the whole of above networks are optimized using back-propagation through time (BPTT) [19] to minimize the following objective function: where c * 1:l−1 = {c * 1 , c * 2 , . . . , c * l−1 } represents the ground truth of the previous characters.

Multi-Head Decoder
The overview of our proposed multi-head decoder (MHD) architecture is shown in Fig. 2. In MHD architecture, multiple attentions are calculated with the same manner in the conventional multi-head attention (MHA) [13]. We first describe the conventional MHA, and extend it to our proposed multi-head decoder (MHD).

Multi-head attention (MHA)
The layer-wise hidden vector at the head n is calculated as follows: where W In the case of MHA, the layer-wise hidden vectors of each head are integrated into a single vector with a trainable linear transformation: where WO is a trainable matrix parameter, N represents the number of heads.

Multi-head decoder (MHD)
On the other hand, in the case of MHD, instead of the integration at attention level, we assign multiple decoders for each head and then integrate their outputs to get a final output. Since each attention decoder captures different modalities, it is expected to improve the recognition performance with an ensemble effect. The calculation of the attention weight at the head n in Eq. (17) is replaced with following equation: Instead of the integration of the letter-wise hidden vectors {r (1) l , r (2) l , . . . , r (N) l } with linear transformation, each letterwise hidden vector r (n) l is fed to n-th decoder LSTM: Note that each LSTM has its own hidden state q (n) l which is used for the calculation of the attention weight a (n) lt , while the input character c l is the same among all of the LSTMs. Finally, all of the outputs are integrated as follows: (22) where W (n) represents a trainable matrix parameter, and b represents a trainable vector parameter.

Heterogeneous multi-head decoder (HMHD)
As a further extension, we propose heterogeneous multi-head decoder (HMHD). Original MHA methods [12,13] use the same attention function such as dot-product or additive attention for each head. On the other hand, HMHD uses different attention functions for each head. We expect that this extension enables to capture the further different context in speech within the attention-based encoder-decoder framework.

Experimental Evaluation
To evaluate the performance of our proposed method, we conducted experimental evaluation using Corpus of Spontaneous Japanese (CSJ) [21], including 581 hours of training data, and three types of evaluation data. To compare the performance, we used following dot, additive, location, and three variants of multi-head attention methods: We used the input feature vector consisting of 80 dimensional log Mel filter bank and three dimensional pitch feature, which is extracted using open-source speech recognition toolkit Kaldi [22]. Encoder and decoder networks were six-layered BLSTM with projection layer [23] (BLSTMP) and one-layered LSTM, respectively. In the second and third bottom layers in the encoder, subsampling was performed to reduce the length of utterance, yielding the length T /4. For MHA/MHD, we set the number of heads to four. For HMHD, we used two kind of settings: (1) dot-product attention + additive attention + location-based attention + coverage mechanism attention (Dot+Add+Loc+Cov), and (2) two location-based attentions + two coverage mechanism attentions (2×Loc+2×Cov). The number of distinct output characters was 3,315 including Kanji, Hiragana, Katakana, alphabets, Arabic number and sos/eos symbols. In decoding, we used beam search algorithm [10] with beam size 20. We manually set maximum and minimum lengths of the output sequence to 0.1 and 0.5 times the length of the subsampled input sequence, respectively, and the length penalty to 0.1 times the length of the output sequence. All of the networks were trained using end-to-end speech processing toolkit ESPnet [24] with a single GPU (Titan X pascal). Character error rate (CER) was used as a metric. The detail of experimental condition is shown in Table 1.
Experimental results are shown in Table 2. First, we focus on the results of the conventional methods. Basically, it is known that location-based attention yields better performance than additive attention [11]. However, in the case of Japanese sentence, its length is much shorter than that of English sentence, which makes the use of location-based attention less effective. In most of the cases, the use of MHA brings the improvement of the recognition performance. Next, we focus on the effectiveness of our proposed MHD architecture. By comparing with the MHA-Loc, MHD-Loc (proposed method) improved the performance in Tasks 1 and 2, while we observed the degradation in Task 3. However, the heterogeneous extension (HMHD), as introduced in Section 3.3, brings the further improvement for the performance of MHD, achieving the best performance among all of the methods for all test sets. Finally, Figure 3 shows the alignment information of each head of HMHD (2×Loc+2×Cov), which was obtained by visualizing the attention weights. Interestingly, the alignments of the right and left ends seem to capture more abstracted dynamics of speech, while the rest of two alignments behave like normal alignments obtained by a standard attention mechanism. Thus, we can see that the attention weights of each head have a  different tendency, and it supports our hypothesis that HMHD can capture different speech/linguistic contexts within its framework.

Conclusions
In this paper, we proposed a new network architecture called multi-head decoder for end-to-end speech recognition as an extension of a multi-head attention model. Instead of the integration in the attention level, our proposed method utilized multiple decoders for each attention and integrated their outputs to generate a final output. Furthermore, in order to make each head to capture the different modalities, we used different attention functions for each head. To evaluate the effectiveness of our proposed method, we conducted an experimental evaluation using Corpus of Spontaneous Japanese. Experimental results demonstrated that our proposed methods outperformed the conventional methods such as location-based and multi-head attention models, and that it could capture different speech/linguistic contexts within the attention-based encoderdecoder framework.
In the future work, we will combine the multi-head decoder architecture with Joint CTC/Attention architecture [11], and evaluate the performance using other databases.