Publications

Detailed Information

Efficient Transformer Network-based End-to-End Speech Recognition : 트랜스포머 기반 음성인식기의 효율적인 동작 연구

Cited 0 time in Web of Science Cited 0 time in Scopus
Authors

심규홍

Advisor
심병효
Issue Date
2022
Publisher
서울대학교 대학원
Keywords
SpeechRecognitionTransformerPhoneticLocalizationAttentionMapReusePhoneticSelfAttention
Description
학위논문(박사) -- 서울대학교대학원 : 공과대학 전기·정보공학부, 2022. 8. 심병효.
Abstract
Deep neural networks (DNNs) have shown impressive performance in end-to-end automatic speech recognition (ASR) in recent years. In particular, Transformer-based models have achieved excellent performance due to their ability to model long-range relationships. However, the self-attention (SA) module inside Transformer requires a quadratic computation complexity to construct the relationship between every frame. Because ASR is a core building block for various applications, it is important to reduce such heavy costs of SA in Transformer-based models. Specifically, we aim at designing an efficient SA architecture for ASR that can accelerate inference on current hardware systems. We obtain the direction of the architectural improvement from the analysis of the domain knowledge.

In this dissertation, we provide a novel analysis of the role of SA in Transformer-based ASR models. We show that the behavior of SA can be distinguished into two groups, phonetic localization and linguistic localization. We introduce two tools for analyzing the behavior of attention heads. First, cumulative attention diagonality (CAD) measures the concentration of attention weights within near frames. Second, phonetic attention relationship (PAR) visualizes the attention between phoneme classes. From the analyses, we present that the lower layers and the upper layers correspond to phonetic and linguistic localization, respectively. Phonetic localization pays more attention to phonologically meaningful frames over the entire sequence, while linguistic localization assigns high attention weights for near frames. The lower SA layers standardize the phonetic variance in utterances, and the upper SA layers build linguistic features from extracted phonetic features. We verify our claim by a phoneme classification task and PAR analysis on CTC, RNNT, and LAS-based ASR models.

Based on the analysis, we propose a practical Transformer design, attention map reuse, which reduces the number of effective SA computations by sharing an attention map through multiple consecutive layers. From extensive experiments, we show that the inference speed is accelerated almost twice on real GPU and CPU platforms without any degradation of accuracy. We investigate the amount of phonetic knowledge by evaluating the PAR coverage ratio and discover that an appropriate reuse configuration can preserve the necessary phonological information. In addition, we propose a new inference strategy called concatenated inference that improves the recognition accuracy by utilizing the extracted phonetic features from an external source, an utterance spoken by the same speaker.

Finally, we develop a variant of SA named phonetic self-attention (phSA) that reinforces the phonetic behavior of attention heads. We divide two different behaviors, similarity-based and content-based attention, of attention heads in the lower layers corresponding to phonetic localization. Similarity-based attention pays high attention weights for similarly pronounced phonemes, employing the pairwise correlation between the query and the key. In contrast, content-based attention gives high attention to certain phoneme classes regardless of the query. By replacing the original SA with the proposed phSA for several lower layers, the model can improve the recognition accuracy without additional parameters and GPU costs.
최근 깊은 인공신경망을 사용하는 음성인식기가 뛰어난 성능을 얻고 있다. 특히, 트랜스포머 구조를 사용하는 인공신경망 모델이 제일 높은 성능을 내고 있는데, 이는 트랜스포머가 멀리 있는 프레임의 정보도 잘 활용할 수 있다는 장점이 있기 때문이다. 하지만, 이를 위해 사용되는 셀프 어텐션 알고리즘은 모든 프레임 사이의 연관성을 계산하기 위해 프레임 수의 제곱에 비례하는 연산 복잡도가 필요하다는 단점이 있다. 음성인식기는 다양한 응용에 필수적으로 활용되는 핵심 모듈이기 때문에, 셀프 어텐션의 무거운 연산 비용을 줄이는 것은 트랜스포머 기반 음성인식기의 상용화에 필수적이다. 본 논문에서는 먼저 트랜스포머의 동작 방식을 분석하고 이를 바탕으로 효율적인 셀프 어텐션 모듈을 디자인하였다.

