본문 바로가기
오늘의 자연어 처리

[2023-03-16] 오늘의 자연어처리

by 지환이아빠 2023. 3. 16.
반응형

Input-length-shortening and text generation via attention values

 

Identifying words that impact a task's performance more than others is a challenge in natural language processing. Transformers models have recently addressed this issue by incorporating an attention mechanism that assigns greater attention (i.e., relevance) scores to some words than others. Because of the attention mechanism's high computational cost, transformer models usually have an input-length limitation caused by hardware constraints. This limitation applies to many transformers, including the well-known bidirectional encoder representations of the transformer (BERT) model. In this paper, we examined BERT's attention assignment mechanism, focusing on two questions: (1) How can attention be employed to reduce input length? (2) How can attention be used as a control mechanism for conditional text generation? We investigated these questions in the context of a text classification task. We discovered that BERT's early layers assign more critical attention scores for text classification tasks compared to later layers. We demonstrated that the first layer's attention sums could be used to filter tokens in a given sequence, considerably decreasing the input length while maintaining good test accuracy. We also applied filtering, which uses a compute-efficient semantic similarities algorithm, and discovered that retaining approximately 6\% of the original sequence is sufficient to obtain 86.5\% accuracy. Finally, we showed that we could generate data in a stable manner and indistinguishable from the original one by only using a small percentage (10\%) of the tokens with high attention scores according to BERT's first layer.

 

다른 단어보다 작업 수행에 더 많은 영향을 미치는 단어를 식별하는 것은 다음과 같다 자연어 처리에 대한 도전. 트랜스포머 모델은 최근에 을 할당하는 주의 메커니즘을 통합함으로써 이 문제를 해결했다 다른 단어보다 일부 단어에 대한 더 큰 주의(즉, 관련성) 점수. 왜냐면 주의 메커니즘의 높은 계산 비용, 변압기 모델 일반적으로 하드웨어 제약으로 인해 입력 길이가 제한됩니다. 이것. 제한은 잘 알려진 양방향을 포함하여 많은 변압기에 적용된다 변압기(BERT) 모델의 인코더 표현. 이 논문에서, 우리는 BERT의 주의 할당 메커니즘을 검토하여 두 가지 질문에 초점을 맞췄다: (1) 입력 길이를 줄이기 위해 주의를 기울이는 방법은 무엇입니까? (2) 주의를 기울이는 방법은 무엇입니까 조건부 텍스트 생성을 위한 제어 메커니즘으로 사용됩니까? 우리는 조사했다 텍스트 분류 작업의 맥락에서 이 질문들. 우리는 발견했다 BERT의 초기 레이어는 텍스트에 더 많은 중요 주의 점수를 할당한다 이후 계층과 비교한 분류 작업. 우리는 첫 번째로 그것을 증명했다 레이어의 주의 합계는 주어진 시퀀스의 토큰을 필터링하는 데 사용될 수 있다, 양호한 테스트 정확도를 유지하면서 입력 길이를 상당히 줄입니다. 우리는 또한 계산 효율적인 의미론적 유사성을 사용하는 필터링을 적용했다 알고리즘, 그리고 원본의 약 6\%를 유지하는 것을 발견했다 시퀀스는 86.5\%의 정확도를 얻기에 충분합니다. 마지막으로 저희가 보여드린 것을 보여주었다 원본과 구별할 수 없는 안정적인 방식으로 데이터를 생성할 수 있습니다 매우 주의를 기울여 토큰의 작은 비율(10\%)만 사용함으로써 하나씩 BERT의 첫 번째 계층에 따른 점수. 

 

 

The Learnability of In-Context Learning

 

In-context learning is a surprising and important phenomenon that emerged when modern language models were scaled to billions of learned parameters. Without modifying a large language model's weights, it can be tuned to perform various downstream natural language tasks simply by including concatenated training examples of these tasks in its input. Though disruptive for many practical applications of large language models, this emergent learning paradigm is not well understood from a theoretical perspective. In this paper, we propose a first-of-its-kind PAC based framework for in-context learnability, and use it to provide the first finite sample complexity results for the in-context learning setup. Our framework includes an initial pretraining phase, which fits a function to the pretraining distribution, and then a second in-context learning phase, which keeps this function constant and concatenates training examples of the downstream task in its input. We use our framework in order to prove that, under mild assumptions, when the pretraining distribution is a mixture of latent tasks (a model often considered for natural language pretraining), these tasks can be efficiently learned via in-context learning, even though the model's weights are unchanged and the input significantly diverges from the pretraining distribution. Our theoretical analysis reveals that in this setting, in-context learning is more about identifying the task than about learning it, a result which is in line with a series of recent empirical findings. We hope that the in-context learnability framework presented in this paper will facilitate future progress towards a deeper understanding of this important new learning paradigm.

 

