- ๋ํ๊ธฐ๊ฐ: 2022.10.26 ~ 2022.11.03
Notion
Team Notion์ ๊ฐ ํ์ ํํฉ๊ณผ ์คํ ๊ฒฐ๊ณผ๋ฅผ ๊ธฐ๋ก ๋ฐ ๊ณต์ .
Git
master branch์์ baseline ์์ ํ, ํ์์ ์ด๋ฆ์ผ๋ก ๋ถ๊ธฐ๋ฅผ ๋๋์ด ์์ ์งํํ์์ต๋๋ค. Wandb, config ํ์ผ ์ฐ๊ฒฐ ๋ฑ ๋ถ์ ํ์ฌ ์์ ํ, ๊ฐ์ branch๋ก mergeํ์์ต๋๋ค.
๐ฌEDA : ๋จ์ต
Exploratory Data Analysis, Reference searching
๐๏ธData : ์ฌ๋, ์ํฌ
Data Augmentation, searching the pre-trained models
๐งฌMODEL : ๊ฑด์ฐ, ์ฉ์ฐฌ
to reconstruct the baseline, searching the pre-trained models
train.csv
- ๋ ๋ฌธ์ฅ ๊ฐ์ ์ ์ฌ๋๋ฅผ ์์ธกํ๋ ๊ฒ์ด ํ๋ก์ ํธ์ ์ต์ข ๋ชฉํ์ด๊ณ , ๋ฐ์ดํฐ์ ์ train(9,324 rows)/dev(550 rows)/test(1,100 rows) ๋น์จ๋ก ๋๋์ด, csvํํ๋ก ์ ๊ณต๋์์ต๋๋ค.
- ๊ฐ ๋ฌธ์ฅ์ ์ถ์ฒ๋ ๊ตญ๋ฏผ์ฒญ์ ๊ฒ์ํ ์ ๋ชฉ, ๋ค์ด๋ฒ ์ํ ๊ฐ์ฑ ๋ถ์ ์ฝํผ์ค, ์ ์คํ ์ด์ง ์ฌ๋ ๋ฐ์ดํฐ์ด๋ฉฐ. ๊ฐ ๋ฐ์ดํฐ๋ณ ์ ์ฌ๋(Label) ์ ์๋ ์ฌ๋ฌ๋ช ์ ์ฌ๋์ด ๊ณตํต์ ์ ์ ๊ธฐ์ค์ผ๋ก ๋ ๋ฌธ์ฅ๊ฐ์ ์ ์๋ฅผ ํ๊ท ๋ธ ๊ฐ์ ๋๋ค.
train.csv : 9,324 rows
dev.csv : 550 rows
- train ๋ฐ์ดํฐ์ ์ Label๋ณ ๋ฐ์ดํฐ ๋ถํฌ ์๊ฐํ๋ฅผ ํตํด, Label 0์ผ๋ก ์ ๋ฆฐ ๋ถ๊ท ํ ๋ฐ์ดํฐ๋ฅผ ๊ด์ธกํ์ต๋๋ค. ๋ฐ๋ฉด, dev.csv ๋ฐ์ดํฐ๋ ๋ชจ๋ label์ ๋ถํฌ๊ฐ ๋์ฒด๋ก ๊ท ์ผํ ํธ์ผ๋ก ๊ด์ธก๋์์ต๋๋ค.
- train์ ๋ฐ์ดํฐ ๋ถ๊ท ํ์ ํด์ํ๊ธฐ ์ํด, ****label 0์ธ ๋ฐ์ดํฐ๋ฅผ ์ค์ฌ์ ๋ค๋ฅธ label๊ณผ ๋ถํฌ๋ฅผ ๋ง์ถ๊ฑฐ๋, label 5๋ฅผ ๋๋ ค์ ๊ท ํ์ ๋ง์ถ๋ ๋ฐฉ๋ฒ์ผ๋ก ๋ฐ์ดํฐ ํด๋์ค ๋ถ๊ท ํ์ ํด๊ฒฐํ๊ณ ์ ํ์ต๋๋ค.(Data Augmentation)
- Wandb, Wandb Sweep ๊ตฌํ
- yaml+OmegaConf+Shell ํ์ฉํ ๋ชจ๋ธํ์ต ๋ฐ ์คํ๊ด๋ฆฌ ํธ์์ฑ ์ฆ๋
- ํ๊ตญ์ด ๊ธฐ๋ฐ RoBERTa, ELECTRA Pre-trained Model ๋ค์ ๋น๊ตํด๋ณด์๊ณ , snunlp/KR-ELECTRA-discriminator๊ฐ ๊ฐ์ฅ ์ข์ ์ฑ๋ฅ์ ๋ณด์์ต๋๋ค.
- ์ดํ snunlp/KR-ELECTRA-discriminator ๋ชจ๋ธ์ ๊ธฐ๋ฐ์ผ๋ก Data Augmentation ์ต์ ํ๋ฅผ ์งํํ์์ต๋๋ค.
Baseline Model(klue/roberta-base, Loss: L1, Optimizer: AdamW) ๊ธฐ์ค์ผ๋ก ์๋ 4๊ฐ์ง ์ฆ๊ฐ๊ธฐ๋ฒ ๋ฐ ์ค๋ฌด๋ฉ ๊ธฐ๋ฒ์ ์ ์ฉํ์ฌ Data pre-processing์ ์งํํ์์ต๋๋ค. ์๋ณธ ๋ฐ์ดํฐ์ ์ฆ๊ฐ๋ ๋ฐ์ดํฐ์ ๋น์จ์ ์กฐ์ ํ๋ฉด์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ์๊ณ , ์ฌ๋ฌ ์ฆ๊ฐ ๊ธฐ๋ฒ์ ์ค๋ณต ์ ์ฉํ๋ ๋ฑ ์ต์ ์ ์กฐํฉ์ ์ฐพ์๋ด๊ณ ์ ํ์์ต๋๋ค. ๊ทธ ์ธ, ํ์ต์ ์๋๋ฅผ ์ํด learning rate๋ฅผ ๋๋ ค์ฃผ๊ฑฐ๋, generalํ ๋ชจ๋ธ์ ๋ง๋ค๊ธฐ ์ํด batch size๋ฑ์ ๋๋ ค์ฃผ์์ต๋๋ค.
- Back Translationยนโพ
- ํ๊ตญ์ด์์ ์์ด ๋ฒ์ญ ํ, ์์ด์์ ํ๊ตญ์ด ์ญ๋ฒ์ญ
- ์ญ ๋ฒ์ญ ์ ๋ถ์ ์ ํ ๋ฒ์ญ ๊ฒฐ๊ณผ์ ๋ฐ์ํ์ฌ ์ผ๊ด๋ ์ ์ ๊ธฐ์ค์ด ์ค์ํ STS Task์ ์ ์ ํ์ง ๋ชปํ ๊ธฐ๋ฒ์ด๋ผ ํ๋จํ์ฌ ์ ์ธํ์์ต๋๋ค.
- Copied Translationยฒโพ
- sentence1์ sentence 2๋ก ๋ณต์ฌํ์ฌ, label 5 ๋ฐ์ดํฐ ์์ฑ
- Train Dataset ๋ถํฌ ๋ถ์ ๊ฒฐ๊ณผ 5 Label ๋ฐ์ดํฐ๊ฐ ์ ์ฒด ๋ฐ์ดํฐ์ ์ 1%์ด๊ธฐ์ Sentence๊ฐ ์๋ก ๊ฐ์ ๋ฌธ์ฅ์ ์ ๋ฐ์ดํฐ์ ์์ ์ํ๋งํ์ฌ 5 Label ๋ฐ์ดํฐ๋ฅผ ์ถ๊ฐํ์์ต๋๋ค.
- Swap Sentence
- sentence1๊ณผ sentence 2์ ์์๋ฅผ ๋ฐ๊ฟ์ค
- Sentence 1๊ณผ Sentece 2์ Segment Embedding ๊ฐ์ด ๋ค๋ฅด๊ธฐ์ ๋ณ๊ฒฝ ์ ์ ์๋ฏธํ ๋ฐ์ดํฐ ์ฆ๊ฐ์ด ๋ ๊ฒ์ด๋ผ๊ณ ๋ถ์ํ์์ต๋๋ค. ์๋ํ ๋ฐฉ๋ฒ ์ค ๊ฐ์ฅ ํจ๊ณผ๊ฐ ์ข์์ต๋๋ค.
- Reverse Textยณโพ
- ๋ฌธ์๋ฅผ ์ญ์์ผ๋ก ์์ฑ
- ๋จ๋ ์ฌ์ฉ์ ํจ๊ณผ๊ฐ ์์๊ณ ์ด๋ฅผ ํตํด ์ ์๋ฏธํ ๋ ธ์ด์ฆ ๊ฐ์ ์์ฑํ ์ ์์ ๊ฒ์ด๋ผ ๋ถ์ํ์ง๋ง ์ฌ๋ฌ ๊ธฐ๋ฒ๊ณผ ํจ๊ป ์ฌ์ฉ์ ์ฑ๋ฅ์ด ํ๋ฝํ์ฌ ์ ์ธํ์์ต๋๋ค.
- Label Smoothing
- label 0 ๋ฐ์ดํฐ ์ ๊ฑฐ
- Train Dataset์ 50% ์ด์์ด 0 Label ์ด๊ธฐ์ ํด๋น Label์ 50% ์ธ๋ ์ํ๋ง ํ์์ต๋๋ค.
- ์ด๋ฅผ Copied Translation๊ณผ ํจ๊ป ์ฌ์ฉํ ์ ํจ๊ณผ๊ฐ ์ข์์ต๋๋ค. ์ด๋ฅผ ์ ๋ถํฌ์ธ Positive Skewness ๋ถํฌ์์ ๋น๊ต์ Uniformํ ๋ถํฌ๋ก ๋ณ๊ฒฝ๋ ๊ฒฐ๊ณผ๋ผ๊ณ ๋ถ์ํ์์ต๋๋ค.
์คํ ๊ฒฐ๊ณผ, learning rate 1e-5, batch size 16์์๋ Copied Translation, Reverse Text, learning rate 2e-5, batch size 32์์๋ Swap Sentence, Label Smoothing, Copied Translation์ด ์ ์๋ฏธํ ์ฑ๋ฅ ํฅ์์ ๋ณด์์ต๋๋ค.
-
Loss, Batch Size, Learning rate, Data์ ๋ฐ๋ฅธ ์คํ ๋ฐ ๋น๊ต
Loss MSE L1 Batch Size 16 32 Learning rate 1e-5 3e-5 5e-5 Data Label Smoothing 0, Copied Translation Label 5 Swap Sentence Model Loss Learning rate Batch Size Val Pearson RoBERTa Large - Label Smoothing 0, Copied Translation Label 5 MSE 7e-6 8 0.9256 ELECTRA - Swap Sentence MSE 3e-5 32 0.9287 ELECTRA - Label Smoothing 0, Copied Translation Label 5, Swap Sentence MSE 3e-5 16 0.9309
- ๊ฐ์ฅ ์ฑ๋ฅ์ด ์ข์๋ Pre-trained ๋ชจ๋ธ์ธ snunlp/KR-ELECTRA-discriminator์ Data Augmentation ์คํ ๊ฒฐ๊ณผ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ต์ ์กฐํฉ์ ์คํํ์์ต๋๋ค.
- ์คํ ๊ฒฐ๊ณผ, Swap Sentence๊ฐ ์ ์๋ฏธํ ์ฑ๋ฅ ํฅ์์ ๋ณด์์ต๋๋ค. ๋ํ ๋ฒ ์ด์ค๋ผ์ธ์ ์ฌ์ฉ๋์๋ L1 Loss ๋ณด๋ค MSE Loss๊ฐ ๋ ๋์ ์ฑ๋ฅ์ ๋ณด์ฌ, ์ดํ ์คํ์์๋ MSE Loss๋ฅผ ์ฌ์ฉํ์์ต๋๋ค.
- klue/roberta-large์ ๊ฒฝ์ฐ ๋ชจ๋ธ์ ํฌ๊ธฐ๊ฐ ์ปค์ ํ์ต์ด ์ํ๋์ง ์๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ฌ, batch size์ learning rate๋ฅผ ์กฐ์ ํ์ฌ ์ต์ ํํ์์ต๋๋ค. Data Augmentation ๊ฒฐ๊ณผ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก, ๊ฐ์ฅ ์ ์๋ฏธ ํ๋ Swap Sentence, Label Smoothing 0 ๋ฐ Copied Translation Label 5, Reverse Text 20% ๋ฐ์ดํฐ๋ฅผ ๊ฐ๊ฐ ์คํํ์์ต๋๋ค.
- ์คํ ๊ฒฐ๊ณผ, Label Smoothing 0 ๋ฐ Copied Translation Label 5 ๋ฐ์ดํฐ์ MSE Loss, Learning Rate 7e-6, Batch Size 8 ์กฐ๊ฑด์์ Val Pearson 0.9256์ผ๋ก ๊ฐ์ฅ ๋์ ์ฑ๋ฅ์ ํ์ธํ์์ต๋๋ค.
- ํ๊ตญ์ด ELECTRA ๋ชจ๋ธ 3๊ฐ(monologg/koelectra-base-v3-discriminator, beomi/KcELECTRA-base, snunlp/KR-ELECTRA-discriminator)์ ๋ฐ์ดํฐ ์ฆ๊ฐ์์ ์ ์๋ฏธํ ์ฑ๋ฅํฅ์์ ๋ณด์ธ Swap Sentence, Label Smoothing 0, Copied Translation Label 5 ๋ฐ์ดํฐ๋ฅผ ๊ธฐ์ค์ผ๋ก, Learning Rate, Batch Size ์ต์ ํ๋ฅผ ์งํํ์์ต๋๋ค.
- ์คํ ๊ฒฐ๊ณผ, snunlp/KR-ELECTRA-discriminator ๋ชจ๋ธ, Label Smoothing 0, Copied Translation Label 5, Swap Sentence ๋ฐ์ดํฐ์ Learning Rate 3e-5 Batch Size 16 ์กฐ๊ฑด์์ Val Pearson 0.9309์ผ๋ก ๋จ์ผ ๋ชจ๋ธ ์ค ๊ฐ์ฅ ๋์ ์ฑ๋ฅ์ ํ์ธํ์์ต๋๋ค.
-
ํ๊ฐ ์งํ์ธ Pearson์ ๊ฒฝ์ฐ ์ ํ์ด๊ธฐ์ Outlier์ ์ทจ์ฝํ ํน์ฑ์ด ์์. ์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ๊ฐ์ค ํ๊ท ์ ๋์ , Outlier์ ์ํฅ๋ ฅ์ ์ค์์ต๋๋ค.โดโพ
-
์์๋ธ์ ์ํํธ๋ณดํ ๋ฐฉ์์ ์ฑ์ฉํ์ฌ ๊ฐ ๋ชจ๋ธ์ ๊ฒฐ๊ณผ๋ฅผ ๋ํด์ฃผ๊ณ ํ๊ท ์ ๋ด์ฃผ๋ ๋์ ๊ฐ ๋ชจ๋ธ์ ์ฑ๋ฅ์ ๊ฐ์ค์น๋ก ๋์ด์ ๊ฐ์ค ํ๊ท ์ ๊ตฌํ๋ ๋ฐฉ์์ผ๋ก ๊ตฌํํ์ต๋๋ค. ๊ฐ ๋ชจ๋ธ์ ์ฑ๋ฅ์ softmax ์ธต์ ํต๊ณผ์์ผ์ ํ๋ฅ ๋ก ๋ณํํ ํ ๊ฐ ๋ชจ๋ธ์ด ์ถ๋ ฅํ logit ๊ฐ๊ณผ ๊ณฑํด์ฃผ์ด์ ์ ๋ถ ๋ํด์ฃผ์์ต๋๋ค.
-
Swap Sentence ๊ธฐ๋ฒ์ ์ ์ฉํ์ฌ Positive Skewness ๋ถํฌ์ธ ๋ฐ์ดํฐ์ Copied Translation๊ณผ Label Smoothing์ ์ ์ฉํ์ฌ Uniform ๋ถํฌ๋ฅผ ๊ฐ์ง ๋ฐ์ดํฐ๋ฅผ ํ์ตํ ๋ชจ๋ธ์ ์์๋ธํ์ฌ Test Dataset ๋ถํฌ์ ์์กด์ ์ด์ง ์์ผ๋ฉฐ Generalํ ๋ชจ๋ธ์ ์ค๊ณํ์์ต๋๋ค.
-
์ฒ์์๋ ์ ์ผ ์ฑ๋ฅ์ด ์ข์ klue/roberta-large์ snunlp/KR-ELECTRA-discriminator 1๊ฐ์ฉ ๊ฐ์ ธ์์ ์ฑ๋ฅ์ 91.24์์ 92.25๋ก ๊ฐ์ ํ์ต๋๋ค. ๊ทธ ํ ๊ฐ ๋ชจ๋ธ์ 3๊ฐ์ฉ ์์ผ๋ธํ ๋ชจ๋ธ๋ก ์ฑ๋ฅ์ 92.69๊น์ง ์ฌ๋ ธ๊ณ , ๋ชจ๋ธ ๊ฐ์ ๋ฎ์ ์๊ด๊ด๊ณ๋ฅผ ๊ฐ๊ณ ์์ผ๋ฉด ์์๋ธ์ด ํจ๊ณผ์ ์ด๋ผ๋ ๊ทผ๊ฑฐ๋ฅผ ํ ๋๋ก ๋ค์ํ ๋ชจ๋ธ์ ์์๋ธํ ๊ฒฐ๊ณผ ์ต๊ณ ์ฑ๋ฅ์ธ 92.9๊ฐ ๋์์ต๋๋ค
klue/roberta-large ๋ชจ๋ธ ์ต๊ณ ์ฑ๋ฅ 1๊ฐ snunlp/KR-ELECTRA-discriminator ์ต๊ณ ์ฑ๋ฅ 1๊ฐ ์ฑ๋ฅ ๊ฐ์ : 0.9124 โ 0.9225 klue/roberta-large ๋ชจ๋ธ 3๊ฐ snunlp/KR-ELECTRA-discriminator 3๊ฐ ์ฑ๋ฅ ๊ฐ์ : 0.9225 โ 0.9269 klue/roberta-large ๋ชจ๋ธ 3๊ฐ snunlp/KR-ELECTRA-discriminator 3๊ฐ beomi/KcELECTRA-base 1๊ฐ โข monologg/koelectra-base-v3-discriminator 1๊ฐ ์ฑ๋ฅ ๊ฐ์ : 0.9269 โ 0.9290
- ์ต์ข pearson : 0.9368
- 14ํ ์ค public 4์ private 3์
๋ฐ์ดํฐ์ ํน์ฑ์ ์ ๋ฐ์ํ๋ ๊ธฐ์ด ๋ชจ๋ธ ์ ์ ์ดํ ๋ค์ํ ์คํ์ ํตํด ์ต์ ํ ๋ฐ ์์๋ธ ์ํ
- ๋ฐ์ดํฐ ๋ถ์์ ํตํ ๋ฐ์ดํฐ ํ์ง ๊ฐ์ (oversampling, data augmentation)
- ๋ฐ์ดํฐ์ ์ ์ ํฉํ Pretrained Model ์ ์ ๋ฐ ์ต์ ํ
- ๋ค์ํ ๊ฒฐ๊ณผ์ ๋ํ ์์๋ธ(Soft Voting)์ ์ํ
-
Pre-trained Model ์ ํ
Model Epoch (Earlystopping/Max epoch, Best Check point) Val loss Val Pearson klue/roberta-small 4/100, 4 0.6108 0.8523 klue/roberta-base 4/100, 4 0.533 0.8916 jhgan/ko-sroberta-multitask 3/100, 3 0.5149 0.8828 beomi/KcELECTRA-base 8/20, 4 0.4385 0.9113 snunlp/KR-ELECTRA-discriminator 9/15, 7 0.4705 0.9242 -
Data Augmentation
Model Epoch Learning rate Batch Size Data Augmentation Val loss Val Pearson klue/roberta-base 4 1e-5 16 Baseline 0.533 0.8916 9 1e-5 16 ์๋ณธ:Back Translation 50% (2:1) 0.5864 0.8655 8 1e-5 16 ์๋ณธ:Back Translation 33% (3:1) 0.4987 0.8958 16 1e-5 16 ์๋ณธ:Back Translation 25% (4:1) 0.4308 0.91 16 1e-5 16 Copied Translation Label 5 50% 0.4707 0.9126 5 1e-5 16 Copied Translation Label 5 20% 0.5326 0.9024 10 1e-5 16 Copied Translation Label 5 10% 0.5083 0.9082 5 1e-5 16 Reverse Text 50% 0.4957 0.8961 14 1e-5 16 Reverse Text 20% 0.4464 0.9169 19 1e-5 16 Reverse Text 10% 0.4869 0.9074 3 1e-5 16 ์๋ณธ:Exchange Sentence : Reverse Text 10% (1:1:0.2) 0.4695 0.908 4 1e-5 16 ์๋ณธ:Exchange Sentence : Reverse Text 20% (1:1:0.4) 0.4384 0.9118 klue/roberta-base 4 2e-5 32 Baseline 0.5919 0.8616 2e-5 32 Swap Sentence 0.5013 0.8967 2e-5 32 Swap Sentence : Back Translation (2:1) 0.5008 0.8922 2e-5 32 Swap Sentence : Back Translation (1:1) 0.4978 0.8845 2e-5 32 Swap Sentence, Label Smoothing 0 50% 0.4892 0.8986 2e-5 32 Swap Sentence, Label Smoothing 0 25% 0.4722 0.8963 2e-5 32 Swap Sentence, Label Smoothing 0 50%, Copied Translation Label 5 0.4801 0.8931 2e-5 32 Swap Sentence, Label Smoothing 0 25%, Copied Translation Label 5 0.4536 0.9123 -
snunlp/KR-ELECTRA-discriminator ์ต์ ํ
Model Epoch Loss Data Augmentation Val loss Val Pearson snunlp/KR-ELECTRA-discriminator 10 MSE Swap Sentence 0.3914 0.9238 6 MSE Swap Sentence, Label Smoothing 0 50% 0.4252 0.9096 12 L1 Swap Sentence 0.5068 0.9001 17 L1 Swap Sentence, Label Smoothing 0 50% 0.4605 0.9172 12 L1 Swap Sentence, Label Smoothing 0 50% + Copied Translation Label 5 50% 0.4484 0.9235 10 L1 Swap Sentence, Label Smoothing 0 50%, Reverse Text 20% 0.4486 0.919 -
RoBERTa Large ์ต์ ํ
Model Epoch Learning rate Batch Size Data Augmentation Val loss Val Pearson klue/roberta-large 9 1e-6 8 Swap Sentence 0.4043 0.913 5 3e-6 Swap Sentence 0.4513 0.9116 11 5e-6 Swap Sentence 0.354 0.9208 7 7e-6 Swap Sentence 0.379 0.9201 X 1e-6 Label Smoothing 0, Copied Translation Label 5 X X 10 3e-6 Label Smoothing 0, Copied Translation Label 5 0.3726 0.9171 6 5e-6 Label Smoothing 0, Copied Translation Label 5 0.3845 0.9121 8 7e-6 Label Smoothing 0, Copied Translation Label 5 0.3363 0.9256 5 5e-6 Copied Translation Label 5 0.4841 0.9019 8 5e-6 Reverse Text 20% 0.4631 0.91
-
Data Augmentation using Back-translation for Context-aware Neural Machine Translation
-
์ ๊ฒฝ๋ง ๊ธฐ๊ณ๋ฒ์ญ์์ ์ต์ ํ๋ ๋ฐ์ดํฐ ์ฆ๊ฐ๊ธฐ๋ฒ ๊ณ ์ฐฐ - โ์คํ๊ฒฐ๊ณผ Back Translation๊ณผ Copied Translation์ ํจ๊ป ์ ์ฉํ์ฌ, 4๋3์ ์๋์ ๋น์จ์ ์ ์ฉํ์ฌ ํ์ต์ ์งํํ์ ๋ ๊ฐ์ฅ ๋์ BLEU ์ ์๋ฅผ ๋ณด์๋ค.โ
-
Sequence to Sequence Learning with Neural Networks - โโฆ reversing the order of the words in all source sentences (but not target sentences) improved the LSTMโs performance markedlyโ
-
Pearson Coefficient of Correlation Explained - โโฆ Pearsonโs correlation coefficient, r, is very sensitive to outliers, which can have a very large effect on the line of best fit and the Pearson correlation coefficient.โ