LLM进阶

prologue:最近大模型火出天际,I’m definitely aware I’m late to the party,2022年毕业之后就很少在系统的跟踪一个domain了,所以这次下定决心要跟踪一下大模型的技术细节和实现过程,不做AI丁真

本文三条主线,(1)文本生成;(2)多模态;(3)对话大语言模型

summary

这个世界的模态无非就是图像、视频、文本、音频四种模态,现在的大模型的目的就是要pre-train出一个世界模型,也就是一个模型能同时处理四种模态的能力。其中,图像和视频属于CV领域,文本属于NLP领域,音频目前我还没有接触过,暂不知道如何归类。目前的大模型可以分为单模态和多模态的。
单模态的比如文生文大模型,比如chatGPT系列
多模态(目前最火的就是Vision-Language Model)的比如:Grok系列等
世界模型比如:Sora等

Large Language Model timeline

Transformer(2017,open-source)

totally self-attention structure, much more parameters than that ResNet based on CNN

Core Algorithmes

BPE

BPE是NLP训练过程和推理过程中常用的将语料转换成 tokens 的方式。BPE的核心是构建一个词表,

BERT(2018.10, open-source)

自监督语言预训练方法,词表是用BPE的变体构建的,两个proxy tasks:
(1)Mask 15% 的tokens;
(2)预测是否是下一句
都是构造人工 target, 之后fine-tune to downstream tasks, 预训练过程只使用 Transformer的 Encoder,为了预测下一句任务,加了一层sengment Embedding

quesetion:
(1)BERT的双向体现在在什么地方?
在GPT-1这些模型中,为了不让模型利用到之后的信息,对attention过程做了mask,舍弃掉了attn矩阵中的右上部门数值,这就是单向的,但是bert没有这样做。
(2)BERT为什么只使用encoder部分?
BERT主要用于理解和表示任务,如文本分类、序列标注等,不需要生成文本,因此只使用encoder部分。

GPT-1(open-source,1.17亿parameters)

词表是用 BPE构建的。因为要生成文本,所以要用且也只用了decoder部分,但是decoder部分做了改进,由于没有用encoder,所以把原来的decoder中需要接收encoder的编码信息的网络层去掉了。

there is the answer from Grok3:
Why Not Encoder-Only?
An encoder-only Transformer (e.g., BERT) is bidirectional: it processes the entire input sequence at once, attending to both past and future tokens. This suits tasks like classification or masked language modeling (e.g., filling in blanks), but not autoregressive generation. GPT-2’s goal is to generate coherent text, not analyze a fixed input, so a bidirectional encoder wouldn’t work—it’d “see the future” and break the generation process.

GPT-1训练过程采用自监督方式(在预训练过程中,输入模型中的数据和伪标签相差1,即是因果语言模型Causal Language Model, CLM, GPT 系列模型都使用了这种预训练方式)。

在这种训练模式下,模型被训练来预测给定前文的下一个词,这样,模型就能学习到文本的顺序结构和语言的生成过程。),预训练过程中无需annotation, 迁移到下游任务上时需要annotation。

