Skip to Content
파이토치로 배우는 LLM & AI
book

파이토치로 배우는 LLM & AI

by 로런스 모로니, 박해선
March 2026
Intermediate
504 pages
11h 26m
Korean
Hanbit Media, Inc.
Content preview from 파이토치로 배우는 LLM & AI
383
15
장
트랜스포머와 transformers
표
15-4
단어에 대한 가중치 행렬
cat dog sat mat the
1
.
0 0
.
5 2
.
0 0
.
3 0
.
7
-
0
.
3 0
.
8 1
.
5 0
.
4 0
.
2
2
.
0 0
.
3 2
.
1 0
.
5 0
.
8
0
.
4 0
.
6 0
.
9 0
.
2 0
.
5
디코더 표현은
1
×
4
이고 각 단어에 대한 행렬은
4
×
1
입니다. 이를 전치되었다고 하며 두 행
렬을 곱하면 하나의 값이 나옵니다.
따라서
cat
의 경우 최종 점수는 이렇게 계산합니다. (
0
.
2
×
1
.
0
) + (–.
5
× –.
3
) + (
0
.
8
×
2
.
0
) + (–
0
.
3
×
0
.
4
) =
1
.
8
이 최종 점수가 됩니다.
각 단어에 대한 최종 점수를 계산하면 [표
15
-
5
]와 같습니다.
표
15-5
각 단어에 대한 최종 점수
cat dog sat mat the
1
.
8
-
0
.
2 1
.
1 0
.
2 0
.
5
소프트맥스 함수를 사용해 이를 확률로 변환하면 [표
15
-
6
]과 같습니다.
표
15-6
소프트맥스 함수로 변환한 확률
cat dog sat mat the
47
.
5
%
6
.
4
%
23
.
6
%
9
.
6
%
12
.
9
%
그다음 가장 높은 확률을 가진 단어를 다음 토큰으로 선택할 수 있습니다. 이를
그리디 디코
딩
greedy
decoding
이라 합니다. 또는 상위
k
개의 값 중에 하나를 선택할 수 있으며, 이를
탑-
K
디코
딩
Top
-
K
decoding
이라 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’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
QuotationMarkI 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
QuotationMarkI’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
QuotationMarkI'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.
Mark W.
Embedded Software Engineer

You might also like

AI 에이전트 엔지니어링

AI 에이전트 엔지니어링

마이클 알바다
핸즈온 LLM

핸즈온 LLM

제이 알아마르, 마르턴 흐루턴도르스트
만들면서 배우는 생성 AI

만들면서 배우는 생성 AI

데이비드 포스터

Publisher Resources

ISBN: 9791175790223