<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Blog</title>
        <link>玻璃小屋.cn/</link>
        <description>懒人博客;随缘更新.</description>
        <lastBuildDate>Thu, 02 Jul 2026 03:55:51 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2026, 海鸥旅人</copyright>
        <item>
            <title><![CDATA[多模态大模型是怎么看懂图片、视频和音频的？]]></title>
            <link>玻璃小屋.cn/article/how-multimodal-llm-sees</link>
            <guid>玻璃小屋.cn/article/how-multimodal-llm-sees</guid>
            <pubDate>Fri, 26 Jun 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[初步了解多模态大语言模型时如何理解图片视频模型的。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-38a5788abc9981b99d3dfb309b42a1fb"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-blue_background_co notion-block-0f648d809ace438ca22299ac4e2e4e87"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-c98b2df85edf47ef8f0b2cc93511f844">写作假设：你了解 ChatGPT/大语言模型是什么，但好奇它们怎么&quot;看&quot;图片和视频、&quot;听&quot;声音。读完你会理解多模态模型的核心架构和训练逻辑，不需要 AI 论文基础。</div></div></div><hr class="notion-hr notion-block-95e60867e7e24eacbb82150f0bfecc76"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-565648e9a52c4b1f83a0ca04df2ccea7" data-id="565648e9a52c4b1f83a0ca04df2ccea7"><span><div id="565648e9a52c4b1f83a0ca04df2ccea7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#565648e9a52c4b1f83a0ca04df2ccea7" title="一句话结论"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">一句话结论</span></span></h2><div class="notion-callout notion-orange_background_co notion-block-721dff41535a45d996a1e9cfd9105731"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🔑">🔑</span></div><div class="notion-callout-text"><div class="notion-text notion-block-4b6310307e2d470194ac6d76cbae98bb">多模态大模型 = 专用编码器（把图片/视频/音频变成数字信号） + 连接器（把信号&quot;翻译&quot;到语言空间） + 大语言模型（推理和生成）</div></div></div><hr class="notion-hr notion-block-a36a907af1ef4282863c5458c49492da"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-86f3a6f575534a3b892746d15c4c5085" data-id="86f3a6f575534a3b892746d15c4c5085"><span><div id="86f3a6f575534a3b892746d15c4c5085" class="notion-header-anchor"></div><a class="notion-hash-link" href="#86f3a6f575534a3b892746d15c4c5085" title="一、引言：从纯文本到&quot;看懂世界&quot;"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">一、引言：从纯文本到&quot;看懂世界&quot;</span></span></h2><div class="notion-text notion-block-3eaf8c30f11546318d5ae767695fb255">2023 年 GPT-4V 发布的时候，最让开发者兴奋的不是它文字能力提升了多少，而是——你可以给它<b>发一张图</b>。</div><div class="notion-text notion-block-828fc5e7bbdb4d2e9ad2b487701a44c4">比如你拍了个冰箱内部的照片，问它&quot;今晚能做什么菜？&quot;它真的能看懂每样食材。这在这之前的大模型里是不可能的——以前的模型只能读文字，你得像写作文一样描述&quot;冰箱里有三个鸡蛋、半棵白菜、一块豆腐&quot;。</div><div class="notion-text notion-block-30c28835dbba4102be5ef84d90bce005"><b>问题是，你描述得再详细，也比不上直接给一张照片。</b> 这句大白话，背后其实是一个严肃的学术命题：</div><blockquote class="notion-quote notion-block-3d64eae3dad1416c800fc3f8057ca002"><div><b>一张图片承载的信息量，远超一段自然语言描述能表达的内容。</b></div></blockquote><div class="notion-text notion-block-e282344ea9c14933adcfc1c64f02c77a">这句话正是 <b>DeepSeek-VL 论文</b>（arXiv:2403.05525）开篇的核心论点。论文指出，真实世界的场景中——网页截图、PDF 排版、表格、公式、逻辑图——这些复杂信息如果用文字描述，要么丢失大量细节，要么描述本身就比图片还长。而视觉输入可以直接、完整地传达所有信息。</div><div class="notion-text notion-block-159fd45df8604b58b14725a78673980b">咱们接下来就一层层拆解：多模态大模型到底是怎么做到的。</div><details class="notion-toggle notion-block-1c4ee9dea7fd4667a53c1328c451f0ab"><summary>什么是「多模态」？</summary><div><div class="notion-text notion-block-4e68bacab0644083b948724ece59ddf7">&quot;模态&quot;（Modality）就是信息的形式。文本是一种模态、图片是一种模态、视频和音频也是。<b>多模态 = 能同时处理多种信息形式</b>。就像人类用眼睛看画面、用耳朵听声音、用语言表达——多模态模型也在模仿这种能力。</div></div></details><hr class="notion-hr notion-block-8099f16b22714ea189fe78bc5531b874"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-a2324d38c85249a5a513dcb9386531b9" data-id="a2324d38c85249a5a513dcb9386531b9"><span><div id="a2324d38c85249a5a513dcb9386531b9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a2324d38c85249a5a513dcb9386531b9" title="二、核心架构：LLM 怎么&quot;看得见&quot;？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二、核心架构：LLM 怎么&quot;看得见&quot;？</span></span></h2><div class="notion-text notion-block-f887d4e72c614ca290c83956fe24209b">多模态大模型的核心结构其实很简单，可以用一句话概括：</div><blockquote class="notion-quote notion-block-2e178cb2e7614de4b940afed0022f257"><div><b>给大语言模型（LLM）装上一个&quot;眼睛&quot;和一个&quot;翻译器&quot;。</b></div></blockquote><div class="notion-text notion-block-e19c0b25d57e4482894cf8bb0e2d5316">它的整体架构分为三层：</div><ol start="1" class="notion-list notion-list-numbered notion-block-8d9c2df525ab4adeb72009c9a0e87d85" style="list-style-type:decimal"><li>🟢 <b>感知层（编码器）</b>：把图片、视频帧、音频波形转成数字特征向量</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-85d134a58f414571abf37830fb82c474" style="list-style-type:decimal"><li>🔵 <b>翻译层（连接器）</b>：把视觉/音频特征&quot;翻译&quot;成 LLM 能理解的 embedding</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-1bba4f3f70be4619b912632d2837c53c" style="list-style-type:decimal"><li>🟣 <b>推理层（LLM）</b>：像处理文字一样处理这些视觉 token，回答问题</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3b777763966d40d781f5dff771dfdee9"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/how-multimodal-llm-sees/02-multimodal-architecture.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3b777763-966d-40d7-81f5-dff771dfdee9" alt="多模态大模型三段式架构图" loading="lazy" decoding="async"/><figcaption class="notion-asset-caption">多模态大模型三段式架构图</figcaption></div></figure><div class="notion-callout notion-blue_background_co notion-block-01bf47fbbd6a418e9b4de44c072f6e98"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-74896472c94444ebadcb75745acfc689">关键洞察：LLM 本身不需要&quot;长眼睛&quot;。它只认识 token（数字序列）。视觉编码器把图片变成数字，连接器确保这些数字的&quot;语言&quot;LLM 能看懂。就这么简单。</div></div></div><div class="notion-text notion-block-748103dd1b684ae4a2638366889995d1">现有的主流架构可以分为四类（后面第6章展开对比）。</div><hr class="notion-hr notion-block-1a92d13761c64475b3d519063ed89775"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-b20c73fe695843048b21880da1a28f02" data-id="b20c73fe695843048b21880da1a28f02"><span><div id="b20c73fe695843048b21880da1a28f02" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b20c73fe695843048b21880da1a28f02" title="三、图像理解：从像素到 token"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三、图像理解：从像素到 token</span></span></h2><div class="notion-text notion-block-472c1177244f4814b49f6769e585a7bb">图片是怎么变成 LLM 能理解的东西的？我们一步步看。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3ab56b42e7074005872ffffaa9902293" data-id="3ab56b42e7074005872ffffaa9902293"><span><div id="3ab56b42e7074005872ffffaa9902293" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3ab56b42e7074005872ffffaa9902293" title="3.1 切块编码（Patchify + ViT）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.1 切块编码（Patchify + ViT）</span></span></h3><div class="notion-text notion-block-0640490f559e40f2b0ab557e3ff76dcb">一张 224×224 像素的图片，首先被切成一个个 16×16 的小方块（patch），一共 14×14=196 个 patch。每个 patch 展平成一串数字（768 维向量），然后加上位置信息（告诉模型这个 patch 在图片的哪个位置）。</div><details class="notion-toggle notion-block-947adb9ebd8c4fd7ac1c1a8a7650ce56"><summary>什么是「ViT（Vision Transformer）」？</summary><div><div class="notion-text notion-block-6e70a2a6850f4d63a342bcb831d90130">ViT 就是&quot;视觉版的 Transformer&quot;。它像处理文字一样处理图片——文字是切分成 token，ViT 把图片切分成 patch（方块），然后用同样的自注意力机制来理解 patch 之间的关系。2020 年 Google 提出后迅速取代了传统的 CNN 架构。</div></div></details><div class="notion-text notion-block-03aad778fde142a58606d100ede5e4b1">这些 patch 序列通过 ViT 的 Transformer 层，经过自注意力（self-attention）计算每个 patch 跟其他 patch 的关系。比如一张狗的照片，高层的注意力权重会集中在狗脸的 patch 上，忽略背景的 patch。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-4277e8356018413291cfc8c9c3283e39"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/how-multimodal-llm-sees/03-vit-patches.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=4277e835-6018-4132-91cf-c8c9c3283e39" alt="ViT 图像切patch → token 示意图" loading="lazy" decoding="async"/><figcaption class="notion-asset-caption">ViT 图像切patch → token 示意图</figcaption></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-262fc486ff7f4d129cbdb9f06ada4ec1" data-id="262fc486ff7f4d129cbdb9f06ada4ec1"><span><div id="262fc486ff7f4d129cbdb9f06ada4ec1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#262fc486ff7f4d129cbdb9f06ada4ec1" title="3.2 对齐：为什么 ViT 懂&quot;语义&quot;？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2 对齐：为什么 ViT 懂&quot;语义&quot;？</span></span></h3><div class="notion-text notion-block-d888e9f48f57420d9222d3b0111bb4d5">光有 ViT 还不够——它的输出是一堆数字，怎么确保这些数字对应的是&quot;狗&quot;、&quot;树&quot;、&quot;桌子&quot;这些语义概念？</div><div class="notion-text notion-block-92ace316bde848f0af3a951f65f6fa33"><b>答案是 CLIP（Contrastive Language-Image Pre-training）</b>。CLIP 在 4 亿张图文对上训练，用对比学习让图片的特征和对应的文字描述在向量空间中&quot;靠在一起&quot;，不相关的内容&quot;推开&quot;。训练完成后，ViT 编码器输出的向量就有了语义含义。</div><details class="notion-toggle notion-block-71d2cfb9726e4d98b3a68bae0c10c597"><summary>什么是「对比学习」？</summary><div><div class="notion-text notion-block-4884ed5312e244cb944f2f0789220dc2">想象你有一堆照片和对应的文字描述。训练时，模型要做的就是把&quot;正确的配对&quot;拉近（照片A和它的文字描述A），把&quot;错误的配对&quot;推远（照片A和文字描述B）。这样一来，模型学会了什么图片特征对应什么语义。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-da52ecf620624cdfb6f6abafc1ecc7c8" data-id="da52ecf620624cdfb6f6abafc1ecc7c8"><span><div id="da52ecf620624cdfb6f6abafc1ecc7c8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#da52ecf620624cdfb6f6abafc1ecc7c8" title="3.3 DeepSeek-VL 的高清策略"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.3 DeepSeek-VL 的高清策略</span></span></h3><div class="notion-text notion-block-3dcc408293ac4ea2b8eab46b11a6d751">一般的 ViT 只能处理 384×384 大小的图片。真实世界的截图、PDF 通常远高于这个分辨率。DeepSeek-VL 提出了一个巧妙的方案：</div><ul class="notion-list notion-list-disc notion-block-1117110e3d7c41378e3af39bf66124ea"><li><b>混合视觉编码器（Hybrid Vision Encoder）</b>：一个 384×384 的编码器提取&quot;粗语义&quot;，一个 1024×1024 的高分辨率编码器提取&quot;精细特征&quot;</li></ul><ul class="notion-list notion-list-disc notion-block-b36d4543a0d54ea79e37fee5bb093db1"><li>两者融合后，一张大图压缩成 <b>仅 576 个 token</b>，既保留了丰富的视觉信息，又把计算量控制在合理范围。</li></ul><div class="notion-callout notion-gray_background_co notion-block-87574420375f4d4292f17278ba53717c"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="📝">📝</span></div><div class="notion-callout-text"><div class="notion-text notion-block-1705befe050d4c44a8b8fe2232182647">其他模型的高清策略：LLaVA-NeXT 用 AnyRes 网格，DeepSeek-VL2 用动态平铺（dynamic tiling）。思路相似，实现不同。</div></div></div><hr class="notion-hr notion-block-118a25af298b4d749b25c18eda3b2d6a"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-88ec084031d84f64913b047199eaca84" data-id="88ec084031d84f64913b047199eaca84"><span><div id="88ec084031d84f64913b047199eaca84" class="notion-header-anchor"></div><a class="notion-hash-link" href="#88ec084031d84f64913b047199eaca84" title="四、视频理解：让模型&quot;看连续画面&quot;"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">四、视频理解：让模型&quot;看连续画面&quot;</span></span></h2><div class="notion-text notion-block-4210ad32f1c04d2ca09931f1ebdd0e73">视频不是静态的——每秒 24-30 帧，有运动、有剧情、有变化。模型怎么理解？</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-43a6fa01acf942ecb22463cb30898663" data-id="43a6fa01acf942ecb22463cb30898663"><span><div id="43a6fa01acf942ecb22463cb30898663" class="notion-header-anchor"></div><a class="notion-hash-link" href="#43a6fa01acf942ecb22463cb30898663" title="4.1 核心思路：帧采样"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.1 核心思路：帧采样</span></span></h3><div class="notion-text notion-block-2b40664184bc418a9f43e8de83da06fa">把视频当作&quot;一组连续图片&quot;来处理：</div><ol start="1" class="notion-list notion-list-numbered notion-block-b773f2967c7648a5b2ae639fb79abe9a" style="list-style-type:decimal"><li><b>帧采样</b>：从视频中均匀抽取 N 帧（常见 8 帧或 32 帧）</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-03b51aa11dc443c38159f7b291536e11" style="list-style-type:decimal"><li><b>每帧通过视觉编码器</b>：共享同一个 ViT 权重，参数不增加</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-d35083842a8645c5aaba2127cb5e8737" style="list-style-type:decimal"><li><b>时空位置编码</b>：把帧序号加入 token，告诉模型&quot;这是第几秒的画面&quot;</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-69d6cf1eea57423a8732667e9b8a5dad" style="list-style-type:decimal"><li><b>帧间时序建模</b>：用 3D 卷积或时间注意力捕捉帧与帧之间的变化</li></ol><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-45710fe5183d40f4b6434b346c492b83" data-id="45710fe5183d40f4b6434b346c492b83"><span><div id="45710fe5183d40f4b6434b346c492b83" class="notion-header-anchor"></div><a class="notion-hash-link" href="#45710fe5183d40f4b6434b346c492b83" title="4.2 Video-LLaVA 的神奇发现"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.2 Video-LLaVA 的神奇发现</span></span></h3><div class="notion-text notion-block-33ba22d3eaaa44ea8c20e23486ca2bbd">Video-LLaVA（arXiv:2311.10122）有一个惊人的发现：<b>只用图像数据训练的视频 LMM，也能理解视频——零样本迁移</b>。也就是说，模型只在单张图片上训练过，但给连续帧序列时，它自动学会了理解动作变化。</div><div class="notion-text notion-block-2c80d5f425b94963879ba0660f7ac66b">原因是：LLM 本身学过足够的时序推理能力（语言本身就是时序的），加上正确的空间位置编码，从静态帧推理动态变化就水到渠成了。</div><details class="notion-toggle notion-block-aa2bf3bbb7954f659f311836746bf651"><summary>什么是「零样本迁移」？</summary><div><div class="notion-text notion-block-86ddd422f5d04518a450ac1ef812b52f">模型在没有专门训练某项任务的情况下，就能完成任务。Video-LLaVA 没在视频数据上训练过，但给它看视频帧序列，它能回答&quot;这个人正在做什么&quot;——这就是零样本能力。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1773bc28abb648b98633fe9a93fcb8b5" data-id="1773bc28abb648b98633fe9a93fcb8b5"><span><div id="1773bc28abb648b98633fe9a93fcb8b5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1773bc28abb648b98633fe9a93fcb8b5" title="4.3 视频的 token 消耗"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.3 视频的 token 消耗</span></span></h3><div class="notion-text notion-block-6091ac4ab5d34071b2ca28e0f3728247">每帧产生约 256 个 visual token，8 帧视频就是 2048 个 token——已经相当可观了。这也是为什么很多视频模型选择&quot;稀疏采样&quot;（每秒只取 1-2 帧）而不是密集采样。</div><hr class="notion-hr notion-block-f7502e40b1c34798b24a86179e0d749c"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-9f041ad55fa542a1b43bdc27b6d8ae84" data-id="9f041ad55fa542a1b43bdc27b6d8ae84"><span><div id="9f041ad55fa542a1b43bdc27b6d8ae84" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9f041ad55fa542a1b43bdc27b6d8ae84" title="五、音频理解：听声、听歌、听语气"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">五、音频理解：听声、听歌、听语气</span></span></h2><div class="notion-text notion-block-2c203e29f0434fd9add4dd8a39200ade">音频的挑战和图像不同：它是<b>一维时序信号</b>（声波随时间变化），不像图片那样有明确的空间结构。</div><div class="notion-text notion-block-143036f0e9864397929a5586dddeb526">目前有两种主流路径：</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2f1937d4e0f545a89fd579376a950e84" data-id="2f1937d4e0f545a89fd579376a950e84"><span><div id="2f1937d4e0f545a89fd579376a950e84" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2f1937d4e0f545a89fd579376a950e84" title="路径 A：语音转文字（ASR First）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">路径 A：语音转文字（ASR First）</span></span></h3><div class="notion-text notion-block-d5bef4bba8da45bd8e6ff19c603c36e2">这个路径简单高效，适合&quot;语音对话&quot;场景。但缺点很明显——<b>丢失了所有非语言信息</b>：背景的狗叫声、说话人的情绪语气、音乐节奏等等。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-932c23e1773f4e10ae543aac7c9be006" data-id="932c23e1773f4e10ae543aac7c9be006"><span><div id="932c23e1773f4e10ae543aac7c9be006" class="notion-header-anchor"></div><a class="notion-hash-link" href="#932c23e1773f4e10ae543aac7c9be006" title="路径 B：原生音频编码（Audio Native）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">路径 B：原生音频编码（Audio Native）</span></span></h3><div class="notion-text notion-block-ece480c61ff748b28ae7639f8a810340">这是 Gemini 的做法。音频先经过短时傅里叶变换（STFT）变成<b>声谱图</b>——一张&quot;时间的频率变化图&quot;，然后让 ViT 或专门的音频 Transformer（AST、CLAP、BEATs）来处理。</div><details class="notion-toggle notion-block-784b25e19d4e47079c883bd9a4f328c6"><summary>什么是「声谱图（Spectrogram）」？</summary><div><div class="notion-text notion-block-db19488509964d4887496f071a3ab478">把声音的波形转换成一幅图：横轴是时间、纵轴是频率、颜色深浅代表音量大小。这样一来，声音就变成了&quot;图像&quot;，可以用同样的视觉模型来理解。狗叫是一块黄色斑块、钢琴声是一排横线。这就是&quot;跨模态&quot;的巧妙之处。</div></div></details><div class="notion-text notion-block-2a88be344c864a098a5257864fc5f865"><b>CLAP</b> 是 CLIP 的音频版——用对比学习对齐音频和文字描述，让模型学会&quot;狗叫的声音&quot;≈&quot;a dog barking&quot;的文本。</div><div class="notion-text notion-block-eda18986ee66400db60578d8ddd1784c"><b>Gemini 的突破</b>：它把音频编码为 32kHz 采样率的&quot;音频 token&quot;序列，和文本 token 混在一起训练，所以它能理解非语言声音——背景的钟声、笑声、汽车鸣笛声。</div><hr class="notion-hr notion-block-6bfe769eb27343358e0c38d2ad3e1c07"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-7bab6f1c0ddf467da537941ede7dfa2e" data-id="7bab6f1c0ddf467da537941ede7dfa2e"><span><div id="7bab6f1c0ddf467da537941ede7dfa2e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7bab6f1c0ddf467da537941ede7dfa2e" title="六、跨模态对齐：让视觉和语言&quot;说同一种话&quot;"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">六、跨模态对齐：让视觉和语言&quot;说同一种话&quot;</span></span></h2><div class="notion-text notion-block-cdf0b03b458542179fc1f405fb6a83a6">视觉编码器输出的是视觉特征，LLM 输入的是文字 embedding——它们的&quot;语言&quot;不同。<b>连接器（Connector）的任务就是当翻译</b>。</div><div class="notion-text notion-block-d65664dbf60345ce9605e46a075cc3f3">现有的对齐方式有三大流派：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-4d815147ec064d908fbc5122f885ff82"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/how-multimodal-llm-sees/06-alignment-comparison.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=4d815147-ec06-4d90-8fbc-5122f885ff82" alt="三种跨模态对齐方案对比" loading="lazy" decoding="async"/><figcaption class="notion-asset-caption">三种跨模态对齐方案对比</figcaption></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-f177a193a04f495ca121eacf8da53ca7" data-id="f177a193a04f495ca121eacf8da53ca7"><span><div id="f177a193a04f495ca121eacf8da53ca7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f177a193a04f495ca121eacf8da53ca7" title="6.1 简单映射（MLP Projector）— LLaVA 方案"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.1 简单映射（MLP Projector）— LLaVA 方案</span></span></h3><div class="notion-text notion-block-0fe6d600c9904f00af0d06a736e272cb">用 1-2 层 MLP 把视觉特征直接映射到 LLM 的 embedding 空间。</div><blockquote class="notion-quote notion-block-8317b68051154aab828b067ca6f28a4a"><div>视觉特征（4096维）→ MLP → 语言空间（4096维）</div></blockquote><div class="notion-text notion-block-b930a3ea81d1429d8017be955c2b48b7">✅ 简单、高效、参数量少</div><div class="notion-text notion-block-6d119157ea0e4879aba834a80c31e41f">❌ 表达能力有限，视觉信息可能丢失</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-6f3079aea3fd4e78bbcb959c43c8e15f" data-id="6f3079aea3fd4e78bbcb959c43c8e15f"><span><div id="6f3079aea3fd4e78bbcb959c43c8e15f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6f3079aea3fd4e78bbcb959c43c8e15f" title="6.2 Query Transformer（Q-Former）— BLIP-2 / InstructBLIP 方案"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.2 Query Transformer（Q-Former）— BLIP-2 / InstructBLIP 方案</span></span></h3><div class="notion-text notion-block-762f28faa9ae4eee8be920f5b6aae688">用一组<b>可学习的 query token</b>，通过交叉注意力从视觉特征中&quot;选择性提取&quot;有用信息。</div><div class="notion-text notion-block-a06884306e59488ab7ed1664f45e19e7">✅ 信息压缩率高（256→32），筛选能力强</div><div class="notion-text notion-block-22730d7a819a406f8d3d2ab5c6c5053c">❌ 结构复杂，训练成本更高</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-441ac7bcb0d7407980e3c85587e9feab" data-id="441ac7bcb0d7407980e3c85587e9feab"><span><div id="441ac7bcb0d7407980e3c85587e9feab" class="notion-header-anchor"></div><a class="notion-hash-link" href="#441ac7bcb0d7407980e3c85587e9feab" title="6.3 交叉注意力注入（Cross-Attention）— Flamingo 方案"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.3 交叉注意力注入（Cross-Attention）— Flamingo 方案</span></span></h3><div class="notion-text notion-block-0fdc75adcb5641a5be7a4894f3afd447">在 LLM 的每一层之间插入 <b>GATED XATTN-DENSE</b> 模块，让 LLM 在推理时&quot;额外看一眼&quot;视觉特征。</div><div class="notion-text notion-block-773ab06d8878474ebc1a68cda5536775">✅ 视觉信息直接参与推理，不信息损失</div><div class="notion-text notion-block-39da4fbd72bc4d9b97504ac43734ee1e">❌ 计算量大（每层都要交叉注意力）</div><div class="notion-callout notion-blue_background_co notion-block-a5fa14796c8547d4b69c051f98107026"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-e87e984a06ce44b09352d87790f8d00d">三者的本质区别：MLP 是&quot;硬翻译&quot;，Q-Former 是&quot;先筛选再翻译&quot;，Cross-Attention 是&quot;边推理边查阅&quot;。</div></div></div><hr class="notion-hr notion-block-4dc6263c81a5442f910204b5f7f8e8e0"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-651bb217f1fb47388a32b5df4876b10d" data-id="651bb217f1fb47388a32b5df4876b10d"><span><div id="651bb217f1fb47388a32b5df4876b10d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#651bb217f1fb47388a32b5df4876b10d" title="七、训练三部曲：对齐→微调→RLHF"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">七、训练三部曲：对齐→微调→RLHF</span></span></h2><div class="notion-text notion-block-a89e62b06ce84534aa241613cb8fa258">多模态模型不是一次性训练出来的。以 LLaVA 为代表，标准流程分三个阶段：</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-73ac0e4176b749ed8e9c8d522850815e" data-id="73ac0e4176b749ed8e9c8d522850815e"><span><div id="73ac0e4176b749ed8e9c8d522850815e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#73ac0e4176b749ed8e9c8d522850815e" title="阶段一：模态对齐预训练"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">阶段一：模态对齐预训练</span></span></h3><ul class="notion-list notion-list-disc notion-block-f8b4e9e590434b7b8b07b9dfe6a0dbff"><li><b>目标</b>：让连接器学会&quot;翻译&quot;视觉特征到语言空间</li></ul><ul class="notion-list notion-list-disc notion-block-923426678828418489714430807ed614"><li><b>数据</b>：图文对（CC3M / LAION），约 558K 条</li></ul><ul class="notion-list notion-list-disc notion-block-d4535c263ef044a2af788357a671ba54"><li><b>训练</b>：冻结视觉编码器 + 冻结 LLM，<b>只训练连接器</b></li></ul><ul class="notion-list notion-list-disc notion-block-9200c006ec124807a5138123ed36fac8"><li><b>损失</b>：语言建模（next token prediction）</li></ul><div class="notion-text notion-block-6f77c244dd984defb31e9c590cd785d8">输入：<code class="notion-inline-code">&lt;image&gt;\nA dog sitting on a chair.</code></div><div class="notion-text notion-block-1bc16a8a67c847e39189143fe6324aa9">输出：模型预测下一 token，推动连接器把视觉特征映射到正确的语言 token 分布。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-603374277bc140e3910fe773228a4fea" data-id="603374277bc140e3910fe773228a4fea"><span><div id="603374277bc140e3910fe773228a4fea" class="notion-header-anchor"></div><a class="notion-hash-link" href="#603374277bc140e3910fe773228a4fea" title="阶段二：视觉指令微调"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">阶段二：视觉指令微调</span></span></h3><ul class="notion-list notion-list-disc notion-block-62d2ab4d668943d8a7ab2dd74f516dc8"><li><b>目标</b>：让模型学会跟随多模态指令（问答、描述、推理）</li></ul><ul class="notion-list notion-list-disc notion-block-9ef6ebc6ff4a45249cf8f1f861c8c848"><li><b>数据</b>：LLaVA-665K（GPT-4 从 COCO 图像生成）+ 学术 VQA</li></ul><ul class="notion-list notion-list-disc notion-block-385cf900c5ff4cea9e9d46a1657720c9"><li><b>训练</b>：冻结视觉编码器，联合训练连接器 + LLM</li></ul><ul class="notion-list notion-list-disc notion-block-ddf65c1586be41a38421e87949604f1f"><li><b>关键</b>：DeepSeek-VL 在这个阶段发现，至少要保留 <b>70% 的纯文本数据</b>，否则语言能力会退化</li></ul><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-8f06503dfb0846b89571facd4d55aa6f" data-id="8f06503dfb0846b89571facd4d55aa6f"><span><div id="8f06503dfb0846b89571facd4d55aa6f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8f06503dfb0846b89571facd4d55aa6f" title="阶段三：RLHF / DPO（可选）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">阶段三：RLHF / DPO（可选）</span></span></h3><ul class="notion-list notion-list-disc notion-block-9e9a98531080445ca86236de24a989c1"><li><b>目标</b>：减少幻觉，提高事实性</li></ul><ul class="notion-list notion-list-disc notion-block-b073c19556bd4fd19708113ef93846c2"><li><b>方法</b>：RLHF 或 DPO（直接偏好优化）</li></ul><ul class="notion-list notion-list-disc notion-block-0d4d8c907d0845b2b3a9c52c32c72984"><li><b>效果</b>：模型学会说&quot;我不知道&quot;而不是瞎编</li></ul><div class="notion-callout notion-red_background_co notion-block-836dcee57d1f4e50af623b1164284cc1"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-ee33637a914b4e6bb889332a13142096">关键教训：很多开源模型只做阶段二（指令微调），不做阶段一（预训练对齐），导致模型虽然能在 benchmark 上刷分，但真实场景中理解图片的&quot;世界知识&quot;很薄弱。DeepSeek-VL 论文特别强调了预训练的重要性。</div></div></div><hr class="notion-hr notion-block-280f9675b0bd4700a415e58288316800"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-3d348367362d46ddbac6e4f902896ed9" data-id="3d348367362d46ddbac6e4f902896ed9"><span><div id="3d348367362d46ddbac6e4f902896ed9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3d348367362d46ddbac6e4f902896ed9" title="八、主流多模态模型一表对比"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">八、主流多模态模型一表对比</span></span></h2><table class="notion-simple-table notion-block-b9230d2a758f40948a46ff0f7cfbd858"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-e1ca317163804cbca64dab0b84e5c3d6"><td class="" style="width:120px"><div class="notion-simple-table-cell">模型</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">编码器</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">连接器</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">底座 LLM</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">多模态</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">发布时间</div></td></tr><tr class="notion-simple-table-row notion-block-4f618d3cf46241c48fdcb0a7ab6c4dcf"><td class="" style="width:120px"><div class="notion-simple-table-cell">GPT-4V/o</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">未公开</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">未公开</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">GPT-4</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">图像+推理</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2023</div></td></tr><tr class="notion-simple-table-row notion-block-06600c6efa1f4da9af255f3c01fa661a"><td class="" style="width:120px"><div class="notion-simple-table-cell">Gemini</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">原生多模态</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">无（统一编码）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Gemini</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">图像+视频+音频+文本</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2023</div></td></tr><tr class="notion-simple-table-row notion-block-3d3f31d61fff4c488aa2667e9387021b"><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude 3.5 Vision</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">未公开</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">未公开</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude 3</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">图像</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2024</div></td></tr><tr class="notion-simple-table-row notion-block-8ab52540ce05471b83b88483f034759e"><td class="" style="width:120px"><div class="notion-simple-table-cell">DeepSeek-VL</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">混合 ViT (384+1024)</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">连接器</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">DeepSeek-LLM</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">图像+表格+OCR</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2024.03</div></td></tr><tr class="notion-simple-table-row notion-block-9f1315f2c462408f9f904dc3a954b8e7"><td class="" style="width:120px"><div class="notion-simple-table-cell">DeepSeek-VL2</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">动态平铺+MoE</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">连接器</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">DeepSeekMoE</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">图像+表格+图表+定位</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2024.12</div></td></tr><tr class="notion-simple-table-row notion-block-3f406b9550d54108a3e998bb9dd1422d"><td class="" style="width:120px"><div class="notion-simple-table-cell">LLaVA 1.5</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">CLIP ViT-L/336</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2层 MLP</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Vicuna-13B</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">图像</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2023.10</div></td></tr><tr class="notion-simple-table-row notion-block-49631ba89bc84d9d84f9f1406ea4d580"><td class="" style="width:120px"><div class="notion-simple-table-cell">Qwen-VL</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">ViT-bigG</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Resampler</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Qwen-7B/72B</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">图像+定位</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2023.08</div></td></tr><tr class="notion-simple-table-row notion-block-644be07c2bb94014aa618c18d6ddbd6e"><td class="" style="width:120px"><div class="notion-simple-table-cell">InstructBLIP</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">ViT-g (EVA)</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Q-Former</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">FLAN-T5</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">图像+指令</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2023.05</div></td></tr><tr class="notion-simple-table-row notion-block-14a2b07e0ab3484b9ba797c13244bb15"><td class="" style="width:120px"><div class="notion-simple-table-cell">Flamingo</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">NFNet-F6</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Perceiver</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Chinchilla</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">图像+视频+交错</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2022.11</div></td></tr><tr class="notion-simple-table-row notion-block-3dea3f72e2764aaa94fe937fc588c77a"><td class="" style="width:120px"><div class="notion-simple-table-cell">Llama 3.2 Vision</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">SigLIP</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Cross-attn</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Llama 3</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">图像</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">2024.09</div></td></tr></tbody></table><hr class="notion-hr notion-block-1a5df081bb8243eeb19bde2b670da5c2"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-9cee8f1e94f44279b095850c133a66f5" data-id="9cee8f1e94f44279b095850c133a66f5"><span><div id="9cee8f1e94f44279b095850c133a66f5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9cee8f1e94f44279b095850c133a66f5" title="九、总结"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">九、总结</span></span></h2><div class="notion-text notion-block-c6ca6a3d748c4cb394230291d3732b9d">一张表回顾核心要点：</div><table class="notion-simple-table notion-block-bf3075e0c33645cfb4789ddc51f2d86c"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-13801ac26b9643ef813943db14b0013f"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">要理解的概念</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">一句话解释</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">关键论文</div></td></tr><tr class="notion-simple-table-row notion-block-9df5b2cd2a5c45f0bef4bddb94b05601"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">为什么需要视觉</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">图片信息量远超文字描述</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">DeepSeek-VL</div></td></tr><tr class="notion-simple-table-row notion-block-dd9d3b2167144dd48c3dd58636ca5be4"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">图片怎么编码</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">ViT 切成 patch + CLIP 对齐语义</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">CLIP</div></td></tr><tr class="notion-simple-table-row notion-block-33d82d1e52cf4b818378aa2390c7edcf"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">视频怎么理解</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">帧采样 + 时序位置编码</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">Video-LLaVA</div></td></tr><tr class="notion-simple-table-row notion-block-b78358a71fd44f4b926972629b5d213a"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">音频怎么理解</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">频谱图→视觉模型 或 ASR 转文字</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">Gemini</div></td></tr><tr class="notion-simple-table-row notion-block-91eb98ddb399488287a9c7223332edfb"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">跨模态对齐</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">MLP/Q-Former/Cross-Attn 三种方案</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">Flamingo</div></td></tr><tr class="notion-simple-table-row notion-block-a49c36c06ae8438e9cc98b79d1735633"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">训练方法论</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">对齐→微调→RLHF 三阶段</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">LLaVA</div></td></tr></tbody></table><div class="notion-callout notion-blue_background_co notion-block-e43694e9f2054b61913613f510ee0192"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🚀">🚀</span></div><div class="notion-callout-text"><div class="notion-text notion-block-e9da78feaa9a48d9a3911fb5cbe8e9b5"><b>下一步可以学的：</b></div><ul class="notion-list notion-list-disc notion-block-06ab5b96be27454ba18ef8cf774a5b07"><li>想动手？去 HuggingFace 下 LLaVA 或 DeepSeek-VL2 的模型权重跑跑</li></ul><ul class="notion-list notion-list-disc notion-block-d7569620e196455c9631dcbd7845cbb2"><li>想深入？读 LLaVA 论文（最易懂的多模态入门论文）</li></ul><ul class="notion-list notion-list-disc notion-block-e846eabe5e574c088bd3d696f89be027"><li>想实战？用 OpenAI GPT-4o 或 Gemini 的 API 体验多模态对话</li></ul></div></div><hr class="notion-hr notion-block-ee3b871243c0494f90add523ef2f258d"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-a9bb2c4c2e9243e590fcc967500b71ae" data-id="a9bb2c4c2e9243e590fcc967500b71ae"><span><div id="a9bb2c4c2e9243e590fcc967500b71ae" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a9bb2c4c2e9243e590fcc967500b71ae" title="延伸阅读与参考资料"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">延伸阅读与参考资料</span></span></h3><div class="notion-text notion-block-e43bc14a76454c3392832575ab8b7174">&lt;bookmark url=&quot;<a class="notion-link" href="https://arxiv.org/abs/2403.05525" target="_blank" rel="noopener noreferrer">https://arxiv.org/abs/2403.05525</a>&quot; /&gt;</div><div class="notion-text notion-block-2a06f9964fd94c8e8ab904afbfdbb47f">&lt;bookmark url=&quot;<a class="notion-link" href="https://arxiv.org/abs/2304.08485" target="_blank" rel="noopener noreferrer">https://arxiv.org/abs/2304.08485</a>&quot; /&gt;</div><div class="notion-text notion-block-296314a36ad94a9c904a030dfb99cdba">&lt;bookmark url=&quot;<a class="notion-link" href="https://arxiv.org/abs/2103.00020" target="_blank" rel="noopener noreferrer">https://arxiv.org/abs/2103.00020</a>&quot; /&gt;</div><div class="notion-text notion-block-916ad44e34604eb4a5b69b01d2006e26">&lt;bookmark url=&quot;<a class="notion-link" href="https://arxiv.org/abs/2204.14198" target="_blank" rel="noopener noreferrer">https://arxiv.org/abs/2204.14198</a>&quot; /&gt;</div><div class="notion-text notion-block-199e0a828bb645648240c58793cd9171">&lt;bookmark url=&quot;<a class="notion-link" href="https://arxiv.org/abs/2311.10122" target="_blank" rel="noopener noreferrer">https://arxiv.org/abs/2311.10122</a>&quot; /&gt;</div><div class="notion-text notion-block-0c8a4b749ee748b9b46330050f254ced">&lt;bookmark url=&quot;<a class="notion-link" href="https://arxiv.org/abs/2312.11805" target="_blank" rel="noopener noreferrer">https://arxiv.org/abs/2312.11805</a>&quot; /&gt;</div><div class="notion-text notion-block-88837a1582cf40b19dbbef63bdade442">&lt;bookmark url=&quot;<a class="notion-link" href="https://github.com/haotian-liu/LLaVA" target="_blank" rel="noopener noreferrer">https://github.com/haotian-liu/LLaVA</a>&quot; /&gt;</div><div class="notion-text notion-block-6d535f5257f94c1aa7b612d0a4ad55bc">&lt;bookmark url=&quot;<a class="notion-link" href="https://github.com/deepseek-ai/DeepSeek-VL" target="_blank" rel="noopener noreferrer">https://github.com/deepseek-ai/DeepSeek-VL</a>&quot; /&gt;</div><div class="notion-blank notion-block-38a5788abc998028b497f29b0aaf0d0f"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Agent 记忆系统架构：2026年全景解读]]></title>
            <link>玻璃小屋.cn/article/ai-agent-memory-architecture-2026</link>
            <guid>玻璃小屋.cn/article/ai-agent-memory-architecture-2026</guid>
            <pubDate>Mon, 22 Jun 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[为什么上下文窗口不等于记忆？Agent 需要三种记忆类型？Write-Manage-Read 循环是什么？2026年最值得关注的两个开源记忆系统 Mem0 和 Engram 深度解析。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-3875788abc99816ab19fe11c8a31fcb5"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3875788abc9981fb8766f98e7c75d7ed" data-id="3875788abc9981fb8766f98e7c75d7ed"><span><div id="3875788abc9981fb8766f98e7c75d7ed" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc9981fb8766f98e7c75d7ed" title="一、为什么需要给AI装记忆？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">一、为什么需要给AI装记忆？</span></span></h3><div class="notion-text notion-block-3875788abc99817db18ffdfe94bdcb70">你有没有遇到过这种情况——和一个 AI 助手聊了半小时，它突然问你「你的名字是什么？」明明十分钟前刚说过。</div><div class="notion-text notion-block-3875788abc9981c796f8c58d22026a53">这不是 AI 笨，是上下文窗口的物理限制。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc99817a94d3ed92264b754b" data-id="3875788abc99817a94d3ed92264b754b"><span><div id="3875788abc99817a94d3ed92264b754b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc99817a94d3ed92264b754b" title="上下文窗口不是什么「记忆」"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">上下文窗口不是什么「记忆」</span></span></h4><div class="notion-text notion-block-3875788abc9981dfb601cb2ec8c51d79">大语言模型的工作方式是：每次对话，把所有内容塞进一个固定大小的上下文窗口里。</div><ul class="notion-list notion-list-disc notion-block-3875788abc998104aba8fe9b271589a9"><li>GPT-3（2020）：2K tokens</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc9981c486ddf75db3481271"><li>GPT-4（2023）：32K tokens</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc9981c89c06f3c64964b98a"><li>Claude 2（2023）：100K tokens</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc99818ebb9ee2ace6ea0927"><li>Gemini 1.5 Pro（2024）：1M tokens</li></ul><div class="notion-callout notion-blue_background_co notion-block-3875788abc998119bb98ec56426ebbe8"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🤔">🤔</span></div><div class="notion-callout-text">类比一下：你的办公桌（上下文窗口）可以放很多文件，但下班后桌子被清空。记忆是你的书架——下班了书还在上面。</div></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3895788abc99818b90d1f86c62b6d800"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/ai-agent-memory-architecture-2026/01-workbench-vs-bookshelf.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3895788a-bc99-818b-90d1-f86c62b6d800" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc9981c3b0bed4f8d91dc3fd" data-id="3875788abc9981c3b0bed4f8d91dc3fd"><span><div id="3875788abc9981c3b0bed4f8d91dc3fd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc9981c3b0bed4f8d91dc3fd" title="为什么不能全靠扩大窗口？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">为什么不能全靠扩大窗口？</span></span></h4><div class="notion-text notion-block-3875788abc9981be9797c7c938ee17d7">三个原因：</div><ul class="notion-list notion-list-disc notion-block-3875788abc9981878e87fa07487a20f2"><li>计算成本爆炸。Transformer 自注意力是 O(N²)——窗口每扩大一倍，算力翻四倍。</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc99817aa995f76f2f3dad26"><li>「Lost in the Middle」。模型倾向记住开头和结尾，中间丢失。</li></ul><details class="notion-toggle notion-block-3875788abc9981c7a73ad86e1ebae7ba"><summary>什么是「Lost in the Middle」？</summary><div><div class="notion-text notion-block-3875788abc99819f8bc2e69983c811a8">LLM 在处理超长文本时，对开头和结尾的内容记忆最好，中间部分容易被「淹没」。这是因为自注意力机制中，中间的 tokens 同时受到前后信息的干扰，信号最弱。</div><div class="notion-text notion-block-3875788abc9981d6b9b9f58d99b24978">举例：读一本 300 页的书，你最容易记住前 10 页和后 10 页，中间 280 页的内容可能只记得零星片段。大模型处理长上下文时也是类似的。</div><div class="notion-text notion-block-3875788abc9981e7b480ec8ce6f924f4">这也是为什么即使上下文窗口扩大到 1M tokens，依然需要外部记忆系统——窗口大了，但中间部分还是容易丢失。</div></div></details><ul class="notion-list notion-list-disc notion-block-3875788abc9981eebfe5daeafdf70e7e"><li>跨会话记忆。窗口在每次新对话时重置。上周的项目、用户偏好——全部归零。</li></ul><hr class="notion-hr notion-block-3875788abc99814f8377c3ecfac5f0fb"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3875788abc99814f9e4bf46733bcde39" data-id="3875788abc99814f9e4bf46733bcde39"><span><div id="3875788abc99814f9e4bf46733bcde39" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc99814f9e4bf46733bcde39" title="二、三种记忆，三种角色"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二、三种记忆，三种角色</span></span></h3><div class="notion-text notion-block-3875788abc998159acbfd8e336c5f718">2026年的 Agent 记忆架构已经收敛到共识模式：三层记忆架构，对应人类认知中的情景、语义和程序记忆。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc9981a188acdcc385b0cf34" data-id="3875788abc9981a188acdcc385b0cf34"><span><div id="3875788abc9981a188acdcc385b0cf34" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc9981a188acdcc385b0cf34" title="情景记忆（Episodic）— 发生了什么"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">情景记忆（Episodic）— 发生了什么</span></span></h4><div class="notion-text notion-block-3875788abc9981009fa3d780a1ca25f7">记录「什么时间、什么地点、发生了什么」。每轮对话的结构化日志，按 (租户, 用户, 会话, 轮次) 索引存储在事务型数据库中。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc998117ae7dc8a4c21ca5bd" data-id="3875788abc998117ae7dc8a4c21ca5bd"><span><div id="3875788abc998117ae7dc8a4c21ca5bd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc998117ae7dc8a4c21ca5bd" title="语义记忆（Semantic）— 我知道了什么"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">语义记忆（Semantic）— 我知道了什么</span></span></h4><div class="notion-text notion-block-3875788abc99813f9cebc32fa3c2abf3">从情景记忆提炼出的事实、实体、关系。跨会话持久化——无论开多少次新窗口，Agent 都应记得用户信息。</div><ul class="notion-list notion-list-disc notion-block-3875788abc998162ab23c009f42ee2c1"><li>用户偏好：如「用户用微信支付」（数月到永久）</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc998158a99cda15d5dfdec5"><li>实体关系：如「用户在研发部」（永久）</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc9981ab944bf2e9063e56db"><li>领域知识：如「API 限速 100 req/min」（随版本更新）</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc99813a8960c0216c17bea6" data-id="3875788abc99813a8960c0216c17bea6"><span><div id="3875788abc99813a8960c0216c17bea6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc99813a8960c0216c17bea6" title="程序记忆（Procedural）— 我会做什么"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">程序记忆（Procedural）— 我会做什么</span></span></h4><div class="notion-text notion-block-3875788abc998152aeeaefbdcf3d763a">Agent 学会的操作流程、技能、工具用法。每一次成功执行强化技能，每一次失败是修正的机会。</div><div class="notion-callout notion-blue_background_co notion-block-3875788abc9981d985c0e5ff9e0dc5b4"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">三个记忆层必须物理分离、schema 独立、可单独寻址，才能避免数据混在一起的问题。</div></div><div class="notion-callout notion-blue_background_co notion-block-3875788abc99812daaa8f8686b65cdce"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="📊">📊</span></div><div class="notion-callout-text">三层架构一图流：情景记忆（发生了什么）+ 语义记忆（我知道了什么）+ 程序记忆（我会做什么）。每个层有独立的读写路径、生命周期和存储后端，通过巩固管道连接。</div></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3895788abc9981e287f3d84150e3f35a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/ai-agent-memory-architecture-2026/02-three-stores.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3895788a-bc99-81e2-87f3-d84150e3f35a" alt="notion image" loading="lazy" decoding="async"/></div></figure><hr class="notion-hr notion-block-3875788abc9981e2a4ebdfbbc631e095"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3875788abc9981cb9f44f0b402a98d20" data-id="3875788abc9981cb9f44f0b402a98d20"><span><div id="3875788abc9981cb9f44f0b402a98d20" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc9981cb9f44f0b402a98d20" title="三、Write-Manage-Read：记忆的生命周期"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三、Write-Manage-Read：记忆的生命周期</span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3895788abc9981d88effdbc641271d1d"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/ai-agent-memory-architecture-2026/03-wmr-cycle.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3895788a-bc99-81d8-8eff-dbc641271d1d" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-3875788abc998118a304ea53ccd638af">2026年综合综述（arXiv:2603.07670）将 Agent 记忆形式化为 Write-Manage-Read 循环，嵌入 POMDP 框架：</div><details class="notion-toggle notion-block-3875788abc9981479011e6507ed8b3c5"><summary>什么是「POMDP」？</summary><div><div class="notion-text notion-block-3875788abc998114bd3fe1a5ccdc8601">POMDP（Partially Observable Markov Decision Process）是描述 Agent 在不完全信息环境中决策的数学模型。</div><div class="notion-text notion-block-3875788abc9981eba389f82aef86edf2">用大白话说：Agent 看不到世界的全部信息（就像你闭着眼睛走路），只能靠过去的观察和记忆来推断当前状态。记忆就是 Agent 对「世界现在是什么样」的信念。</div><div class="notion-text notion-block-3875788abc9981b3b942db23da28d709">把 Agent 记忆形式化为 POMDP 的好处是：有了理论框架来讨论「什么该记、什么该忘、如何检索」，而不是凭经验拍脑袋设计。</div></div></details><blockquote class="notion-quote notion-block-3875788abc99818d9784d2ea5db4d205"><div>记忆不是一堆文字的快照，而是 Agent 在不完全信息世界中的信念状态。</div></blockquote><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc99815dbd79ea57caaa5b79" data-id="3875788abc99815dbd79ea57caaa5b79"><span><div id="3875788abc99815dbd79ea57caaa5b79" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc99815dbd79ea57caaa5b79" title="编码（Write）— 每轮写入"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">编码（Write）— 每轮写入</span></span></h4><div class="notion-text notion-block-3875788abc99818f9e67e3845b525619">每轮对话结束时，Agent 将结构化事件写入情景存储，包含租户、会话、轮次、角色、内容、工具调用等字段。写是同步的——写入不成功则本轮不算完成。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc998194be8ded8d663dd039" data-id="3875788abc998194be8ded8d663dd039"><span><div id="3875788abc998194be8ded8d663dd039" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc998194be8ded8d663dd039" title="巩固（Consolidation）— 异步提炼"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">巩固（Consolidation）— 异步提炼</span></span></h4><div class="notion-text notion-block-3875788abc9981b4a559c9ef70592608">巩固是连接三层记忆的管道，每 N 轮或 N 分钟异步运行一次：</div><ul class="notion-list notion-list-disc notion-block-3875788abc99818e85b9d2e7114b2210"><li>事实提取：从最近事件中提取实体和关系 → 写入语义存储</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc998168a8fde8eedbd001d5"><li>工作流检测：识别重复成功的任务序列 → 提升为程序记忆</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc9981c3a5eff823e72a455e"><li>摘要压缩：旧事件压缩为会话摘要（原始数据保留审计）</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc998124a3f7ff957c54560e"><li>遗忘与衰减：过期事实降低权重、失效工作流降级</li></ul><div class="notion-callout notion-red_background_co notion-block-3875788abc99819e9c0ee73a8edfd93d"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text">语义和程序记忆只能通过巩固管道写入，对话循环中禁止直接写入。这确保所有事实都有溯源链。</div></div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc998169b929c29820f2e66b" data-id="3875788abc998169b929c29820f2e66b"><span><div id="3875788abc998169b929c29820f2e66b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc998169b929c29820f2e66b" title="检索（Read）— 混合读取"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">检索（Read）— 混合读取</span></span></h4><div class="notion-text notion-block-3875788abc9981f393bff684e7b9ca2f">每轮开始前检索三层：最近 N 轮情景 + Top-K 语义 + Top-M 工作流。结果包有硬上限（如 8+12+4），超出部分丢弃并记录日志。</div><hr class="notion-hr notion-block-3875788abc99813285f8cb088bf8cb90"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3875788abc998177b3a9e6c91132dd2d" data-id="3875788abc998177b3a9e6c91132dd2d"><span><div id="3875788abc998177b3a9e6c91132dd2d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc998177b3a9e6c91132dd2d" title="四、2026年最值得关注的两个记忆系统"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">四、2026年最值得关注的两个记忆系统</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc9981559753cc615f61540e" data-id="3875788abc9981559753cc615f61540e"><span><div id="3875788abc9981559753cc615f61540e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc9981559753cc615f61540e" title="Mem0：多信号检索的标杆"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Mem0：多信号检索的标杆</span></span></h4><div class="notion-text notion-block-3875788abc9981d89b6afab95f78f50d">Mem0（48K GitHub Stars）是当前最成熟的开源 Agent 记忆层。</div><details class="notion-toggle notion-block-3875788abc9981449677d70bed8ef783"><summary>什么是「多信号检索」？</summary><div><div class="notion-text notion-block-3875788abc9981339b92d7a4d55bee56">传统检索只用向量相似度（embedding），Mem0 跑三个并行评分通道后融合：语义匹配（主要）+ BM25关键词匹配（补充）+ 实体识别（补充）。三路融合比单语义搜索高出约 16 分。</div></div></details><div class="notion-text notion-block-3875788abc9981ddbf25d5b91b6375e4">基准成绩（2026年5月官方数据）：</div><ul class="notion-list notion-list-disc notion-block-3875788abc998161b25ec2a71a071278"><li>LoCoMo：92.5（每轮 ~7,000 tokens）</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc998137a25bfc2762775aef"><li>LongMemEval：94.4（每轮 ~6,800 tokens）</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc9981d19081cb5b78ad433a"><li>BEAM 1M：64.1 / BEAM 10M：48.6</li></ul><div class="notion-text notion-block-3875788abc9981a086edf2d0e030b9b3">对比：全上下文方案每轮消耗 25,000+ tokens。Mem0 在 3-4x 更低的 token 成本下达到同等或更高准确率。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3895788abc99814191d6d63af447bb2d"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/ai-agent-memory-architecture-2026/04-three-screens.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3895788a-bc99-8141-91d6-d63af447bb2d" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc99817ab1add1b4d3a99fb8" data-id="3875788abc99817ab1add1b4d3a99fb8"><span><div id="3875788abc99817ab1add1b4d3a99fb8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc99817ab1add1b4d3a99fb8" title="Engram：双时间模型的突破"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Engram：双时间模型的突破</span></span></h4><div class="notion-text notion-block-3875788abc99816e962ee94f984b2739">Engram（arXiv:2606.09900, 2026年6月）是由 Liuyin Wang 提出的开源双过程记忆引擎。</div><details class="notion-toggle notion-block-3875788abc998165865de423f63cd738"><summary>什么是「双时间数据模型」？</summary><div><div class="notion-text notion-block-3875788abc9981eb884adfdb1854519f">记录每个事实的「有效时间」（事实真实发生时间）和「事务时间」（系统记录时间）。旧版本标记为已替代但不删除——保证完整溯源链。</div></div></details><div class="notion-text notion-block-3875788abc9981c19673ca6716f6110b">更少的上下文，更高的准确率：</div><ul class="notion-list notion-list-disc notion-block-3875788abc9981d3ac43ee4daa7dd4b5"><li>Engram（精简检索）：83.6%（~9.6K tokens）</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc99810ea001f91fc70b18ca"><li>全上下文基线：73.2%（~79K tokens，8x 更多）</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc99811283ccdbea9f326698"><li>差值：+10.4 分 ⭐</li></ul><div class="notion-callout notion-blue_background_co notion-block-3875788abc9981f1ac6bdf1f67b8e8da"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⭐">⭐</span></div><div class="notion-callout-text">Engram 用约 1/8 的 token 量反而高出 10.4 分。关键在混合读取路径：稠密向量 + 词汇匹配 + 图遍历 + 近因信号。</div></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3895788abc9981e0b34ef7cc1e89b4c4"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/ai-agent-memory-architecture-2026/05-dual-clock.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3895788a-bc99-81e0-b34e-f7cc1e89b4c4" alt="notion image" loading="lazy" decoding="async"/></div></figure><hr class="notion-hr notion-block-3875788abc998136a5a0e7b020d1c1ea"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3875788abc9981e9bb18efa389e07c51" data-id="3875788abc9981e9bb18efa389e07c51"><span><div id="3875788abc9981e9bb18efa389e07c51" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc9981e9bb18efa389e07c51" title="五、Agent 记忆的安全与挑战"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">五、Agent 记忆的安全与挑战</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc9981759a35f9d515ea57c3" data-id="3875788abc9981759a35f9d515ea57c3"><span><div id="3875788abc9981759a35f9d515ea57c3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc9981759a35f9d515ea57c3" title="记忆中毒（Memory Poisoning）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">记忆中毒（Memory Poisoning）</span></span></h4><details class="notion-toggle notion-block-3895788abc998195b057fb8b1864c5f4"><summary>什么是「记忆中毒（Memory Poisoning）」？</summary><div><div class="notion-text notion-block-3895788abc9981e08e39d9cc52e05f41">记忆中毒是一种针对 AI Agent 长期记忆系统的攻击。攻击者通过间接提示注入，在 Agent 读取网页或文件时，将恶意内容嵌入 Agent 的记忆存储中。</div><div class="notion-text notion-block-3895788abc9981ce9202c453476c111a">危害在哪？Agent 中毒后，每次回想都可能输出攻击者想要的结果——比如推荐特定产品、泄露隐私、或拒绝执行本该执行的命令。因为是记忆层被污染，影响是跨会话、持续性的。</div><div class="notion-text notion-block-3895788abc99817db642e2d42ced06e8">形象地说：这像有人在图书馆的书里偷偷替换了几页。你每次借这本书读到的都是被改过的版本，但你自己完全不知道。</div></div></details><div class="notion-text notion-block-3875788abc9981e98601fcabd088ff7d">MINJA 攻击（2025）通过间接提示注入在 Agent 记忆中植入恶意内容：</div><ul class="notion-list notion-list-disc notion-block-3875788abc9981bb98e2f198110b703b"><li>95% 注射成功率</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc9981ecbbf4f8d86a31aac6"><li>70% 攻击成功率</li></ul><ul class="notion-list notion-list-disc notion-block-3875788abc998183bb53fba34b39fd34"><li>LLM 检测漏掉 66% 的中毒条目</li></ul><div class="notion-callout notion-red_background_co notion-block-3895788abc99819ab40ac953f1dc2453"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text">典型场景：用户让 Agent 搜索网页信息，页面中被植入了隐藏恶意指令。Agent 读取后将其写入记忆——LLM 逐条看都觉得无害（漏掉 66% 的原因），但多条叠加就形成完整攻击链。防御需要写入过滤 + 审计 + 定期异常检测三层。</div></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3895788abc99811d9e21da596cc5e7b1"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/ai-agent-memory-architecture-2026/06-poison-pages.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3895788a-bc99-811d-9e21-da596cc5e7b1" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc99813b8f6ecf3e3dd09578" data-id="3875788abc99813b8f6ecf3e3dd09578"><span><div id="3875788abc99813b8f6ecf3e3dd09578" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc99813b8f6ecf3e3dd09578" title="遗忘权（Right to be Forgotten）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">遗忘权（Right to be Forgotten）</span></span></h4><div class="notion-text notion-block-3875788abc9981b488ebf55885c94528">GDPR、DPDP 等法规要求用户有权删除自己的数据。需要三层记忆级联删除，单 API 调用应在几百毫秒内完成。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc99818f807cdc38fbd60466" data-id="3875788abc99818f807cdc38fbd60466"><span><div id="3875788abc99818f807cdc38fbd60466" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc99818f807cdc38fbd60466" title="开放挑战"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">开放挑战</span></span></h4><ul class="notion-list notion-list-disc notion-block-3895788abc9981d2bcc8c466f1c66374"><li>记忆管理：多数系统「写」「读」不错，但中间的巩固/管理环节被严重忽视。不加管理的记忆就像没人整理的仓库——东西越堆越多，越来越难找到真正有用的那件。</li></ul><ul class="notion-list notion-list-disc notion-block-3895788abc99817c98c8ce3453d00f46"><li>评估标准化：LoCoMo、LongMemEval、BEAM 是主流基准，但不同系统使用不同条件，分数不可直接比较。Engram 论文专门批评了这个问题并开源了可复现评测框架。</li></ul><ul class="notion-list notion-list-disc notion-block-3895788abc9981128e80f318673bcb57"><li>跨LLM可移植性：模型 A 写的记忆，模型 B 读——信息保留率多少？Rosetta Memory（arXiv:2606.07711）正在探索这个方向。</li></ul><ul class="notion-list notion-list-disc notion-block-3895788abc99817187ccf8c8d158755a"><li>Token 预算约束：技能/记忆模块每次检索都有 token 成本，当开销超过价值时应该退役。插入记忆系统不是免费的。</li></ul><div class="notion-text notion-block-3895788abc9981fa9af7f0bb0d8be450">这些挑战意味着：Agent 记忆不只是存储技术，更是涉及安全、评估、经济的系统工程。</div><hr class="notion-hr notion-block-3875788abc9981bca292d97c1120120a"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3875788abc9981b98c8bdb55842c0f42" data-id="3875788abc9981b98c8bdb55842c0f42"><span><div id="3875788abc9981b98c8bdb55842c0f42" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc9981b98c8bdb55842c0f42" title="六、总结"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">六、总结</span></span></h3><div class="notion-callout notion-blue_background_co notion-block-3875788abc9981b7909df396adc0c2e6"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">核心要点：
1. 上下文窗口是工作缓冲区，不是记忆库
2. 三层架构（情景/语义/程序）是 2026 年共识
3. Write-Manage-Read 循环是核心设计模式
4. Mem0 和 Engram 代表多信号检索和双时间模型的突破
5. 记忆安全和遗忘权是必须考虑的生产要素</div></div><div class="notion-text notion-block-3875788abc99819fa7e6ec6767b25992">如果只带一句话：好的 Agent 记忆系统是在正确的层级上用正确的方式存储正确的信息，而不是把一切扔进向量数据库。</div><div class="notion-text notion-block-3895788abc998190a1c1e14e936c3e4a"><b>回顾全文脉络：</b></div><ul class="notion-list notion-list-disc notion-block-3895788abc998129acffd69fc8ccdeec"><li>从问题出发：上下文窗口是工作台不是书架，扩大窗口解决不了记忆问题</li></ul><ul class="notion-list notion-list-disc notion-block-3895788abc9981b0ac65f29e7d7267a0"><li>到架构设计：三层记忆 + Write-Manage-Read 循环是 2026 年共识模式</li></ul><ul class="notion-list notion-list-disc notion-block-3895788abc9981828aade475078e48e9"><li>到实现落地：Mem0 和 Engram 代表两种不同的工程路径</li></ul><ul class="notion-list notion-list-disc notion-block-3895788abc99818fb6fcfd0f8cdfea3c"><li>到安全挑战：记忆中毒、遗忘权、评估标准化——系统工程远未完工</li></ul><div class="notion-callout notion-blue_background_co notion-block-3895788abc9981edad8bec5265740167"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="📊">📊</span></div><div class="notion-callout-text">实战选型建议：
• 产品级快速落地 → Mem0（平台成熟，48K⭐）
• 需要强溯源审计 → Engram（双时间模型，完整溯源链）
• 多租户 SaaS 场景 → 三层架构 + 独立租户隔离
• 从零开始建议 → 先做情景存储，再加巩固管道，最后上语义和程序记忆</div></div><div class="notion-text notion-block-3895788abc99815cbfb9c2160f71c1c1"><b>值得关注的下一步方向：</b></div><ul class="notion-list notion-list-disc notion-block-3895788abc998124ad80ff38a4f0334a"><li>记忆巩固自动化——当前手动设计巩固规则，未来需要 Agent 自主管理记忆质量</li></ul><ul class="notion-list notion-list-disc notion-block-3895788abc99817a9a4becb162ef29ee"><li>跨会话身份追踪——让 Agent 在不同会话间识别同一用户和同一实体</li></ul><ul class="notion-list notion-list-disc notion-block-3895788abc9981aabdafc5c04a40fbc3"><li>时效与遗忘——不是所有信息都需永久保留，如何自动衰减和遗忘是开放问题</li></ul><hr class="notion-hr notion-block-3875788abc99818a9b16cc44961e9bab"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3875788abc998176a115ff0de52ac509" data-id="3875788abc998176a115ff0de52ac509"><span><div id="3875788abc998176a115ff0de52ac509" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3875788abc998176a115ff0de52ac509" title="延伸阅读与参考资料"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">延伸阅读与参考资料</span></span></h4><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc9981b1817bf2e3fda75257" href="https://arxiv.org/abs/2603.07670" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">arxiv.org</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://arxiv.org/abs/2603.07670</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc9981c7906fe145c47ed13c" href="https://arxiv.org/abs/2512.13564" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">arxiv.org</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://arxiv.org/abs/2512.13564</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc9981faa74bd1372d5f159c" href="https://arxiv.org/abs/2606.09900" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">arxiv.org</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://arxiv.org/abs/2606.09900</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc998102ac72eb5012533cec" href="https://arxiv.org/abs/2504.19413" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">arxiv.org</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://arxiv.org/abs/2504.19413</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc998129a7f2fbb5b78866bd" href="https://www.appscale.blog/en/blog/agent-memory-architecture-episodic-semantic-procedural-the-three-tier-pattern-2026" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">www.appscale.blog</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://www.appscale.blog/en/blog/agent-memory-architecture-episodic-semantic-procedural-the-three-tier-pattern-2026</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc99811eab1ae5365fabdf40" href="https://aiagentmemory.org/articles/context-window-problem-llm/" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">aiagentmemory.org</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://aiagentmemory.org/articles/context-window-problem-llm/</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc9981ddbf80de671c1c3e77" href="https://mem0.ai/research" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">mem0.ai</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://mem0.ai/research</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc9981e5ac54c44080deef9b" href="https://towardsdatascience.com/a-practical-guide-to-memory-for-autonomous-llm-agents/" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">towardsdatascience.com</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://towardsdatascience.com/a-practical-guide-to-memory-for-autonomous-llm-agents/</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc9981779d86c7ad82ed70a1" href="https://zylos.ai/research/2026-04-05-ai-agent-memory-architectures-persistent-knowledge/" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">zylos.ai</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://zylos.ai/research/2026-04-05-ai-agent-memory-architectures-persistent-knowledge/</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc998185a9bad03d64a084f8" href="https://unit42.paloaltonetworks.com/indirect-prompt-injection-poisons-ai-longterm-memory/" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">unit42.paloaltonetworks.com</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://unit42.paloaltonetworks.com/indirect-prompt-injection-poisons-ai-longterm-memory/</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc9981749e34f512f62a2786" href="https://mem0.ai/blog/ai-memory-security-best-practices" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">mem0.ai</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://mem0.ai/blog/ai-memory-security-best-practices</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc9981b3ad34eabda88bdddb" href="https://arxiv.org/abs/2602.19320" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">arxiv.org</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://arxiv.org/abs/2602.19320</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc998144b87ee4922ed2aaaa" href="https://arxiv.org/abs/2501.13956" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">arxiv.org</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://arxiv.org/abs/2501.13956</div></div></div></a></div><div class="notion-row"><a class="notion-bookmark notion-block-3875788abc9981058da4ecaa2a91a5c5" href="https://arxiv.org/abs/2601.03236" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">arxiv.org</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://arxiv.org/abs/2601.03236</div></div></div></a></div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[lora训练部署]]></title>
            <link>玻璃小屋.cn/article/lora</link>
            <guid>玻璃小屋.cn/article/lora</guid>
            <pubDate>Fri, 02 Jul 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[基于linux服务器训练lora微调模型]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-0aa58737e5324109a053c08ed7fe9fc3"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-gray_background_co notion-block-dff46190adc34307ae19fa7248a77056"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="😀">😀</span></div><div class="notion-callout-text">这里写文章的前言：
基于阿里云服务器的“机器学习api”平台部署（可以白嫖三个月的服务时长）
着条环境理论上是可以在任何一个liunx服务器上部署成功的。</div></div><div class="notion-blank notion-block-ce4ad750a6574338a3a3015d1c130a87"> </div><div class="notion-blank notion-block-63ef7e5ef3964963aec70781320e0adb"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-74bd0eccbec6412cbf667d8a9628ee2a" data-id="74bd0eccbec6412cbf667d8a9628ee2a"><span><div id="74bd0eccbec6412cbf667d8a9628ee2a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#74bd0eccbec6412cbf667d8a9628ee2a" title="📝 主旨内容"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">📝 主旨内容</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-245d556e939f45b39a87dabd949664a1" data-id="245d556e939f45b39a87dabd949664a1"><span><div id="245d556e939f45b39a87dabd949664a1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#245d556e939f45b39a87dabd949664a1" title="系统环境"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">系统环境</span></span></h3><ul class="notion-list notion-list-disc notion-block-a9530426522e46ffadc569796fe05a84"><li>系统镜像：<em>modelscope:tf1.15torch1.11-gpu-py37-cu113-ubuntu20.04</em></li></ul><ul class="notion-list notion-list-disc notion-block-5d03ce8c93e64b6cab025723ca5c978d"><li>系统版本：<em>ubuntu20.04</em></li></ul><ul class="notion-list notion-list-disc notion-block-27d6b964adbb4b92a7eae6978adbdde7"><li>系统环境：py 3.7/cu113</li></ul><div class="notion-text notion-block-02f9fbdd462641df8357d8ce01a5777f">项目引用</div><div class="notion-row"><a class="notion-bookmark notion-block-541782b5245c415b9eff8ab330e156cb" href="https://github.com/Akegarasu/lora-scripts" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">GitHub - Akegarasu/lora-scripts: LoRA training scripts use kohya-ss&#x27;s trainer, for diffusion model.</div><div class="notion-bookmark-description">LoRA training scripts use kohya-ss&#x27;s trainer, for diffusion model. - GitHub - Akegarasu/lora-scripts: LoRA training scripts use kohya-ss&#x27;s trainer, for diffusion model.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=541782b5-245c-415b-9eff-8ab330e156cb&amp;t=541782b5-245c-415b-9eff-8ab330e156cb" alt="GitHub - Akegarasu/lora-scripts: LoRA training scripts use kohya-ss&#x27;s trainer, for diffusion model." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/Akegarasu/lora-scripts</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F5028981c7969e32390f79fa76459b4a7ef9ade5a791914933a6363ccec2c79c4%2FAkegarasu%2Flora-scripts?table=block&amp;id=541782b5-245c-415b-9eff-8ab330e156cb&amp;t=541782b5-245c-415b-9eff-8ab330e156cb" alt="GitHub - Akegarasu/lora-scripts: LoRA training scripts use kohya-ss&#x27;s trainer, for diffusion model." loading="lazy" decoding="async"/></div></a></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-7475a06353cf4cb788e177afbdff8a7d" data-id="7475a06353cf4cb788e177afbdff8a7d"><span><div id="7475a06353cf4cb788e177afbdff8a7d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7475a06353cf4cb788e177afbdff8a7d" title="准备"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">准备</span></span></h3><ul class="notion-list notion-list-disc notion-block-e14140958c0a4a558ca9bac4c991d6e3"><li>阿里云账号，并开通了机器学习api的工作台。</li></ul><div class="notion-button-block notion-block-8730878ed53e4f0baf1e33612c237b8b"><button type="button" class="notion-button notion-default notion-block-8730878ed53e4f0baf1e33612c237b8b" title="Button">Button</button></div><ul class="notion-list notion-list-disc notion-block-f99b75266f1047f68ad8fd7ff30e10f7"><li>一台电脑</li></ul><ul class="notion-list notion-list-disc notion-block-26aade51136943cf9661f6cc9e485235"><li>手</li></ul><ul class="notion-list notion-list-disc notion-block-96bdd3ebf2cd413fa1e3fd2003afb5a9"><li>会复制粘贴</li></ul><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-f50b8b53662843a8af421b2efd55d436" data-id="f50b8b53662843a8af421b2efd55d436"><span><div id="f50b8b53662843a8af421b2efd55d436" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f50b8b53662843a8af421b2efd55d436" title="开始实操"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">开始实操</span></span></h3><details class="notion-toggle notion-block-f35cd3d833a043d8ba7ebd9c2d5d7d0d"><summary><b>创建服务器实列，环境</b></summary><div><ol start="1" class="notion-list notion-list-numbered notion-block-ba1f2f7b3e8e4829bb9c23702e3372a4" style="list-style-type:decimal"><li>选择交互式建模(DSW),并创建实列。</li><ol class="notion-list notion-list-numbered notion-block-ba1f2f7b3e8e4829bb9c23702e3372a4" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3253f89f70884e85917c39723532f779"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb4e7f6f0-1487-4d33-b11f-26961964ff94%2FUntitled.png?table=block&amp;id=3253f89f-7088-4e85-917c-39723532f779&amp;t=3253f89f-7088-4e85-917c-39723532f779&amp;width=1013&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-callout notion-gray_background_co notion-block-78fbf9ea27ba450d9ab21e90ba0d6bef"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="👉">👉</span></div><div class="notion-callout-text">随便来一个实列名称，<b><span class="notion-red">选择GPU规格，在官方镜像下选择</span></b><span class="notion-inline-underscore"><b><em>modelscope:tf1.15torch1.11-gpu-py37-cu113-ubuntu20.04</em></b></span><em>
这个镜像</em></div></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-7de483be801f40e79570ed7a047f081e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ffa5e112b-5418-4fa9-bcaf-3e13af47b669%2FUntitled.png?table=block&amp;id=7de483be-801f-40e7-9570-ed7a047f081e&amp;t=7de483be-801f-40e7-9570-ed7a047f081e&amp;width=1090&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><blockquote class="notion-quote notion-block-a02cf04410de48679b596d51b3ed8359"><div>需要挂在nas的可以挂载nas系统</div></blockquote><div class="notion-callout notion-gray_background_co notion-block-48f0a7effa444623b7f7b93894b26860"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="👉">👉</span></div><div class="notion-callout-text">然后下一步，创建实列即可。</div></div></ol></ol></div></details><details class="notion-toggle notion-block-94726740e1d14a24a7ddc8bae3d161db"><summary><b>系统环境的基本创建。</b></summary><div><ul class="notion-list notion-list-disc notion-block-dbd505d25e834bb58d508f56fa30ae0d"><li>等待系统环境的创建~~~~~出现了打开就可以进入系统环境了。</li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-c978a287241c446c86126ce798f27a72"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fccb90855-2c89-4961-bf41-bd5cbe272955%2FUntitled.png?table=block&amp;id=c978a287-241c-446c-8612-6ce798f27a72&amp;t=c978a287-241c-446c-8612-6ce798f27a72&amp;width=1579&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></div></details><ul class="notion-list notion-list-disc notion-block-23aba2b38e72439fa6ef1ac6dd585bdc"><li>进入界面后点击上面的加号，在选择控制终端。</li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-813a6277098448b6bce6e8cdc383ac7b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F84139918-7026-4c7c-b3f6-680f4ee48aed%2FUntitled.png?table=block&amp;id=813a6277-0984-48b6-bce6-e8cdc383ac7b&amp;t=813a6277-0984-48b6-bce6-e8cdc383ac7b&amp;width=1073.65625&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="1" class="notion-list notion-list-numbered notion-block-e356854d359542188d5c0e9522530cdf" style="list-style-type:decimal"><li>安装Anaconda3</li></ol><div class="notion-row notion-block-f3af6382b93b44d6aaa67054a00ec901"><div class="notion-column notion-block-c565fe26e9e1429fb4092b7d495b51ec" style="width:calc((100% - (1 * min(32px, 4vw))) * 0.5)"><ul class="notion-list notion-list-disc notion-block-5b347be8699b420896a4e6285bb7b808"><li>出现这个输入yes即可，然后就回车确认即可</li></ul></div><div class="notion-spacer"></div><div class="notion-column notion-block-ae37117dd1194577b1a2d9fb7e25bbe6" style="width:calc((100% - (1 * min(32px, 4vw))) * 0.5)"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-4d7b76012fb649b4ba6f9666212a49a2"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:393.97918701171875px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fbe80d103-8359-4a17-a7a8-3d33a316b852%2FUntitled.png?table=block&amp;id=4d7b7601-2fb6-49b4-ba6f-9666212a49a2&amp;t=4d7b7601-2fb6-49b4-ba6f-9666212a49a2&amp;width=393.97918701171875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></div><div class="notion-spacer"></div></div><div class="notion-row notion-block-2a6ac77578b04a3f8f96db7408022b15"><div class="notion-column notion-block-64366ec73d0142cdae7d6aff8976b42c" style="width:calc((100% - (1 * min(32px, 4vw))) * 0.5)"><ul class="notion-list notion-list-disc notion-block-9ae29520f7b145fd9198ec0f7a8b8fc8"><li>这有重复出现的输入no即可退出</li></ul></div><div class="notion-spacer"></div><div class="notion-column notion-block-d0afda197edc429f894c2a39f28ff5cb" style="width:calc((100% - (1 * min(32px, 4vw))) * 0.5)"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-8cb55a25b37f4afbaef8503c7a3e086a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:505.8125px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F12b9bdba-8e92-469b-b5b9-dbe26260edfe%2FUntitled.png?table=block&amp;id=8cb55a25-b37f-4afb-aef8-503c7a3e086a&amp;t=8cb55a25-b37f-4afb-aef8-503c7a3e086a&amp;width=505.8125&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></div><div class="notion-spacer"></div></div><ol start="2" class="notion-list notion-list-numbered notion-block-f3d59d2e172e4e87b88807f377c70165" style="list-style-type:decimal"><li>创建虚拟环境</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-de4f718f39244612abe2dc510ad44733" style="list-style-type:decimal"><li>不建议一起扔进去有可能会报错。</li></ol><ul class="notion-list notion-list-disc notion-block-33861c49a75940ef890f405ed3af0c6e"><li>拉去项目文件</li></ul><ul class="notion-list notion-list-disc notion-block-d6308aba115145d283135481d2890666"><li>安装vem环境安装pip</li></ul><ul class="notion-list notion-list-disc notion-block-c5a6fd22475146fbb7946b5a3981810c"><li>更新pip版本</li></ul><ul class="notion-list notion-list-disc notion-block-1b0d7456b3d44f8786c30aa0bee93627"><li>下载依赖文件</li></ul><ul class="notion-list notion-list-disc notion-block-408e55b7c22d4f08bb17166b8a183d30"><li>安装xformers：</li></ul><ul class="notion-list notion-list-disc notion-block-e038def243e944b08650b10de74f08f1"><li>安装Triton：</li></ul><ul class="notion-list notion-list-disc notion-block-e097ec1546fd462e9c151d070e8e063f"><li>安装lion：</li></ul><ul class="notion-list notion-list-disc notion-block-b03eeb9343b643b89a7410b59eb6adb9"><li>安装accelerate模块</li></ul><div class="notion-blank notion-block-341a6f53bf504ebda45e062c7d0fa4bf"> </div><ul class="notion-list notion-list-disc notion-block-8e873d373ed840669d2e3b0d8729e375"><li>退出vem环境</li></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-e134df9134824c55ae9c699535a3f22e" data-id="e134df9134824c55ae9c699535a3f22e"><span><div id="e134df9134824c55ae9c699535a3f22e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#e134df9134824c55ae9c699535a3f22e" title="📎 参考文章"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">📎 参考文章</span></span></h2><ul class="notion-list notion-list-disc notion-block-6ce2fe5f53484e45aff9cec6be732562"><li>参考网页</li></ul><div class="notion-row"><a class="notion-bookmark notion-block-39d3d6b4b7f24700aa02ba2bcaae52a3" href="https://blog.csdn.net/OriginSXC/article/details/129458346" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">在Linux云服务器上部署stable diffusion的lora训练的另一种方法_回天一梦的博客-CSDN博客</div><div class="notion-bookmark-description">在云服务器上部署stable diffusion的lora训练的另一种方法更加简单，便捷。</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fg.csdnimg.cn%2Fstatic%2Flogo%2Ffavicon32.ico?table=block&amp;id=39d3d6b4-b7f2-4700-aa02-ba2bcaae52a3&amp;t=39d3d6b4-b7f2-4700-aa02-ba2bcaae52a3" alt="在Linux云服务器上部署stable diffusion的lora训练的另一种方法_回天一梦的博客-CSDN博客" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://blog.csdn.net/OriginSXC/article/details/129458346</div></div></div></a></div><div class="notion-blank notion-block-3af2d1f054ce41ccbcd65de7fbe5a5cf"> </div><div class="notion-callout notion-gray_background_co notion-block-0fbeae7282dd440a9adc0e43622cea03"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">有关Notion安装或者使用上的问题，欢迎您在底部评论区留言，一起交流~</div></div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vibe Coding实现MAX Script编写]]></title>
            <link>玻璃小屋.cn/article/vibe-coding-max-script</link>
            <guid>玻璃小屋.cn/article/vibe-coding-max-script</guid>
            <pubDate>Fri, 19 Jun 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[不需要了解代码结构，直接开始氛围编程——用AI编写MAXScript的完整指南]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-3845788abc9981cea497ff34cbe2ae7f"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-block-a33466580ea0448aba72c01ff29c5b8b"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-4f19717a57e24000825d41d49cefd791"><b>写作假设（由 AI 推断）</b></div><ul class="notion-list notion-list-disc notion-block-bc87d1ffa9a6447eb1960ff1abb4064b"><li><b>目标读者：</b> 3ds Max 用户、CG 从业者、想用 AI 辅助编写 MAXScript 但无从下手的初学者</li></ul><ul class="notion-list notion-list-disc notion-block-232aa9fbaf65452c9338d0d6a29a25f3"><li><b>前置知识：</b> 了解 MAXScript 的基本概念，有 3ds Max 操作经验，不需要编程背景</li></ul><ul class="notion-list notion-list-disc notion-block-b0e9277ff7b34491a6ce008ae1ac5c70"><li><b>读完能做什么：</b> 知道 Vibe Coding 是什么、怎么选工具（含 2026年6月最新模型排行榜数据）、怎么用 RAG/Agent 等进阶技巧写 MAXScript</li></ul></div></div><hr class="notion-hr notion-block-3c57cb5a908447bf8a538c34a3f7596f"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-55e2e132b9e0488284594113705a0025" data-id="55e2e132b9e0488284594113705a0025"><span><div id="55e2e132b9e0488284594113705a0025" class="notion-header-anchor"></div><a class="notion-hash-link" href="#55e2e132b9e0488284594113705a0025" title="1. 了解 Vibe Coding"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1. 了解 Vibe Coding</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-a5242eab17844ea5bb6f92066dbae8c3" data-id="a5242eab17844ea5bb6f92066dbae8c3"><span><div id="a5242eab17844ea5bb6f92066dbae8c3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a5242eab17844ea5bb6f92066dbae8c3" title="1.1 什么是 Vibe Coding"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.1 什么是 Vibe Coding</span></span></h3><blockquote class="notion-quote notion-block-102294b1d0b64300963d3748ee1e2639"><div><b>Vibe Coding（氛围编程）</b> 是一个由 Andrej Karpathy（OpenAI 联合创始人）在 2025 年初提出的概念。直译过来就是「在氛围中编程」——意思是开发者不再需要逐行写代码，而是用自然语言描述<b>想要什么</b>，AI 帮你生成代码，你要做的只是预览、测试、微调。</div></blockquote><details class="notion-toggle notion-block-efcc0c8f7bab491db6a1a84e8cbd7448"><summary><b>「Vibe Coding」这个词怎么来的？</b></summary><div><div class="notion-text notion-block-86e7650f7ee44cdcab59d271ee938a24">2025 年 2 月，Karpathy 在社交媒体上描述了一种新的编程方式：你完全沉浸在「氛围」里，跟 AI 对话式地写代码，遇到错误就直接粘贴给 AI 让它修，不再像传统程序员那样逐行 debug。他管这叫 <b>Vibe Coding</b> —— 一种「全情投入地感受，然后让 AI 帮你写出来」的编程范式。</div><div class="notion-text notion-block-61fb10ef40874e2ebb7d5fe9646be75f">这个词很快在开发者社区传开，因为它准确描述了 AI IDE（Cursor、Windsurf、Copilot 等）带来的全新体验。</div></div></details><div class="notion-text notion-block-691d62c05c954284a1dd47713702869a">传统写 MAXScript 的流程是：<b>想功能 → 查文档 → 写代码 → 报错 → 调试 → 改 → 再试</b>。一个简单的批量导入工具，可能折腾一整天。</div><div class="notion-text notion-block-b68ee632169e4444a0d40679c7c6e4a2">有了 Vibe Coding 之后，流程变成了：</div><blockquote class="notion-quote notion-block-809e8c66d1314063ad3300b17ae754b5"><div><b>想功能 → 告诉 AI → 等几秒 → 测试 → 不满意就再描述一次 → 完成</b></div></blockquote><div class="notion-text notion-block-d6341769e89a45a98efeedc704d7050d">你不需要记住 3ds Max 的 API 方法名叫什么，不需要担心 <code class="notion-inline-code">dotNetClass</code> 的语法细节，你只需要描述清楚<b>你要做什么</b>。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-397e5ae6295a41108f37dae6b343f3cc" data-id="397e5ae6295a41108f37dae6b343f3cc"><span><div id="397e5ae6295a41108f37dae6b343f3cc" class="notion-header-anchor"></div><a class="notion-hash-link" href="#397e5ae6295a41108f37dae6b343f3cc" title="1.2 Vibe Coding 与传统编程的区别"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.2 Vibe Coding 与传统编程的区别</span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3855788abc9980e9ba3ef6a08d7c0f6e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/vibe-coding-max-script/01-2-vibe-coding-vs-traditional.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3855788a-bc99-80e9-ba3e-f6a08d7c0f6e" alt="notion image" loading="lazy" decoding="async"/></div></figure><table class="notion-simple-table notion-block-3d0785572cfb4207b45671b74d707e62"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-607e63633f8e4a73acbe39115a0d996b"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">维度</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">传统编程</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">Vibe Coding</div></td></tr><tr class="notion-simple-table-row notion-block-a023306a24dd45b19950ef579e01c20d"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell"><b>工作方式</b></div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">手写每一行代码</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">自然语言描述需求</div></td></tr><tr class="notion-simple-table-row notion-block-ca765c59b56c45108ab7b1c375c00f10"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell"><b>学习曲线</b></div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">陡峭（先学语法、API）</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">平缓（会说话就行）</div></td></tr><tr class="notion-simple-table-row notion-block-48b7483e3d9f4fec9fa7384f5e2d783d"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell"><b>调试方式</b></div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">看日志、断点、逐行排查</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">把错误粘贴给 AI 让它修</div></td></tr><tr class="notion-simple-table-row notion-block-7cebc8e61fab4e8bb668fa0606879eae"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell"><b>适合人群</b></div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">专业程序员</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">任何人，包括设计师、艺术家</div></td></tr><tr class="notion-simple-table-row notion-block-9f946953833948eaa77f5135f18f7061"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell"><b>代码质量</b></div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">稳定可控</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">依赖 AI 模型能力</div></td></tr><tr class="notion-simple-table-row notion-block-0d6fb9f806754c069ac8eda5138e2f68"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell"><b>效率提升</b></div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">熟练后稳定</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">新手直接起飞，但需验证</div></td></tr></tbody></table><div class="notion-callout notion-block-431aaf609c0a4af3b3f4b40741e129ca"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-dd3f7acb51224758bc3d0a2fd6497ec8"><b>一个简单的例子：</b></div><div class="notion-text notion-block-7dc2395ecd0d4ece93ddcb8e34b976bc">传统方式写「批量导出为 FBX」：</div><div class="notion-text notion-block-e5a0fdc6bff54609b35d28a57d26e874">Vibe Coding 直接说：<b>「帮我写一个 MAXScript，把当前场景里所有选中物体批量导出成 FBX，按物体名称命名」</b> → 等 10 秒 → 跑一下 → 可能有个小 bug → <b>「导出路径不对，改成弹窗让用户选择保存文件夹」</b> → 搞定。</div></div></div><hr class="notion-hr notion-block-006d32a2311f43629a2b01b730f241c6"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-3855788abc99802a89fbd05f70d6dc76" data-id="3855788abc99802a89fbd05f70d6dc76"><span><div id="3855788abc99802a89fbd05f70d6dc76" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3855788abc99802a89fbd05f70d6dc76" title="2. AI中的名词/术语解释"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2. AI中的名词/术语解释</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3855788abc998075b419c84a18416ca2" data-id="3855788abc998075b419c84a18416ca2"><span><div id="3855788abc998075b419c84a18416ca2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3855788abc998075b419c84a18416ca2" title="2.1 上下文"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.1 上下文</span></span></h3><blockquote class="notion-quote notion-block-3865788abc99818988ffd3b6aeb3325c"><div>上下文（Context）是 AI 的「短期记忆」——它决定了 AI 能「看到」多少你的聊天历史和项目信息，直接影响回答的准确性。</div></blockquote><div class="notion-text notion-block-3865788abc9981dcbfccc560be901ce1">窗口越大，AI 能参考的代码就越多，生成的代码越符合你的项目风格。把整个项目放进去，AI 就能理解你的命名规范和已有模块，而不是从零猜测。</div><div class="notion-text notion-block-3865788abc9981db8824f7b4cdc6a093">各模型的上下文大小：DeepSeek V4 和 Claude Sonnet 4 均支持 1M Token（约 75 万汉字）。可以把整个大型代码库一次性放进去，但消耗的 Token 更多，费用也更高。</div><div class="notion-callout notion-block-3865788abc9981e29154d07a4e196145"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">高效技巧：只粘贴关键代码片段 → 善用 @Codebase / RAG → 定期 /compact 压缩 → 新任务开新会话 → 项目根目录放 CLAUDE.md</div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3855788abc998078b549e8ba107ffb33" data-id="3855788abc998078b549e8ba107ffb33"><span><div id="3855788abc998078b549e8ba107ffb33" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3855788abc998078b549e8ba107ffb33" title="2.2 Token"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.2 Token</span></span></h3><blockquote class="notion-quote notion-block-3865788abc9981df8b15da3e2e6d1680"><div>Token（词元）是 AI 处理文本的最小单位——可以是一个汉字、半个英文单词、或一个标点符号。不同模型的「分词器」（Tokenizer）切分方式不同，同一句话在 GPT、Claude、DeepSeek 中的 Token 数会有差异。AI 的上下文窗口和费用都以 Token 计算。</div></blockquote><details class="notion-toggle notion-block-3865788abc99813bbe2ad7fdd1d1eafc"><summary>什么是分词器（Tokenizer）？</summary><div><div class="notion-text notion-block-3865788abc99819f81fbd30c75cea571">分词器（Tokenizer）是 AI 模型内部的「切词工具」。它把人类的文字切成一个个小片段（Token），这样 AI 才能处理。不同模型用不同的分词器，所以同一句话在 GPT、Claude、DeepSeek 中切出来的 Token 数会不一样。</div><div class="notion-text notion-block-3865788abc9981c4bf79c22254a64a8b">举个例子：「我爱编程」这句话，GPT 可能切成 3 个 Token（我/爱/编程），Claude 可能切成 4 个（我/爱/编/程）。Token 数不同，费用也不同。</div></div></details><div class="notion-text notion-block-3865788abc998178b559cccf56677bf3">中文大约 1 个汉字 = 1~2 个 Token，英文大约 1 个单词 = 1~2 个 Token。DeepSeek V4 的 1M Token 上下文窗口约等于 75 万汉字，能把整个大型代码库放进去。</div><div class="notion-callout notion-block-3865788abc99817b8617ef7847d4bcb0"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💰">💰</span></div><div class="notion-callout-text">省钱技巧：Token 越多费用越高。写代码时只粘贴关键片段，善用 RAG 自动检索，避免把整个文件丢给 AI。</div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3855788abc9980c8bc60c200bd174cb7" data-id="3855788abc9980c8bc60c200bd174cb7"><span><div id="3855788abc9980c8bc60c200bd174cb7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3855788abc9980c8bc60c200bd174cb7" title="2.3 skill"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.3 skill</span></span></h3><blockquote class="notion-quote notion-block-3865788abc998155b939c714e7c2dea1"><div>Skill（技能）是 AI 工具中的「按需知识文档」——遵循 agentskills.io 开放标准，只在需要时加载，教会 AI 如何完成特定类型的任务。注意：Skill ≠ 持久指令（如 CLAUDE.md）。CLAUDE.md 每次会话都会加载到上下文中，而 Skill 只在被调用时才加载，更节省 Token。</div></blockquote><details class="notion-toggle notion-block-3865788abc9981d7bddbd0279d7fdea0"><summary>Skill 和 CLAUDE.md/Rules 有什么区别？</summary><div><div class="notion-text notion-block-3865788abc99811b88c5f30d6d54d3bf">• CLAUDE.md / Rules = 持久指令，每次会话自动加载到上下文中，消耗 Token</div><div class="notion-text notion-block-3865788abc998178aefaf68b900764e7">• Skill = 按需知识文档，只在被调用时才加载，更省 Token</div><div class="notion-text notion-block-3865788abc9981009f60fa1348e3390c">• 两者都遵循 agentskills.io 开放标准，支持 /skill-name 斜杠命令调用</div><div class="notion-text notion-block-3865788abc99814dbd27ffc9acf03248">• 实际使用：项目规范放 CLAUDE.md（每次生效），特定任务流程放 Skill（按需加载）</div></div></details><div class="notion-callout notion-block-3865788abc99815987b1cc82c744ad0f"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">建议：把常用的任务流程保存为 Skill，按需加载更省 Token；项目级的通用规范放 CLAUDE.md/Rules，每次自动生效。</div></div><details class="notion-toggle notion-block-3865788abc9981a1a776c33ce0be5471"><summary>不同工具中的 Skill 叫什么？</summary><div><div class="notion-text notion-block-3865788abc998183bb27eb85df4b0fd0">• Hermes Agent → Skill 文件（.hermes/skills/目录下的 SKILL.md）</div><div class="notion-text notion-block-3865788abc998128a51ce3f20f9915c7">• Claude Code → CLAUDE.md（项目根目录下的指令文件）</div><div class="notion-text notion-block-3865788abc99811b9f6ef6324270612c">• Cursor → Rules（.cursor/rules/目录下的规则文件）</div><div class="notion-text notion-block-3865788abc99815ca50bfb13c678a39b">• Windsurf → .windsurfrules</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3865788abc99816294b0d49abf33217b" data-id="3865788abc99816294b0d49abf33217b"><span><div id="3865788abc99816294b0d49abf33217b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3865788abc99816294b0d49abf33217b" title="2.4 MCP 工具&amp;协议"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.4 MCP 工具&amp;协议</span></span></h3><blockquote class="notion-quote notion-block-3865788abc99812fbeabfb2e38a2ffc0"><div>MCP（Model Context Protocol）是 AI 的「USB 接口」——一种开放协议，让 AI 能直接查询数据库、操作文件、调用 API，而不只是生成文本。</div></blockquote><details class="notion-toggle notion-block-3865788abc9981c98e63e4c3f54bc4f9"><summary>MCP 能做什么？</summary><div><div class="notion-text notion-block-3865788abc9981e39a1ec528b98e09fe">• 查询数据库（MySQL、PostgreSQL、MongoDB）</div><div class="notion-text notion-block-3865788abc9981d9aeabc16d2bd0487b">• 操作文件系统（读写文件、管理目录）</div><div class="notion-text notion-block-3865788abc998146b441cdbb979e2245">• 调用 API（GitHub、Notion、Slack、Google Sheets）</div><div class="notion-text notion-block-3865788abc9981fdb470deebf18c0404">• 访问云服务（AWS S3、Cloudflare、Vercel）</div><div class="notion-text notion-block-3865788abc998187a1fecd20c99b11d3">• 控制浏览器（Playwright、Puppeteer）</div><div class="notion-text notion-block-3865788abc998189a61ce3499f0ba304">MCP 采用客户端-服务器架构，基于 JSON-RPC 2.0 协议：</div><div class="notion-text notion-block-3865788abc99817a864ae2b73fefbcb9">• Host（主机）：AI 应用（如 Claude Desktop、Cursor），协调管理客户端</div><div class="notion-text notion-block-3865788abc99811a8595cc5ef7c9629b">• Client（客户端）：每个 MCP 服务器对应一个客户端，维护专用连接</div><div class="notion-text notion-block-3865788abc99817ab92ccd6449624677">• Server（服务器）：提供工具（Tools）、资源（Resources）、提示模板（Prompts）</div><div class="notion-text notion-block-3865788abc99810eacafde60c9e9461d">传输方式：Stdio（本地进程间通信）或 Streamable HTTP（远程通信+OAuth 认证）</div></div></details><div class="notion-text notion-block-3865788abc99817ca085d0bdd7a30906">在 Vibe Coding 中，MCP 让 AI 从「聊天框」变成了真正的「工具箱」——可以访问你的代码库、文档甚至云服务。比如通过 MCP，AI 可以直接读取你的项目文件、查询 Notion 文档、操作 GitHub 仓库。</div><div class="notion-callout notion-block-3865788abc9981769266eafcee434eb5"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🔌">🔌</span></div><div class="notion-callout-text">常用 MCP 服务器：文件系统、数据库、GitHub、Notion、Slack 等。</div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3865788abc99813baa6cd81900b18a9b" data-id="3865788abc99813baa6cd81900b18a9b"><span><div id="3865788abc99813baa6cd81900b18a9b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3865788abc99813baa6cd81900b18a9b" title="2.5 缓存命中"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.5 缓存命中</span></span></h3><blockquote class="notion-quote notion-block-3865788abc9981dab69bdd1bc6e148c9"><div>缓存命中（Cache Hit）是 AI 的「记忆复用」——当你问的问题和之前相似时，AI 直接复用已计算过的结果，而不是重新生成一遍。</div></blockquote><details class="notion-toggle notion-block-3865788abc998102ae1dc2ecfcd86345"><summary>缓存命中的好处</summary><div><div class="notion-text notion-block-3865788abc99816aa5e6fd4f7fa2f60d">• 响应速度：从几秒降到毫秒级</div><div class="notion-text notion-block-3865788abc9981379b89e3fd476f7e0e">• 成本降低：缓存命中的费用通常是重新计算的 10%~25%</div><div class="notion-text notion-block-3865788abc99812f92c3da505d5ebba3">• 一致性：相同问题得到相同答案，避免随机性</div><div class="notion-text notion-block-3865788abc9981c8b6e7d2e573aca59d">工作原理：基于 Prompt 前缀精确匹配——相同前缀的部分直接复用已计算的 KV 缓存，无需重新推理。</div><div class="notion-text notion-block-3865788abc9981c2ae19df6e6ac3af66">费用对比（Anthropic 官方定价）：</div><div class="notion-text notion-block-3865788abc9981caa645c58bf7bf40c8">• 普通输入：1.0× 基准价</div><div class="notion-text notion-block-3865788abc998141891fcc5400d06629">• Cache Write（写入缓存）：1.25× 基准价（5分钟TTL）</div><div class="notion-text notion-block-3865788abc9981b68244de034e2bdb50">• Cache Read（命中缓存）：0.1× 基准价（节省 90%！）</div><div class="notion-text notion-block-3865788abc9981d88975e3f0a391489e">OpenAI 在 Prompt ≥1024 Token 时自动启用缓存，无需代码改动。</div></div></details><div class="notion-text notion-block-3865788abc998106b489dc3c339b4ac6">响应速度提升最高 80%，费用节省最高 90%（Anthropic 官方数据：Cache Read 仅收基准价的 10%）。原理是基于 Prompt 前缀精确匹配——相同前缀直接复用已计算的 KV 缓存，无需重新推理。OpenAI 在 Prompt ≥1024 Token 时自动启用缓存。</div><div class="notion-callout notion-block-3865788abc9981e79dc7e0f295575cbe"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚡">⚡</span></div><div class="notion-callout-text">技巧：相似问题尽量在同一个会话中问，更容易触发缓存命中。</div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3865788abc998160b84ac28afb2e46b8" data-id="3865788abc998160b84ac28afb2e46b8"><span><div id="3865788abc998160b84ac28afb2e46b8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3865788abc998160b84ac28afb2e46b8" title="2.6 温度"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.6 温度</span></span></h3><blockquote class="notion-quote notion-block-3865788abc9981a9960fd3ea239d42bc"><div>温度（Temperature）是控制 AI 输出随机性的参数——取值范围 0~2（OpenAI）或 0~1（Anthropic/Gemini），默认值为 1.0。通过缩放 Softmax 函数的 logits 来改变概率分布：T=0 时完全确定（每次输出相同），T 越高输出越随机多样。</div></blockquote><details class="notion-toggle notion-block-3865788abc9981bb8e7cf1f181d9284d"><summary>不同平台的温度范围</summary><div><div class="notion-text notion-block-3865788abc9981848ab2fe1b68dbe23c">• OpenAI：0 ~ 2.0，默认 1.0</div><div class="notion-text notion-block-3865788abc9981b48813dc7649c2b337">• Anthropic (Claude)：0 ~ 1.0</div><div class="notion-text notion-block-3865788abc9981669826f968dad6e4ea">• Google Gemini：0 ~ 1.0，默认 1.0</div><div class="notion-text notion-block-3865788abc99814995d9e670337b7a01">• T=0 时为完全确定性输出（greedy decoding），相同输入始终得到相同输出</div></div></details><div class="notion-callout notion-block-3865788abc998176a583f8842fe75a2b"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🎛️">🎛️</span></div><div class="notion-callout-text">写代码时温度设低（接近 0），保证确定性输出；创意写作时温度设高，获得更多样化的表达。注意：Temperature 和 top_p 建议只调其一，不要同时调整。</div></div><details class="notion-toggle notion-block-3865788abc99810394d9fb8575fff304"><summary>温度设置建议</summary><div><div class="notion-text notion-block-3865788abc99816d91eede45d0b10e3a">• 写代码：0.1~0.3（保守、确定、正确性优先）</div><div class="notion-text notion-block-3865788abc99812aa94be48de477383e">• 写文档/注释：0.5~0.7（自然、流畅、可读性好）</div><div class="notion-text notion-block-3865788abc9981a6bc4de7a1e74b5f8f">• 创意写作：0.8~1.0（有想象力、但可能不稳定）</div><div class="notion-text notion-block-3865788abc9981eba963d21ae7d23eb6">• 数学计算：0.0（完全确定、无随机性</div><div class="notion-text notion-block-3865788abc9981dea107e374b6f15ce1">温度通过缩放 Softmax 函数的 logits 来改变概率分布形状：</div><div class="notion-text notion-block-3865788abc998151b044eb796653f07a">• T &lt; 1：概率分布变「尖锐」，高概率 token 更主导，输出更聚焦确定</div><div class="notion-text notion-block-3865788abc99813eb5ccf29f6cf7934f">• T = 1：保持模型原始概率分布（默认行为）</div><div class="notion-text notion-block-3865788abc998189bd9bc59503b14e0f">• T &gt; 1：概率分布变「平坦」，低概率 token 也有机会被选中，输出更多样</div><div class="notion-text notion-block-3865788abc998134a438c47958049304">• T = 0：等同于 argmax，每次对相同输入返回完全相同输出（greedy decoding）</div><div class="notion-text notion-block-3865788abc99815bbd74d301fe1b9ca0">注意：Temperature 和 top_p 建议只调其一，不要同时调整（OpenAI 官方建议）。</div></div></details><div class="notion-callout notion-block-3865788abc9981b7ae89eed61b752fd7"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🎛️">🎛️</span></div><div class="notion-callout-text">建议：写代码时温度设低，写注释时温度设高，灵活调整。</div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-112a482a8a7045f78d5cd40f3dd6dbc5" data-id="112a482a8a7045f78d5cd40f3dd6dbc5"><span><div id="112a482a8a7045f78d5cd40f3dd6dbc5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#112a482a8a7045f78d5cd40f3dd6dbc5" title="2.7 RAG — 让 AI 参考你的代码库"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.7 RAG — 让 AI 参考你的代码库</span></span></h3><div class="notion-text notion-block-8f9b936504a3414187dd7ee627a34079">RAG（Retrieval-Augmented Generation，检索增强生成）是 Vibe Coding 进阶的关键技术。简单说就是：<b>AI 写代码时，先自动从你的代码库里找相似代码作为参考，再生成新的。</b></div><details class="notion-toggle notion-block-9dab110e19cb462f9ac5ba2323b562ba"><summary><b>RAG 的原理大白话</b></summary><div><div class="notion-text notion-block-b7c804ad5a714e9c8bf870e45b67b1db">没有 RAG 的 AI：它凭空生成 MAXScript，用的是训练数据里的「通用知识」。它不知道你写过什么工具函数、不知道你的命名规范、不知道你常用的模式。</div><div class="notion-text notion-block-b7cff2c905544ae2b770239c11170c43">有 RAG 的 AI：你问它「写一个批量导出工具」，它会先检索你已有的代码库，找到你之前写的导出函数、UI 组件、工具类，然后<b>基于这些已有代码</b>生成新的脚本。生成结果风格一致、直接可用。</div></div></details><div class="notion-text notion-block-dfe6709341244c89a12f1423e63fc7da"><b>对 MAXScript 的实用场景：</b></div><table class="notion-simple-table notion-block-761a32f903dc4f7aa72c77ba3e4d505d"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-c2fa7c515fb04952a3f9f126992d8634"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">场景</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">操作方法</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">效果</div></td></tr><tr class="notion-simple-table-row notion-block-561b65922b6243188167018d54361d9c"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">复用已有工具函数</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell"><code class="notion-inline-code">@Codebase 参考 myTools.ms 里的 UI 风格</code></div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">新脚本和老工具风格一致</div></td></tr><tr class="notion-simple-table-row notion-block-c8e1363556be4c26b1c95891efea7711"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">学习现有代码</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell"><code class="notion-inline-code">@Codebase 分析这个脚本的工作流</code></div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">AI 解释别人的 MAXScript</div></td></tr><tr class="notion-simple-table-row notion-block-6e69cd12a9464046a58306d6e3334470"><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">跨文件重构</div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell"><code class="notion-inline-code">@Codebase 把三个脚本里的重复功能提取成公共函数</code></div></td><td class="" style="width:235.66666666666666px"><div class="notion-simple-table-cell">自动整理代码库</div></td></tr></tbody></table><div class="notion-text notion-block-059c62576556416489cb7f8999a74202"><b>建立你的 MAXScript RAG 知识库：</b></div><div class="notion-text notion-block-91655c71d8464fe58502523565a2e482">为了让 RAG 效果更好，建议在项目目录下放一个 <code class="notion-inline-code">_references/</code> 文件夹，存放：</div><div class="notion-callout notion-block-23e0b5adb8854a148666b36bf8c9fb87"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-10f442b9af3d411693eb95d29822e591"><b>RAG 进阶技巧：</b> 每次写新功能前，先用 <code class="notion-inline-code">@Codebase</code> 看一下有没有现成的代码可以直接复用。这比你让 AI 从零生成要快得多，而且代码风格一致。每次完成的脚本都放入 <code class="notion-inline-code">_references/</code> 知识库，下次同类型任务 RAG 就能直接参考，形成<b>越用越顺</b>的正循环。</div></div></div><hr class="notion-hr notion-block-38e7347fedb14e29b0a94ed7e9f0bdef"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-0ef2a4cfc24244139724813325a5daa7" data-id="0ef2a4cfc24244139724813325a5daa7"><span><div id="0ef2a4cfc24244139724813325a5daa7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0ef2a4cfc24244139724813325a5daa7" title="2.8 Agent（智能代理模式）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.8 Agent（智能代理模式）</span></span></h3><div class="notion-text notion-block-54a1cc060453496d911fd3131abc2703">如果说 Vibe Coding 是「你告诉 AI 做什么」，那 <b>Agent 模式</b>就是「你告诉 AI 一个目标，AI 自己规划步骤、执行、检查结果」。</div><details class="notion-toggle notion-block-888a0d21531d4ad0a355c865ca5d1fc1"><summary><b>Agent 和普通聊天的区别</b></summary><div><table class="notion-simple-table notion-block-147aa0efdd794867b516033b17e72783"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-beda5067c8cb45cfb864621e2b8300fc"><td class="" style="width:219px"><div class="notion-simple-table-cell">维度</div></td><td class="" style="width:219px"><div class="notion-simple-table-cell">普通聊天</div></td><td class="" style="width:219px"><div class="notion-simple-table-cell">Agent 模式</div></td></tr><tr class="notion-simple-table-row notion-block-dcc1e589efaf44b58c610235be78613d"><td class="" style="width:219px"><div class="notion-simple-table-cell">任务粒度</div></td><td class="" style="width:219px"><div class="notion-simple-table-cell">一次一步</div></td><td class="" style="width:219px"><div class="notion-simple-table-cell">多步自主规划</div></td></tr><tr class="notion-simple-table-row notion-block-3e82f7a6fc81420db8d85340937b5f39"><td class="" style="width:219px"><div class="notion-simple-table-cell">工具调用</div></td><td class="" style="width:219px"><div class="notion-simple-table-cell">你手动复制运行</div></td><td class="" style="width:219px"><div class="notion-simple-table-cell">AI 自动调用工具</div></td></tr><tr class="notion-simple-table-row notion-block-b7effcbdba7d4abdbb79b20b4b0172fb"><td class="" style="width:219px"><div class="notion-simple-table-cell">错误处理</div></td><td class="" style="width:219px"><div class="notion-simple-table-cell">你把报错贴给 AI</div></td><td class="" style="width:219px"><div class="notion-simple-table-cell">AI 自己发现并修复</div></td></tr><tr class="notion-simple-table-row notion-block-fc0fd33778bb46538b6a5bd9351c50a8"><td class="" style="width:219px"><div class="notion-simple-table-cell">适用场景</div></td><td class="" style="width:219px"><div class="notion-simple-table-cell">简单脚本</div></td><td class="" style="width:219px"><div class="notion-simple-table-cell">复杂多步骤任务</div></td></tr></tbody></table></div></details><div class="notion-text notion-block-915361667e2149929b87ebff8e053cf2">Agent 会自动：读取场景 → 分析需求 → 生成代码 → 运行测试 → 发现 bug → 修复 → 完成。你只需要在最后验收。</div><div class="notion-text notion-block-888eb4db8fb54f45aac6197cdd1cd737"><b>也可以多 Agent 协同：</b> 一个 Agent 写核心逻辑，另一个 Agent 写 UI，第三个 Agent 测试。这在 Windsurf 的协作模式下已经可以实现。</div><hr class="notion-hr notion-block-e575ee485e1842879663be427ed55bce"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-fea3936df51c496486cfebce9490e2d1" data-id="fea3936df51c496486cfebce9490e2d1"><span><div id="fea3936df51c496486cfebce9490e2d1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fea3936df51c496486cfebce9490e2d1" title="2.9 提示词模板库"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.9 提示词模板库</span></span></h3><div class="notion-text notion-block-1ee00ba37b704d709889026cf52e35c0">不要每次都从零开始写 prompt。创建一套 MAXScript 专用的提示词模板，直接复制使用：</div><details class="notion-toggle notion-block-a7edf99e8676431c91fb713784b143a6"><summary><b>模板 1：从零写脚本</b></summary><div></div></details><details class="notion-toggle notion-block-1599d0a34bc14720a203fcc6706d1d27"><summary><b>模板 2：修改现有脚本</b></summary><div></div></details><details class="notion-toggle notion-block-7d9de2f398d04f5eac9cda53b1fac907"><summary><b>模板 3：调试报错</b></summary><div></div></details><details class="notion-toggle notion-block-5b76fab6aa2a4a4aac3edbd8d6e798f3"><summary><b>模板 4：生成 UI 界面</b></summary><div></div></details><hr class="notion-hr notion-block-02e748b44f2845c6989d40a3adcfc8b7"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-94cd50ffeac546f29395ce5085b187fa" data-id="94cd50ffeac546f29395ce5085b187fa"><span><div id="94cd50ffeac546f29395ce5085b187fa" class="notion-header-anchor"></div><a class="notion-hash-link" href="#94cd50ffeac546f29395ce5085b187fa" title="3. 如何开始"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3. 如何开始</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-5bf191a7721f407db2d351e7e086f055" data-id="5bf191a7721f407db2d351e7e086f055"><span><div id="5bf191a7721f407db2d351e7e086f055" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5bf191a7721f407db2d351e7e086f055" title="3.1 需要用到的工具"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.1 需要用到的工具</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-2a4671c55dd349469143e116c1d83cf1" data-id="2a4671c55dd349469143e116c1d83cf1"><span><div id="2a4671c55dd349469143e116c1d83cf1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2a4671c55dd349469143e116c1d83cf1" title="3.1.1 AI IDE 选择"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.1.1 AI IDE 选择</span></span></h4><div class="notion-text notion-block-3855788abc998124b2f5c0707a4759a0"><b>Claude Code</b> 和 <b>Codex</b> 是新一代的 AI 编程工具，它们不再依赖传统的 IDE 界面，而是直接在终端中运行，通过自然语言与你对话来完成代码编写、调试和重构。这种模式更符合 Vibe Coding 的理念——你只需要描述想要什么，AI 帮你实现。</div><div class="notion-text notion-block-3855788abc9981f0a6c8f5a0d8649817">与传统的 AI IDE（如 Cursor、Windsurf）相比，Claude Code 和 Codex 的优势在于：</div><ul class="notion-list notion-list-disc notion-block-3855788abc9981a19e7dd4d6824cfa50"><li><b>无需切换编辑器</b>：直接在终端运行，与你现有的 3ds Max 工作流无缝集成</li></ul><ul class="notion-list notion-list-disc notion-block-3855788abc9981e99d8be743cb425bf0"><li><b>更强的上下文理解</b>：能读取整个项目目录，自动理解代码结构和依赖关系</li></ul><ul class="notion-list notion-list-disc notion-block-3855788abc9981e89748c568c2def204"><li><b>自动化程度更高</b>：可以自主执行测试、修复错误、迭代优化，你只需要在最后验收</li></ul><div class="notion-text notion-block-3855788abc9981a19eb7ec059e052e73"><b>推荐选择：</b>如果你是第一次接触 Vibe Coding，建议从 Claude Code 开始——它的中文理解能力更强，对 MAXScript 这种小众语言的支持也更好。如果你已经有 Python/Node.js 基础，Codex 也是不错的选择。</div><div class="notion-text notion-block-3855788abc998184bc40d1cf5fb46e02"><b>主流 AI 编程工具对比：</b></div><ul class="notion-list notion-list-disc notion-block-3855788abc9981e98789c75e6ea7c72d"><li><b>Claude Code</b>（CLI/终端）— 中文理解强，MAXScript 支持好，适合小众语言开发，学习成本低</li></ul><ul class="notion-list notion-list-disc notion-block-3855788abc99812cab15f78b30ebe53f"><li><b>Codex</b>（CLI/终端）— OpenAI 生态，Python/JS 强，适合 Python 和 Web 开发，学习成本中</li></ul><ul class="notion-list notion-list-disc notion-block-3855788abc9981078e1cf2eb078dc958"><li><b>Cursor</b>（AI IDE）— 可视化界面，RAG 集成，适合全栈开发和大型项目，学习成本中</li></ul><ul class="notion-list notion-list-disc notion-block-3855788abc998137896fcc044d849932"><li><b>Windsurf</b>（AI IDE）— 多 Agent 协同，实时预览，适合团队协作和复杂项目，学习成本高</li></ul><ul class="notion-list notion-list-disc notion-block-3855788abc9981b2ace1ecd98902fbf8"><li><b>GitHub Copilot</b>（IDE 插件）— 代码补全，生态成熟，适合日常编码和快速原型，学习成本低</li></ul><details class="notion-toggle notion-block-3855788abc9980939511d0a00e1aa03f"><summary><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-3855788abc9980939511d0a00e1aa03f" data-id="3855788abc9980939511d0a00e1aa03f"><span><div id="3855788abc9980939511d0a00e1aa03f" class="notion-header-anchor"></div><span class="notion-h-title">3.1.2 Claude code安装使用指南</span></span></h4></summary><div><details class="notion-toggle notion-block-3855788abc998013b988ffd40ac5d08c"><summary><h4 class="notion-h notion-h3 notion-block-3855788abc998013b988ffd40ac5d08c" data-id="3855788abc998013b988ffd40ac5d08c"><span><div id="3855788abc998013b988ffd40ac5d08c" class="notion-header-anchor"></div><span class="notion-h-title">Claude code 安装</span></span></h4></summary><div><details class="notion-toggle notion-block-3855788abc998012aeabeea1d2eef9c1"><summary>官方脚本安装(简单方便)</summary><div><div class="notion-text notion-block-3855788abc9980fb8f1cf728cadc316d"><b>Windows PowerShell：</b></div><div class="notion-text notion-block-3855788abc9980d2a727cf2c0c2eeb27"><b>Windows CMD：</b></div><div class="notion-text notion-block-3855788abc99803ba99bdad1a77fc138"><b>macOS、Linux、WSL：</b></div></div></details><details class="notion-toggle notion-block-3855788abc99805cb3a8d9c4b87dfb19"><summary>npm安装方式(需要安装nodejs)</summary><div><div class="notion-text notion-block-3855788abc99805b88f4da42c162f459">首先检查是否本地环境中安装了<span class="notion-red">nodejs</span></div><details class="notion-toggle notion-block-3855788abc9980d5aaabecd2d554a3e4"><summary>输出如果没有输出版本号那么》<span class="notion-teal">点开我</span>《</summary><div><div class="notion-text notion-block-3855788abc9980588ecff36ec0ce259e">首先先去下方网页中点击下载node.js</div><div class="notion-row"><a class="notion-bookmark notion-block-3855788abc998002b713d3ad04e93c34" href="https://nodejs.org/zh-cn" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">Node.js — 在任何地方运行 JavaScript</div><div class="notion-bookmark-description">Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fnodejs.org%2Fstatic%2Fimages%2Ffavicons%2Ffavicon.png?table=block&amp;id=3855788a-bc99-8002-b713-d3ad04e93c34&amp;t=3855788a-bc99-8002-b713-d3ad04e93c34" alt="Node.js — 在任何地方运行 JavaScript" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://nodejs.org/zh-cn</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fnodejs.org%2Fen%2Fnext-data%2Fog%2Fannouncement%2FNode.js%2520%25E2%2580%2594%2520%25E5%259C%25A8%25E4%25BB%25BB%25E4%25BD%2595%25E5%259C%25B0%25E6%2596%25B9%25E8%25BF%2590%25E8%25A1%258C%2520JavaScript?table=block&amp;id=3855788a-bc99-8002-b713-d3ad04e93c34&amp;t=3855788a-bc99-8002-b713-d3ad04e93c34" alt="Node.js — 在任何地方运行 JavaScript" loading="lazy" decoding="async"/></div></a></div><blockquote class="notion-quote notion-block-3855788abc99800fb44ee7cfeda6a575"><div>安装方法是一只下一步直到安装完成。</div></blockquote></div></details><div class="notion-text notion-block-3855788abc9980bc9b13cf90884f9110">成功输出了版本号那么就复制下方代码安装claude code cli</div></div></details><div class="notion-text notion-block-3855788abc998056a1c7fb23def19fa7">验证是否安装成功</div><blockquote class="notion-quote notion-block-3855788abc9980c48504e57749d72e47"><div>如果正确的输出了版本号那么就安装成功了。</div></blockquote><div class="notion-text notion-block-3855788abc998029a8fbe2f56e73fcb8">下方命令是手动更新Claude code </div><blockquote class="notion-quote notion-block-3855788abc99805bad13ccc914586564"><div>一般情况下不需要手动更新，每次启动时会自动更新。</div></blockquote></div></details><details class="notion-toggle notion-block-3855788abc998088a148c047e5baadf6"><summary><h4 class="notion-h notion-h3 notion-block-3855788abc998088a148c047e5baadf6" data-id="3855788abc998088a148c047e5baadf6"><span><div id="3855788abc998088a148c047e5baadf6" class="notion-header-anchor"></div><span class="notion-h-title">API配置</span></span></h4></summary><div><div class="notion-text notion-block-3855788abc9980dabdbff03c8f4cf94a">Claude code的API配置我们可以使用下面这个开源项目快速配置大模型API。</div><div class="notion-row"><a class="notion-bookmark notion-block-3855788abc9980d18bf6ef44e47c1f30" href="https://github.com/farion1231/cc-switch/" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">GitHub - farion1231/cc-switch: A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI &amp; Hermes Agent. Only official website: ccswitch.io</div><div class="notion-bookmark-description">A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI &amp; Hermes Agent. Only official website: ccswitch.io - farion1231/cc-switch</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3855788a-bc99-80d1-8bf6-ef44e47c1f30&amp;t=3855788a-bc99-80d1-8bf6-ef44e47c1f30" alt="GitHub - farion1231/cc-switch: A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI &amp; Hermes Agent. Only official website: ccswitch.io" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/farion1231/cc-switch/</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fb0aa9844401202a3eef4b5b8b25861ba6a76c0aef5445225dcd94b6eb305f9bd%2Ffarion1231%2Fcc-switch?table=block&amp;id=3855788a-bc99-80d1-8bf6-ef44e47c1f30&amp;t=3855788a-bc99-80d1-8bf6-ef44e47c1f30" alt="GitHub - farion1231/cc-switch: A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI &amp; Hermes Agent. Only official website: ccswitch.io" loading="lazy" decoding="async"/></div></a></div></div></details><details class="notion-toggle notion-block-3855788abc99805f9afafee8d632e04b"><summary><h4 class="notion-h notion-h3 notion-block-3855788abc99805f9afafee8d632e04b" data-id="3855788abc99805f9afafee8d632e04b"><span><div id="3855788abc99805f9afafee8d632e04b" class="notion-header-anchor"></div><span class="notion-h-title">claude code 常用命令</span></span></h4></summary><div><table class="notion-simple-table notion-block-3855788abc9980ce9a46d019da4abb3d"><tbody><tr class="notion-simple-table-row notion-block-3855788abc9980a3afbec337dcc2a8e5"><td class="" style="width:314.5px"><div class="notion-simple-table-cell">命令</div></td><td class="" style="width:314.5px"><div class="notion-simple-table-cell">功能</div></td></tr><tr class="notion-simple-table-row notion-block-3855788abc9980229da4ed6e9ef23b78"><td class="" style="width:314.5px"><div class="notion-simple-table-cell">/help</div></td><td class="" style="width:314.5px"><div class="notion-simple-table-cell">参考全部可用命令</div></td></tr><tr class="notion-simple-table-row notion-block-3855788abc99809b8414d7e6e2504800"><td class="" style="width:314.5px"><div class="notion-simple-table-cell">/init</div></td><td class="" style="width:314.5px"><div class="notion-simple-table-cell">创建CLAUDE.md项目记忆(初始化项目)</div></td></tr><tr class="notion-simple-table-row notion-block-3855788abc9980e39404f76497fb98c4"><td class="" style="width:314.5px"><div class="notion-simple-table-cell">/compact</div></td><td class="" style="width:314.5px"><div class="notion-simple-table-cell">压缩上下文(省token)</div></td></tr><tr class="notion-simple-table-row notion-block-3855788abc998089849af7d90b86b075"><td class="" style="width:314.5px"><div class="notion-simple-table-cell">/model</div></td><td class="" style="width:314.5px"><div class="notion-simple-table-cell">切换模型</div></td></tr><tr class="notion-simple-table-row notion-block-3855788abc9980d7b496c1de8aafcedc"><td class="" style="width:314.5px"><div class="notion-simple-table-cell">/clear</div></td><td class="" style="width:314.5px"><div class="notion-simple-table-cell">查看token用量</div></td></tr><tr class="notion-simple-table-row notion-block-3855788abc99809eac87dded0a3a4b2d"><td class="" style="width:314.5px"><div class="notion-simple-table-cell">/review</div></td><td class="" style="width:314.5px"><div class="notion-simple-table-cell">代码审查</div></td></tr><tr class="notion-simple-table-row notion-block-3855788abc99804f9b7bdf4132d66ee2"><td class="" style="width:314.5px"><div class="notion-simple-table-cell">/plan</div></td><td class="" style="width:314.5px"><div class="notion-simple-table-cell">进入规划模式</div></td></tr><tr class="notion-simple-table-row notion-block-3855788abc99802cb503feb842557f60"><td class="" style="width:314.5px"><div class="notion-simple-table-cell">/memory</div></td><td class="" style="width:314.5px"><div class="notion-simple-table-cell">编辑CLAUDE.md</div></td></tr><tr class="notion-simple-table-row notion-block-3855788abc998020b511e04f94e710b2"><td class="" style="width:314.5px"><div class="notion-simple-table-cell">/exit(或Ctrl+D)</div></td><td class="" style="width:314.5px"><div class="notion-simple-table-cell">退出</div></td></tr></tbody></table><div class="notion-callout notion-gray_background_co notion-block-3855788abc99804cb2b3e8774c04f2a9"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-3855788abc99801ab948f55f4f54e195">超级实用：在一次对话后你对本次对话的修改不满意可以双击“ESC”键可以将对话或修改退回到上次对话的状态。</div></div></div></div></details><div class="notion-callout notion-gray_background_co notion-block-3855788abc998053984ecaed10b2b100"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-3855788abc9980c79f9cd2cfbbb600ad">想了解更多Claude code使用技巧可以访问一下以下网站。</div><div class="notion-row"><a class="notion-bookmark notion-block-3855788abc9980749376dff09fc063df" href="https://www.runoob.com/claude-code/claude-code-tutorial.html" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">Claude Code 教程 | 菜鸟教程</div><div class="notion-bookmark-description">Claude Code 教程    Claude Code 是 Anthropic 推出的面向开发者的 AI 编程协作工具。 Claude Code 定位不是聊天，而是在本地代码仓库中执行高权限、可上下文感知的工程任务。   Claude Code 与在聊天窗口里写几段代码不同，它理解你的整个项目，能直接读取你的文件、运行测试并根据反馈修改代码。  Claude Code 不是一个代码生成器，而是一个能读项目、懂上下文、遵守约束的 AI..</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fstatic.char123.com%2Fimages%2Ficon%2Fmobile-icon.png?table=block&amp;id=3855788a-bc99-8074-9376-dff09fc063df&amp;t=3855788a-bc99-8074-9376-dff09fc063df" alt="Claude Code 教程 | 菜鸟教程" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://www.runoob.com/claude-code/claude-code-tutorial.html</div></div></div></a></div></div></div></div></details><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-7553a94abf9e42b48ec9ce1c0c299f72" data-id="7553a94abf9e42b48ec9ce1c0c299f72"><span><div id="7553a94abf9e42b48ec9ce1c0c299f72" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7553a94abf9e42b48ec9ce1c0c299f72" title="3.2 国内外模型选择（2026年6月 AA Quality Index 排行榜）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2 国内外模型选择（2026年6月 AA Quality Index 排行榜）</span></span></h3><div class="notion-text notion-block-53d0a7464ba6410fbf51703f8e9a562d">本数据来自 DataLearnerAI AA Quality Index（人工智能质量指数）综合排行榜（2026-06-13 数据版本），综合10项权威评测基准（GDPval-AA、Terminal-Bench、GPQA Diamond、SciCode等），从数学、科学、编程、推理等多维度对AI模型进行全面评估，共212个模型。</div><div class="notion-row"><a class="notion-bookmark notion-block-3885788abc9980f0a75eee10aae59653" href="https://www.datalearner.com/leaderboards/external/aa-quality-index" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">Artificial Analysis Intelligence Index - AI模型智能指数排行榜 | DataLearnerAI</div><div class="notion-bookmark-description">AI智能指数排行榜：基于10项评测比较190+模型综合能力。</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fwww.datalearner.com%2Fdl_logo_rect.webp?table=block&amp;id=3885788a-bc99-80f0-a75e-ee10aae59653&amp;t=3885788a-bc99-80f0-a75e-ee10aae59653" alt="Artificial Analysis Intelligence Index - AI模型智能指数排行榜 | DataLearnerAI" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://www.datalearner.com/leaderboards/external/aa-quality-index</div></div></div></a></div><div class="notion-callout notion-block-935a0e992e784f18849e21da4c84ae13"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-ae436e7d19c3480aaaada48e3aca74ef"><b>选型建议：</b></div><div class="notion-text notion-block-b8d388f3cf6646ba891dbda10ea45fd9">代码能力最强的当属 <b>Claude Fable 5</b>，以 95% SWE-bench 得分 + LMArena 编程 Elo 1566 占据双料冠军位置，但需要中转服务才能使用。</div><div class="notion-text notion-block-09759ea1377d46edb0e321da2810f7e7">国内用户首选 <b>DeepSeek-V4-Pro</b>（80.6% 开源最强，$0.2/M 极致低价，1M token 上下文）或 6 月新发的 <b>MiniMax M3</b>（70%，同样 100 万上下文）。日常对话用 <b>DeepSeek V4 Flash</b>（比 Pro 更便宜），复杂脚本生成切到 Claude。</div><div class="notion-text notion-block-bc6c87c1f58e41f38f9f551f0a9a7356">注意中转服务（如 GeekAI、API2D）会有一定加价，但省去了海外 API 直连的网络问题。如果不方便用海外模型，DeepSeek-V4 系列和 GLM 5.1 都能写出可用的 MAXScript。</div></div></div><hr class="notion-hr notion-block-56fcafba73164b0692b4d52a52e085bb"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-401247802d884549bb4e8a8e0cd9d4ce" data-id="401247802d884549bb4e8a8e0cd9d4ce"><span><div id="401247802d884549bb4e8a8e0cd9d4ce" class="notion-header-anchor"></div><a class="notion-hash-link" href="#401247802d884549bb4e8a8e0cd9d4ce" title="4. 使用 AI 工具的发展阶段"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4. 使用 AI 工具的发展阶段</span></span></h2><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-af3b4acf67514020b300a03acf656d4e" data-id="af3b4acf67514020b300a03acf656d4e"><span><div id="af3b4acf67514020b300a03acf656d4e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#af3b4acf67514020b300a03acf656d4e" title="4.1 提示词工程（Prompt Engineering）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.1 提示词工程（Prompt Engineering）</span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3855788abc9981278045d55d8e583561"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/vibe-coding-max-script/03-1-prompt-engineering.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3855788a-bc99-8127-8045-d55d8e583561" alt="提示词工程工作流" loading="lazy" decoding="async"/><figcaption class="notion-asset-caption">提示词工程工作流</figcaption></div></figure><div class="notion-text notion-block-0db2d375de634f64a6a30e07521180ad">这是 Vibe Coding 的第一阶段——<b>学会问问题</b>。</div><div class="notion-text notion-block-588e3e4a6cec43b88f89a7bd16921aa8">很多新手第一次用 AI 写 MAXScript 会说：</div><blockquote class="notion-quote notion-block-0ce22d405c3340ba97d1f0a4fa5fcd72"><div>❌「帮我写个脚本」</div></blockquote><div class="notion-text notion-block-cfd86fade5c0420dabddcf0671919a35">这种问题太模糊，AI 不知道你要什么。好的提示词应该包含：</div><div class="notion-callout notion-block-e165e9ebe18f48f89daa1677ddda69cd"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-7e862271755242bbbd797167429331e0"><b>提示词的核心公式：</b></div><div class="notion-text notion-block-fd272d9fea9d48e2bd6f0a057f15836a">角色（你是谁） + 任务（做什么） + 输入（有什么） + 输出（给什么） + 约束（注意事项）</div><div class="notion-text notion-block-ee9085f90dff47fc9d5d41bcf7d63c96">这五要素每多一个，AI 的输出质量就上一个台阶。</div></div></div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-b42f32069ff540ff9826c6b1055b17ac" data-id="b42f32069ff540ff9826c6b1055b17ac"><span><div id="b42f32069ff540ff9826c6b1055b17ac" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b42f32069ff540ff9826c6b1055b17ac" title="4.2 上下文工程（Context Engineering）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.2 上下文工程（Context Engineering）</span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3855788abc9981159998cdd9153ec0bf"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/vibe-coding-max-script/03-2-context-engineering.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3855788a-bc99-8115-9998-cdd9153ec0bf" alt="上下文工程：给AI喂对的材料" loading="lazy" decoding="async"/><figcaption class="notion-asset-caption">上下文工程：给AI喂对的材料</figcaption></div></figure><div class="notion-text notion-block-75911d3e1b1449e7a44dc17fa5e1bdef">第二阶段——<b>给 AI 喂对的材料</b>。</div><div class="notion-text notion-block-c72c5f931bca42dd8ce643cc872aa6e6">AI 不知道你的项目环境、不知道你用的是哪个版本的 3ds Max、不知道你有哪些已经写好的工具函数。<b>你需要告诉它。</b></div><div class="notion-text notion-block-335bfdba1ebc478296351145642ffdc7">实际做法：</div><ul class="notion-list notion-list-disc notion-block-4f0cca3fe7254ae2a26f3cd6224cbbac"><li>在项目根目录放一个 <code class="notion-inline-code">CONTEXT.md</code>，写明项目基本信息</li></ul><ul class="notion-list notion-list-disc notion-block-81b3326a48b24531b25a42a65bb67a83"><li>在 AI IDE 的 Rules 里写好固定上下文</li></ul><ul class="notion-list notion-list-disc notion-block-3d28babc4903459b88db31cec3c52eb8"><li>每次问问题前，先粘贴相关代码给 AI 看</li></ul><details class="notion-toggle notion-block-9d3f6844a7f54334b2aa36fbdb584102"><summary><b>MAXScript 项目 </b><b><a class="notion-link" href="http://CONTEXT.md" target="_blank" rel="noopener noreferrer">CONTEXT.md</a></b><b> 示例</b></summary><div></div></details><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-9b307799324a47d3a15e413aa8939b7c" data-id="9b307799324a47d3a15e413aa8939b7c"><span><div id="9b307799324a47d3a15e413aa8939b7c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9b307799324a47d3a15e413aa8939b7c" title="4.3 驾驭工程（Harness Engineering）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.3 驾驭工程（Harness Engineering）</span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3855788abc998164b729e89f73535fd5"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/vibe-coding-max-script/03-3-harness-engineering.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3855788a-bc99-8164-b729-e89f73535fd5" alt="驾驭工程：给AI装方向盘和刹车" loading="lazy" decoding="async"/><figcaption class="notion-asset-caption">驾驭工程：给AI装方向盘和刹车</figcaption></div></figure><div class="notion-text notion-block-150cb5de8603459c97955ef6410e519c">第三阶段——<b>给 AI 装「方向盘」和「刹车」</b>。</div><div class="notion-text notion-block-2c0b2a76970a42ffb8f55e6cadafa5db">AI 生成的代码不一定是对的，尤其是 MAXScript——3ds Max 的 API 版本差异很大，AI 偶尔会生成过时的 API 调用。你需要驾驭它：</div><ul class="notion-list notion-list-disc notion-block-178ede0751d84c618f61f998c6cc9b29"><li><b>方向控制：</b> 用 Rules / Instructions / Skill 限定 AI 的行为边界</li></ul><ul class="notion-list notion-list-disc notion-block-433568a9fe364fcb89fda1764e4a7c0d"><li><b>安全护栏：</b> 涉及文件操作、批量删除、场景修改的脚本，第一次别直接跑，先看一遍代码</li></ul><ul class="notion-list notion-list-disc notion-block-47224d4b952d4490ba20320aa180bfa9"><li><b>增量验证：</b> 让 AI 分步骤生成脚本，每步都测试，不要一次性生成 500 行代码然后全崩</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-9a72a233c10d4556b4bde916db4a7467" data-id="9a72a233c10d4556b4bde916db4a7467"><span><div id="9a72a233c10d4556b4bde916db4a7467" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9a72a233c10d4556b4bde916db4a7467" title="4.4 循环工程（Loop Engineering）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.4 循环工程（Loop Engineering）</span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3855788abc99810d98c5f1a40c3d4ded"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/vibe-coding-max-script/03-4-loop-engineering.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3855788a-bc99-810d-98c5-f1a40c3d4ded" alt="循环工程：让AI进入自我迭代循环" loading="lazy" decoding="async"/><figcaption class="notion-asset-caption">循环工程：让AI进入自我迭代循环</figcaption></div></figure><div class="notion-text notion-block-ad16b315e4df49808cee5dac301ed3ac">最终阶段——<b>让 AI 进入自我迭代的循环</b>。</div><div class="notion-text notion-block-3238e5013d194f5d9cd560106a6e1ad2">到了这个阶段，你不是在跟 AI 对话，而是在建立一个循环：</div><blockquote class="notion-quote notion-block-761f3e99b72d47c68b7f895c33679e5e"><div><b>描述 → 生成 → 测试 → 反馈 → 修正 → 测试 → 发布</b></div></blockquote><details class="notion-toggle notion-block-c79a4c66ecf84d6a860a22b1b13318aa"><summary><b>循环工程的实际工作流</b></summary><div></div></details><hr class="notion-hr notion-block-1ff3ef8461da432fa0a8acb11745b4f3"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-62f87d57ec194c54bb5b8bb805e37983" data-id="62f87d57ec194c54bb5b8bb805e37983"><span><div id="62f87d57ec194c54bb5b8bb805e37983" class="notion-header-anchor"></div><a class="notion-hash-link" href="#62f87d57ec194c54bb5b8bb805e37983" title="5. 进阶工作流：综合运用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5. 进阶工作流：综合运用</span></span></h3><div class="notion-text notion-block-207289c107824584a097e726e9af6aa7">将前面所有知识点串联起来，形成完整的 Vibe Coding + MAXScript 工作流：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3855788abc99810683c7dc2a709aa08e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/vibe-coding-max-script/04-workflow.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3855788a-bc99-8106-83c7-dc2a709aa08e" alt="Vibe Coding + MAXScript 完整工作流" loading="lazy" decoding="async"/><figcaption class="notion-asset-caption">Vibe Coding + MAXScript 完整工作流</figcaption></div></figure><div class="notion-callout notion-block-5f4c962b459749c48a3e236c5ee4eb61"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-70210ee9cfec4cc1ae3031575e763346"><b>核心原则：</b> 每次完成的脚本都放入 <code class="notion-inline-code">_references/</code> 知识库，下次同类型任务 RAG 就能直接参考，形成<b>越用越顺</b>的正循环。</div></div></div><hr class="notion-hr notion-block-6190df55394f40d9ac25a192b0f0c275"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-d3112a47188642c7b2ec487d0cc830ae" data-id="d3112a47188642c7b2ec487d0cc830ae"><span><div id="d3112a47188642c7b2ec487d0cc830ae" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d3112a47188642c7b2ec487d0cc830ae" title="总结"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">总结</span></span></h3><div class="notion-text notion-block-46e10f8c09d14cf3bb7ff1f62a90a98f">Vibe Coding 不是「编程的终结」，而是<b>编程的民主化</b>。对于 MAXScript 这种小众但实用的脚本语言来说，Vibe Coding 的价值格外明显——你不用再花费大量时间翻找零散的官方文档，而是用自然语言直达目标。</div><div class="notion-text notion-block-b6d19ee1339e4f50b9de109e75753b5f"><b>从本文学到的技能栈：</b></div><ol start="1" class="notion-list notion-list-numbered notion-block-5b29cf84ff9f48d7871dcedd35c35a95" style="list-style-type:decimal"><li>✅ 选对工具和模型（IDE + 模型配置，数据来源 DataLearnerAI 2026-06-17）</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-49b47966a5cc4831954e255346dacef7" style="list-style-type:decimal"><li>✅ 理解基础概念（Token、上下文、缓存）</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-ad9ba921d31b4f19a9c7e8c8255a0212" style="list-style-type:decimal"><li>✅ 用 RAG 让 AI 学习你的代码风格</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-a0d4c439c1914a08bb8b887c7c78707b" style="list-style-type:decimal"><li>✅ 用 Agent 模式处理复杂多步任务</li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-db2f5d1cc4bc4814a153b474264253cb" style="list-style-type:decimal"><li>✅ 用模板避免每次从零写 prompt</li></ol><ol start="6" class="notion-list notion-list-numbered notion-block-15884c567db5444da0d087ca8a1031bd" style="list-style-type:decimal"><li>✅ 用代码审查保证输出质量</li></ol><ol start="7" class="notion-list notion-list-numbered notion-block-09d1b8c47c67496195b3f13ddaca1f88" style="list-style-type:decimal"><li>✅ 用循环工程迭代到满意</li></ol><div class="notion-text notion-block-7fc0974a73124f90a05bdc534f8378c7">从提示词工程到循环工程，你会经历四个阶段。<b>不需要一口气全部掌握</b>——先从 3.1 的提示词公式开始，写几个简单的脚本找找感觉，慢慢地你就会发现自己已经进入了循环工程的模式。</div><div class="notion-callout notion-block-8a48f7c51b894fd2ba8a659891c6615c"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-db7a6edf634f4fa8b064d3dd98f7c02d"><b>最后的一句话：</b></div><div class="notion-text notion-block-38d41d70b90047c4bd822243cc2b86a0">AI 写的 MAXScript <b>不一定一次就对</b>，但让 AI <b>修三次</b>之后，大概率就对了。这是 Vibe Coding 最核心的思维转变——<b>不追求一次完美，追求快速迭代。</b></div></div></div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[非真实感渲染（NPR）管线拆解：从卡通着色到风格化笔触 ]]></title>
            <link>玻璃小屋.cn/article/npr-rendering-pipeline</link>
            <guid>玻璃小屋.cn/article/npr-rendering-pipeline</guid>
            <pubDate>Thu, 11 Jun 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[从塞尔达到原神，NPR 风格游戏背后的渲染管线到底怎么工作？本文手拆四道核心工序：漫反射量化、边缘描边、高光风格化、后期合成，附完整 GLSL 代码。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-37c5788abc9981fa84b3fcba948267a4"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-53b69177e9964257922182bd08b8c43d" data-id="53b69177e9964257922182bd08b8c43d"><span><div id="53b69177e9964257922182bd08b8c43d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#53b69177e9964257922182bd08b8c43d" title="非真实感渲染（NPR）管线拆解：从卡通着色到风格化笔触"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">非真实感渲染（NPR）管线拆解：从卡通着色到风格化笔触</span></span></h2><blockquote class="notion-quote notion-block-a5fee178f8494e379898af41a631445f"><div>你以为塞尔达的卡通感是&quot;画&quot;出来的？不，那是一套精心设计的渲染管线。本文带你手拆 NPR 四道核心工序。</div></blockquote><div class="notion-callout notion-block-37c5788abc998163a2d9fd56980082ef"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="📌">📌</span></div><div class="notion-callout-text">🏷️ 本文特色：四道工序逐层拆解 · 完整 GLSL 着色器代码 · 6 个术语 Toggle 解释（从零开始）· 8 张对比速查表 · 初学者友好，无需 NPR 基础</div></div><div class="notion-callout notion-blue_background_co notion-block-dcf60da3e060401891b694aefd729686"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-6b69a19a09914be6b50c9d31c5e573d8">写作假设（由 AI 推断）</div><ul class="notion-list notion-list-disc notion-block-6f39ea476cd945cba5f9a76bc098c5d8"><li>目标读者：学过基础图形学（了解标准渲染管线），但没系统学过 NPR</li></ul><ul class="notion-list notion-list-disc notion-block-d6d296168e3242dfb72fb23884396531"><li>前置知识：熟悉法线、漫反射光照、后期处理的基本概念</li></ul><ul class="notion-list notion-list-disc notion-block-bd16f0e6db5e48bdad2d1bf814e8c89d"><li>读完能：理解 NPR 的核心技术模块，能在 GLSL 中实现卡通着色 + 描边</li></ul><ul class="notion-list notion-list-disc notion-block-3658bec3a0ef46368cc00ed06fab3a70"><li>本文不会深究：PBR、次表面散射、高级 NPR（水彩/油画风格）</li></ul></div></div><div class="notion-callout notion-blue_background_co notion-block-18cfb216bbc04bcf8f0bd433074c8491"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-08ece7c6814343809c8e7c69f5f4890b">先说结论</div><div class="notion-text notion-block-f0117fe80c134c619bec06e060dcd84a">NPR（Non-Photorealistic Rendering）不是一种技术，而是一套可自由组合的「风格工具箱」。它的核心思路是：丢掉「越真实越好」的执念，用渲染技术模仿艺术风格。标准的 NPR 管线由四道工序串联而成：漫反射量化 → 边缘描边 → 高光风格化 → 后期合成。</div></div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-84a16a716d8045a9b1c7d2bc5663b5da" data-id="84a16a716d8045a9b1c7d2bc5663b5da"><span><div id="84a16a716d8045a9b1c7d2bc5663b5da" class="notion-header-anchor"></div><a class="notion-hash-link" href="#84a16a716d8045a9b1c7d2bc5663b5da" title="为什么你需要理解 NPR"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">为什么你需要理解 NPR</span></span></h3><div class="notion-text notion-block-f2321d8bd3144ac5b1d206de09e6f010">你可能没意识到，近几年最火的游戏几乎都在用 NPR：</div><ul class="notion-list notion-list-disc notion-block-7ce7005abd20410aae140245fa29a606"><li><b>《塞尔达传说：旷野之息》</b>——用低饱和色阶 + 水彩描边创造冒险感</li></ul><ul class="notion-list notion-list-disc notion-block-a73b0cff8b0b44a0a16b00daf02ffa5b"><li><b>《原神》</b>——经典的二次元 Toon Shading，角色面部特调光照</li></ul><ul class="notion-list notion-list-disc notion-block-af9e6a6f48f1403ea6bf5eb6a9b08517"><li><b>《无主之地》</b>——粗黑描边 + 纯色填充 + 美式漫画质感</li></ul><ul class="notion-list notion-list-disc notion-block-c018d8e2d2a54da4ac87dd885a1fdca8"><li><b>《罪恶装备：斗争》</b>——三渲二天花板，完全模仿 2D 手绘动画</li></ul><details class="notion-toggle notion-block-935010b5f35d460381642bd9b8c7c3a0"><summary>Toggle: 什么是「非真实感渲染（NPR）」？</summary><div><div class="notion-text notion-block-6cf38420aa134405b52264781fa7dd6a">NPR 全称 Non-Photorealistic Rendering，直译就是「非照片级真实感渲染」。</div><div class="notion-text notion-block-bdf7580c897f41f989fc27e503e54c31">大白话说：真实感渲染的目标是「像照片一样真实」；NPR 的目标是「像画一样好看」。</div><div class="notion-text notion-block-6c35498355924a558df6fdb241486021">在这篇文章里，你只需要知道：NPR 是一个技术统称，卡通着色（Toon Shading / Cel Shading）是它最主流的分支。</div></div></details><details class="notion-toggle notion-block-0b62085e303b4aca9a4fa68964a4a692"><summary>Toggle: 什么是「渲染管线」？</summary><div><div class="notion-text notion-block-8aae5dfab29f4b97a5eaa7171d62e46f">渲染管线就是把 3D 模型变成 2D 屏幕图像的一整套流水工序。</div><div class="notion-text notion-block-c21618c606694fc9b7a6fe8b0b0f9251">就像做一道菜：备菜 → 下锅 → 调味 → 装盘。</div><div class="notion-text notion-block-5778f16ba2e2421391927bb802c0058f">渲染管线也是：顶点处理 → 光栅化 → 片段着色 → 后期处理。</div></div></details><div class="notion-text notion-block-c44205e6525240249b3abeef8d901d9e">NPR 还有一个特别的优势：<b>越老越耐看</b>。2017 年的《塞尔达》今天看依然惊艳，而 2017 年的写实游戏可能已经过时了——因为风格本身就是艺术，不受硬件代际限制。</div><hr class="notion-hr notion-block-bd2a9d94a6ad483ead453d5d4f70612b"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-608fc83691cb48cca5bcfa61f44b1d28" data-id="608fc83691cb48cca5bcfa61f44b1d28"><span><div id="608fc83691cb48cca5bcfa61f44b1d28" class="notion-header-anchor"></div><a class="notion-hash-link" href="#608fc83691cb48cca5bcfa61f44b1d28" title="从零开始：NPR 到底在做什么？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">从零开始：NPR 到底在做什么？</span></span></h3><div class="notion-text notion-block-9e4f6720ac154f448c48c11ab7ecc6b3">先看一个直观对比：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3815788abc99817cbf72e477f3e251cb"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/npr-rendering-pipeline/01-npr-vs-pbr.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3815788a-bc99-817c-bf72-e477f3e251cb" alt="notion image" loading="lazy" decoding="async"/></div></figure><table class="notion-simple-table notion-block-4ff5a633584e42f4839f51190e6ace5f"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-af523827af05485ebb08fbfdb8d6681a"><td class="" style="width:120px"><div class="notion-simple-table-cell">维度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">真实感渲染</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">NPR 非真实感渲染</div></td></tr><tr class="notion-simple-table-row notion-block-77c553bbe563432ca8da757d5a6cb26c"><td class="" style="width:120px"><div class="notion-simple-table-cell">最终目标</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">像照片</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">像画/动画/漫画</div></td></tr><tr class="notion-simple-table-row notion-block-47abae2b7c7b4f4b97feffb2323e5a1a"><td class="" style="width:120px"><div class="notion-simple-table-cell">漫反射</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">连续平滑过渡</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">阶梯式色块</div></td></tr><tr class="notion-simple-table-row notion-block-1b10890398c54fa19e0ada7d25991af3"><td class="" style="width:120px"><div class="notion-simple-table-cell">边缘</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">自然过渡</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">刻意描边</div></td></tr><tr class="notion-simple-table-row notion-block-6c6f076c81f34cbe91adf6dcf2a4dc85"><td class="" style="width:120px"><div class="notion-simple-table-cell">高光</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">物理精确</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">风格化裁切</div></td></tr><tr class="notion-simple-table-row notion-block-422f876ace824d7586ada182f154f20a"><td class="" style="width:120px"><div class="notion-simple-table-cell">阴影</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">软阴影模拟</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">硬边色块</div></td></tr><tr class="notion-simple-table-row notion-block-9a966bc87c4b4fed91bda144cf013dcd"><td class="" style="width:120px"><div class="notion-simple-table-cell">代表应用</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">3A 写实游戏、影视 VFX</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">二次元游戏、独立游戏、插画</div></td></tr></tbody></table><div class="notion-text notion-block-6579844fb26b47dc9949cf1043d95ade">NPR 的核心理念其实就一句话：</div><div class="notion-callout notion-blue_background_co notion-block-57f020df8e23458f867eed9f29060420"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-4698734778734455ad7efaeda0c2e52a">真实感渲染忠实模拟物理世界；NPR 忠实模拟艺术家的视觉表达。</div></div></div><div class="notion-text notion-block-e7afc6976ce244d584d7e0508c0ecbc5">下面我们逐道工序拆解 NPR 管线。</div><hr class="notion-hr notion-block-f49831700fdd44ca8b57a9f5d7344ef4"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-9d3a99f86c2345c0a51c64e7f673fe38" data-id="9d3a99f86c2345c0a51c64e7f673fe38"><span><div id="9d3a99f86c2345c0a51c64e7f673fe38" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9d3a99f86c2345c0a51c64e7f673fe38" title="第一道工序：漫反射量化（Diffuse Quantization）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">第一道工序：漫反射量化（Diffuse Quantization）</span></span></h3><div class="notion-text notion-block-a5031dc46b194a88a01bee4bfd1719f3">这是 NPR 最标志性的效果——<b>把连续的漫反射亮度「砍」成几个固定色阶</b>。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3815788abc99817da66dcccfac554631"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/npr-rendering-pipeline/02-diffuse-quantization.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3815788a-bc99-817d-a66d-cccfac554631" alt="notion image" loading="lazy" decoding="async"/></div></figure><details class="notion-toggle notion-block-42d4ab298dfc43c3815d48f530ee07f3"><summary>Toggle: 什么是「漫反射量化」？</summary><div><div class="notion-text notion-block-776746915df145cab7af75be47710a20">还记得兰伯特光照模型吗？$I = k_d times I_{light} times max(0, mathbf{N} cdot mathbf{L})$</div><div class="notion-text notion-block-e195debc2463448da55f58243173a8db">正常渲染中，$mathbf{N} cdot mathbf{L}$ 是 0 到 1 之间的连续值，产生平滑渐变。</div><div class="notion-text notion-block-b6d26cbb5cfa4198a0393de4689d51ee">漫反射量化就是用阶梯函数把连续值映射到几个离散值上——结果就是卡通感十足的硬边色块。</div></div></details><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-7f13262164b4425c8763684a4b24ceca" data-id="7f13262164b4425c8763684a4b24ceca"><span><div id="7f13262164b4425c8763684a4b24ceca" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7f13262164b4425c8763684a4b24ceca" title="核心数学"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">核心数学</span></span></h4><div class="notion-text notion-block-f3b0f1b9892947f1ab8b858d8992ddd6">标准兰伯特漫反射：</div><span role="button" tabindex="0" class="notion-equation notion-equation-block"><span></span></span><div class="notion-text notion-block-04bd198ac6aa476287645e00b69f6480">卡通着色漫反射：</div><span role="button" tabindex="0" class="notion-equation notion-equation-block"><span></span></span><div class="notion-text notion-block-28853773b33648b9936d256b056f099a">其中 <span role="button" tabindex="0" class="notion-equation notion-equation-inline"><span></span></span> 是一个<b>阶梯函数</b>，把连续值 <span role="button" tabindex="0" class="notion-equation notion-equation-inline"><span></span></span> 映射到几个固定区间：</div><span role="button" tabindex="0" class="notion-equation notion-equation-block"><span></span></span><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-926b869871ee490f94b7a48940329d6f" data-id="926b869871ee490f94b7a48940329d6f"><span><div id="926b869871ee490f94b7a48940329d6f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#926b869871ee490f94b7a48940329d6f" title="三种主流量化方式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三种主流量化方式</span></span></h4><table class="notion-simple-table notion-block-0bac6799c7ac4f58894e5c5cc28b8ee6"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-1352b8f8ed2c41d98f8a801492e8e366"><td class="" style="width:120px"><div class="notion-simple-table-cell">方式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">实现方法</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">优点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">缺点</div></td></tr><tr class="notion-simple-table-row notion-block-db1ab0531e4647c794797196bc357d50"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>硬阶梯（Step）</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><span role="button" tabindex="0" class="notion-equation notion-equation-inline"><span></span></span></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">性能最好，1 行代码</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">色阶过渡不均匀</div></td></tr><tr class="notion-simple-table-row notion-block-56e985bcd1a341a49b5221b2c638b4e3"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>软阶梯（Smooth Step）</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><span role="button" tabindex="0" class="notion-equation notion-equation-inline"><span></span></span></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">色阶边缘柔和一点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">需要查表</div></td></tr><tr class="notion-simple-table-row notion-block-67b730ab9e5f4ea7822d5c3303e07d86"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>纹理采样</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">用 1D 纹理存储色阶映射</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">最灵活，可调</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">多一次纹理采样</div></td></tr></tbody></table><div class="notion-text notion-block-4e044da5128d4ad583b9e11f0b6ed8e3">如果 LEVELS = 3，亮度被切成 3 档：</div><table class="notion-simple-table notion-block-b3834631f50a4a6d99eb4bcaff375dfb"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-d1a72d47121c4f9aa0092801cd2e6ce7"><td class="" style="width:303px"><div class="notion-simple-table-cell">ndotl 范围</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">toonLight</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">亮度</div></td></tr><tr class="notion-simple-table-row notion-block-f6160d3e739343a7b04f7793956ad75c"><td class="" style="width:303px"><div class="notion-simple-table-cell">0.00 ~ 0.33</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">0.0</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">暗部（纯环境光）</div></td></tr><tr class="notion-simple-table-row notion-block-150508396a994bff947692c61d70a9b4"><td class="" style="width:303px"><div class="notion-simple-table-cell">0.33 ~ 0.66</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">0.33</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">中间调</div></td></tr><tr class="notion-simple-table-row notion-block-5c2f58c3d83c4d19852aa9b82dd46fc9"><td class="" style="width:303px"><div class="notion-simple-table-cell">0.66 ~ 1.00</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">0.66</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">亮部</div></td></tr></tbody></table><div class="notion-callout notion-blue_background_co notion-block-e76b9fa6e59c46cd812f3a44bccccc9f"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-dc54f18426854d829409ad9cac68eaf9">一句话总结：色阶数量越少，卡通感越强。LEVELS = 2 是极简平面风，LEVELS = 4~5 是原神风，LEVELS &gt; 8 就接近真实渲染了。</div></div></div><hr class="notion-hr notion-block-60feb23d1ee84871b3a1944bc41ab704"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-f2639c32e29b4df8acd55ea749c35a4a" data-id="f2639c32e29b4df8acd55ea749c35a4a"><span><div id="f2639c32e29b4df8acd55ea749c35a4a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f2639c32e29b4df8acd55ea749c35a4a" title="第二道工序：边缘检测与描边（Edge Detection &amp; Outline）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">第二道工序：边缘检测与描边（Edge Detection &amp; Outline）</span></span></h3><details class="notion-toggle notion-block-452cd103044749d6a4eb89c834c10216"><summary>Toggle: 什么是「边缘检测」？</summary><div><div class="notion-text notion-block-7d3f0a880e4a4b4891488b698a0df3bf">边缘检测就是找到 3D 物体轮廓在屏幕上对应的像素位置，然后把它们涂成黑色（或其他颜色）。</div><div class="notion-text notion-block-468103ec62fc4e81b95812fe36ef89a7">类似漫画里的墨线——把角色的轮廓勾出来，增强画面的手绘感。</div></div></details><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-1bf72f2cb8f946009d1d739edae29536" data-id="1bf72f2cb8f946009d1d739edae29536"><span><div id="1bf72f2cb8f946009d1d739edae29536" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1bf72f2cb8f946009d1d739edae29536" title="三种主流描边方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三种主流描边方法</span></span></h4><table class="notion-simple-table notion-block-f1f707cde85048dca1bf88c2081146a6"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-69be5ab1be3745beb52091ad4e31daa4"><td class="" style="width:120px"><div class="notion-simple-table-cell">方法</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">原理</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">性能</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">效果</div></td></tr><tr class="notion-simple-table-row notion-block-58137e041aa8430eb6750806f594bd84"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>法线外扩描边</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">背面剔除后沿法线向外偏移顶点，渲染纯色</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">⭐⭐⭐ 单次 Pass</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">轮廓线均匀，最常用</div></td></tr><tr class="notion-simple-table-row notion-block-443d9ac260e2485da40f513ed06eb334"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>深度/法线边缘检测</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">后处理中用 Sobel 算子检测深度/法线跳跃</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">⭐⭐⭐⭐ 单 Pass</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">检测所有内边缘，但依赖参数调优</div></td></tr><tr class="notion-simple-table-row notion-block-663ba9174e3740689dda1a262618edb9"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>图像边缘检测</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">对最终画面用 Canny/Sobel</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">⭐⭐⭐⭐⭐ 快</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">只能检测颜色剧烈变化处</div></td></tr></tbody></table><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-3aea6e003af24f648fca7dd6b4c064b8" data-id="3aea6e003af24f648fca7dd6b4c064b8"><span><div id="3aea6e003af24f648fca7dd6b4c064b8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3aea6e003af24f648fca7dd6b4c064b8" title="法线外扩描边（最常用方案）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">法线外扩描边（最常用方案）</span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3815788abc9981ca8bb0d21d26b04ea1"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/npr-rendering-pipeline/03-normal-extrusion.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3815788a-bc99-81ca-8bb0-d21d26b04ea1" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-f7cefea88d024fb9974ffcab262fc8ec">这是<b>绝大多数卡通游戏</b>使用的方案。它分两步走：</div><div class="notion-callout notion-block-9c119e5af993430cacfcaed7ba3bf4d0"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="📝">📝</span></div><div class="notion-callout-text"><div class="notion-text notion-block-cabe121f75564282a7fa1563ee66af7d">第一步：渲染背面，沿法线方向外扩顶点 → 比原模型大一圈</div><div class="notion-text notion-block-37c5788abc9981869ba1eaa063133cac">第一步：渲染背面，沿法线方向外扩顶点 → 比原模型大一圈</div><div class="notion-text notion-block-37c5788abc99818f8a19d5980cc0e8e7">第二步：把外扩后的背面涂成黑色 → 看起来就像描了一圈边</div><div class="notion-text notion-block-37c5788abc9981bebdb5e23feef8d711">第三步：正常渲染正面 → 描边效果完成！</div></div></div><div class="notion-callout notion-block-7f9d4edb47e84cc099b66f1cff4e4e27"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-f696e34ef76e422684a38449c96196f0">常见陷阱：硬边缘（如立方体棱角）外扩后会产生断裂。解决方案是：用顶点法线平均值代替面法线，或者对法线做平滑预处理。</div></div></div><hr class="notion-hr notion-block-2ea4f6d157314be582053102d5ca22f2"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-5a040fe723f1450b9c94e8330ebe1a37" data-id="5a040fe723f1450b9c94e8330ebe1a37"><span><div id="5a040fe723f1450b9c94e8330ebe1a37" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5a040fe723f1450b9c94e8330ebe1a37" title="第三道工序：高光风格化（Specular Stylization）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">第三道工序：高光风格化（Specular Stylization）</span></span></h3><div class="notion-text notion-block-4a44461ef8e848a88e3c895d098099f0">真实感渲染的高光追求物理精确（Blinn-Phong、GGX），NPR 的高光追求<b>看起来像画上去的</b>。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3815788abc998129ac8dcc93cef2a702"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/npr-rendering-pipeline/04-specular-stylization.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3815788a-bc99-8129-ac8d-cc93cef2a702" alt="notion image" loading="lazy" decoding="async"/></div></figure><details class="notion-toggle notion-block-d5c1a143843d4194955b62275b043abc"><summary>Toggle: 什么是「镜面高光」？</summary><div><div class="notion-text notion-block-4be55258b8624725b4ec876b368cfebf">镜面高光是光线在光滑表面反射形成的亮斑——比如苹果上的那个小白点。</div><div class="notion-text notion-block-774a21c811964f47bd73ef36fc7b2343">在 NPR 中，高光经常被故意「修」成特定的形状：圆形、星形、或者干脆只保留最亮的那个点。</div></div></details><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-0dd49a4e00b1404eae9ed10fba4f291b" data-id="0dd49a4e00b1404eae9ed10fba4f291b"><span><div id="0dd49a4e00b1404eae9ed10fba4f291b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0dd49a4e00b1404eae9ed10fba4f291b" title="高光量化"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">高光量化</span></span></h4><div class="notion-text notion-block-162fea5ae6c845f0b78b2c430ddcaf81">和漫反射一样，NPR 的高光也做量化处理：</div><div class="notion-text notion-block-add0b58684104db29453eaf67f2c67cd">关键区别：</div><table class="notion-simple-table notion-block-9d58bb85ffae4e6783c617d7b68b64a7"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-6f4506d4980647b0b8d063c721c9a8d0"><td class="" style="width:120px"><div class="notion-simple-table-cell">特性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">真实感高光</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">NPR 高光</div></td></tr><tr class="notion-simple-table-row notion-block-074d002231e24b81a02a51a9626ff980"><td class="" style="width:120px"><div class="notion-simple-table-cell">形状</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">物理精确（GGX 尾部拖长）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">硬边圆斑或自定义形状</div></td></tr><tr class="notion-simple-table-row notion-block-258eb3d9236f4032bf319bdaef92e3a3"><td class="" style="width:120px"><div class="notion-simple-table-cell">颜色</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">白色，随入射角变化</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">纯白、或与角色配色一致</div></td></tr><tr class="notion-simple-table-row notion-block-49614aa1d8a54dbea52827cf06e48e62"><td class="" style="width:120px"><div class="notion-simple-table-cell">位置</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">视线方向影响</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">可以选择固定</div></td></tr></tbody></table><div class="notion-callout notion-blue_background_co notion-block-cffa9be4aceb40b198de75e55740c745"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-aed7ccfa5e8b471a98a3eace37d5ed59">小窍门：原神风格的角色头发高光经常做「双眼皮」效果——用阶梯函数把高光切成两段，中间留一条暗缝。</div></div></div><hr class="notion-hr notion-block-4e4083a860ad49beafa84866fc5ee15e"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-90cd9074e65e49ceb0ef587219664a7a" data-id="90cd9074e65e49ceb0ef587219664a7a"><span><div id="90cd9074e65e49ceb0ef587219664a7a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#90cd9074e65e49ceb0ef587219664a7a" title="第四道工序：后期合成（Post-Processing）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">第四道工序：后期合成（Post-Processing）</span></span></h3><div class="notion-text notion-block-a0c6db704bc74a31a0577b0ab0320c3a">前三道工序产出的是渲染帧，第四道工序做最后的风格化包装：</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-6d91eb495d1a412193cf1ace79eeea47" data-id="6d91eb495d1a412193cf1ace79eeea47"><span><div id="6d91eb495d1a412193cf1ace79eeea47" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6d91eb495d1a412193cf1ace79eeea47" title="常用后期效果"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">常用后期效果</span></span></h4><table class="notion-simple-table notion-block-5f200a589084487696ffc4c813becc24"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-da29983d79fd450a92df9069f4021e0c"><td class="" style="width:120px"><div class="notion-simple-table-cell">效果</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">实现</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">目的</div></td></tr><tr class="notion-simple-table-row notion-block-c3568c6696454757a6ca9a2a001f295b"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>色调映射调整</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">降低对比度、调低饱和度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">模仿动画的柔和调色</div></td></tr><tr class="notion-simple-table-row notion-block-0768aaedd41e42b9aed07919874f33aa"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>颜色量化</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">减少颜色数量（Posterization）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">强化卡通色块感</div></td></tr><tr class="notion-simple-table-row notion-block-4aa14552ef324979bac6537c73f7b279"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>边缘线后期</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Sobel 检测颜色/深度跳变</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">补充几何描边遗漏的细节</div></td></tr><tr class="notion-simple-table-row notion-block-80322896a158490f861190e957dffd30"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>抖动（Dithering）</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">添加噪点纹理</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">模拟纸张/胶片质感</div></td></tr><tr class="notion-simple-table-row notion-block-9ed274f7122b474f933a3a343cec2e28"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>Bloom</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">泛光效果</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">增强高光部分的发光感</div></td></tr></tbody></table><hr class="notion-hr notion-block-f8ededd5e49448169ad505d0e4f1db09"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-9a95d20c85d3420c8eb651a7ecd2f083" data-id="9a95d20c85d3420c8eb651a7ecd2f083"><span><div id="9a95d20c85d3420c8eb651a7ecd2f083" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9a95d20c85d3420c8eb651a7ecd2f083" title="完整管线组合示例"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">完整管线组合示例</span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3815788abc9981139a61d5c71eacbe00"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://cnb.cool/link_root/bolg_image/-/git/raw/main/npr-rendering-pipeline/05-complete-pipeline.png?spaceId=8662c00f-f557-4f66-b489-20e198b7ec32&amp;t=3815788a-bc99-8113-9a61-d5c71eacbe00" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-dd7fe5ec34cc499baae9b26dd1cc8a50">把四道工序串起来，就是一个可用的 NPR 着色器：</div><div class="notion-callout notion-block-8b3b861f7d37491592de02cc5e20e95d"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-26826d0455b64419a2f7094aca781d63">注意：这个着色器故意省略了第二道工序（描边）。描边需要单独一个 Pass 在顶点着色器中做法线外扩，无法和正常渲染 Pass 合并。</div></div></div><hr class="notion-hr notion-block-76832417bb8044c28c244b3352c46b03"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-28108b46f4be45e3bac61096f3a0ee7b" data-id="28108b46f4be45e3bac61096f3a0ee7b"><span><div id="28108b46f4be45e3bac61096f3a0ee7b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#28108b46f4be45e3bac61096f3a0ee7b" title="常见坑点"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">常见坑点</span></span></h3><div class="notion-callout notion-block-e9e0840ea84f404eb0f4c62ee7a7c0f2"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><ol start="1" class="notion-list notion-list-numbered notion-block-bdf164e371e044fe96f235cc61fbfae0" style="list-style-type:decimal"><li>法线归一化不能省：插值后的法线长度不是 1，不归一化会导致色阶边界歪斜</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-f0c5f93a6c5441b28500cb1ce4fc4b8c" style="list-style-type:decimal"><li>描边宽度与视口相关：屏幕分辨率变化时，固定的顶点偏移量会导致描边变粗或变细，需要用投影矩阵调整</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-beb0831b423e44139af77113125d60a9" style="list-style-type:decimal"><li>高光阈值要适配场景：亮色调场景用 step(0.5) 可能高光太多，深色场景可能太少</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-2f6941ac070143d5a12d8654f46acb05" style="list-style-type:decimal"><li>多光源问题：多个光源需要分别量化再叠加，否则卡通感会被「冲淡」</li></ol></div></div><hr class="notion-hr notion-block-cdecd958950d4aa6a3dc8b5d180f0d35"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-dffe2b51619a4bbda45277bbb30d32c7" data-id="dffe2b51619a4bbda45277bbb30d32c7"><span><div id="dffe2b51619a4bbda45277bbb30d32c7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#dffe2b51619a4bbda45277bbb30d32c7" title="进阶：NPR 风格的更多可能性"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">进阶：NPR 风格的更多可能性</span></span></h3><table class="notion-simple-table notion-block-49ba3e95a6ea46ccb3b0d628f39ff5b5"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-17d3dd9d71b34566964438abbb2772fd"><td class="" style="width:303px"><div class="notion-simple-table-cell">风格</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">核心技术</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">代表作品</div></td></tr><tr class="notion-simple-table-row notion-block-04b1cd4a46f2433687819b2bf5443614"><td class="" style="width:303px"><div class="notion-simple-table-cell"><b>卡通着色（Cel Shading）</b></div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">漫反射量化 + 法线外扩描边</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">原神、塞尔达</div></td></tr><tr class="notion-simple-table-row notion-block-2af24e850c3d45ca90ba75415e17221f"><td class="" style="width:303px"><div class="notion-simple-table-cell"><b>美式漫画</b></div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">粗黑描边 + 纯色填充 + 网点抖动</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">无主之地</div></td></tr><tr class="notion-simple-table-row notion-block-3e915746006f4e33a78ee492ee165373"><td class="" style="width:303px"><div class="notion-simple-table-cell"><b>三渲二</b></div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">面部特调光照 + 手绘修正法线</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">罪恶装备：斗争、ARC 系统</div></td></tr><tr class="notion-simple-table-row notion-block-fdeed61ce73d458ea90d60481207a2b6"><td class="" style="width:303px"><div class="notion-simple-table-cell"><b>水彩风</b></div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">颜色扩散模拟 + 纸张纹理 + 边缘湿边</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">Okami（大神）</div></td></tr><tr class="notion-simple-table-row notion-block-8f186894cbfb4873af24ecb71a000aaf"><td class="" style="width:303px"><div class="notion-simple-table-cell"><b>铅笔画</b></div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">Hatching（排线）+ 弯曲描边</div></td><td class="" style="width:303px"><div class="notion-simple-table-cell">插画风格游戏</div></td></tr></tbody></table><details class="notion-toggle notion-block-dfbbafe428b84b1d9ef36dbc6d169f3f"><summary>Toggle: 延伸阅读</summary><div><ul class="notion-list notion-list-disc notion-block-f15d42ead026425f9647f5830b3fe3ba"><li>《Real-Time Rendering》第 14 章：Non-Photorealistic Rendering</li></ul><ul class="notion-list notion-list-disc notion-block-1eb4dbb2e906476d9a5ac2e14dbe1e81"><li>LearnOpenGL - Advanced Lighting / Toon Shading 教程</li></ul><ul class="notion-list notion-list-disc notion-block-b57543751e364aa38101362ea7968878"><li>Three.js 示例：webgl_materials_toon</li></ul><ul class="notion-list notion-list-disc notion-block-e9237fe0864f443e82bb2c3699a123f6"><li>《罪恶装备 Xrd》GDC 分享：如何用 3D 技术做出 2D 手绘感觉</li></ul></div></details><hr class="notion-hr notion-block-f4d22c8ecdbe4e858353ec26f35e9ac0"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-e16f05a835434ffb88595de7f08160fb" data-id="e16f05a835434ffb88595de7f08160fb"><span><div id="e16f05a835434ffb88595de7f08160fb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#e16f05a835434ffb88595de7f08160fb" title="最后总结"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">最后总结</span></span></h3><table class="notion-simple-table notion-block-5b2fd99e81d14a24b0a66102e5468d2b"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-4e0c6858cf634075923ba828caeb57aa"><td class="" style="width:120px"><div class="notion-simple-table-cell">工序</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">技术</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">一句话</div></td></tr><tr class="notion-simple-table-row notion-block-783b46dc0fdf45d484034b59afaf8be9"><td class="" style="width:120px"><div class="notion-simple-table-cell">① 漫反射量化</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><span role="button" tabindex="0" class="notion-equation notion-equation-inline"><span></span></span></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">把连续亮度切成阶梯</div></td></tr><tr class="notion-simple-table-row notion-block-c440fdae21484477b17ef9f86d904515"><td class="" style="width:120px"><div class="notion-simple-table-cell">② 边缘描边</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">法线外扩背面渲染</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">给模型勾黑边</div></td></tr><tr class="notion-simple-table-row notion-block-d094b4beb89f496d8aab960d3aa2aef1"><td class="" style="width:120px"><div class="notion-simple-table-cell">③ 高光风格化</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">step(threshold, spec)</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">只保留最亮的高光</div></td></tr><tr class="notion-simple-table-row notion-block-9349a23c15aa43dbbacb84931c717c36"><td class="" style="width:120px"><div class="notion-simple-table-cell">④ 后期合成</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">色调映射 + 颜色量化</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">做最后的风格化包装</div></td></tr></tbody></table><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-fb113b1731e4477894bdcbed04dca976" data-id="fb113b1731e4477894bdcbed04dca976"><span><div id="fb113b1731e4477894bdcbed04dca976" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fb113b1731e4477894bdcbed04dca976" title="读完你应该能做到"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">读完你应该能做到</span></span></h4><div class="notion-to-do notion-block-33599d7fcdce41498ec5dccfb0776658"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">理解 NPR 和真实感渲染的本质区别</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-f029c465ab1a4ceb9b80091cd7385073"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">能用 GLSL 实现基础的卡通着色（漫反射量化）</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-e38e1979c6e94afdac1ea8db277bb70f"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">理解法线外扩描边的原理和局限性</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-1c4e9430583a4182968c1ea43e721d12"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">知道如何用后期处理强化卡通风格</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-5b97e5c863bf4b3aaeb4b7ef679905d5"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">能说出至少三种 NPR 风格及其代表性游戏</div></div><div class="notion-to-do-children"></div></div><div class="notion-callout notion-block-c292da06a5974e5fbe34392630d4da74"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="📝">📝</span></div><div class="notion-callout-text"><div class="notion-text notion-block-9da45416e8b941f881bffd98f001da31">参考：Wikipedia - Non-photorealistic rendering | LearnOpenGL - Advanced Lighting | Three.js Toon Shading Example</div></div></div><div class="notion-blank notion-block-37c5788abc99809cb97ed9f730256aa2"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[在阿里云上部署ai绘画]]></title>
            <link>玻璃小屋.cn/article/example-4</link>
            <guid>玻璃小屋.cn/article/example-4</guid>
            <pubDate>Fri, 02 Jul 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[sd绘画在linux服务器部署教程]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-51a4fb01061c42b8993f0b55716e8406"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-gray_background_co notion-block-9066b7c9e76841be9b593fbefef807e0"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="😀">😀</span></div><div class="notion-callout-text">前言：
- 你是否还在为使用ai绘画找不到方法，是否还在使用市面上的付费服务，可调参数少得可怜。
- 如果你有上面的问题那么下面的教程将十分适合你，能够白嫖阿里云的机器学习平台的API来完成自己的AI绘画应用的部署。</div></div><ul class="notion-list notion-list-disc notion-block-b704134604c14b9db97fd2f5334fde55"><li>Github项目地址</li></ul><div class="notion-row"><a class="notion-bookmark notion-block-86dc5143b2814fa5a1b61d201d364854" href="https://github.com/AUTOMATIC1111/stable-diffusion-webui" target="_blank" rel="noopener noreferrer"><div><div class="notion-bookmark-title">GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI</div><div class="notion-bookmark-description">Stable Diffusion web UI. Contribute to AUTOMATIC1111/stable-diffusion-webui development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=86dc5143-b281-4fa5-a1b6-1d201d364854&amp;t=86dc5143-b281-4fa5-a1b6-1d201d364854" alt="GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/AUTOMATIC1111/stable-diffusion-webui</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F61dd511a483e909ae0ca42bb8aafb496dd410d9c5304bec12eb7ef757f8dbc49%2FAUTOMATIC1111%2Fstable-diffusion-webui?table=block&amp;id=86dc5143-b281-4fa5-a1b6-1d201d364854&amp;t=86dc5143-b281-4fa5-a1b6-1d201d364854" alt="GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI" loading="lazy" decoding="async"/></div></a></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-17bba8107b5f4877800e2167acf6ac6e" data-id="17bba8107b5f4877800e2167acf6ac6e"><span><div id="17bba8107b5f4877800e2167acf6ac6e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#17bba8107b5f4877800e2167acf6ac6e" title="前期准备："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">前期准备：</span></span></h2><details class="notion-toggle notion-block-4900fe0c314344ada05aa3a74ccbe7b6"><summary><b>注册并完成实名认证</b></summary><div><ol start="1" class="notion-list notion-list-numbered notion-block-af6cfadaaa5b41e0a59f0f51e15735e2" style="list-style-type:decimal"><li>打开<a class="notion-link" href="https://www.aliyun.com/activity/new/index?userCode=r5av7tbd" target="_blank" rel="noopener noreferrer">阿里云官网</a></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-2de9a173a5c848728832b79cf6f85108" style="list-style-type:decimal"><li>注册并根据提示完成实名认证。</li></ol></div></details><details class="notion-toggle notion-block-ca98e325729741feb6ec5a55970b595d"><summary><b>领取免费的机器学习平台的API</b></summary><div><ol start="1" class="notion-list notion-list-numbered notion-block-d25f55785e664629aa3a0c1d8cb27563" style="list-style-type:decimal"><li>在完成注册和实名认证后根据下图在阿里云官网点击“免费试用”———&gt;“机器学习平台API”</li><ol class="notion-list notion-list-numbered notion-block-d25f55785e664629aa3a0c1d8cb27563" style="list-style-type:lower-alpha"><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-49aa9c4da5344ef486a79d67262a02cd"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd741b8e1-3b1c-4846-b124-53bb248412e4%2FUntitled.png?table=block&amp;id=49aa9c4d-a534-4ef4-86a7-9d67262a02cd&amp;t=49aa9c4d-a534-4ef4-86a7-9d67262a02cd&amp;width=720&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><li>根据下图操作即可</li><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-33161f8283ee4b1e8037ac14de035330"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9753ccce-981f-479e-b979-05c04b665b34%2FUntitled.png?table=block&amp;id=33161f82-83ee-4b1e-8037-ac14de035330&amp;t=33161f82-83ee-4b1e-8037-ac14de035330&amp;width=1752&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-callout notion-gray_background_co notion-block-0fb3e749ca8f4647b287d06abd6e23c6"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">将地区更改为上海，自我感觉上海的服务器要多一点。
-根据下面图片顺序完成授权和开通即可。</div></div><ul class="notion-list notion-list-disc notion-block-07c238385a2442e49e81894dc5f049e3"><li>在角色授权时不会自动返回开通界面要自己手动返回。</li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b8a1e1cc4c074165af29e405cd611185"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8309c139-bfd4-40de-97a4-8b4ff39e2039%2FUntitled.png?table=block&amp;id=b8a1e1cc-4c07-4165-af29-e405cd611185&amp;t=b8a1e1cc-4c07-4165-af29-e405cd611185&amp;width=1918&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><li>开通成功后是这个界面，进入工作空间即可。</li><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-988b53b7dd7e447eba583a0041cec9ba"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:576px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc48d244c-9684-4e94-8708-11664cbfac5b%2FUntitled.png?table=block&amp;id=988b53b7-dd7e-447e-ba58-3a0041cec9ba&amp;t=988b53b7-dd7e-447e-ba58-3a0041cec9ba&amp;width=576&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><li>在进入工作空间后我们要选择交互式建模。</li><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-c6a32406792346fe856950fac8765590"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb000b5d8-288c-4f57-8708-7d42fe6abac0%2FUntitled.png?table=block&amp;id=c6a32406-7923-46fe-8569-50fac8765590&amp;t=c6a32406-7923-46fe-8569-50fac8765590&amp;width=1906&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></ol></ol></div></details><details class="notion-toggle notion-block-49592d360cf645da96f509061d5dfdb5"><summary><b>[可选]开通nas存储（3个月免费/50G储存）[不使用后将文件进行删除]</b></summary><div><ol start="1" class="notion-list notion-list-numbered notion-block-cb42373f6a894fc28d86d12714ec4f94" style="list-style-type:decimal"><li>还是点击直接进行跳转<b><span class="notion-inline-underscore"><a class="notion-link" href="https://free.aliyun.com/?crowd=personal&amp;pipCode=nas&amp;spm=5176.28055625.J_3207526240.159.1c4c154aBkmZzs&amp;scm=20140722.M_9659031._.V_1" target="_blank" rel="noopener noreferrer">nas储存</a></span></b></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-8ab3ee76493040d08c1c00b3b0add1de" style="list-style-type:decimal"><li>按照图片进行开通即可。</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-cc135838b0284f378d8e71abca71e11e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4ff0146f-cd6a-461d-bc57-546a30578380%2FUntitled.png?table=block&amp;id=cc135838-b028-4f37-8d8e-71abca71e11e&amp;t=cc135838-b028-4f37-8d8e-71abca71e11e&amp;width=1901&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-b4364d6b7cbe425a848dbf7000f97260">3.我们要先进入vps专用网络来创建自己的专用网络，点这里进行跳转<span class="notion-inline-underscore"><b><a class="notion-link" href="https://vpcnext.console.aliyun.com/overview" target="_blank" rel="noopener noreferrer">vps专用网络控制台</a></b></span></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-c89d01057b494292971a45a0470d91b7"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F351d3fc5-12e9-495b-a240-a32647bf119e%2FUntitled.png?table=block&amp;id=c89d0105-7b49-4292-971a-45a0470d91b7&amp;t=c89d0105-7b49-4292-971a-45a0470d91b7&amp;width=1916&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="4" class="notion-list notion-list-numbered notion-block-1ab3cf92f26846a1a57bd12dbebd0853" style="list-style-type:decimal"><li>按照上面图片操作后会进入这个界面，按照图片的提示操作即可。</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-8ffd3207cb434460a2ef7402ea118b85"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F37ba990d-25d3-443b-9ec6-4b803baf7faa%2FUntitled.png?table=block&amp;id=8ffd3207-cb43-4460-a2ef-7402ea118b85&amp;t=8ffd3207-cb43-4460-a2ef-7402ea118b85&amp;width=1908&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-blank notion-block-5b300406f2c14580bac3bcbf5caef0db"> </div><div class="notion-text notion-block-cececef5665e4d209e2d099a9397623b">5.在开通后会进入自己阿里云的控制台，点击这个进入<span class="notion-inline-underscore"><b><a class="notion-link" href="https://nasnext.console.aliyun.com/overview" target="_blank" rel="noopener noreferrer">文件存储的控制台</a></b></span></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-4f1eb41f5fb345ec8ec11b1b7e173176"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe609520f-8451-4315-910d-52103cce9e0a%2FUntitled.png?table=block&amp;id=4f1eb41f-5fb3-45ec-8ec1-1b1b7e173176&amp;t=4f1eb41f-5fb3-45ec-8ec1-1b1b7e173176&amp;width=1918&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-fb74248717c1411581b4361e2b6192ac">6.在下面会有同意协议和确认购买的按钮</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-e5fff4f7849240c3bcb48abb35805471"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb9e215c3-e84c-4fbc-aa12-61b5d33a46dc%2FUntitled.png?table=block&amp;id=e5fff4f7-8492-40c3-bcb4-8abb35805471&amp;t=e5fff4f7-8492-40c3-bcb4-8abb35805471&amp;width=1918&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-callout notion-gray_background_co notion-block-a5784997d48b4c53bcce62f445072af1"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><b>如果你在这一步出现了不能购买的话，就要去检查自己的地区是否改为了上海；
地区没有问题那么可能是在设置专用网络时地区没有改为上海。</b></div></div></div></details><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1a675336a10947b88abe4d5d2b520715" data-id="1a675336a10947b88abe4d5d2b520715"><span><div id="1a675336a10947b88abe4d5d2b520715" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1a675336a10947b88abe4d5d2b520715" title="SD的部署"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">SD的部署</span></span></h3><ul class="notion-list notion-list-disc notion-block-d0c52f471b1f4ba5820f57e365ec5209"><li><b>下载这个文件。</b></li></ul><div class="notion-text notion-block-ddc75e28842b4e889d51d844eec5387a"><a class="notion-link" href="https://www.123pan.com/s/5VLUVv-rRknA.html" target="_blank" rel="noopener noreferrer">https://www.123pan.com/s/5VLUVv-rRknA.html</a></div><ol start="1" class="notion-list notion-list-numbered notion-block-67120ea5d4e64929b268df76a991759b" style="list-style-type:decimal"><li>打开这个网页进入到<a class="notion-link" href="https://pai.console.aliyun.com/?regionId=cn-shanghai&amp;workspaceId=331064#/notebook" target="_blank" rel="noopener noreferrer">机器学习平台api</a>界面。</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-076dc294ab2b43b3b059e5f9c060ac75"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ffabf9562-ffd0-4314-a7dd-15883d31476c%2FUntitled.png?table=block&amp;id=076dc294-ab2b-43b3-b059-e5f9c060ac75&amp;t=076dc294-ab2b-43b3-b059-e5f9c060ac75&amp;width=1073.6458740234375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-ffedabf8b6324113a8cbd7fa47e3e01c">2.进入服务器购买页面。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3b5e02726253407794bc4d7f02049991"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9967e588-bc48-4c61-81b6-5dea737429b9%2FUntitled.png?table=block&amp;id=3b5e0272-6253-4077-94bc-4d7f02049991&amp;t=3b5e0272-6253-4077-94bc-4d7f02049991&amp;width=1073.6458740234375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="3" class="notion-list notion-list-numbered notion-block-8a7b432ac2d94bd4bfbc31fccef03527" style="list-style-type:decimal"><li>这一步是可以选择创建的，没有创建得话在删除服务器后将全部丢失服务器中的文件。</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-5d386b6684574be49194292ed1e3e63a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd87b1e18-1150-48ab-95b2-5fd5a646fdfd%2FUntitled.png?table=block&amp;id=5d386b66-8457-4be4-9194-292ed1e3e63a&amp;t=5d386b66-8457-4be4-9194-292ed1e3e63a&amp;width=1073.6458740234375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="4" class="notion-list notion-list-numbered notion-block-e7a249102e134f0686fe5002c0b78dea" style="list-style-type:decimal"><li>下一步一定要看清楚系统环境</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-9586e7dea02a4f4d9df93a975508a148"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F583f2310-8732-46e8-9ec2-c92d6f121ed4%2FUntitled.png?table=block&amp;id=9586e7de-a02a-4f4d-9df9-3a975508a148&amp;t=9586e7de-a02a-4f4d-9df9-3a975508a148&amp;width=1073.6458740234375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="5" class="notion-list notion-list-numbered notion-block-c829a0cde28b4a42910e414094778b69" style="list-style-type:decimal"><li>下一步同意协定创建实例即可</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-9ddec5ecc71e40c5a71731e8656a968b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fbc373e6e-72c7-4e1c-9339-ae5e1347a762%2FUntitled.png?table=block&amp;id=9ddec5ec-c71e-40c5-a717-31e8656a968b&amp;t=9ddec5ec-c71e-40c5-a717-31e8656a968b&amp;width=1073.65625&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="6" class="notion-list notion-list-numbered notion-block-3087a539c9f74e4b8c4194b45eb99635" style="list-style-type:decimal"><li>打开服务器管理界面</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-bdb758434702469282e20a8c12ea259d"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ff9bb2282-3d8d-427c-9184-deef82cf725e%2FUntitled.png?table=block&amp;id=bdb75843-4702-4692-82e2-0a8c12ea259d&amp;t=bdb75843-4702-4692-82e2-0a8c12ea259d&amp;width=1073.6458740234375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="7" class="notion-list notion-list-numbered notion-block-bae930bf36c347d383977415e34fc4a9" style="list-style-type:decimal"><li>将上面下载好了的文件拖入服务器中。</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-398dbfe50c764e3b9395747e360cb139"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc2b43287-2935-4c67-8878-61c1f419a01b%2FUntitled.png?table=block&amp;id=398dbfe5-0c76-4e3b-9395-747e360cb139&amp;t=398dbfe5-0c76-4e3b-9395-747e360cb139&amp;width=1073.6458740234375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="8" class="notion-list notion-list-numbered notion-block-a5ee7a88314b4a2397fd80964a744387" style="list-style-type:decimal"><li>将服务安装到服务器中。</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1be1a922fafa4ca8acf99f134b03962d"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe57c4bb6-0c02-4c21-be26-a544bd4008c5%2FUntitled.png?table=block&amp;id=1be1a922-fafa-4ca8-acf9-9f134b03962d&amp;t=1be1a922-fafa-4ca8-acf9-9f134b03962d&amp;width=1073.6458740234375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-6e1c7da03285428ab3f7f6e0a7d2b819">9.启动web ui界面</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-231c678f975d40d3887b3f98b1870ef5"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1f6b6c65-35ed-4399-b90b-52edfc86a346%2FUntitled.png?table=block&amp;id=231c678f-975d-40d3-887b-3f98b1870ef5&amp;t=231c678f-975d-40d3-887b-3f98b1870ef5&amp;width=1073.65625&amp;cache=v2" alt="启动web ui后直接点击连接就可以进入ui了" loading="lazy" decoding="async"/><figcaption class="notion-asset-caption"><span class="notion-gray_background"><b>启动web ui后直接点击连接就可以进入ui了</b></span></figcaption></div></figure><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-49244d9632ec4da1b554a3711e21681d" data-id="49244d9632ec4da1b554a3711e21681d"><span><div id="49244d9632ec4da1b554a3711e21681d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#49244d9632ec4da1b554a3711e21681d" title="web ui界面基本操作"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">web ui界面基本操作</span></span></h2><details class="notion-toggle notion-block-1910f04dc43546208cf6c3ffb2d21e17"><summary><b>ui界面调整为中文</b></summary><div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-cf13ea8e6c0f4c719aebab37f09d339b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9124cd99-68d7-48dc-a5cf-568beeb9ccc4%2FUntitled.png?table=block&amp;id=cf13ea8e-6c0f-4c71-9aeb-ab37f09d339b&amp;t=cf13ea8e-6c0f-4c71-9aeb-ab37f09d339b&amp;width=1869&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></div></details><details class="notion-toggle notion-block-afbd038aba8742468c1aea8dba23c09b"><summary>ui界面的基本操作和作用</summary><div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-23ad01fe2e3c478b9b7f596309123a69"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3ca2bf9e-d2a1-4bdd-8896-7493e211bbde%2FUntitled.png?table=block&amp;id=23ad01fe-2e3c-478b-9b7f-596309123a69&amp;t=23ad01fe-2e3c-478b-9b7f-596309123a69&amp;width=1901&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></div></details><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-31bde691c2854e31a5c4251e7ee3d8cd" data-id="31bde691c2854e31a5c4251e7ee3d8cd"><span><div id="31bde691c2854e31a5c4251e7ee3d8cd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#31bde691c2854e31a5c4251e7ee3d8cd" title="报错处理"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">报错处理</span></span></h3><div class="notion-text notion-block-8f0c3febba8a48159b6340c34a243df2">1.在安装时出现了下面报错那么就多刷新几次，这个是网络连接时出现了错误。</div><div class="notion-text notion-block-40f1b2862e3b437a9db73449abdadb5c">如果刷新还是无效那么就是链接地址无效，或者被墙了。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-acb33eef18b44c8ab66bd8e0949781b5"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2d10d4a7-1db2-4f3b-a979-23828d8a9ea0%2FUntitled.png?table=block&amp;id=acb33eef-18b4-4c8a-b66b-d8e0949781b5&amp;t=acb33eef-18b4-4c8a-b66b-d8e0949781b5&amp;width=1073.6458740234375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-blank notion-block-1a502c355e664baea0ae7b69b459aae2"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26319f2c8be14489aa92fc05daff181e" data-id="26319f2c8be14489aa92fc05daff181e"><span><div id="26319f2c8be14489aa92fc05daff181e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26319f2c8be14489aa92fc05daff181e" title="总结"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">总结</span></span></h3><blockquote class="notion-quote notion-block-04a53a1ad92b411b8503031415780f66"><div>在部署云端绘画时可能有着其他奇奇怪怪的bug和问题，就需要自己去网络上寻找解决的办法。</div></blockquote><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-29a65b7ab87b4d399912ba3e77b29cd6" data-id="29a65b7ab87b4d399912ba3e77b29cd6"><span><div id="29a65b7ab87b4d399912ba3e77b29cd6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#29a65b7ab87b4d399912ba3e77b29cd6" title="📎 参考文章"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">📎 参考文章</span></span></h2><ul class="notion-list notion-list-disc notion-block-582fc7fbc409433197b38bb872a27fe2"><li>本文的启动参数引用借鉴了b站<a class="notion-link" href="https://space.bilibili.com/12566101?spm_id_from=333.337.0.0" target="_blank" rel="noopener noreferrer"><b>秋葉aaaki</b></a><b>的启动代码。</b></li></ul><div class="notion-blank notion-block-687f545bf6c94b8a92c23b822a4aae3c"> </div><div class="notion-callout notion-gray_background_co notion-block-36676bea429541c8b0c0959afe2d92f6"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">有关sd安装或者使用上的问题，欢迎您在底部评论区留言，一起交流~</div></div><div class="notion-blank notion-block-8fbae44c848e47ec9a758cdacebb36cf"> </div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>