生成式模型和判别式模型的区别?
以前经常认为生成式模型和判别式模型的区别就是是否有生成内容的过程,但是原生的Transformer就是用来做机器翻译的,机器翻译过程中,就天生包含了生成内容的过程,但是我们好像不把原声Transformer当作一个生成式模型, So there is the answer from Grok3:
Whether a translation model is considered a generative model depends on how it’s designed and what it does under the hood. Let’s break it down:
Translation Models: Generative or Not?
Translation involves taking text in one language (source) and producing text in another language (target). This process inherently involves generating new text, which suggests a generative nature. However, the classification depends on the model’s architecture and training objective:
(1)Traditional Rule-Based or Statistical Translation
Older translation systems (e.g., phrase-based statistical machine translation) weren’t strictly generative in the modern machine learning sense. They relied on rules or statistical alignments (e.g., word/phrase mappings) rather than learning a full data distribution.
Verdict: Not generative. These are more like engineered pipelines than models learning
P ( target ∣ source ) P(\text{target}|\text{source}) P(targetsource)
in a probabilistic sense.
(2)Neural Machine Translation (NMT) - Encoder-Decoder Models
Most modern translation systems (e.g., Google Translate’s backbone, models like Transformer-based seq2seq) use an encoder-decoder architecture:
Encoder: Processes the source language into a representation (e.g., a context vector or hidden state).
Decoder: Generates the target language text, word by word or token by token, conditioned on the encoder’s output.
These models are trained to maximize the likelihood of the target sentence given the source sentence, i.e., P ( target ∣ source ) P(\text{target}|\text{source}) P(targetsource)
.
Why Generative?: The decoder produces new sequences of text, sampling from a learned distribution of possible translations. It’s not just picking from a fixed set—it can generate novel outputs.
Examples: Transformer models (like those in PyTorch’s Fairseq or Hugging Face’s MarianMT).
Verdict: Yes, these are generative models because they generate new data (target text) based on an input distribution.
3. Autoregressive vs. Non-Autoregressive Translation
Autoregressive (AR): Most NMT models (e.g., Transformer with a decoder) generate text sequentially, predicting each word based on the previous ones. This is a hallmark of generative models (e.g., GPT-style generation).
Verdict: Generative.
Non-Autoregressive (NAR): Some newer translation models (e.g., NAT, or Non-Autoregressive Transformers) predict all words in the target sentence simultaneously, often for speed. These still generate text but don’t model the sequential dependency as strongly.
Verdict: Still generative, but less “classically” so, as they don’t rely on step-by-step sampling.
4. Comparison to Discriminative Models
A discriminative model in this context might classify something about the text (e.g., “Is this sentence in English or Spanish?”) rather than producing a new sentence. Translation models don’t classify—they create—so they don’t fit the discriminative mold.
Key Insight: Generative Nature of Translation
Translation models, especially neural ones, are generative because:
They learn a conditional distribution P ( target ∣ source ) P(\text{target}|\text{source}) P(targetsource).
They output new, coherent sequences of text, not just decisions or labels.
They can produce multiple valid translations for the same input (e.g., “I love you” → “Je t’aime” or “Je vous aime” in French, depending on context), which reflects sampling from a learned distribution.
Examples in Practice
Google Translate: Uses Transformer-based NMT, which is generative.
T5 (Text-to-Text Transfer Transformer): Treats translation as a text generation task (“translate to French: Hello” → “Bonjour”). Generative.
Older SMT (Statistical Machine Translation): Less generative in the ML sense, more like a hybrid of statistical mapping and generation.
My Take as Grok
If you’re asking about modern translation models (like those powering apps today), they’re overwhelmingly generative, especially the neural ones. They’re designed to produce text, not just analyze or classify it. That said, their generative nature is conditional—they generate based on an input (source text)—unlike fully unconditional generative models (e.g., a GAN making random images).
Does that answer your question? If you’re thinking of a specific translation model, feel free to name it, and I can dig deeper!

GPT-2(2019.2 15亿参数)

GPT-2 参数量rapidly increase,说明模型也变得非常大,预训练过程还是自监督,伪标注还是和gpt-1一样用的简单的预测下一个词,训练数据集40GB, 数据来源 internet。
Grok3’s answer of GPT-2’s network architecture as follows: It is based entirely on the decoder-only portion of the Transformer, adapted for autoregressive tasks like text generation. Let me clarify how this works and contrast it with the full Transformer architecture.

GPT-2 没有把15亿参数的模型放出来,只放出了一个smaller model for experiment validation.

生成文本:1024 tokens (doubled from GPT-1).

GPT-2和GPT-1在网络结构上基本一致,只是GPT-2更大更深,最主要的不同就是在训练数据上,GPT-1用的是小说训练的,内容比较单一,所以模型的鲁棒性不强,而且在生成长序列上的连贯性不强。GPT-2是用的网络数据,数据的多样性更强,更符合实际的数据分布,所以训练出来的模型更robust。

GPT-3(close source, 2020.3 1750亿parameters)

