이것이 고수준에서 본 디코더의 작동 방식입니다. 다음 절에서는 이들이 어떻게 결합되어 인코
더-디코더 구조를 만드는지 알아보겠습니다.
15.2
인코더-디코더 구조
시퀀스-투-시퀀스
sequence
-
to
-
sequence
작업에 사용되는
인코더-디코더 구조
encoder
-
decoder
architecture
는
앞서 소개한 두 개의 구조를 결합합니다. 이 구조는 입력 시퀀스와 출력 시퀀스의 길이가 다를
때 두 시퀀스 사이의 변환을 다루는 작업을 수행합니다. 특히 기계 번역에서 매우 효과적으로
알려져 있지만 텍스트 요약과 질문 답변을 위한 모델에서도 사용될 수 있습니다.
다음 토큰 예측(선형 및 소프트맥스)
토큰 임베딩 + 위치 인코딩
이전에 생성한 토큰
인코더 출력
덧셈 및 정규화
피드포워드
크로스 어텐션
덧셈 및 정규화
덧셈 및 정규화
마스크드 멀티헤드 셀프 어텐션
디코더 층
(
N
번 반복)
그림
15-6
인코더-디코더 구조
385
15
장
트랜스포머와 transformers
[그림
15
-
6
]에서 보듯이 대부분 구조는 디코더와 비슷합니다. 인코더의 출력이 전체 처리 과
정의 중간에 주입되는 크로스 어텐션
cross
-
attention
층이 추가된 것이 다릅니다.
인코더는 전체 입력 시퀀스를 처리하여 입력 전체의 의미를 담은 문맥 표현을 만듭니다. 디코
더는 이를 쿼리로 사용하여 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.