156 0

Pattern of Retraining On The BERT by Fine tuning

Title
Pattern of Retraining On The BERT by Fine tuning
Author
김가연
Advisor(s)
김영훈
Issue Date
2023. 2
Publisher
한양대학교
Degree
Master
Abstract
Fine-tuned BERT performs well in various natural language processing fields, but the effect of fine-tuning on BERT is not clearly known. This paper aims to understand the effect of fine-tuning on the layer of BERT and input data by using the BERT which fine-tuned on various data. First, to understand the effect of fine-tuning on the layer of BERT, we compared the changes in similarity between the pre-trained BERT and fine-tuned BERT for all words. As the result, the cosine similarity on upper layers more rapidly falls than lower layers. This phenomenon shows that fine-tuning affects upper layers more than lower layers. Next, to see how the embedding vectors per layers are adjusted by fine-tuning, we train a classifier that mimics the original downstream task using the word embedding vectors from each layers of BERT. By the results of the classifier, it was confirmed that the word embedding vector of the upper layer predicts the label of the input data better than the word embedding vector of the lower layer. Through this experiments, fine-tuning affects high layers in BERT and the embedding vectors from that layers are adjusted to conduct the downstream task well. Second, to figure out the effect of fine-tuning on the input data, we used LIME to identify words that greatly affect the results of the model. The words that have a great influence when fine-tuned BERT yields results for most data were those with high frequency in the dataset. Especially, in the sentiment analysis dataset like SST2, Rotten Tomatoes, the positive and negative words has the high effect to the model. Furthermore, we observe that even in SNLI data with contradiction labels, word pairs that best represent the relationship of contradictions within two sentences have a strong influence when the model predicts. The findings suggest that the fine-tuned BERT contains a lot of information in words with high frequency. In addition, it was confirmed that fine-tuned BERT also contains a lot of information about task in words that represent the meaning of sentences, just as people pay attention to words within sentences when classifying sentences or inferring relationships between sentences.|미세조정된 BERT는 다양한 자연어 처리 분야에서 뛰어난 성능을 발휘하고 있지만 미세조정이 BERT에 미치는 영향에 대해서는 뚜렷하게 알려진 바가 없다. 본 연구에서는 다양한 데이터를 사용해 BERT를 미세조정하여 미세조정이 BERT의 계층과 입력 데이터에 미치는 영향을 파악하고자 한다. 첫번째로, 미세조정이 BERT 계층에 미치는 영향을 파악하기 위해 모든 단어들에 대해 기존의 BERT와 미세 조정된 BERT 간의 유사도 변화를 비교해 보았다. 뒤쪽 계층에서 유사도가 급격하게 줄어드는 것을 보아 미세조정은 하위 계층 보다 상위 계층에 더 많은 영향을 미친다는 것을 알 수 있었다. 다음으로 미세조정에 의해 레이어별 임베딩 벡터가 어떻게 조정되는지 확인하기 위해 계층별 단어 임베딩 벡터를 이용해 원래의 다운스트림 태스크를 모방하는 분류기를 학습하였다. 분류기의 결과를 통해, 하위 계층의 단어 임베딩 벡터보다 상위 계층의 단어 임베딩 백터가 입력 데이터의 라벨을 더욱 잘 예측하는 것을 확인할 수 있었다. 이를 통해, 미세조정은 BERT의 상위 계층에 많은 영향을 미치고, 상위 계층의 임베딩 벡터는 다운스트림 태스크를 잘 수행할 수 있도록 조정된다는 것을 관찰할 수 있었다. 두번째로, 미세조정이 입력 데이터에 미치는 영향을 파악하기 위해 LIME을 이용하여 모델의 결과에 많은 영향을 미치는 단어를 확인해 보았다. 대부분의 데이터에 대해 미세조정된 BERT가 결과를 도출할 때 큰 영향을 미치는 단어는 데이터셋에서 빈도수가 높은 단어들이었다. 특히 SST2와 Rotten Tomatoes와 같은 감정 분류 데이터에서는 긍정과 부정을 나타내는 단어가 모델이 결과를 도출하는 데 높은 영향을 미친다는 것을 확인할 수 있었다. 또한, 모순의 라벨을 가지는 SNLI 데이터에서도, 두 문장내에서 모순의 관계를 가장 잘 나타내는 단어 쌍이 모델의 결과에 높은 영향을 미치는 것을 관찰하였다. 이를 통해, 미세조정된 BERT는 빈도수가 높은 단어에 많은 정보를 담는 다는 것을 알 수 있었다. 뿐만 아니라 사람이 문장을 분류하거나 문장 간의 관계를 추론할 때 문장 내의 단어를 주목하는 것 처럼, 미세 조정된 BERT 또한 문장의 의미를 대표하는 단어에 태스크에 대한 많은 정보를 담는다는 것을 확인할 수 있었다.
URI
http://hanyang.dcollection.net/common/orgView/200000651165https://repository.hanyang.ac.kr/handle/20.500.11754/179793
Appears in Collections:
GRADUATE SCHOOL[S](대학원) > APPLIED ARTIFICIAL INTELLIGENCE(인공지능융합학과) > Theses(Master)
Files in This Item:
There are no files associated with this item.
Export
RIS (EndNote)
XLS (Excel)
XML


qrcode

Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.

BROWSE