GPT-3当年横扫文本生成领域,不仅能问答、翻译、写文章,还能做数学计算。GPT-3首次提出了“上下文学习”概念,允许大语言模型通过少样本学习解决各种任务,消除了对新任务进行微调的需求(在特定任务中不需要微调‌。)。GPT-3采用了更高效的训练策略,包括更精细的梯度下降技术和改进的正则化方法,这些优化帮助模型在训练过程中更好地泛化和避免过拟合。

GPT-3 没有公布源代码和模型权重,但Meta复现了一遍GPT-3,改名OPT,把代码、权重、部署都开源了出来,

悟道1.0(2021.3 北京智源研究院)

悟道1.0 是我国首个超大规模智能模型系统,包含了4个不同面向领域的模型:
1、悟道·文源‌:以中文为核心的大规模预训练模型,模型参数量达26亿。具有识记、理解、检索、数值计算、多语言等多种能力,覆盖开放域回答、语法改错、情感分析等20种主流中文自然语言处理任务,技术能力已与GPT-3实现齐平‌。
2、‌悟道·文澜‌:超大规模多模态预训练模型,模型参数量达10亿。基于从公开来源收集到的5000万个图文对上进行训练,是首个公开的中文通用图文多模态预训练模型,旨在突破基于图、文和视频相结合的多模态数据的预训练理论难题‌。
3、悟道·文汇‌:面向认知的超大规模新型预训练模型,参数规模达113亿。通过微调可实现AI作诗、AI作图、AI制作视频、图文生成、复杂推理等功能,致力于从认知的角度研究通用人工智能中的本质问题‌
4、悟道·文溯‌:超大规模蛋白质序列预测预训练模型。

悟道2.0(2021.6 1.75万亿parameters)

M6-1T(阿里巴巴达摩院, MM,2021.6 10万亿parameters)

MultiModality-to-MultiModality Multitask Mega-transformer (sparse model)

M6-10T(阿里巴巴达摩院, MM,2021.10 100万亿parameters)

文心一言3.0(2.6亿parameters, 百度)

GPT-3.5(2022.11 openAI)

Llama(2023.2 MetaAI)

65B parameters

GPT-4(2023.3 openAI)

1.76T parameters

Llama 2(2023.7 MetaAI)

70B parameters

文心一言4.0(2023.10 百度)

Grok-1 (2023.11 xAI)

314B parameters

Gemini(2023.12 Google DeepMind)

Gemini 1.5(2024.2 Google DeepMind)

Llama 3 70B(2024.4 MetaAI)

Llama 3.1 405B(2024.7 MetaAI)

Grok-2 (2024.8 xAI)

o1(2024.8 openAI)

A new series of reasoning models for solving hard problems.

Llama 3.3 70B(2024.11 MetaAI)

Gemini 2.0(2024.11 Google DeepMind)

o3(2024.12 openAI)

DeepSeek v3(DeepSeek-AI)

685B

DeepSeek R1(2025.1 DeepSeek-AI)

Grok-2 (2025.2 xAI)

GPT-4.5(2025.2 openAI)

chat LLM timeline

Meena(2020.1 google 26亿parameters)

LaMDA(1.37亿parameters, google, 2021.5)

全名LaMDA (Language Model for Dialogue Applications),是一个面向聊天的ChatBot。前身是 Meena(google 开发的chatbot),后续为了对抗openAI的chatGPT的崛起,google又基于 LaMDA开发了 Bard (now aka Gemini)

from wike:LaMDA is a decoder-only Transformer language model.[48] It is pre-trained on a text corpus that includes both documents and dialogs consisting of 1.56 trillion words,[49] and is then trained with fine-tuning data generated by manually annotated responses for “sensibleness, interestingness, and safety”

LaMDA 2(1.37亿parameters, google, 2022.5)

chatGPT(2022.11 )

ChatGPT is fine-tuned from a model in the GPT‑3.5 series, which finished training in early 2022. You can learn more about the 3.5 series here⁠(opens in a new window). ChatGPT and GPT‑3.5 were trained on an Azure AI supercomputing infrastructure.

Bard(基于LaMDA的产品)

text-to-image Model timeline

world model

Sora(2024.2, OpenAI)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/896698.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Ubuntu 下查看进程 PID 和终止进程方法

