Skip to Content
仕組みからわかる大規模言語モデル 生成AI時代のソフトウェア開発入門
book

仕組みからわかる大規模言語モデル 生成AI時代のソフトウェア開発入門

by 奥田 勝己
February 2025
Intermediate
376 pages
9h 25m
Japanese
Shōeisha
Content preview from 仕組みからわかる大規模言語モデル 生成AI時代のソフトウェア開発入門
トークナイザ
1.4
トークナイザは、テキストとトークンID 列を相互変換するソフトウェアモジュールです。
テキストをトークンID列に変換する処理をトークン化(tokenization)やエンコード処理
encoding)と呼びます。一方、逆にトークンID 列をテキストに変換することをデコード処理
decoding)と呼びます。
本書執筆時点の主要なLLM におけるトークナイザでは、サブワードをトークンとして使用
します。サブワードとは単語を細かく分解した単位です。このサブワード分割には、Byte
Pair EncodingBPE)やその派生形が用いられます。これらのトークン化アルゴリズムは、
テキストを一連のトークンに分割するために、多言語コーパスで事前に学習された共通の語彙
を使用します。ここでの語彙はすべてのトークンの集合を意味します。また、コーパスとは、
モデルの訓練に使用するテキストデータの集合のことです。多言語コーパスには単一の言語だ
けでなく英語や日本語など様々な言語のテキストデータが含まれます。
本書では、基本となるBPE について解説します。BPEでは語彙表を用いてエンコード/
コード処理を行います。この語彙表はTransformer の学習とは独立して行われます。本節で
は、以降、デコード処理、エンコード処理、語彙表の学習について順に説明します。語彙表の
役割を理解するために、まずはデコード処理から見てみましょう。
1.4.1
デコード
デコードは、トークンID のリストをテキストに変換する処理です。トークナイザは ...
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

What Successful Brick-and-Mortar Retailers Get Right

What Successful Brick-and-Mortar Retailers Get Right

Rob Angell
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9784798185613