우선, 기존에 알려지지 않았던 트랜스포머 기반 음성인식기의 동작을 새롭게 분석하였다. 핵심적으로, 셀프 어텐션의 역할이 크게 음운론적 지역화와 언어적 지역화의 두 가지로 나눠진다는 것을 발견하였다. 분석을 위해 두 가지 새로운 분석 기법을 제안하였다. 첫째, 누적 어텐션 대각성분 분석은 각 프레임이 자기 주변의 프레임들에 얼마나 어텐션 가중치를 주는지를 측정한다. 둘째, 음소 어텐션 관계 분석은 음소 종류들 사이에서의 어텐션 가중치를 보여준다. 분석을 통해 음성인식기의 아래쪽 층에서는 음운론적 지역화가, 위쪽 층에서는 언어적 지역화가 발현된다는 것을 확인하였다. 음운론적 지역화는 입력 전체에 걸쳐 각 프레임이 음소에 기반한 특징을 추출하도록 하며, 언어적 지역화는 이렇게 추출된 특징을 사용해 발화에 맞는 문장을 생성하는 역할을 한다. 특히, 음운론적 지역화는 발화 내부에 존재하는 동일 음소에 대한 변화를 표준화하여 인식을 더 수월하게 만들어 준다. 이 과정에서 음소 어텐션 관계 분석을 통해, 음성인식기가 잘 알려진 음운론적 음소 관계를 스스로 학습했다는 것을 확인하였다. CTC, LAS, RNNT 방식으로 훈련된 음성인식기에서 위 두 가지 기법을 사용한 분석과 음소 분류 실험을 수행하여 핵심 주장을 뒷받침하였다.

다음으로, 실제 연산되는 셀프 어텐션의 횟수를 줄여 모델을 최적화하는 방법인 어텐션 맵 재사용 기법을 제안하였다. 이 기법은 한 층에서 연산한 셀프 어텐션 맵을 연속된 다음 여러 층에서 다시 그대로 사용하게 하여 층수보다 훨씬 적은 연산만으로도 모델을 구성할 수 있게 해 준다. 실험을 통해, 제안한 기법을 사용하면 실제 GPU 및 CPU에서 2배 이상 추론 속도를 올리면서도 정확도에는 거의 손실이 없다는 것을 보였다. 음소 관계 분석을 통해, 재사용을 했을 때 모델이 학습한 음운론적인 정보가 크게 손실되지 않는다면 모델의 정확도를 유지할 수 있다는 것을 발견하였다. 추가로, 동일 발화자의 다른 문장에서 추출한 음운론적인 특징을 활용하여 인식 정확도를 높이는 기법인 연쇄 추론 기법을 제안하였다.

마지막으로, 셀프 어텐션을 변형한 음운론 기반 셀프 어텐션 알고리즘을 제안하였다. 이 알고리즘은 어텐션 연산에서 음운론적인 특징 추출 과정을 강화하여 아래쪽 층에서 음운론적 지역화가 더 잘 수행되도록 한다. 우선 셀프 어텐션 내부의 곱 연산을 분해하여 유사도 기반 어텐션과 내용 기반 어텐션을 계산하는 항을 분리하였다. 전자는 프레임 간의 관계에 기반한 가중치를, 후자는 프레임 각각의 종류에 기반한 가중치를 만드는 데 특화되어 있다. 아래쪽 층들에서 기존의 일반적인 셀프 어텐션 층을 제안한 개선된 셀프 어텐션으로 대체한 결과, 음성인식 성능을 높이면서도 모델 크기와 GPU 연산 속도를 그대로 유지할 수 있었다.
Language
eng
URI
https://hdl.handle.net/10371/187722

https://dcollection.snu.ac.kr/common/orgView/000000171999
Files in This Item:
Appears in Collections:

Altmetrics

Item View & Download Count

  • mendeley

Items in S-Space are protected by copyright, with all rights reserved, unless otherwise indicated.

Share