查看进程 PID 使用 ps 命令: ps aux | grep <process_name>例如&#xff0c;查看名为 python 的进程&#xff1a; ps aux | grep python使用 pgrep 命令: pgrep <process_name>例如&#xff0c;查看名为 python 的进程&#xff1a; pgrep python使用 top 命令: top…

Java基础语法练习34(抽象类-abstract)(抽象类最佳实践-模版设计模式)

一抽象类-abstract、 父类方法不确定性的问题故将该方法设计为抽象类&#xff08;没有实现的方法&#xff09;&#xff0c;但一般来说被子类继承然后实现 细节&#xff1a; 1、抽象类不可以被实例化 2、抽象类可以不包含抽象方法而且可以有实现的其他非抽象方法 3、abstra…

Android SDK与NDK的区别

Android SDK&#xff08;Software Development Kit&#xff09;与NDK&#xff08;Native Development Kit&#xff09;在Android应用开发中各自扮演着重要角色&#xff0c;它们之间存在显著的区别。以下是Android SDK与NDK的主要区别&#xff1a; 一、定义与用途 Android SDK…

DeepSeek在PiscTrace上完成个性化处理需求案例——光流法将烟雾动态可视化

引言&#xff1a;PiscTrace作为开放式的视图分析平台提供了固定格式的类型参数支持个性化定制处理需求&#xff0c;本文一步步的实现光流分析按照不同需求根据DeepSeek的代码处理视频生成数据。 光流法&#xff08;Optical Flow&#xff09;是一种基于图像序列的计算机视觉技术…

Linux网络 TCP全连接队列与tcpdump抓包

TCP全连接队列 在 Linux 网络中&#xff0c;TCP 全连接队列&#xff08;也称为 Accept 队列&#xff09;是一个重要的概念&#xff0c;用于管理已经完成三次握手&#xff0c;即已经处于 established 状态但尚未被应用程序通过 accept( ) 函数处理的 TCP 连接&#xff0c;避免因…

flex布局自定义一行几栏,靠左对齐===grid布局

模板 <div class"content"><div class"item">1222</div><div class"item">1222</div><div class"item">1222</div><div class"item">1222</div><div class"…

使用3090显卡部署Wan2.1生成视频

layout: post title: 使用3090显卡部署Wan2.1生成视频 catalog: true tag: [Kubernetes, GPU, AI] 使用3090显卡部署Wan2.1生成视频 1. 环境说明2. 模型下载3. 克隆仓库4. 安装依赖5. 生成视频 5.1. 使用generate脚本生成5.2. 使用gradio启动UI界面生成 5.2.1. 启动gradio服务5…

Prompt生成-Prompt工程师

# Role:Prompt工程师 ## Attention&#xff1a; - 我总是被老板骂写不出来Prompt&#xff0c;如果你能写出优秀的Prompt会避免让我失业&#xff0c;请认真思考并竭尽全力&#xff0c;拜托了&#xff01; ## Profile: - Author:pp - Version:2.1 - Language:中文 - Description:…

数据存储:一文掌握RabbitMQ的详细使用

文章目录 一、RabbitMQ简介二、RabbitMQ的概述2.1 基本概念2.2 实际应用场景三、RabbitMQ的安装与配置3.1 安装RabbitMQ3.2 启用管理插件四、使用Python操作RabbitMQ4.1 安装Pika库4.2 生产者示例4.3 消费者示例4.4 发布/订阅模式示例五、RabbitMQ的高级特性5.1 消息持久化5.2 …

Mixture of Experts与Meta Learning深度学习中的两大变革性技术

1. 引言 随着人工智能&#xff08;AI&#xff09;和深度学习技术的迅猛发展&#xff0c;创新的架构和算法不断涌现&#xff0c;推动了智能系统性能的显著提升。在这些技术中&#xff0c;Mixture of Experts (MoE) 和 Meta Learning Algorithms (MLA) 是两种极具影响力的方法。…

【新立电子】探索AI眼镜背后的黑科技,FPC如何赋能实时翻译与语音识别,点击了解未来沟通的新方式!

