pocca2048 / ml-paper-reading Goto Github PK
View Code? Open in Web Editor NEWDaily ML paper reading
Daily ML paper reading
Conference :
Link : https://arxiv.org/pdf/2011.10566.pdf
Authors' Affiliation : Facebook AI Research, Kaiming He
TL;DR : 사실 negative pair, large batch, momentum encoder 중 어느 것도 없이도 충분히 의미있는 representation을 학습할 수 있다. Stop-gradient operation이 collapsing을 방지하는데 핵심적인 역할을 한다.
Summary :
Siamese network = weights sharing NN applied on 2+ inputs
하나의 이미지에 대한 2개의 augmentation을 인풋으로 하고 similarity를 최대화.
그러나 샴네트워크는 하나의 constant로 모든 output이 collapse해버릴수 있다.
그동안 collapsing을 막는 여러 방법들이 제안되었다: contrastive learning에서는 pos는 끌어당기고 neg는 밀어서 negative pair를 통해 constant solution을 배제한다. clustering을 사용하는 방법도 있다( SwAV). BYOL에서는 positive pair에만 의존하지만 momentum encoder를 사용해서 collapse를 방지한다.
이 논문에서는 위의 어떤 방법도 사용하지 않고 간단한 샴 네트워크만으로 collapsing을 방지할 수 있음을 보인다.
We empirically show that collapsing solutions do exist, but a stop-gradient operation (Figure 1) is critical to pre- vent such solutions.
stop-gradient가 중요하다는 것은 기저에 사실 다른 optimization problem이 풀어지고 있다는걸 암시한다.
가설: 2개의 변수 집합이 implicit하게 있고, SimSiam은 각 집합을 번갈아가며 optimize 하는것처럼 행동한다.
이 가설을 검증하기 위해 PoC 실험을 한다.
샴 네트워크는 자연스럽게 invariance를 모델링 하기위한 inductive bias를 제시한다.
convolution이 자연스러운 translation-invariance를 도입하는 것처럼 샴네트워크는 더 복잡한 transformation에 대한 invaraicne를 제공한다.
# f: backbone + projection mlp
# h: prediction mlp
for x in loader: # load a minibatch x with n samples
x1, x2 = aug(x), aug(x) # random augmentation
z1, z2 = f(x1), f(x2) # projections, n-by-d
p1, p2 = h(z1), h(z2) # predictions, n-by-d
L = D(p1, z2)/2 + D(p2, z1)/2 # loss
L.backward() # back-propagate
update(f, h) # SGD update
def D(p, z): # negative cosine similarity
z = z.detach() # stop gradient
p = normalize(p, dim=1) # l2-normalize
z = normalize(z, dim=1) # l2-normalize
return -(p*z).sum(dim=1).mean()
backbone + projection + prediction
Prediction MLP head의 역할은 한 view의 output을 다른 view에게 맞도록 transform해주는 것.
negative cosine similarity를 minimize하는 것은 l2-normalized vector의 MSE를 minimize 하는 것과 같다 (up to a scale of 2?)
없으면 무조건 collapse함. variance가 0이되고 있으면 unit sphere에 랜덤하게 분포.
h를 없애면 작동안함. 즉, h는 identity mapping 임(?????). 사실 이런 관측은 symmetric loss가 사용될때 예상된거임 (?)
h를 제거한 loss를 사용하면 collapsing 이 관측됨.
asymmetric loss를 사용해도 h를 없애면 fail한다고 함. 왜지????
h만 lr decay를 안쓰는게 더 효과적. h는 항상 latest representation에 adapt해야 하므로 lr 을 줄여서 수렴하도록 강요하는게 필요치 않다.
대부분의 bsz에서 잘 작동. 64, 128 이어도 비교적 잘 작동하고 이보다 크면 비슷.
근데 신기하게도 SGD optimizer는 supervised 에서도 그렇고 batch가 너무 크면 잘 작동 안함. 성능이 4096일때 급격히 떨어짐.
bn 아예 안쓰면 acc이 절반으로. projection에 까지 쓰면 최대. prediction에도 쓰면 unstable. 그냥 다른 supervised때와 똑같음.
BN이 collapsing을 막아준다는 증거는 전혀 없음.
cosine similarity 대신에
collapsing은 cosine similarity 자체의 문제가 아님.
asymmetric 버전 쓰면 4%정도 떨어짐. 하지만 collapsing 이슈랑은 관계없음.
symmetrization은 각 이미지에 대해 하나 많은 prediction을 하므로 이걸 각 이미지마다 sampling을 2pair 만큼 해서 보충하면 acc gap이 줄어든다.
stop gradient가 collapsing을 멈추는 가장 중요한 요소이다.
SimSiam에 의해 최적화되는게 무엇인가에 대한 가설을 세우고 PoC 실험을 한다.
가설은 simsiam이 EM 같은 알고리즘의 implementation이라는 것이다. EM은 2개의 변수 집합을 가지고 2개의 기저하는 subproblem을 푼다.
stop-gradient의 존재는 extra set of variable을 introduce하는 것의 결과다.
Conference : ICML 2021
Link : https://arxiv.org/pdf/2103.03230.pdf
Authors' Affiliation : FAIR, Yann LeCun
TL;DR : Barlow twin이라는 방법을 고안했는데 이 방법이 SimSiam, SimCLR, BYOL 등의 방법보다 좋다.
Summary :
cross-correlation matrix를 identity matrix와 최대한 비슷하게 만드는 방법.
이 loss 함수는 그 자체로 collapse를 하지 않기 때문에 stop gradient, momentum 등의 방법이 필요없다.
SimCLR처럼 large batch도 필요 없고 신기하게도 dimension을 키울수록 성능이 좋아진다.
Conference :
Link : https://arxiv.org/pdf/2104.08821.pdf
Authors' Affiliation : princeton, tsinghua
TL;DR : sentence embedding. 즉, cross encoder가 아니라 bi/dual encoder에서 새로운 sota를 기록한 논문.
Summary :
Given a distribution of positive pairs p_pos, alignment calculates expected distance between embeddings of the paired instances
uniformity measures how well the embeddings are uniformly distributed
그냥 forward 한번하고 다시 한번하면 dropout이 달라지니까 그것 만으로 충분하다는 것. 다른 어떤 data augmentation도 하지 않고.
" a minimal form of data augmentation"
NLI에서 entailment를 positive로 가져오고 Contradiction을 negative로 가져와서 학습.
anisotropy problem
the learned embeddings occupy a narrow cone in the vector space, which largely limits their expressiveness
s. Gao et al. (2019) term it as a representation degeneration problem and demonstrate that language models trained with tied input/output embeddings lead to anisotropic word embeddings
Wang et al. (2020) show that the singular values of the word embedding matrix decay drastically. In other words, except for a few dominating singular values, all others are close to zero.
we show that the contrastive objective can inherently “flatten” the singular value distribution of the sentence-embedding matrix.
when minimizing the second term in Eq. 6, we are reducing the top eigenvalue of WW> and inherently “flattening” the singular spectrum of the embedding space. Hence contrastive learning can potentially tackle the representation degeneration problem and improve the uniformity.
-> 오히려 반대 아닌가? 논리적 비약이 심한것 같은데.
왜 transfer task에는 MLM을 추가 했는데 STS에선 추가 안했지? 아무튼 SimCSE + MLM이 제일 성능이 좋음.
SimCSE가 uniformity나 alignment 측면에서 좋다.
Conference : NIPS 2020
Link : https://arxiv.org/abs/2006.07733
Authors' Affiliation : DeepMind
TL;DR : Better than SimCLR w/o negative pairs.
Summary :
기존 방법들은 negative pair들을 매우 잘 다뤄야만 한다.
또한 성능이 image augmentations 성능에 크게 좌우된다.
제안하는 BYOL은 negative pair 없이한다.
BYOL contrastive methods보다 choice of image augmentations에 robust하다. (+ bsz의 변화에도 resilient)
negative 페어에 의존하지 않는 것이 향상된 robustness의 가장 큰 이유일 것으로 추측한다.
이전에 bootstrapping 기반 방법은 pseudo-labels [16], cluster indices [17] or a handful of labels [18, 19, 20] 등의 방법을 사용했지만 여기서는 직접적으로 representations을 bootstrap 하는 것을 제안한다
(bootstrap이 뭘까... 통계에서의 bootstrap은 아니라고 한다)
BYOL에서는 2개의 네트워크 : target & online 을 사용해서 서로에게 배우며 상호작용한다.
image와 augmented view가 있으면 하나는 target 에 넣어서 이 representation을 다른 view를 인풋으로 받은 online이 예측하도록 학습한다.
이 objective가 모든 image를 하나로 output하는 collapsed solution을 허용하지만 경험적으로 그러지는 않음을 보인다.
이 이유는 1) addition of a predictor to the online network 2) use of a slow-moving average of the online parameters 라고 추측한다.
representation learning을 위한 unsupervised method는 generative method와 discriminative method로 나뉨
generative 방법은 데이터와 latent embedding 에 대한 분포를 만들고 학습된 임베딩을 이미지의 representation으로 쓴다. auto-encoding, GAN, data와 representation 같이 모델링 같은 방법들을 사용한다. generative 방법들은 보통 pixel space에서 직접적으로 작동하는데, computationally expensive하고 image generation에 필요한 높은 레벨의 detail은 representation learning에 사실 필요하지 않을지도 모른다.
discriminative 방법에서는 self-supervised 방법 중 contrastive method가 sota를 찍고 있다. 근데 많은 경우 다른 sample들과 비교해야 하는데 과연 negative pair를 이용하는게 필요한가라는 의문을 제기한다.
DeepCluster 에선 부분적으로 의문에 대한 답을 한다. 여기서는 다음 representation에 대한 target을 만들기 위해 representation의 이전버전에 bootstrapping을 사용한다: 이전 representation을 사용해서 clustering 한 다음에 cluster index를 classification target으로 사용한다. negative pair를 안쓰긴 하지만 갑비싼 clustering phase가 필요하다는 단점이 있고, trivial solution으로 collapse하는걸 막기위해 특별한 주의가 필요하다.
어떤 self-supervised 방법들은 contrastive 하진 않지만 부가적인 태스크를 해서 학습한다. 퍼즐, colorizing 등등. 근데 이 방법들은 contrastive 방법에 비해 성능이 떨어짐.
RL에서 사용되는 PBL(Predictions of Bootstrapped Latents)와 우리 방법은 비슷한 면이 있다. agent의 history representation과 future observation의 encoding을 jointly 학습한다.
하나의 이미지의 다른 view를 representation space에서 직접 예측하는 것은 collapsed representation을 야기할 수 있다.
contrastive 방법은 이것을 prediction 문제에서 discrimination 문제로 reformulate함으로써 우회한다. 이렇게 하면 collapse 문제는 해결할 수 있지만 discrimination task를 충분히 어렵게 해주기 위해 보통 많은 negative example과 비교를 해줘야 한다.
이 연구는 그래서 과연 이 negative example이 필수 불가결한 것인지를 묻는 연구이다.
collapse를 방지 하기 위해 단순한 방법은 고정된 random init 네트워크를 사용해서 target을 생산하는 것이다. 이 방법은 collapse를 안하긴하지만 별로 좋은 representation을 생산하지 않는다. 그래도 이 방법으로 학습된 representation이 처음의 고정된 representation보다는 좋다는 것은 흥미롭다. 학습 전에는 1.4% -> 학습 후에는 18.8% 정확도가 나온다. 이것이 BYOL의 핵심 모티베이션이다.
given representation, target이 주어졌을때 개선된 representation, online을 target을 예측함으로써 새로 학습한다.
근데 이 과정을 반복하면 더 좋은 representation을 생산할 수 있지 않을까? subsequent online network를 새로운 target network로 사용하는 것이다. 실제로 적용할때는 BYOL에서는 이것을 slowly moving exponential average of the online network를 target network로 사용함으로써 적용한다.
BYOL의 goal = downstream task에 사용할 수 있는 representation
online에다가만 prediction 을 apply (linear 한번더)함으로써 asymmetric 아키텍처를 만든다.
그리고 online과 target의 Mean Squared Error 를 적용.
loss가
BYOL의 dynamics가 바람직하지 않은 평형점을 허용하기는 하지만 실제 실험에서 그런 경우는 관측하지 못했다. 또한 그런 바람직하지 않은 평형점은 unstable하다고 가설을 세운다.
Conference : blog
Link : https://ruder.io/recent-advances-lm-fine-tuning/
Authors' Affiliation : ruder, DeepMind?
TL;DR :
Summary :
ruder 블로그 글 읽기 (https://ruder.io/recent-advances-lm-fine-tuning/)
Conference :
Link : ICLR 2021
Authors' Affiliation : FAIR
TL;DR : vector - vector dot product 대신 그냥 직접 unique entity name을 autoregressive하게 generate하자.
Summary :
기존 entity retrieval 방식은 각 entity들이 하나의 label이 되어 multi-class classification으로 푸는 방식이었다. input과 label 간의 match는 bi encoder에서 나온 벡터 곱에서 나온 similarity로 계산하고 max-inner-product-search로 검색한다.
근데 이 방식은 여러 단점을 갖는다
여기서 제안하는 방식은 때때로 우리에게는 unambiguous, highly structured and compositional entity names이 있다는 사실로부터 모티베이션을 얻었다.
(위키피디아의 문서 제목과 같은)
inputs could be translated into unique entity names, word by word, instead of being classified among a huge set of options
GENRE = Generative ENtity REtrieval
context에 condition해서 entity name을 autoregressive하게 generate하는 방식이다. 근데 생성된 이름이 항상 valid한 이름은 아닐 수도 있다. 이를 방지하기 위해 constrained decoding 방식을 사용해서 생성되는 이름이 미리 정의된 후보 set에 있도록 강제한다.
이 방식으로 하면 entity count가 아니라 vocab size에 scale되므로 메모리 요구량이 크지 않다. negative 샘플링도 필요 없다.
candidate set은 trie로 저장하게 되면 메모리를 많이 아낄 수 있다.
Entity Disambiguation, end-to-end Entity Linking (EL), page-level Document Retrieval 에서 SOTA 혹은 competitive 결과를 얻었다.
거기다 memory는 dramatic하게 줄어든다.
Conference : Neurips 2021
Link : https://arxiv.org/pdf/2111.12797.pdf
Authors' Affiliation : University of Wisconsin-Madison, FAIR
TL;DR :
observation : OOD data can trigger unit activation patterns that are significantly different from ID data
Propose : Rectified Activations for improving OOD detection performance
Method :
나머지는 일반적인 OOD 도메인에서 하는 process와 일치한다.
나온 결과를 OOD 기존 방법들인 softmax score, ODIN score, Energy based score, Mahalanobis distance 등을 거쳐서 score를 뽑는다.
일반적으로 score 는 높을수록 ID일 확률이 높다는 것이고 낮을 수록 OOD일 확률이 높다는 의미이다.
마지막으로 threshold lambda를 정해서 그것보다 score가 높으면 ID로, 낮으면 OOD로 분류하면 된다.
Conference :
Link : https://arxiv.org/pdf/2104.08211.pdf
Authors' Affiliation : Johns Hopkins University
TL;DR : text를 image로 바꿔서 BPE 대신 representation으로 썼더니 robust해지더라.
Summary :
demonstrate significant robustness to varied types of noise
다만 성능은 약간 떨어지는듯
Conference : EMNLP 2021
Link : https://arxiv.org/pdf/2109.06798.pdf
Authors' Affiliation : Johns Hopkins University
TL;DR : Data projection + self-training을 시험해봤다. 어느 한 가지 방법이 모든 것에서 잘하기 않기 때문에 zero-shot training에서 잘하려면 다 해봐야 한다.
Summary :
참고) POS tagging vs Dependency parsing vs Constituency parsing
augmenting the source language training data with data in the target language—either via projection of the source data to the target language (so-called “silver” data)
via self-training with translated text
Data projection = src 언어에 있는 word-level annotations을 tgt 언어로 word-to-word alignments를 통해 transfer하는 것.
레이블이 word-level인 것들은 sub-words에서 첫 번째를 제외하고 마스크 시킴.
One might optimistically consider that the latest multilingual encoder (in this case XLM-R) in the zero-shot setting would achieve the best possible performance. However, in our extensive experiments in Table 4 and Table 5, we find that the zero shot approach can usually be improved with data projection.
Conference : NAACL 2021
Link : https://arxiv.org/abs/2103.13136
Authors' Affiliation : University of Southern California
TL;DR :
아직 합의된 holistic한 방법은 없다. string-based에서 그나마 좋다고 밝혀진 것은
Summary :
"11시에 일어났다"와 "11불을 벌었다"에서 11은 큰 차이가 있다. 11을 10으로 바꾸는건 되지만 25로 바꾸는건 안되는 일이다.
quantity와 갯수에 대해서 이해하는 것은 세계를 이해함에 있어서 중요하다.
우리 조상은 numeracy를 언어의 발전과 독립적으로 발전시켜왔다.
하지만 NLP에서는 전처리때 아예 지워버리거나 word와 같은 취급을 하거나, UNK로 붕괴시켜 버린다.
wordpiece같은 데서는 없애진 않지만 임의의 토큰들로 분리시킨다.
최근 논문들에서는 이들이 suboptimal number representation 이란 것을 밝혔다.
BERT는 정답이 숫자이면 span of text일때보다 5배 못한다.
단순히 subword에서 char-level tokenization으로 바꾸는 것이나 decimal 을 scientific notation으로 바꾸는 것만으로 성능이 향상된다.
이 논문에서는 numeracy task에 대한 taxonomy와 (section2) number representation (section3)를 제공한다.
granularity와 unit라는 2가지 차원에 기반해서 분류한다.
string-based vs real-based
real-based에서는 computation을 해서 한다.
string-based에서는 number를 surface form으로 본다. 임의의 token id를 assign해서 임베딩을 look up해야한다.
LM에서는 디폴트로 number를 string으로 다룬다 (word와 똑같이).
number encoder를
Conference : EMNLP 2020
Link : https://arxiv.org/abs/2010.10648
Authors' Affiliation :
TL;DR : end-to-end pixel 레벨에서 in-image NMT를 해보자. 물론 구글 프로덕트에 있지만 어떻게 하는지는 모르니까.
Summary :
pixel로 직접 하면 vocab 문제를 우회할 수 있음.
headless-chrome
이란 걸로 synthetic dataset을 생성.
grayscale에서 0.5를 기준으로 흑과 백으로만 해서 pixel wise binary cross entropy loss로 학습.
은근 잘 된다고 함.
실패하는 경우를 자세히 보면 however와 nevertheless 사이에서 모델이 불확실해하는 것을 알 수 있음.
Conference : CogSci 2021
Link : https://arxiv.org/abs/2105.07197
Authors' Affiliation : Princeton University
TL;DR : Vision Transformer가 CNN보다 더 인간과 비슷하다.
Summary :
ViT가 shape bias가 더 세다.
인간은 shape/texture 말고도 concept까지도 사용할지도.
Conference :
Link : http://arxiv.org/abs/2102.06810
Authors' Affiliation : Facebook AI Research
TL;DR : SimSiam 논문의 원인을 탐구하는 논문. "How can SSL with only positive pairs avoid representational collapse?"
Summary :
Minimizing differences between positive pairs encourages modeling invariances, while contrasting negative pairs is thought to be required to prevent representational collapse
그러나 요즘 나온 BYOL, SimSiam 과 같은 논문들에서는 negative없이 성공했다.
근데 이 논문들이 왜 representation collapse를 겪지 않는건지는 아직 밝혀지지 않았다.
analyze the behavior of non-contrastive SSL training and the empirical effects of multiple hyperparameters, including (1) Exponential Moving Average (EMA) or momentum encoder, (2) Higher relative learning rate (αp) of the predictor, and (3) Weight decay η
We explain all these empirical finding with an exceedingly simple theory based on analyzing the nonlinear learning dynamics of simple linear networks.
Theorem 1 (Weight decay promotes balancing of the predictor and online networks
Theorem 2 (The stop-gradient signal is essential for success.)
노잼이라 그만...
Conference : EACL 2021
Link : https://arxiv.org/pdf/2101.08231.pdf
Github: https://github.com/neulab/awesome-align
Authors' Affiliation : CMU
TL;DR : propose 1) PLM + finetune on parallel text (objective to improve alignment quality), and 2) methods to effectively extract alignments from these fine-tuned models.
Summary :
Importantly, we show that it is possible to train multilingual word aligners that can obtain robust performance even in zero-shot settings, making them a valuable tool that can be used out-of�the-box with good performance over a wide variety of language pairs.
similarity matrix S = hx dot hy^T -> Normalise (softmax, \alpha-entmax) -> := source-to-target alignment matrix
$$ \sum_{i,j} C(x_i, y_j) S_{xyij} $$ where
To convert them to word alignments, we follow previous work (Sabet et al., 2020; Zenkel et al., 2020) and consider two words to be aligned if any of their subwords are aligned.
Final objective L = LMLM + LTLM + LSO + LP SI + βLCO
loss가 너무 많아서 제대로 밸런싱이 안 되어 있을 듯.
기존 method에 비해 성능이 뚜렷하게 좋다고 보기는 어려움. 내부에서도 좋은 거랑 안 좋은 거랑 차이가 큼.
Conference : EMNLP 2020
Link : https://arxiv.org/pdf/2004.04906.pdf
Authors' Affiliation : Facebook & UW
TL;DR : 제대로 학습하기만 하면 (pretrain 없이) 단순히 passage question pair로 파인튜닝만 해도 bm25를 이길수 있음
Summary :
open domain QA에서는 2스테이지로 진행됨. 1) context retriever가 몇개의 passage를 가져오고 2) machine reader가 거기서 정답을 고름.
여기서 context retriever 로 쓰이는게 보통 tf-idf나 bm25. 이것들은 일종의 sparse vector라고 볼수 있음. 이것과 반대되는게 dense vector.
완전히 다른 키워드로 쓰여있어도 의미를 인지하고 가깝게 매핑할 수 있다는 장점.
A term-based system would have difficulty retrieving such a context, while a dense retrieval system would be able to better match “bad guy” with “villain” and fetch the correct context. Dense encodings are also learnable by adjusting the embedding functions, which provides additional flexibility to have a task-specific representation. With special in-memory data structures and indexing schemes, retrieval can be done efficiently using maximum inner product search (MIPS) algorithms
그러나 이런 dense embedding을 학습하는건 일반적으로 많은 labeled 데이터들이 필요하다고 믿어지고있음. 그래서 ORQA에서 나온 Inverse cloze task
이전에는 bm25를 이긴적이 없음. 여기서는 bm25를 이겼지만 단점 2가지가 있음:
추가적인 pretraining없이 question / passage(or answers) pair만 가지고 dense embedding 모델을 잘 학습할 수 있을까? 이 논문에선 비교적 적은 q/p pair만 가지고 올바르게 학습하는 scheme에 집중한다.
Solution = the embedding is optimized for maximizing inner products of the question and relevant passage vectors, with an objective comparing all pairs of questions and passages in a batch.
컨트리뷰션: 1) 제대로 학습하기만 하면 단순히 passage question pair로 파인튜닝만 해도 bm25를 이길수 있음을 보임. 2) open domain qa에서 높은 retrieval precision은 높은 qa accuracy로 직결됨을 보임.
이 논문의 초점은 open domain QA에서 retrieval을 개선하는 것임.
DPR = 그냥 SimCLR
BM25+DPR, using a linear combination of their scores as the new ranking function. Specifically, we obtain two initial sets of top-2000 passages based on BM25 and DPR, respectively, and rerank the union of them using BM25(q,p) + λ · sim(q, p) as the ranking function. We used λ = 1.1 based on the retrieval accuracy in the development set.
there is a high lexical overlap between passages and questions, which gives BM25 a clear advantage.
Inbatch negative training (=simclr)가 1-of-N training 보다 성능이 조금이지만 좋음. 왜지?? 전혀 차이가 있을 이유가 없어보이는데. 정확히 1 of n이란게 뭘까?
batch size가 커질수록 성능이 좋아지는건 당연한 것으로 보이고.
마지막으로 제안되는게 흥미로운데, 일반적인 SimCLR에서 batch의 나머지 요소들을 negative로 간주하는것에 추가해서 hard negative를 추가하는 방식이다. 이 hard negative는 bm25로 뽑은 건데 이걸 넣어주고 안 넣어주고가 성능에 매우 큰 영향을 끼친다. 여기서도 배치사이즈가 커지면 성능은 좋아지고.
이 bm25로 추가된 negative들은 batch에 있는 다른 모든 문제에 대해서도 negative가 되는 것이다. bm25 negative를 하나만 추가한 것과 2개를 추가한 것에는 큰 차이를 보이지 않는다.
이걸 우리 데이터셋에 적용하려면 약간의 전처리가 필요할듯 하다 (ocr search request 별로 묶어줘야 함.)
dot product >= L2 >> cosine. triplet loss쓰나 NLL loss 쓰나 별 차이 없음.
다른 데이터셋에서도 generalize를 잘 하는가? 잘한다. bm25 보다 훨씬 높다.
bm25는 lexical overlap이 있냐 없냐에 따라 크게 갈림. 또한 부분적으로 lexical overlap이 있으면서 다른 의미인 문장들을 걸러내지 못함. 반면 DPR은 lexical overlap이 없어도 잘하는 반면, lexical overlap이 중요한 경우 capture하지 못하는 경우가 있다. 즉, 각각이 장단점을 가진다. 둘다 적당히 결합해서 쓰면 좋을 것 같다.
With the help of FAISS in-memory index for real-valued vectors , DPR can be made incredibly efficient, processing 995.0 questions per second, returning top 100 passages per question.
In contrast, BM25/Lucene (implemented in Java, using file index) processes 23.7 questions per second per CPU thread.
반면 dense vector의 인덱스를 생성하는게 훨씬 오래걸린다. 21M 벡터에 대해서 FAISS에서 인덱스를 생성하는건 8.5시간이 걸리는 반면, 루씬에선 30분이면 된다.
후속 논문
https://arxiv.org/pdf/2104.05740.pdf
원래 논문에서 bm25 가 잘못 평가되어있었음. bm25의 성능은 그것보다 훨씬 높음. 그래도 DPR이 bm25보다 성능이 높은건 사실.
bm25 + DPR hybrid 방식이 저평가되어있었음. bm25에 weight를 주는 방식으로 바꾸고 normalization까지 하면 성능이 확 오름. hybrid는 항상 DPR 단독이나 bm25 단독 보다 좋음.
retriever에서 나온 evidence를 scoring phase에 사용하면 end to end에서 성능이 더 오름.
by incorporating evidence from the retriever and an improved answer span scoring technique, we are able to improve end-to-end question answering effectiveness using exactly the same models as in the original work.
Conference : 2020 ICLR
Link : https://arxiv.org/pdf/2002.03932.pdf
Authors' Affiliation : cmu, google
TL;DR : 적절히 디자인된 paragraph-level 사전학습 태스크로 학습하면, transformer 모델은 bm25보다 훨씬 잘 할 수 있다.
Summary :
With adequately designed paragraph-level pre-training tasks, the Transformer models can remarkably improve over the widely-used BM-25 as well as embedding models without Transformers.
retrieval phase + scoring phase
retrieval은 중요하다. 높은 recall을 가져야 한다. 그러면서 매우 efficient 하지 않으면 쓰지도 못한다.
token-based matching 알고리즘 방식과 embedding based 방식이 있음.
embedding based 방식을 two-tower retrieval model, Siamese network, dual-encoder model 로도 부름.
The token-level masked-LM (MLM) pretraining task is crucial to the success of BERT-style cross-attention models. Nevertheless, what pre-training tasks are useful for improving two-tower Transformer models in large-scale retrieval, remains a crucial yet unsolved research problem. In this paper, we aim to answer this question by studying different pre-training tasks for the two-tower Transformer models.
Contribution:
pre-training data is defined as positive query-document (q, d) pair
A good pre-training task : 1) it should be relevant to the downstream task 2) It should be cost-efficient to collect the pre-training data, ideally not requiring additional human supervision.
제안:
BFS and WLP를 새로 제안한것. The training data for all these tasks can be freely obtained based from Wikipedia without an additional manual labeling process.
Inverse Cloze Task (ICT) Given a passage p consisting of n sentences, p = {s1, . . . , sn}, the query q is a sentence randomly drawn from the passage, q = si , i ∼ [1, n], and the document d is the rest of sentences, d = {s1, . . . , si−1, si+1, . . . , sn}. See (q1,d) in Figure 2 as an example. This task captures the semantic context of a sentence and was originally proposed by Lee et al. (2019).
Body First Selection (BFS) We propose BFS to capture semantic relationship outside of the local paragraph. Here, the query q2 is a random sentence in the first section of a Wikipedia page, and the document d is a random passage from the same page (Figure 2). Since the first section of a Wikipedia article is often the description or summary of the whole page, we expect it to contain information central to the topic.
Wiki Link Prediction (WLP) We propose WLP to capture inter-page semantic relation. The query q3 is a random sentence in the first section of a Wikipedia page, and the document d is a passage from another page where there is a hyperlink link to the page of q3 (Figure 2). Intuitively, a hyperlink link indicates relationship between the two Wikipedia pages. Again, we take a sentence from the first section because it is often the description or summary of the topic.
신기한게 MLM보다 여기서 나온 pretraining process의 성능이 월등히 좋음. 다만, pretraining task별로 성능이 안나온건 매우 사기. 그리고 pretrain한 BoW-MLP의 성능이 너무 좋은데? 데이터가 적을때는 MLM 학습한 transformer보다 좋다.
(Specifically, BoW-MLP looks up uni-grams from the embedding table5 , aggregates the embeddings with average pooling, and passes them through a shallow two-layer MLP network with tanh activation to generate the final 512-dimensional query/document embeddings. For fair comparison, the BoW-MLP encoder has a comparable model size to the Transformer encoder (i.e., 128M v.s. 110M parameters, slightly favorable to BoW-MLP encoder).)
실험결과를 보면 역시나 ICT가 제일 좋고 나머지는 하나마나 거의 의미없음. 그럼 이 논문의 컨트리뷰션은 사실상 그냥 실험만 한것.
random init , MLM 같은 부적절한 사전학습 < BM25 베이스라인
적절히 디자인된 사전학습이 중요하다.
Conference :
Link : https://arxiv.org/pdf/2107.00079.pdf
Authors' Affiliation : The Bank of New York Mellon
TL;DR : we catalog and document numerous antipatterns in financial ML operations (MLOps)
Summary :
supervised learning or forecasting context에서 얘기함.
배포해놓고 한번도 안보는 경우. 계속 모니터링해야 concept drift를 막을수 있음.
hyperparameter의 중요성.
it is imperative that the part of a learning pipeline concerned with hyper-parameter optimization be explicitly and painstakingly documented so as to be reproducible and easily adaptable
Perceived Empirical SuperioriTy (PEST)
성능이 좋다고 구라치는 논문들에 속지말자. 많은 논문들은 실험 부족, hyperparameter 튜닝 부족으로 베이스라인보다 좋다고 사기치는것.
위에꺼랑 마찬가지. 대부분 performance gain은 제시한 방법 덕분이 아닌데, 그거라고 주장하는 경우가 많음.
HARKing (Hypothesizing After Results are Known) = test set 가지고서 계속 eval하는 행위.
--> implicit data leakage
concept drift
uncertainty. calibration도 중요.
data processing 스텝을 확실하게 기록하고 변하는 걸 감지해야 함.
Conference : NeurIPS 2020
Link : https://arxiv.org/pdf/2002.09437.pdf
Authors' Affiliation : University of Oxford
TL;DR : focal loss 써서 학습하면 모델이 잘 calibrated됨
Summary :
even when the classification error is 0, the NLL can be positive, and the optimisation algorithm can still try to reduce it to 0 by further increasing the value of pˆi,yi for each sample
lr decay한 직후부터 average test NLL이 증가하기 시작하는데, 이는 모두 incorrectly classified samples의 평균 NLL이 높아지기 때문이다. 정답인 샘플들의 NLL은 lr decay 이후에도 계속 떨어진다. 또한 lr decay한 이후에는 평균 ECE도 오르는데, 이는 네트워크가 miscalibrated 되기 시작한다는 뜻이다.
miscalibration 과 NLL overfitting은 연결되어 있다.
또한 entropy가 정답과 오답 모두에서 lr decay이후 감소하는데, 틀린 것에서조차 떨어진다는건 자신의 잘못된 예측에 대해서도 더 confident하게 된다는걸 의미한다.
cross entropy 로스가 0이 되는건 logit이 무한대가 되어야 가능하므로 tendency of weight magnification을 근본적으로 야기한다. weight decay가 거의 항상 accuracy를 증가시키는건 이것 때문일지도 모른다.
$L = - (1 - \hat{p}{i, y_i})^\gamma \log \hat{p}{i, y_i}$
gamma는 hyperparameter
if pˆi,yi ∈ [0, 0.2), then γ = 5, otherwise γ = 3 (note that g(0.2, 5) ≈ 1 and g(0.25, 3) ≈ 1
Conference : CVPR 2021
Link : https://arxiv.org/pdf/2104.00323v1.pdf
Authors' Affiliation : Chinese University of Hong Kong
TL;DR : jigsaw를 이미지 안에서만 섞는게 아니라 batch안에서 섞으면 성능이 좋다.
Summary :
자세한건 귀찮..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.