인콘텍스트 학습은 놀랍고 중요한 현상이다 현대 언어 모델이 수십억 개의 학습된 매개 변수로 확장되었을 때. 큰 언어 모델의 가중치를 수정하지 않고, 그것은 수행하도록 조정될 수 있다 단순히 연결된 것을 포함함으로써 다양한 다운스트림 자연어 작업 입력에서 이러한 작업의 교육 예제. 많은 사람들에게 파괴적이긴 하지만 대규모 언어 모델의 실용적인 적용, 이 새로운 학습 패러다임은 이론적인 관점에서 잘 이해되지 않는다. 이 논문에서, 우리는 맥락 내 학습 가능성을 위한 최초의 PAC 기반 프레임워크를 제안한다, 그리고 그것을 사용하여 첫 번째 유한 샘플 복잡성 결과를 제공한다 내부 학습 설정. 우리의 프레임워크는 초기 사전 훈련 단계를 포함한다, 사전 훈련 분포에 함수를 적합시킨 다음, 두 번째 이 기능을 일정하게 유지하고 연결하는 in-in-in-in-learning 단계 입력에 있는 다운스트림 작업의 교육 예제. 우리는 우리의 프레임워크를 사용한다 가벼운 가정 하에서 사전 훈련 분포가 언제인지 증명할 것을 지시한다 잠재된 작업(자연어에 대해 종종 고려되는 모델)의 혼합이다 사전 교육), 이러한 작업은 현장 학습을 통해 효율적으로 학습될 수 있습니다, 모델의 가중치가 변경되지 않고 입력이 상당히 많은 경우에도 사전 훈련 분포에서 벗어난다. 우리의 이론적 분석에 따르면 이 설정에서, 현장 학습은 과제를 식별하는 것에 더 가깝다 그것을 배우는 것보다, 최근 일련의 결과와 일치하는 결과 경험적 발견. 우리는 문맥 내 학습 가능성 프레임워크를 희망한다 이 논문에서 제시된 것은 더 깊은 곳을 향한 미래의 진보를 촉진할 것이다 이 중요한 새로운 학습 패러다임에 대한 이해. 

 

 

The Learnability of In-Context Learning

 

In-context learning is a surprising and important phenomenon that emerged when modern language models were scaled to billions of learned parameters. Without modifying a large language model's weights, it can be tuned to perform various downstream natural language tasks simply by including concatenated training examples of these tasks in its input. Though disruptive for many practical applications of large language models, this emergent learning paradigm is not well understood from a theoretical perspective. In this paper, we propose a first-of-its-kind PAC based framework for in-context learnability, and use it to provide the first finite sample complexity results for the in-context learning setup. Our framework includes an initial pretraining phase, which fits a function to the pretraining distribution, and then a second in-context learning phase, which keeps this function constant and concatenates training examples of the downstream task in its input. We use our framework in order to prove that, under mild assumptions, when the pretraining distribution is a mixture of latent tasks (a model often considered for natural language pretraining), these tasks can be efficiently learned via in-context learning, even though the model's weights are unchanged and the input significantly diverges from the pretraining distribution. Our theoretical analysis reveals that in this setting, in-context learning is more about identifying the task than about learning it, a result which is in line with a series of recent empirical findings. We hope that the in-context learnability framework presented in this paper will facilitate future progress towards a deeper understanding of this important new learning paradigm.

 

인콘텍스트 학습은 놀랍고 중요한 현상이다 현대 언어 모델이 수십억 개의 학습된 매개 변수로 확장되었을 때. 큰 언어 모델의 가중치를 수정하지 않고, 그것은 수행하도록 조정될 수 있다 단순히 연결된 것을 포함함으로써 다양한 다운스트림 자연어 작업 입력에서 이러한 작업의 교육 예제. 많은 사람들에게 파괴적이긴 하지만 대규모 언어 모델의 실용적인 적용, 이 새로운 학습 패러다임은 이론적인 관점에서 잘 이해되지 않는다. 이 논문에서, 우리는 맥락 내 학습 가능성을 위한 최초의 PAC 기반 프레임워크를 제안한다, 그리고 그것을 사용하여 첫 번째 유한 샘플 복잡성 결과를 제공한다 내부 학습 설정. 우리의 프레임워크는 초기 사전 훈련 단계를 포함한다, 사전 훈련 분포에 함수를 적합시킨 다음, 두 번째 이 기능을 일정하게 유지하고 연결하는 in-in-in-in-learning 단계 입력에 있는 다운스트림 작업의 교육 예제. 우리는 우리의 프레임워크를 사용한다 가벼운 가정 하에서 사전 훈련 분포가 언제인지 증명할 것을 지시한다 잠재된 작업(자연어에 대해 종종 고려되는 모델)의 혼합이다 사전 교육), 이러한 작업은 현장 학습을 통해 효율적으로 학습될 수 있습니다, 모델의 가중치가 변경되지 않고 입력이 상당히 많은 경우에도 사전 훈련 분포에서 벗어난다. 우리의 이론적 분석에 따르면 이 설정에서, 현장 학습은 과제를 식별하는 것에 더 가깝다 그것을 배우는 것보다, 최근 일련의 결과와 일치하는 결과 경험적 발견. 우리는 문맥 내 학습 가능성 프레임워크를 희망한다 이 논문에서 제시된 것은 더 깊은 곳을 향한 미래의 진보를 촉진할 것이다 이 중요한 새로운 학습 패러다임에 대한 이해. 

 

 

반응형

댓글