在全球化的今天&#xff0c;语言障碍成为人们沟通与交流的一大难题。AI眼镜作为一种新兴的智能设备&#xff0c;正在通过实时翻译与语音识别功能&#xff0c;打破语言壁垒&#xff0c;为人们提供无缝沟通的解决方案。FPC在AI眼镜中的应用&#xff0c;为实时翻译与语音识别功能的…

(十 三)趣学设计模式 之 模版方法模式!

目录 一、 啥是模板方法模式&#xff1f;二、 为什么要用模板方法模式&#xff1f;三、 模板方法模式的实现方式四、 模板方法模式的优缺点五、 模板方法模式的应用场景六、 总结 &#x1f31f;我的其他文章也讲解的比较有趣&#x1f601;&#xff0c;如果喜欢博主的讲解方式&a…

模型和数据集的平台之在Hugging Face上进行模型下载、上传以及创建专属Space

模型下载 步骤&#xff1a; 注册Hugging Face平台 https://huggingface.co/ 新建一个hf_download_josn.py 文件 touch hf_download_josn.py 编写hf_download_josn.py文件 import os from huggingface_hub import hf_hub_download# 指定模型标识符 repo_id "inter…

【弹性计算】弹性裸金属服务器和神龙虚拟化(二):适用场景

弹性裸金属服务器和神龙虚拟化&#xff08;二&#xff09;&#xff1a;适用场景 1.混合云和第三方虚拟化软件部署2.高隔离容器部署3.高质量计算服务4.高速低时延 RDMA 网络支持场景5.RISC CPU 支持6.GPU 性能无损输出 公共云服务提供商推出 弹性裸金属服务器&#xff0c;很显然…

python容器之常用操作

以列表list为例&#xff0c;这个list相当于c中的数组或vector容器。那列表有哪些常用的操作呢&#xff1f; 获取列表的长度 list [1,2,3,4,5] //获取列表的长度 length len(list) 注意这里与c不同&#xff0c;c中的容器都是有各自的定义&#xff0c;每种容器类型都实现了自…

工程化与框架系列(11)--Serverless实践

Serverless实践 ☁️ Serverless&#xff08;无服务器&#xff09;架构是云计算的一种新范式&#xff0c;它让开发者专注于业务逻辑而无需关心服务器运维。本文将详细介绍前端开发中的Serverless实践方案。 Serverless概述 &#x1f31f; &#x1f4a1; 小知识&#xff1a;Se…

kan与小波,和不知所云的画图

文章目录 小波应用范围与pde小波的名字 画图图(a)&#xff1a;数值解向量 \( u \)图(b)&#xff1a;数值解向量 \( v \)结论图4 小波 在你提供的代码中&#xff0c;小波变换&#xff08;Wavelet Transform&#xff09;被用于 KANLinear 类中。具体来说&#xff0c;小波变换在 …

算法-二叉树篇22-二叉搜索树的最近公共祖先

二叉搜索树的最近公共祖先 力扣题目链接 题目描述 给定一个二叉搜索树, 找到该树中两个指定节点的最近公共祖先。 百度百科中最近公共祖先的定义为&#xff1a;“对于有根树 T 的两个结点 p、q&#xff0c;最近公共祖先表示为一个结点 x&#xff0c;满足 x 是 p、q 的祖先且…

细说STM32F407单片机RS485收发通信实例及调试方法

目录 一、硬件配置 1、RCC、DEBUG、CodeGenerator 2、USART3 3、 RS485_DIR 4、NVIC 二、软件设计 1、RS485的收发控制 2、main.c 三、运行调试 1、修改RS485_DIR为SET后需要延迟 2、向串口助手发送的数据不能太长 MCU上的串口UART&#xff08;USART&#xff09;是…

PDF工具 Candy Desktop(安卓)

PDF Candy Desktop&#xff08;安卓&#xff09; 今天给大家分享一个电脑端的PDF工具&#xff0c;里面的功能很多&#xff0c;主要涉及PDF编辑、转换等&#xff0c;不仅超级好用&#xff0c;而且免费&#xff01;剩下就不说了&#xff0c;兄弟们自行下载体验吧&#xff01; 「…