Skip to Content
图解大模型 : 生成式AI 原理与实战
book

图解大模型 : 生成式AI 原理与实战

by Jay Alammar, Maarten Grootendorst
May 2025
Intermediate to advanced
382 pages
10h 33m
Chinese
Posts & Telecom Press
Content preview from 图解大模型 : 生成式AI 原理与实战
词元和嵌入
57
根据模型预测正确与否,典型的机器学习训练步骤会调整嵌入向量,以便模型在下次遇到
这两个向量时,更准确地进行预测。在训练过程结束时,词表中的所有词元获得了更好的
词嵌入表示。
这种接收两个向量并预测它们是否具有某种关系的模型思想,是机器学习中最强大的思想
之一,并且在语言模型中屡试不爽。这就是为什么我们要在第
10
章专门讨论这个概念,
以及它如何优化语言模型来完成特定任务(如句子嵌入和检索)。
这个思想也是连接文本和图像等不同模态的核心,这对
AI
图像生成模型来说至关重要,
我们将在第
9
章详细讨论多模态模型。在多模态形式中,模型会接收一张图片和一段描述
文本,然后预测该文本是否描述了这张图片。
2.5
 推荐系统中的嵌入
正如我们提到的,嵌入的概念在许多其他领域都很有用。在工业界,它被广泛应用于推荐
系统。
2.5.1
 基于嵌入的歌曲推荐
在本节中,我们将使用
word2vec
算法,利用人工创建的音乐播放列表来嵌入歌曲。想象
一下,我们把每首歌曲都当作一个词或词元来处理,把每个播放列表当作一个句子,这些
嵌入就可以用来推荐经常出现在同一个播放列表中的歌曲。
我们将使用的
Playlist
数据集是由康奈尔大学的
Shuo Chen
收集的。它包含了来自美国数
百个广播电台的播放列表。图
2-17
展示了这个数据集的形式。
播放列表 1:
播放列表 2:
播放列表 3:
歌曲 1
歌曲 2
歌曲 13
歌曲 81
歌曲 2
歌曲 13
歌曲 400
歌曲 82 歌曲 77
歌曲 2歌曲 13
2-17:为了获得捕捉歌曲相似性的歌曲嵌入,我们将使用由一系列播放列表组成的数据集,每个 ...
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

大模型应用开发极简入门 : 基于GPT-4 和ChatGPT(第2版)

大模型应用开发极简入门 : 基于GPT-4 和ChatGPT(第2版)

Olivier Caelen, Marie-Alice Blete
生成式人工智能可视化

生成式人工智能可视化

Priyanka Vergadia, Valliappa Lakshmanan

Publisher Resources

ISBN: 9787115670830