자연어처리(Natural Language Processing, NLP)는 일상생활에서 사용하는 인간 의 언어 현상을 컴퓨터와 같은 기계가 이해하고 해석하여 묘사할 수 있도록 연구 하는 인공지능의 주요 분야다. 그 중에서 언어 모델(Language Model, LM)은 언어 의 문법 및 의미를 학습하여 모델링하고자 하는 단어 시퀀스에 확률을 할당하는 것에 목적을 두고 있으며 모델 크기 증가에 따른 성능이 향상 된 여러 연구 사례 를 기반으로 대규모 언어 모델(Large Language Model, LLM)에 대한 연구가 지속 적으로 진행되고 있는 추세이다. 이런 대규모 언어 모델은 단일 모델로 여러 과제 를 함께 수행할 수 있는 강건한 모델을 만들 수 있지만 모델을 학습하기 위해선 방대한 컴퓨팅 리소스와 엄청난 양의 학습 데이터 구축이 필수적이라는 단점이 있 다. 특히, 엣지 환경 및 모바일 디바이스와 같은 제한된 컴퓨팅 리소스를 가진 환 경에서는 사용이 제한되며 실시간 처리가 요구되는 환경에서 사용하는데 어려움이 있다. 이를 해결하고자 신경망 모델에서 사용되는 지식 증류(Knowledge distillation)와 같은 경량화 기법들이 언어 모델에 적용되어 경량화된 언어 모델이 제안되었다. 하지만 여전히 언어 모델의 파마미터 수에 많은 비중을 차지하는 모 델 구조 변경 없이 진행되어 경량화에 한계가 있으며 고정된 모델 크기로 모델 경 량화가 수행된다는 한계점을 여전히 지니고 있다. 또한, 대부분의 언어 모델이 영 어나 중국어와 같이 세계적으로 많이 사용되는 언어에 특화되었기 때문에 한국어 기반 언어 모델에 대한 경량화 연구는 매우 미진한 상황이다. 본 연구에서는 지식 증류 기법을 한국어 기반 언어 모델에 적용하여 제한된 컴퓨팅 리소스 환경에서도 사용이 가능한 사전학습 한국어 언어 모델의 경량화 기법을 제안하였다. 그리고 저계수 분해(Low-rank factorization) 기법을 함께 적용하여 언어 모델의 파라미터 수의 많은 비중을 차지하는 순방향 신경망(Feed-forward Neural Network, FNN) 과 인코더 층(Encoder-layer)의 구조를 변경하여 경량화를 개선하였다. 제안된 방법의 검증을 위해 한국어 언어 모델을 평가할 때 주로 사용되는 공개된 8개의 한국어 말뭉치를 활용하였다. 또한, 지식 증류 정도에 따른 모델 성능에 대 한 영향을 검증하기 위해 기존 언어 모델의 Loss와 지식 증류 기반의 Loss 비율 을 30%, 50%, 70%로 증가하여 모델 성능을 평가하였으며 특히 53MB 모델 크기 를 가진 Small 모델에 Loss 비율을 50%로 학습한 모델이 432MB 모델 대비 96.697%의 우수한 모델 성능을 확인하였다. 이와 같은 실험 결과를 통해 제안하는 경량화된 사전학습 한국어 언어 모델이 제한된 컴퓨팅 리소스를 주어진 상황에서 자연어 처리 태스크의 효과적인 도구로 활용될 수 있음을 확인할 수 있다.
Natural Language Processing (NLP) is a main research field of artificial intelligence, which enables machines such as computers to understand, interpret, and describe human language phenomena used in daily life. Among them, a language model (LM) aims to learn the grammar and meaning of a language and assign a probability to a word sequence to be modeled. In addition, based on several research cases in which the performance is improved as the model size increases, research on large language models (LLM) is continuously being conducted. Such a large language model is able to create a robust model that can perform multiple tasks together with a single model, but it has the disadvantages of requiring massive computing resources and building a huge amount of training data to train the model. In particular, its use is limited in cases of an environment with limited computing resources, such as edge environments and mobile devices, and it is difficult to use in an environment requiring real-time processing. To solve this problem, several lightweight techniques such as a knowledge distillation used in neural network models were applied to the language model and a number of lightweight version of language model has been developed through model weight reduction. However, there is still no change in the structure of the model, which has a large weight on the number of parameters of the language model, and there is a limit to the degree of weight reduction as the model weight is reduced to a specific fixed model size. In addition, since most language models are specialized for widely used languages such as English and Chinese, research on weight reduction on Korean language models remains a challenge. In this study, by applying the knowledge distillation technique to a Korean language model, we propose a lightweight method for a pre-trained Korean language model that is capable of being used even in a limited computing resource environment. Additionally, the use of the low-rank factorization technique together yields more reduction of the weight by changing the structure of the feed-forward neural network (FNN) and the encoder-layer, which have a large proportion of the number of parameters in the language model. To validate the proposed method, we utilized eight publicly available Korean corpora, which have been mainly used when evaluating Korean language models. In addition, in order to verify the effect on model performance according to the degree of knowledge distillation, the loss ratio of the existing language model and the knowledge distillation loss ratio were increased to 30%, 50%, and 70% to evaluate the model performance. In particular, the model trained with a 50% loss ratio on a small model with a model size of 53MB achieved averaged 96.697% model performance on eight corpora compared to the model with 432MB. Theses results confirm that the proposed lightweight Korean language model might provide an efficient tool for NLP tasks with limited computing resources.
목차
제 1장. 서론 11.1 배경지식 및 연구목표 11.2 연구의 필요성 3제 2장. 관련된 연구 72.1 사전학습 언어 모델(Pre-trained Language Model, PLM) 72.2 신경망 모델 기반 경량화 기법 9제 3장. 제안 기법 133.1 지식 증류 기반 사전학습 한국어 언어 모델 경량화 133.2 경량화 모델 구조를 위한 저계수 분해 기법(Low-rank factorization) 18제 4장. 결과 224.1 검증에 사용된 데이터 224.1.1 네이버 영화 감정 말뭉치 224.1.2 네이버 개체명 인식 말뭉치 234.1.3 단어 스크램블링 의역 말뭉치 234.1.4 한국어 자연어 추론 말뭉치 254.1.5 한국어 텍스트 의미적 유사성 말뭉치 264.1.6 한국어 질문 쌍 말뭉치 264.1.7 한국어 질의응답 말뭉치 274.1.8 한국어 혐오표현 말뭉치 284.2 한국어 기반 자연어처리 말뭉치에 대한 알고리즘 검증 294.2.1 지식 증류 기반 경량화된 사전학습 한국어 언어 모델 성능 평가 ? Tiny 모델 크기의 Student 모델 294.2.2 지식 증류 기반 경량화된 사전학습 한국어 언어 모델 성능 평가 ? Small 모델 크기의 Student 모델 344.2.3 지식 증류와 저계수 분해 기법을 결합한 경량화된 사전학습 한국어 언어 모델 성능 평가 38제 5장. 결론 51참고문헌 54