<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
            <title type="text">马草原 の Blog</title>
            <subtitle type="text">If you want to tame a person , will risk tears.</subtitle>
    <updated>2025-08-30T14:06:59+08:00</updated>
        <id>https://www.mcaoyuan.com</id>
        <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com" />
        <link rel="self" type="application/atom+xml" href="https://www.mcaoyuan.com/atom.xml" />
    <rights>Copyright © 2026, 马草原 の Blog</rights>
    <generator uri="https://halo.run/" version="1.5.5">Halo</generator>
            <entry>
                <title><![CDATA[杭州 · 太子尖]]></title>
                <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com/archives/taizijian" />
                <id>tag:https://www.mcaoyuan.com,2025-08-30:taizijian</id>
                <published>2025-08-30T14:06:59+08:00</published>
                <updated>2025-08-30T14:06:59+08:00</updated>
                <author>
                    <name>马草原</name>
                    <uri>https://www.mcaoyuan.com</uri>
                </author>
                <content type="html">
                        <![CDATA[<h2 id="%E6%9D%AD%E5%B7%9E-%C2%B7-%E5%A4%AA%E5%AD%90%E5%B0%96" tabindex="-1">杭州 · 太子尖</h2><p>2025年08月30日 晴☀️</p><p>凌晨两点出发，四点半开始爬山…</p><p><img src="https://file.mcaoyuan.com/blog/taizijian2025083001.avif" alt="taizijian2025083001" /></p><p>日出！！！</p><p><img src="https://file.mcaoyuan.com/blog/taizijian2025083007.avif" alt="taizijian2025083007" /></p><p><img src="https://file.mcaoyuan.com/blog/taizijian2025083005.avif" alt="taizijian2025083005" /></p><p><img src="https://file.mcaoyuan.com/blog/taizijian2025083006.avif" alt="taizijian2025083006" /></p><p><img src="https://file.mcaoyuan.com/blog/taizijian2025083003.avif" alt="taizijian2025083003" /></p><p>山一栾又一栾 犹如水墨画</p><p><img src="https://file.mcaoyuan.com/blog/taizijian2025083004.avif" alt="taizijian2025083004" /></p><p><img src="https://file.mcaoyuan.com/blog/taizijian2025083002.avif" alt="taizijian2025083002" /></p>]]>
                </content>
            </entry>
            <entry>
                <title><![CDATA[宁波市]]></title>
                <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com/archives/ningbo" />
                <id>tag:https://www.mcaoyuan.com,2025-08-23:ningbo</id>
                <published>2025-08-23T13:57:04+08:00</published>
                <updated>2025-08-23T13:57:04+08:00</updated>
                <author>
                    <name>马草原</name>
                    <uri>https://www.mcaoyuan.com</uri>
                </author>
                <content type="html">
                        <![CDATA[<h2 id="%E5%AE%81%E6%B3%A2%E5%B8%82" tabindex="-1">宁波市</h2><p>2025年08月23日 ☁️阴天</p><p><img src="https://file.mcaoyuan.com/blog/ningbo2025082301.avif" alt="ningbo2025082301" /></p><p><img src="https://file.mcaoyuan.com/blog/ningbo2025082302.avif" alt="ningbo2025082302" /></p><p><img src="https://file.mcaoyuan.com/blog/ningbo2025082305.avif" alt="ningbo2025082305" /></p><p><img src="https://file.mcaoyuan.com/blog/ningbo2025082306.avif" alt="ningbo2025082306" /></p><h4 id="%E6%8B%BF%E7%9D%80%E9%95%8A%E5%AD%90%E6%8B%BC%E4%BA%863%E5%B0%8F%E6%97%B6%E2%80%A6" tabindex="-1">拿着镊子拼了3小时…</h4><p><img src="https://file.mcaoyuan.com/blog/ningbo2025082304.avif" alt="ningbo2025082304" /></p><p><img src="https://file.mcaoyuan.com/blog/ningbo2025082303.avif" alt="ningbo2025082303" /></p>]]>
                </content>
            </entry>
            <entry>
                <title><![CDATA[江西 · 武功山]]></title>
                <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com/archives/wugongmountain" />
                <id>tag:https://www.mcaoyuan.com,2025-08-09:wugongmountain</id>
                <published>2025-08-09T14:01:36+08:00</published>
                <updated>2025-08-09T14:01:36+08:00</updated>
                <author>
                    <name>马草原</name>
                    <uri>https://www.mcaoyuan.com</uri>
                </author>
                <content type="html">
                        <![CDATA[<h2 id="%E6%B1%9F%E8%A5%BF-%C2%B7-%E6%AD%A6%E5%8A%9F%E5%B1%B1" tabindex="-1">江西 · 武功山</h2><p>2025年08月09日 晴天☀️</p><p><img src="https://file.mcaoyuan.com/blog/wugongshan2025080901.avif" alt="wugongshan2025080901" /></p><p><img src="https://file.mcaoyuan.com/blog/wugongshan2025080902.avif" alt="wugongshan2025080902" /></p><p><img src="https://file.mcaoyuan.com/blog/wugongshan2025080903.avif" alt="wugongshan2025080903" /></p><p><img src="https://file.mcaoyuan.com/blog/wugongshan2025080904.avif" alt="wugongshan2025080904" /></p><p><img src="https://file.mcaoyuan.com/blog/wugongshan2025080905.avif" alt="wugongshan2025080905" /></p><h4 id="%E6%97%A5%E8%90%BD" tabindex="-1">日落</h4><p><img src="https://file.mcaoyuan.com/blog/wugongshan2025080907.avif" alt="wugongshan2025080907" /></p><h4 id="%E5%A4%9C%E6%99%9A%E9%9C%B2%E8%90%A5%E2%9B%BA%EF%B8%8F-%E6%9C%88%E4%BA%AE%E5%A5%BD%E5%A4%A7" tabindex="-1">夜晚露营⛺️ 月亮好大</h4><p><img src="https://file.mcaoyuan.com/blog/wugongshan2025080906.avif" alt="wugongshan2025080906" /></p><h4 id="%E5%87%8C%E6%99%A8" tabindex="-1">凌晨</h4><p><img src="https://file.mcaoyuan.com/blog/wugongshan2025080908.avif" alt="wugongshan2025080908" /></p><h4 id="%E6%97%A5%E5%87%BA-%E4%B8%8D%E5%87%BA%E2%80%A6" tabindex="-1">日出 不出…</h4><p><img src="https://file.mcaoyuan.com/blog/wugongshan2025080909.avif" alt="wugongshan2025080909" /></p><h4 id="%E6%B1%9F%E8%A5%BF%E2%80%9C%E5%BE%AE%E8%BE%A3%E2%80%9D" tabindex="-1">江西“微辣”</h4><p><img src="https://file.mcaoyuan.com/blog/wugongshan20250809010.avif" alt="wugongshan20250809010" /></p>]]>
                </content>
            </entry>
            <entry>
                <title><![CDATA[绍兴市 · 鲁迅故居]]></title>
                <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com/archives/shaoxing" />
                <id>tag:https://www.mcaoyuan.com,2025-08-02:shaoxing</id>
                <published>2025-08-02T13:54:16+08:00</published>
                <updated>2025-08-02T13:54:16+08:00</updated>
                <author>
                    <name>马草原</name>
                    <uri>https://www.mcaoyuan.com</uri>
                </author>
                <content type="html">
                        <![CDATA[<h2 id="%E7%BB%8D%E5%85%B4%E5%B8%82-%C2%B7-%E9%B2%81%E8%BF%85%E6%95%85%E5%B1%85" tabindex="-1">绍兴市 · 鲁迅故居</h2><p>2025年08月02日 晴☀️</p><p><img src="https://file.mcaoyuan.com/blog/shaoxing2025080201.avif" alt="shaoxing2025080201" /></p><p><img src="https://file.mcaoyuan.com/blog/shaoxing2025080202.avif" alt="shaoxing2025080202" /></p><p><img src="https://file.mcaoyuan.com/blog/shaoxing2025080203.avif" alt="shaoxing2025080203" /></p>]]>
                </content>
            </entry>
            <entry>
                <title><![CDATA[AI基础学习]]></title>
                <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com/archives/ai" />
                <id>tag:https://www.mcaoyuan.com,2025-06-22:ai</id>
                <published>2025-06-22T20:41:20+08:00</published>
                <updated>2025-06-22T21:07:02+08:00</updated>
                <author>
                    <name>马草原</name>
                    <uri>https://www.mcaoyuan.com</uri>
                </author>
                <content type="html">
                        <![CDATA[<h1 id="ai%E5%9F%BA%E7%A1%80%E5%AD%A6%E4%B9%A0" tabindex="-1">AI基础学习</h1><h2 id="%E4%B8%80%E3%80%81%E4%BB%80%E4%B9%88%E6%98%AFtokenization" tabindex="-1">一、什么是Tokenization</h2><p>Tokenization（分词）是将文本分解成较小单元（称为 Token）的过程，这些单元可以是单词、子词、字符或标点符号。它是大模型（如语言模型）处理文本的第一步，为后续的编码和理解奠定基础。</p><h4 id="%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E5%88%86%E8%AF%8D%EF%BC%9F" tabindex="-1">为什么要分词？</h4><p>简单来说就是因为计算机不认识也看不懂人类语言，计算机只认识数字，所以分词就是为了把人类语言切分成小块（Token），让大模型处理这些Token。每个Token都有对应的编号（数字ID），大模型通过识别这些数字来理解和处理人类语言。</p><h4 id="%E4%BB%80%E4%B9%88%E6%98%AFtoken%EF%BC%9F" tabindex="-1">什么是Token？</h4><p>Token就是分词拆分出来的小块，对应一个数字ID。大模型通过这个数字ID可以在预先构建的词汇表（Vocabulary）中查询到，而嵌入层（Embedding Layer）回给每个Token的数字ID赋予一个高维向量。这个向量捕捉了 token 的语义、上下文关系等信息。这些向量是模型在海量文本数据上训练出来的，包含了 token 在语言中的“含义”。</p><h4 id="tokenization%E7%9A%84%E6%80%9D%E8%B7%AF" tabindex="-1">Tokenization的思路</h4><p><strong>基于单词的 Tokenization（Word-based Tokenization）</strong><br />思路：将文本按单词边界拆分，每个单词作为一个 token。通常基于空格或标点符号分割，适合英语等有明确单词边界的语言。</p><p>例：<br />输入：I love you.<br />Token：<code>[&quot;I&quot;,&quot;love&quot;,&quot;you&quot;]</code></p><p><img src="https://file.mcaoyuan.com/blog/ai01.avif" alt="ai01" /></p><p><strong>基于字节的 Tokenization（Byte-level Tokenization）</strong><br />思路：将文本编码为字节（byte），每个字节作为一个 token。通常结合 UTF-8 编码，适用于所有语言。</p><p>例：<br />输入：你好<br />Token：<code>[e4, bd, a0, e5, a5, bd]</code></p><p><img src="https://file.mcaoyuan.com/blog/ai02.avif" alt="ai01" /></p><p><strong>基于子词的 Tokenization（Subword-based Tokenization）</strong><br />思路：将文本拆分为介于单词和字符之间的单元（子词），常见算法包括 Byte Pair Encoding (BPE)、WordPiece 和 SentencePiece。通过统计词频或语言模型概率，合并常用字符或子词，形成词汇表。</p><p>例：<br />输入：playing AI<br />Token：<code>[&quot;play&quot;, &quot;##ing&quot;, &quot;AI&quot;]</code></p><p><img src="https://file.mcaoyuan.com/blog/ai03.avif" alt="ai01" /></p><p><strong>Byte-Pair Encoding算法（基于子词的分词算法）</strong><br />Byte-Pair Encoding (BPE) 是一种基于子词的 分词（Tokenization） 算法，广泛用于现代大语言模型（如 GPT 系列、LLaMA 等）。它的核心思路是通过统计字符对的频率，逐步合并最常见的字符对，生成一个适中的词汇表，既能捕捉语义又能处理新词和多语言文本。<br />简单说，BPE 就像把一堆文本“切碎”成小块（从字符开始），然后根据哪些小块经常一起出现，把它们组合成更大的块（子词），最终形成一个高效的词汇表。</p></br><h2 id="%E4%BA%8C%E3%80%81%E4%BB%80%E4%B9%88%E6%98%AFtransformer" tabindex="-1">二、什么是Transformer</h2><p>Transformer 是一种深度学习模型架构，专门为处理序列数据（如文本、语音等）设计，广泛用于自然语言处理（NLP）和大语言模型（如 BERT、GPT、T5）。它由 Google 在 2017 年的论文《Attention is All You Need》中提出，取代了传统的循环神经网络（RNN）和卷积神经网络（CNN），成为现代 NLP 的核心技术。<br />简单说Transformer 就像一个超级聪明的“翻译官”或“理解大师”，能快速分析和理解句子中每个词的含义以及词与词之间的关系。它通过一种叫 注意力机制（Attention Mechanism） 的技术，高效捕捉序列中的上下文信息，适合翻译、对话、文本生成等任务。</p><h3 id="transformer%E7%9A%84%E6%A0%B8%E5%BF%83%E6%80%9D%E6%83%B3" tabindex="-1">Transformer的核心思想</h3><p>Transformer 的核心创新是 自注意力机制（Self-Attention），它让模型能同时关注序列中所有位置的元素，而不是像 RNN 那样按顺序处理。这使得 Transformer：</p><ul><li>并行处理：更快地处理长序列。</li><li>捕捉长距离依赖：理解句子中远距离词的关系（比如“他…昨天…跑步”中的“他”和“跑步”）。</li><li>上下文敏感：动态生成每个词的表示，考虑整个句子的上下文（比如“买512g的小米打游戏”和“买512g的小米煮粥”，两句话中的小米会被理解为不同的含义（手机和食物））。</li></ul><h3 id="%E8%87%AA%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6%EF%BC%88self-attention%EF%BC%89" tabindex="-1">自注意力机制（Self-Attention）</h3><p>自注意力机制是一种让模型同时关注输入序列中所有 Token（单词或子词）的方法，通过计算每个 token 与其他 token 的相关性，动态生成上下文相关的表示。<br />简单说自注意力就像让每个词“抬头看”整个句子，决定哪些词对自己的含义最重要，从而更好地理解上下文。而不是只关注自己的Token，毕竟人类世界的同一个词在不同语境含义是不一样的，就如小米，可能是手机也可能是食物。</p><p>核心原理：自注意力通过 Query（查询）、Key（键）、Value（值） 三个向量，计算每个 Token 的 Query 与所有 Token 的 Key 的点积，生成注意力分数，衡量相关性。<br />公式：（dₖ 是向量维度，缩放防止数值过大）</p><p><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mi>c</mi><mi>o</mi><mi>r</mi><mi>e</mi><mi>s</mi><mo>=</mo><mo stretchy="false">(</mo><mi>Q</mi><mo>×</mo><mi>K</mi><mtext>ᵀ</mtext><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mtext>√</mtext><mi>d</mi><mtext>ₖ</mtext></mrow><annotation encoding="application/x-tex">scores = (Q × Kᵀ) / √dₖ</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">s</span><span class="mord mathnormal">c</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span><span class="mord mathnormal">e</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">Q</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:1.05em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.07153em;">K</span><span class="mord">ᵀ</span><span class="mclose">)</span><span class="mord">/</span><span class="mord">√</span><span class="mord mathnormal">d</span><span class="mord">ₖ</span></span></span></span></p><p>归一化处理：<br /><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mi>t</mi><mi>t</mi><mi>e</mi><mi>n</mi><mi>t</mi><mi>i</mi><mi>o</mi><msub><mi>n</mi><mi>w</mi></msub><mi>e</mi><mi>i</mi><mi>g</mi><mi>h</mi><mi>t</mi><mi>s</mi><mo>=</mo><mi>S</mi><mi>o</mi><mi>f</mi><mi>t</mi><mi>m</mi><mi>a</mi><mi>x</mi><mo stretchy="false">(</mo><mi>s</mi><mi>c</mi><mi>o</mi><mi>r</mi><mi>e</mi><mi>s</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">attention_weights = Softmax(scores)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord mathnormal">a</span><span class="mord mathnormal">t</span><span class="mord mathnormal">t</span><span class="mord mathnormal">e</span><span class="mord mathnormal">n</span><span class="mord mathnormal">t</span><span class="mord mathnormal">i</span><span class="mord mathnormal">o</span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.151392em;"><span style="top:-2.5500000000000003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.02691em;">w</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">e</span><span class="mord mathnormal">i</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">h</span><span class="mord mathnormal">t</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.05764em;">S</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">t</span><span class="mord mathnormal">m</span><span class="mord mathnormal">a</span><span class="mord mathnormal">x</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mord mathnormal">c</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span><span class="mord mathnormal">e</span><span class="mord mathnormal">s</span><span class="mclose">)</span></span></span></span></p><p>比如：“我要买512G的小米打游戏”这句输入</p><h4 id="%E8%AE%A1%E7%AE%97%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9D%83%E9%87%8D%EF%BC%9A" tabindex="-1">计算注意力权重：</h4><ol><li>“小米”的 Q₅ 与所有 token 的 Key（K₁ 到 K₈）点积，得到分数矩阵。</li><li>假设结果</li></ol><ul><li>“小米”对“512G”的分数高（因为“512G”常与手机存储相关）。</li><li>“小米”对“打游戏”的分数也很高（因为“打游戏”暗示设备功能）。</li><li>“小米”对“我”“要”“买”“的”的分数较低（这些词语义关联弱）。</li></ul><ol start="3"><li>Softmax 后，注意力权重可能为：</li></ol><ul><li>“512G”：0.4（高权重，存储容量暗示手机）。</li><li>“打游戏”：0.3（高权重，游戏功能暗示设备）。</li><li>其他 token：0.1 或更低。<br />加权求和生成新表示：<br />用注意力权重对所有 token 的 Value 向量加权求和，生成“小米”的新表示。<br /><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext>输出</mtext><mo>=</mo><mi>a</mi><mi>t</mi><mi>t</mi><mi>e</mi><mi>n</mi><mi>t</mi><mi>i</mi><mi>o</mi><msub><mi>n</mi><mi>w</mi></msub><mi>e</mi><mi>i</mi><mi>g</mi><mi>h</mi><mi>t</mi><mi>s</mi><mo>×</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">输出 = attention_weights × V</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord cjk_fallback">输</span><span class="mord cjk_fallback">出</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord mathnormal">a</span><span class="mord mathnormal">t</span><span class="mord mathnormal">t</span><span class="mord mathnormal">e</span><span class="mord mathnormal">n</span><span class="mord mathnormal">t</span><span class="mord mathnormal">i</span><span class="mord mathnormal">o</span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.151392em;"><span style="top:-2.5500000000000003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.02691em;">w</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">e</span><span class="mord mathnormal">i</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">h</span><span class="mord mathnormal">t</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal" style="margin-right:0.22222em;">V</span></span></span></span></li><li>“小米”的新表示 = 0.4 × V₄(“512G”) + 0.3 × V₇(“打游戏”) + 0.1 × V₁(“我”) + …</li><li>这个新向量融合了“512G”和“打游戏”的语义，偏向于“手机”而非“粮食”，因为： “512G”明确指存储容量，常用于描述电子设备。“打游戏”暗示需要计算能力，排除“粮食”的可能性。</li></ul><blockquote><p>上面例子只是一个极简的例子，实际处理要复杂的多并且需要其他组件的联合处理，比如通过前馈网络、残差连接等处理。</p></blockquote><h4 id="%E5%A4%9A%E5%A4%B4%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6%EF%BC%88multi-head-attention%EF%BC%89" tabindex="-1">多头注意力机制（Multi-head Attention）</h4><p>多头注意力机制（Multi-Head Attention） 是 Transformer 架构中自注意力机制（Self-Attention）的增强版本。简单说就是从多方面、多角度去分析输入。</p><h3 id="%E6%AE%8B%E5%B7%AE%E8%BF%9E%E6%8E%A5%EF%BC%88residual-connection%EF%BC%89" tabindex="-1">残差连接（Residual Connection）</h3><p>残差连接是一种网络结构设计，将子模块的输入直接加到其输出上，形成“残差”路径。简单来说，输出 = 输入 + 子模块处理结果。这种设计最初由 ResNet（残差网络）提出，Transformer 沿用了它。<br />每个编码器/解码器层有两个残差连接：</p><ul><li>自注意力后：输出 = 输入 + 自注意力输出</li><li>前馈网络（FFN）后：输出 = 输入 + FFN 输出<br />简单说残差连接就是把原始信息加上去，避免在多个组件处理后丢失原生输入信息。</li></ul><p><img src="https://file.mcaoyuan.com/blog/ai04.avif" alt="ai01" /></p><h3 id="%E5%BD%92%E4%B8%80%E5%8C%96%EF%BC%88normalization%EF%BC%8C%E7%89%B9%E6%8C%87-layer-normalization%EF%BC%89" tabindex="-1">归一化（Normalization，特指 Layer Normalization）</h3><p>层归一化（Layer Normalization，简称 LayerNorm）是一种标准化技术，对每个样本的特征（向量）进行归一化，使其均值为 0，方差为 1。Transformer 使用 LayerNorm 来稳定每层编码器/解码器的输出。</p><p>公式：</p><ul><li>对于输入向量 x = [x₁, x₂, …, xₔ]（d 维，比如 512 维）：<br />○ 计算均值：μ = (1/d) Σxᵢ<br />○ 计算方差：σ² = (1/d) Σ(xᵢ - μ)²<br />○ 归一化：x’ = (x - μ) / √(σ² + ε)（ε 是小常数，防止除零）<br />○ 缩放与偏移：y = γ × x’ + β（γ、β 是可学习的参数）</li><li>结果：输出 y 的均值≈0，方差≈1，但通过 γ 和 β 保留学习能力。<br />归一化的核心作用是 稳定和优化神经网络的训练，简单说就是标准化计算的结果，平衡一下输出避免一些特别极端结果的影响，提高模型的训练效果。</li></ul><h3 id="transformer%E7%9A%84%E7%BB%93%E6%9E%84" tabindex="-1">Transformer的结构</h3><p>Transformer的核心组件是编码器（Encoder） 和 解码器（Decoder）。</p><p><img src="https://file.mcaoyuan.com/blog/ai05.avif" alt="ai01" /></p><h4 id="%E7%BC%96%E7%A0%81%E5%99%A8%EF%BC%88encoder%EF%BC%89" tabindex="-1">编码器（Encoder）</h4><p>编码器是负责将输入序列（比如一个句子）处理成一组上下文相关的向量表示。这些向量捕捉了输入中每个 token（单词或子词）的语义以及它们之间的关系，为后续任务（如翻译、分类或生成）提供丰富的语义信息。<br />简单说，编码器就像一个笔记整理员，他通过理解你的输入，整理一份笔记。里面包含了每个Token的含义，以及他们之间的关联关系、上下文信息。这份笔记是一个融合整体的结果，不是只对某个词的含义。</p><h4 id="%E8%A7%A3%E7%A0%81%E5%99%A8%EF%BC%88decoder%EF%BC%89" tabindex="-1">解码器（Decoder）</h4><p>解码器负责根据编码器（Encoder）生成的上下文信息（或直接根据输入）逐步生成输出序列，比如翻译后的句子、生成的对话或预测的下一个词。<br />简单说解码器是将编码器的“笔记”或上下文信息转化为实际输出的生成器。</p><br/><h2 id="%E4%B8%89%E3%80%81%E4%BB%80%E4%B9%88%E6%98%AFprompt-engineering" tabindex="-1">三、什么是Prompt Engineering</h2><p>Prompt Engineering（提示工程）是优化与大语言模型（LLM）交互的关键技术，Prompt Engineering是与LLM高效沟通的桥梁，帮助用户最大化模型能力，弥补其理解和生成中的不足。<br />简单说Prompt可以有效的帮助大模型理解用户的意图，增强输出的相关性和准确性。</p><h4 id="%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81prompt-engineering" tabindex="-1">为什么需要Prompt Engineering</h4><p><img src="https://file.mcaoyuan.com/blog/ai16.avif" alt="ai01" /></p><h3 id="prompt%E7%9A%84%E5%9F%BA%E6%9C%AC%E8%A6%81%E7%B4%A0" tabindex="-1">Prompt的基本要素</h3><p><img src="https://file.mcaoyuan.com/blog/ai17.avif" alt="ai01" /></p><h3 id="prompt%E4%BA%94%E5%A4%A7%E6%A1%86%E6%9E%B6" tabindex="-1">Prompt五大框架</h3><h3 id="rtf%E6%A1%86%E6%9E%B6" tabindex="-1">RTF框架</h3><p>RTF框架（Role, Task, Format）是Prompt Engineering中一种简洁高效的提示设计框架，用于结构化地引导大语言模型（LLM）生成符合预期的输出。<br />构成：<br /><img src="https://file.mcaoyuan.com/blog/ai18.avif" alt="ai01" /></p><p>优势：<br /><img src="https://file.mcaoyuan.com/blog/ai19.avif" alt="ai01" /></p><h4 id="%E6%80%9D%E8%80%83%E9%93%BE%E6%A1%86%E6%9E%B6" tabindex="-1">思考链框架</h4><p>思考链（Chain-of-Thought, CoT）框架是一种Prompt Engineering技术，通过引导大语言模型（LLM）逐步推理来提升其在复杂任务中的表现，特别是逻辑推理、数学计算或多步骤问题。<br />构成：<br /><img src="https://file.mcaoyuan.com/blog/ai20.avif" alt="ai01" /></p><p>优势：<br /><img src="https://file.mcaoyuan.com/blog/ai21.avif" alt="ai01" /></p><h4 id="risen%E6%A1%86%E6%9E%B6" tabindex="-1">RISEN框架</h4><p>RISEN框架（Role, Instruction, Steps, Examples, Notes）是一种结构化的Prompt Engineering框架，用于设计清晰、有效的提示，以引导大语言模型（LLM）生成高质量、符合预期的输出。<br />构成：<br /><img src="https://file.mcaoyuan.com/blog/ai22.avif" alt="ai01" /></p><p>优势：<br /><img src="https://file.mcaoyuan.com/blog/ai23.avif" alt="ai01" /></p><h4 id="rodes%E6%A1%86%E6%9E%B6" tabindex="-1">RODES框架</h4><p>RODES框架（Role, Objective, Details, Examples, Sense Check）是一种结构化的Prompt Engineering框架，用于设计精准、有效的提示，引导大语言模型（LLM）生成符合预期的高质量输出。<br />构成：<br /><img src="https://file.mcaoyuan.com/blog/ai24.avif" alt="ai01" /></p><p>优势：<br /><img src="https://file.mcaoyuan.com/blog/ai25.avif" alt="ai01" /></p><h4 id="%E5%AF%86%E5%BA%A6%E9%93%BE%E6%A1%86%E6%9E%B6" tabindex="-1">密度链框架</h4><p>密度链框架通过系统化的方法对生成模型进行优化，实现了更高效的互动效果。其核心在于对输入提示的灵活运用、输出的标准化评估和目标引导，辅以反馈机制，从而形成一个持续学习和高质量输出的闭环。这种框架为开发者和用户提供了更具针对性的控制能力，使得生成模型能够更好地满足具体任务需求。<br />构成：<br /><img src="https://file.mcaoyuan.com/blog/ai26.avif" alt="ai01" /></p><p>优势：<br /><img src="https://file.mcaoyuan.com/blog/ai27.avif" alt="ai01" /></p><br/><h2 id="%E5%9B%9B%E3%80%81rag%E6%8A%80%E6%9C%AF" tabindex="-1">四、RAG技术</h2><p>RAG（Retrieval-Augmented Generation，检索增强生成） 是一种结合信息检索与文本生成的技术，旨在通过引入外部知识库来增强大型语言模型（LLM）的能力。其核心思想是：模型在生成回答时，先从外部数据库中检索相关文档或信息，再基于这些信息生成答案，从而弥补模型本身知识库的局限性。</p><h3 id="%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81rag%E6%8A%80%E6%9C%AF%EF%BC%9F" tabindex="-1">为什么需要RAG技术？</h3><p><img src="https://file.mcaoyuan.com/blog/ai06.avif" alt="ai01" /></p><h3 id="rag%EF%BC%88retrieval-augmented-generation%EF%BC%89%E6%8A%80%E6%9C%AF%E7%9A%84%E6%A0%B8%E5%BF%83%E7%BB%84%E4%BB%B6" tabindex="-1">RAG（Retrieval-Augmented Generation）技术的核心组件</h3><h4 id="%E6%A3%80%E7%B4%A2%E5%99%A8%EF%BC%88retriever%EF%BC%89" tabindex="-1">检索器（Retriever）</h4><p>从外部知识库中快速检索与用户查询相关的文档或段落。通过嵌入模型（如DPR, Dense Passage Retrieval）将查询和文档编码为向量，计算相似度。<br />典型工具：Elasticsearch、FAISS、Pinecone、Milvus（向量数据库）。</p><h4 id="%E7%9F%A5%E8%AF%86%E5%BA%93%EF%BC%88knowledge-base%EF%BC%89" tabindex="-1">知识库（Knowledge Base）</h4><p>存储结构化或非结构化的外部数据，供检索器调用。</p><h4 id="%E7%94%9F%E6%88%90%E6%A8%A1%E5%9E%8B%EF%BC%88generator%EF%BC%89" tabindex="-1">生成模型（Generator）</h4><p>基于检索结果和用户查询，生成自然语言回答。</p><h4 id="%E5%90%91%E9%87%8F%E6%95%B0%E6%8D%AE%E5%BA%93%EF%BC%88vector-database%EF%BC%89" tabindex="-1">向量数据库（Vector Database）</h4><p>高效存储和检索向量数据（如文档嵌入）。</p><h4 id="%E6%9F%A5%E8%AF%A2%E5%A4%84%E7%90%86%E5%99%A8%EF%BC%88query-processor%EF%BC%89" tabindex="-1">查询处理器（Query Processor）</h4><p>对用户输入进行预处理和优化，提升检索与生成效果。</p><h4 id="%E5%90%8E%E5%A4%84%E7%90%86%E6%A8%A1%E5%9D%97%EF%BC%88post-processor%EF%BC%89" tabindex="-1">后处理模块（Post-Processor）</h4><p>优化生成结果，确保准确性和一致性。</p><h4 id="%E7%B3%BB%E7%BB%9F%E9%9B%86%E6%88%90%E4%B8%8E%E5%8D%8F%E8%B0%83%EF%BC%88system-integration%EF%BC%89" tabindex="-1">系统集成与协调（System Integration）</h4><p>将上述组件整合为端到端流程。</p><h3 id="rag%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%B7%A5%E4%BD%9C%E6%B5%81%E7%A8%8B" tabindex="-1">RAG系统的工作流程</h3><p><img src="https://file.mcaoyuan.com/blog/ai07.avif" alt="ai01" /></p><h3 id="graphrag" tabindex="-1">GraphRAG</h3><p>GraphRAG（Graph-based Retrieval-Augmented Generation） 是一种结合 知识图谱（Knowledge Graph） 或 图神经网络（GNN） 的 RAG 方法。它通过将外部知识库以图的形式组织（如实体-关系-实体的三元组），在检索阶段利用图的结构特性（如路径、邻接关系、拓扑结构）获取更精准的上下文信息，从而提升生成模型的效果。</p><h4 id="graphrag%E7%9A%84%E6%A0%B8%E5%BF%83%E5%8E%9F%E7%90%86" tabindex="-1">GraphRAG的核心原理</h4><p>图结构的知识表示</p><ul><li>知识图谱：将外部知识（如维基数据、企业数据库）转化为图结构，其中：<br />○ 节点（Nodes）：实体（如“苹果公司”、“乔布斯”）。<br />○ 边（Edges）：关系（如“创始人”、“总部位于”）。</li><li>图嵌入（Graph Embedding）：使用图神经网络（如 GAT、GraphSAGE）将节点和关系编码为向量，便于后续检索。<br />(2) 图检索（Graph-based Retrieval）</li><li>路径检索：通过图遍历算法（如 BFS、DFS）或图嵌入相似度匹配，找到与用户查询相关的实体路径。<br />○ 示例：用户问“谁是苹果公司的创始人？”，GraphRAG 会检索知识图谱中“苹果公司”→“创始人”→“乔布斯”的路径。</li><li>多跳推理：支持通过图中的多步关系推理（如“苹果公司 → 产品 → iPhone → 制造商 → 富士康”）获取深层信息。<br />(3) 图增强生成（Graph-Augmented Generation）</li><li>将图结构的信息（如节点属性、路径关系）与用户查询结合，输入生成模型（如 GPT、LLaMA）生成答案。<br />○ 示例：结合“苹果公司”节点的属性（市值、总部）、关系（创始人、产品）生成综合回答。</li></ul><h3 id="graphrag%E7%9A%84%E4%BC%98%E5%8A%BF" tabindex="-1">GraphRAG的优势</h3><p><img src="https://file.mcaoyuan.com/blog/ai08.avif" alt="ai01" /></p><br/><h2 id="%E4%BA%94%E3%80%81ai-agent" tabindex="-1">五、AI Agent</h2><p>Agent，或称智能体，指的是一个能够自主感知环境、做出决策并执行动作的计算实体。它可以被视为一个拥有独立思考和行动能力的“智能助手”，能够帮助人们完成各种任务，尤其是那些需要复杂思考和行动协调的任务。</p><p><img src="https://file.mcaoyuan.com/blog/ai09.avif" alt="ai01" /></p><h3 id="agent%E6%9E%B6%E6%9E%84" tabindex="-1">Agent架构</h3><p><img src="https://file.mcaoyuan.com/blog/ai10.avif" alt="ai01" /></p><blockquote><p>参考：<a href="https://lilianweng.github.io/posts/2023-06-23-agent/" target="_blank">https://lilianweng.github.io/posts/2023-06-23-agent/</a></p></blockquote><h3 id="agent%E5%AE%9A%E4%B9%89%EF%BC%9A" tabindex="-1">Agent定义：</h3><p><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mi>g</mi><mi>e</mi><mi>n</mi><mi>t</mi><mo>=</mo><mtext>大模型（</mtext><mi>L</mi><mi>L</mi><mi>M</mi><mtext>）</mtext><mo>+</mo><mtext>规划（</mtext><mi>P</mi><mi>l</mi><mi>a</mi><mi>n</mi><mi>n</mi><mi>i</mi><mi>n</mi><mi>g</mi><mtext>）</mtext><mo>+</mo><mtext>记忆（</mtext><mi>M</mi><mi>e</mi><mi>m</mi><mi>o</mi><mi>r</mi><mi>y</mi><mtext>）</mtext><mo>+</mo><mtext>工具使用（</mtext><mi>T</mi><mi>o</mi><mi>o</mi><mi>l</mi><mi>U</mi><mi>s</mi><mi>e</mi><mtext>）</mtext></mrow><annotation encoding="application/x-tex">Agent = 大模型（LLM）+ 规划（Planning）+ 记忆（Memory）+ 工具使用（Tool Use）</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8777699999999999em;vertical-align:-0.19444em;"></span><span class="mord mathnormal">A</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">e</span><span class="mord mathnormal">n</span><span class="mord mathnormal">t</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.76666em;vertical-align:-0.08333em;"></span><span class="mord cjk_fallback">大</span><span class="mord cjk_fallback">模</span><span class="mord cjk_fallback">型</span><span class="mord cjk_fallback">（</span><span class="mord mathnormal">L</span><span class="mord mathnormal">L</span><span class="mord mathnormal" style="margin-right:0.10903em;">M</span><span class="mord cjk_fallback">）</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord cjk_fallback">规</span><span class="mord cjk_fallback">划</span><span class="mord cjk_fallback">（</span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord mathnormal">a</span><span class="mord mathnormal">n</span><span class="mord mathnormal">n</span><span class="mord mathnormal">i</span><span class="mord mathnormal">n</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord cjk_fallback">）</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.8777699999999999em;vertical-align:-0.19444em;"></span><span class="mord cjk_fallback">记</span><span class="mord cjk_fallback">忆</span><span class="mord cjk_fallback">（</span><span class="mord mathnormal" style="margin-right:0.10903em;">M</span><span class="mord mathnormal">e</span><span class="mord mathnormal">m</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span><span class="mord cjk_fallback">）</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.69444em;vertical-align:0em;"></span><span class="mord cjk_fallback">工</span><span class="mord cjk_fallback">具</span><span class="mord cjk_fallback">使</span><span class="mord cjk_fallback">用</span><span class="mord cjk_fallback">（</span><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="mord mathnormal">o</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord mathnormal" style="margin-right:0.10903em;">U</span><span class="mord mathnormal">s</span><span class="mord mathnormal">e</span><span class="mord cjk_fallback">）</span></span></span></span></p><h4 id="1.-planning-%E8%A7%84%E5%88%92" tabindex="-1">1. Planning  规划</h4><p>子目标和分解：代理将大任务分解为更小、更易于管理的子目标，从而能够高效处理复杂任务。反思与改进：代理可以对过去的行为进行自我批评和自我反思，从错误中吸取教训，并为未来的步骤进行改进，从而提高最终结果的质量。</p><h4 id="2.-memory-%E8%AE%B0%E5%BF%86" tabindex="-1">2. Memory  记忆</h4><p>短期记忆：我认为所有情境学习都是利用模型的短期记忆来学习。长期记忆：这为代理提供了在较长时间内保留和回忆（无限）信息的能力，通常是通过利用外部向量存储和快速检索来实现的。</p><h4 id="3.-tool-use-%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8" tabindex="-1">3. Tool use  工具使用</h4><p>代理学习调用外部 API 来获取模型权重中缺少的额外信息（预训练后通常很难改变），包括当前信息、代码执行能力、访问专有信息源等。</p><h3 id="agent%E5%BC%80%E5%8F%91%E6%A1%86%E6%9E%B6" tabindex="-1">Agent开发框架</h3><h4 id="1.-langchain" tabindex="-1">1. LangChain</h4><p>LangChain 是一个用于构建 AI Agent（人工智能代理）和 大型语言模型（LLM）应用 的开源框架，旨在简化开发流程并增强 LLM 的能力。它通过模块化设计和丰富的工具链，帮助开发者将 LLM 与外部数据、工具、记忆功能等结合，构建复杂的应用程序（如聊天机器人、自动化助手、数据分析工具等）。但是不支持Java。</p><blockquote><p><a href="https://www.langchain.com/" target="_blank">https://www.langchain.com/</a></p></blockquote><p>LangChain 的核心组件是Chains（链）：Chains（链）是将多个 LLM 调用或工具调用串联成工作流，实现复杂任务。其中包含简单链、多步骤链、条件链等复杂处理链。</p><h4 id="2.-langengine" tabindex="-1">2. LangEngine</h4><p>阿里巴巴LangEngine是一个基于Java的AI应用开发框架。它赋予LLM两大核心能力：</p><ol><li>数据感知，将语言模型与其他数据源相连接；</li><li>代理能力，允许语言模型与工程系统化能力互动；<br />LangEngine的主要应用场景包括个人助手、基于文档的问答、聊天机器人、查询表格数据、代码分析、低代码应用生成等。<br />LangEngin是当下Java语言最流行的Agent框架，并且是开源的。</li></ol><blockquote><p><a href="https://github.com/AIDC-AI/ali-langengine/blob/main/README_CN.md" target="_blank">https://github.com/AIDC-AI/ali-langengine/blob/main/README_CN.md</a></p></blockquote><h4 id="3.-spring-ai-%26-spring-ai-alibaba" tabindex="-1">3. Spring AI &amp; Spring AI Alibaba</h4><blockquote><p><a href="https://spring.io/projects/spring-ai" target="_blank">https://spring.io/projects/spring-ai</a><br /><a href="https://sca.aliyun.com/en/ai/" target="_blank">https://sca.aliyun.com/en/ai/</a></p></blockquote><p>SpringAI 是 Spring 生态系统 中的一个开源框架，旨在简化 人工智能（AI）和机器学习（ML） 在企业级 Java 应用中的集成与部署。它由 Pivotal（现为 VMware 旗下）开发，专为 Spring Boot 和 Spring Cloud 用户设计，提供了一套工具和抽象层，帮助开发者快速构建、部署和管理 AI/ML 模型驱动的应用程序。</p><br/><h2 id="%E5%85%AD%E3%80%81%E6%A8%A1%E5%9E%8B%E5%BE%AE%E8%B0%83%E4%B8%8E%E9%83%A8%E7%BD%B2" tabindex="-1">六、模型微调与部署</h2><h3 id="%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%EF%BC%9A" tabindex="-1">基础知识：</h3><h4 id="%E9%A2%84%E8%AE%AD%E7%BB%83%EF%BC%88pre-training%EF%BC%89" tabindex="-1">预训练（Pre-training）</h4><p>预训练（Pre-training）是指在训练一个人工智能模型之前，先进行一种初步的大规模数据训练，以使模型能够学习到通用的特征和知识。在AI大模型领域，尤其是在自然语言处理和计算机视觉等任务中，预训练通常涉及使用大量的未标注数据，让模型通过自监督学习或者其他方法进行训练。<br />核心目的是为了加速训练和提升性能。</p><h4 id="%E5%90%8E%E8%AE%AD%E7%BB%83%EF%BC%88post-training%EF%BC%89" tabindex="-1">后训练（Post-training）</h4><p>后训练（Post-training）是指在一个预训练的模型基础上，进一步进行的调整和优化步骤，通常是为了适应特定的任务或需求。与预训练不同，后训练主要是在已经具备一定能力的模型上进行的改进，以增强其对特定数据集或应用场景的表现。</p><p>就像是已毕业的学生，为了更好地适应某个职业的要求，进行额外的职业培训或实习。这个学生已经掌握了很多基础知识和技能，但在进入职场之前，他可能需要针对特定工作的独特要求，再进行一些专门的培训。主要目的是为了提高任务适应性、细化模型表现、减少偏差和过拟合同时提高效率。</p><h5 id="%E7%9B%91%E7%9D%A3%E5%BE%AE%E8%B0%83%EF%BC%88supervised-fine-tuning%EF%BC%8Csft%EF%BC%89" tabindex="-1">监督微调（Supervised Fine-Tuning，SFT）</h5><p>监督微调（Supervised Fine-Tuning，SFT）是指在已经预训练的机器学习模型基础上，使用标注数据集进行的进一步训练过程。这一步骤通常涉及调整和优化模型的参数，以使其在特定任务上的表现更加出色。<br />核心目的是为了优化输出结果，增强模型适应性。</p><h5 id="%E5%9F%BA%E4%BA%8E%E4%BA%BA%E7%B1%BB%E5%8F%8D%E9%A6%88%E7%9A%84%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0" tabindex="-1">基于人类反馈的强化学习</h5><p>基于人类反馈的强化学习（Reinforcement Learning from Human Feedback，RLHF）是一种结合了强化学习和人类反馈的机器学习方法。在这种方法中，模型通过接收来自人工的反馈信号来优化其行为，以实现更好的性能。这种方法通常用于训练具有复杂决策能力的模型，比如对话系统、游戏代理等。<br /><img src="https://file.mcaoyuan.com/blog/ai11.avif" alt="ai01" /><br />核心目的：<br /><img src="https://file.mcaoyuan.com/blog/ai12.avif" alt="ai01" /></p><h3 id="%E4%BB%80%E4%B9%88%E6%98%AF%E6%A8%A1%E5%9E%8B%E5%BE%AE%E8%B0%83" tabindex="-1">什么是模型微调</h3><p>模型微调（Fine-tuning）是指在已有的预训练模型基础上，针对特定的任务或数据集，进一步训练模型的过程。这样做的主要目的是让通用模型更好地适应某个具体应用场景，从而提升其在该场景下的表现。</p><p><strong>微调优点:</strong><br /><img src="https://file.mcaoyuan.com/blog/ai13.avif" alt="ai01" /><br /><strong>微调缺点:</strong><br /><img src="https://file.mcaoyuan.com/blog/ai15.avif" alt="ai01" /></p><h3 id="%E5%BE%AE%E8%B0%83%E8%BF%87%E7%A8%8B" tabindex="-1">微调过程</h3><p><img src="https://file.mcaoyuan.com/blog/ai14.avif" alt="ai01" /></p><h4 id="1.-%E5%87%86%E5%A4%87%E6%95%B0%E6%8D%AE" tabindex="-1">1. 准备数据</h4><ul><li>收集数据：收集与你任务相关的数据。比如，情感分析就需要带有情感标签的文本，图像分类就需要标注好种类的图片等。</li><li>清洗数据：去除无关内容、重复、异常、残缺的数据，保证数据的质量。</li><li>标注/分组：将数据正确标注（如打标签），并划分成训练集、验证集（以及测试集）。</li><li>格式处理：按模型要求的格式进行处理，如文本进行分词/编码，图片统一尺寸、归一化。</li></ul><h4 id="2.-%E9%80%89%E6%8B%A9%E6%A8%A1%E5%9E%8B" tabindex="-1">2. 选择模型</h4><ul><li>选择一个与你任务相关、已经在大数据集上预训练过的模型（如GPT、BERT、ResNet等）。</li><li>根据自己的需求，确定选择什么模型架构、什么规模（大模型/小模型）。</li></ul><h4 id="3.-%E8%B0%83%E6%95%B4%E7%BB%93%E6%9E%84" tabindex="-1">3. 调整结构</h4><ul><li>添加任务“头”：根据自己的任务对模型最后一层做修改，比如分类任务在顶部加一个“全连接+softmax”，文本生成可能加一个特殊的解码头。</li><li>部分参数冻结（可选）：如果只想小规模微调，可以只训练一部分参数，其余部分保持预训练权重不变。</li><li>输入/输出调整：保证输入数据和模型输入格式对齐。</li></ul><h4 id="4.-%E8%AE%AD%E7%BB%83" tabindex="-1">4. 训练</h4><ul><li>把训练集的数据输入模型，让模型参数根据目标任务“学一遍”。</li><li>设定训练超参数（如学习率、批量大小、训练轮数等）。</li><li>记录训练过程中的损失、准确率等，适时保存模型。</li></ul><h4 id="5.-%E9%AA%8C%E8%AF%81%E5%92%8C%E4%BF%9D%E5%AD%98" tabindex="-1">5. 验证和保存</h4><ul><li>用验证集/测试集数据检验训练后的模型表现（评估准确率、F1、召回、损失等）。</li><li>记录最优表现的模型版本，进行保存。</li><li>检查模型泛化能力（是否同样适用于没有见过的数据）。</li></ul><h3 id="lora%E6%8A%80%E6%9C%AF" tabindex="-1">LoRA技术</h3><p>LoRA（Low-Rank Adaptation，低秩适应）是近年来在AI大模型（如大语言模型、图像生成模型）领域提出的一种高效微调（fine-tuning）技术。</p><h4 id="%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81lora" tabindex="-1">为什么需要LoRA</h4><p>AI大模型参数量巨大，直接微调所有参数（full fine-tuning）成本高、存储和计算消耗大，也容易过拟合小样本。<br />简单说LoRA就是一种只需调整少量新增参数、高效低成本适应大模型的方法，能大幅降低资源消耗来微调大模型。</p><h4 id="lora%E7%9A%84%E6%A0%B8%E5%BF%83%E6%80%9D%E6%83%B3%EF%BC%9A" tabindex="-1">LoRA的核心思想：</h4><ol><li>低秩分解：假设大模型中的某些权重其实并不需要全部调整，仅在一个低维（低秩）方向做适配即可。</li><li>冻结原模型参数：不改变大模型原来的参数，而是在关键层（如Transformer里的Self-Attention或Feed-forward层）的权重上加上一个小的、可训练的“低秩结构”。</li><li>参数量显著减少：只训练新加的低秩矩阵，大大减少需要更新的参数数量，提升了微调效率，同时降低了显存和存储消耗。</li></ol><h4 id="lora%E5%BE%AE%E8%B0%83%E7%9A%84%E9%87%8D%E8%A6%81%E5%8F%82%E6%95%B0" tabindex="-1">LoRA微调的重要参数</h4><h5 id="%E7%A7%A9%EF%BC%88rank%2C-r%EF%BC%89" tabindex="-1">秩（Rank, r）</h5><ul><li>定义：低秩分解中增量矩阵 AA、BB 的秩（即中间的低维空间维度）。</li><li>作用：决定了可训练参数的量和模型表达能力。</li><li>经验值：常见取值有 4、8、16、32。秩越大，表达能力越强，但参数和显存消耗也更高。实际微调，通常 r=8 或 r=16 就有不错表现。</li></ul><h5 id="alpha%EF%BC%88%E7%BC%A9%E6%94%BE%E5%9B%A0%E5%AD%90%EF%BC%8Clora-alpha%EF%BC%89" tabindex="-1">Alpha（缩放因子，LoRA Alpha）</h5><ul><li>定义：用于对低秩增量的总输出进行缩放（scaling）。</li><li>作用：调节增量对原权重的影响比例，避免梯度爆炸或模型不稳定。</li><li>经验值：一般设置为与 rank 同步（比如 rank=8，alpha=8），也可设为 2~16 的倍数（部分任务用更大 alpha，提升适应速度）。</li><li>公式：（LoRA论文里推荐）总输出乘以 alpha / rank。</li></ul><h5 id="%E5%BE%AE%E8%B0%83%E7%9B%AE%E6%A0%87%E5%B1%82%EF%BC%88target-modules-%2F-layer-selection%EF%BC%89" tabindex="-1">微调目标层（Target Modules / Layer Selection）</h5><ul><li>定义：在哪些层应用 LoRA。常见有 attention 的 query、value、key、feed-forward 层等。</li><li>作用：不同层加 LoRA，微调效果、代价有区别；常用只在 attention 的 query 和 value 层插入 LoRA，效果已非常好。</li><li>拓展：有的任务会在更多层加 LoRA。</li></ul><h5 id="dropout" tabindex="-1">Dropout</h5><ul><li>定义：对 LoRA 的输出应用 dropout，缓解过拟合。</li><li>经验值：取 0.05~0.1，特殊任务调整。</li></ul><h5 id="%E5%AD%A6%E4%B9%A0%E7%8E%87%EF%BC%88learning-rate%EF%BC%89" tabindex="-1">学习率（Learning rate）</h5><ul><li>定义：LoRA专用的学习率，可与主模型参数区分。</li><li>作用：LoRA参数较少，一般可以适当提高学习率，训练更快收敛。</li></ul><br/><h2 id="%E4%B8%83%E3%80%81%E8%87%AA%E5%8A%A8%E5%8C%96%E8%AF%84%E6%B5%8B%E4%B8%8E%E4%BC%98%E5%8C%96" tabindex="-1">七、自动化评测与优化</h2><p>大模型评测是指针对大模型在实际应用场景（如对话、文本生成、信息抽取、代码生成、问答系统等）中的输出质量、能力边界和不足进行系统性的评价和对比。不只是看模型论文中的某些单一指标，更关注实际场景下对用户乃至业务是否真的有用。</p><p>评测方法目前可以分为自动化评测（Automatic Evaluation）和人工评测（Human Evaluation）。</p><h3 id="%E8%87%AA%E5%8A%A8%E5%8C%96%E8%AF%84%E6%B5%8B%E6%96%B9%E6%B3%95" tabindex="-1">自动化评测方法</h3><h4 id="%E7%BB%8F%E5%85%B8%E6%8C%87%E6%A0%87" tabindex="-1">经典指标</h4><ul><li>困惑度（Perplexity）：衡量模型对语言分布的拟合优化，常用但和实际应用相关性弱。</li><li>BLEU、ROUGE、METEOR、chrF等：在文本生成、翻译任务上比较参考答案和生成内容的n-gram重叠等。</li><li>Accuracy/F1/Recall等：用于选择、抽取、分类等任务（如MMLU/AGIEval等数据集）。</li></ul><h4 id="%E5%9F%BA%E5%87%86%E4%BB%BB%E5%8A%A1%E8%AF%84%E6%B5%8B%EF%BC%88benchmark-datasets%EF%BC%89" tabindex="-1">基准任务评测（Benchmark Datasets）</h4><p>如 SuperGLUE、MMLU、AGI-Eval、CEval、CMMLU 等，涵盖常识推理、数学推理、法律/医疗/教育等领域。直接给定问题、标准答案和评分脚本，批量验证模型表现。<br />上下文理解、代码生成、推理等专门数据集评测<br />如 HumanEval（代码）、GSM8K（数学）、BBH（大脑智力测试），不断有新benchmark。</p><h4 id="llm%E8%87%AA%E8%AF%84%EF%BC%88llm-as-a-judge%EF%BC%89%EF%BC%9A" tabindex="-1">LLM自评（LLM-as-a-judge）：</h4><p>用另一个经过特殊微调的LLM自动判分，作为人类评测的补充，不过依然可能存在偏差。</p><h3 id="%E4%BA%BA%E5%B7%A5%E8%AF%84%E6%B5%8B%E6%96%B9%E6%B3%95" tabindex="-1">人工评测方法</h3><h4 id="%E4%BA%BA%E7%B1%BB%E4%B8%BB%E8%A7%82%E8%AF%84%E5%88%86" tabindex="-1">人类主观评分</h4><p>人工采样模型输出，打分维度包括：正确性（accuracy/factual correctness）、相关性（relevance）、流畅性、丰富度、创新性、安全性等。</p><h4 id="a%2Fb%E5%AF%B9%E6%AF%94%E6%89%93%E5%88%86" tabindex="-1">A/B对比打分</h4><p>多模型结果“盲评”，随机呈现给评测员，标明更喜欢哪个输出或相等（常用于主流开源模型之间的对比）。</p><h4 id="%E7%94%A8%E6%88%B7%E5%9C%BA%E6%99%AF%E4%BD%93%E9%AA%8C%E6%B5%8B%E8%AF%95" tabindex="-1">用户场景体验测试</h4><p>注重端到端完整流程，如“机器人客服”的真实用户满意度、呼叫中心辅助、智能问答准确率等。</p>]]>
                </content>
            </entry>
            <entry>
                <title><![CDATA[苏州]]></title>
                <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com/archives/suzhou" />
                <id>tag:https://www.mcaoyuan.com,2025-06-01:suzhou</id>
                <published>2025-06-01T16:43:25+08:00</published>
                <updated>2025-06-21T16:45:19+08:00</updated>
                <author>
                    <name>马草原</name>
                    <uri>https://www.mcaoyuan.com</uri>
                </author>
                <content type="html">
                        <![CDATA[<h2 id="%E8%8B%8F%E5%B7%9E" tabindex="-1">苏州</h2><p>2025.06.01 小雨 🌧️</p><h4 id="%E8%8B%8F%E5%B7%9E%E8%83%A1%E8%BE%A3%E6%B1%A4-%E5%93%88%E5%93%88%E5%93%88" tabindex="-1">苏州胡辣汤 哈哈哈</h4><p><img src="https://file.mcaoyuan.com/blog/suzhou2025060104.avif" alt="suzhou2025060104" /></p><h4 id="%E8%8B%8F%E5%B7%9E-1" tabindex="-1">苏州</h4><p><img src="https://file.mcaoyuan.com/blog/suzhou2025060114.avif" alt="suzhou2025060114" /></p><h4 id="%E7%83%9F%E9%9B%A8-%C2%B7-%E6%8B%99%E6%94%BF%E5%9B%AD" tabindex="-1">烟雨 · 拙政园</h4><p><img src="https://file.mcaoyuan.com/blog/suzhou2025060103.avif" alt="suzhou2025060103" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou2025060102.avif" alt="suzhou2025060102" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou2025060106.avif" alt="suzhou2025060106" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou20250601012.avif" alt="suzhou20250601012" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou2025060118.avif" alt="suzhou2025060118" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou20250601016.avif" alt="suzhou20250601016" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou2025060109.avif" alt="suzhou2025060109" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou2025060105.avif" alt="suzhou2025060105" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou20250601011.avif" alt="suzhou20250601011" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou2025060107.avif" alt="suzhou2025060107" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou2025060108.avif" alt="suzhou2025060108" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou20250601010.avif" alt="suzhou20250601010" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou20250601013.avif" alt="suzhou20250601013" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou20250601017.avif" alt="suzhou20250601017" /></p><p><img src="https://file.mcaoyuan.com/blog/suzhou20250601015.avif" alt="suzhou20250601015" /></p><h4 id="%E8%BF%98%E6%98%AF%E8%A7%86%E9%A2%91%E6%9B%B4%E6%9C%89%E6%84%8F%E5%A2%83" tabindex="-1">还是视频更有意境</h4><blockquote><p>不支持Live Photo 那就转成视频吧…</p></blockquote><video controls width="100%" poster="https://file.mcaoyuan.com/blog/suzhou202506010111.avif">    <source src="https://file.mcaoyuan.com/blog/suzhou20250601.mp4">   你的浏览器不支持视频播放，请使用Chrome浏览器。  </video></br><video controls width="100%" poster="https://file.mcaoyuan.com/blog/suzhou2025060108.avif">    <source src="https://file.mcaoyuan.com/blog/suzhou2025060101.mp4">   你的浏览器不支持视频播放，请使用Chrome浏览器。  </video></br>]]>
                </content>
            </entry>
            <entry>
                <title><![CDATA[上海]]></title>
                <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com/archives/shanghai2025" />
                <id>tag:https://www.mcaoyuan.com,2025-05-31:shanghai2025</id>
                <published>2025-05-31T16:23:32+08:00</published>
                <updated>2025-06-21T16:44:23+08:00</updated>
                <author>
                    <name>马草原</name>
                    <uri>https://www.mcaoyuan.com</uri>
                </author>
                <content type="html">
                        <![CDATA[<h2 id="%E4%B8%8A%E6%B5%B7" tabindex="-1">上海</h2><p>2025.05.31 阴☁️</p><h3 id="%E6%AD%A6%E5%BA%B7%E5%A4%A7%E6%A5%BC" tabindex="-1">武康大楼</h3><p><img src="https://file.mcaoyuan.com/blog/shanghai2025053101.avif" alt="shanghai2025053101" /></p><h4 id="%E9%9D%99%E5%AE%89%E5%AF%BA" tabindex="-1">静安寺</h4><p><img src="https://file.mcaoyuan.com/blog/shanghai2025053104.avif" alt="shanghai2025053104" /></p><p><img src="https://file.mcaoyuan.com/blog/shanghai2025053103.avif" alt="shanghai2025053103" /></p><p><img src="https://file.mcaoyuan.com/blog/shanghai202505312.avif" alt="shanghai202505312" /></p><p><img src="https://file.mcaoyuan.com/blog/shanghai2025053105.avif" alt="shanghai2025053105" /></p><h4 id="%E6%B2%B3%E5%8D%97%E5%8D%97%E8%B7%AF" tabindex="-1">河南南路</h4><p><img src="https://file.mcaoyuan.com/blog/shanghai2025053110.avif" alt="shanghai2025053110" /><br /><img src="https://file.mcaoyuan.com/blog/shanghai2025053106.avif" alt="shanghai2025053106" /></p><h4 id="%E4%B8%9C%E6%96%B9%E6%98%8E%E7%8F%A0" tabindex="-1">东方明珠</h4><p><img src="https://file.mcaoyuan.com/blog/shanghai2025053112.avif" alt="shanghai2025053112" /></p><h4 id="%E9%99%86%E5%AE%B6%E5%98%B4" tabindex="-1">陆家嘴</h4><p><img src="https://file.mcaoyuan.com/blog/shanghai2025053111.avif" alt="shanghai2025053111" /></p><h4 id="%E5%A4%96%E6%BB%A9-%26-%E4%BA%BA%E6%BB%A9" tabindex="-1">外滩 &amp; 人滩</h4><p><img src="https://file.mcaoyuan.com/blog/shanghai2025053107.avif" alt="shanghai2025053107" /></p><p><img src="https://file.mcaoyuan.com/blog/shanghai2025053108.avif" alt="shanghai2025053108" /></p><h4 id="%E5%A4%96%E6%BB%A9%E5%A4%9C%E6%99%AF" tabindex="-1">外滩夜景</h4><p><img src="https://file.mcaoyuan.com/blog/shanghai2025053109.avif" alt="shanghai2025053109" /></p>]]>
                </content>
            </entry>
            <entry>
                <title><![CDATA[创业MVP]]></title>
                <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com/archives/mvp" />
                <id>tag:https://www.mcaoyuan.com,2025-05-12:mvp</id>
                <published>2025-05-12T23:47:31+08:00</published>
                <updated>2025-05-13T10:47:09+08:00</updated>
                <author>
                    <name>马草原</name>
                    <uri>https://www.mcaoyuan.com</uri>
                </author>
                <content type="html">
                        <![CDATA[<h2 id="%E5%88%9B%E4%B8%9Amvp" tabindex="-1">创业MVP</h2><p><img src="https://file.mcaoyuan.com/blog/random2.webp" alt="random2" /></p><h3 id="%E4%B8%80%E3%80%81%E4%BB%80%E4%B9%88%E6%98%AF%E5%88%9B%E4%B8%9A%EF%BC%9F" tabindex="-1">一、什么是创业？</h3><p>有人说创业就是自己当老板，做自己喜欢的事情。也有人说创业就是做生意赚大钱。</p><p>我的理解：创业的本质是解决市场上用户的需求、痛点，赚钱更多的是作为解决用户需求创造价值后的奖励。所以创业为什么可以成功，本质上是解决了市场上真实存在的需求或者痛点，而不是一厢情愿的吹嘘和制造伪需求。创业者的初心也绝不能从盯着赚钱或是把初期目标定为赚多少钱而开始，要理解赚钱的本质不是吹嘘和营销；赚钱的本质是解决用户的痛点后，为用户创造了价值，用户给予的一种奖励。所以创业本身是用户导向的，需要不断贴近用户需求不断修正方向，如果按着自己的主观臆想或制造和鼓吹伪需求来炒作营销必定会失败。</p><p>所以创业的本质就是基于自己的想法和假设，去实现产品，然后在市场上验证需求是否是用户渴望的，随后根据用户反馈不断修改完善产品或者及时改变研发方向：</p><p><img src="https://file.mcaoyuan.com/blog/mvp1.avif" alt="mvp1" /></p><p>但是以上流程可以看出来，创业的本质还是需求，只要需求是市场所需的，是用户的痛点就很容易取得成功。但是从提出想法到实现产品需要投入大量的资源和成本，试错成本极大。很多创业公司的资金很难支撑多次试错的成本。个人创业者就更难实现了，一是资金问题而生很多个人创业者并不能全职创业。</p><p>所以提升创业成功率的关键就在于用最小的成本验证想法和需求，一旦确定想法和需求是市场所需的那就会极大提高创业成功率；这个方法就成为MVP。</p><br/><h3 id="%E4%BA%8C%E3%80%81%E4%BB%80%E4%B9%88%E6%98%AFmvp" tabindex="-1">二、什么是MVP</h3><p><strong><font style="color:rgb(32, 33, 34);">MVP是最简可行产品</font></strong><font style="color:rgb(32, 33, 34);">（英语：Minimum Viable Product, MVP），一句话说就是用最少的功能和最低资源成本快速打造一个产品，用来验证市场需求和获取用户反馈。我觉得和</font><font style="color:rgba(0, 0, 0, 0.84);">《精益创业》中所讲的是一个思想，简单说就是初期要把钱花在刀刃上。</font></p><p><font style="color:rgb(32, 33, 34);"></font></p><blockquote><p>维基百科的定义：</p></blockquote><blockquote><p><strong><font style="color:rgb(32, 33, 34);">最简可行产品</font></strong><font style="color:rgb(32, 33, 34);">（英语：</font><font style="color:rgb(32, 33, 34);">Minimum Viable Product, MVP</font><font style="color:rgb(32, 33, 34);">），是</font>[<font style="color:rgb(51, 102, 204);">新产品开发</font>]<font style="color:rgb(32, 33, 34);">中的名词，是指有部分机能，恰好可以让设计者表达其核心设计概念的产品。设计者可以进行</font><a href="https://zh.wikipedia.org/w/index.php?title=%E9%A9%97%E8%AD%89%E5%BC%8F%E5%AD%B8%E7%BF%92&amp;action=edit&amp;redlink=1" target="_blank"><font style="color:rgb(0, 122, 94);">验证式学习</font></a><font style="color:rgb(32, 33, 34);">，根据使用者的回馈，进一步了解使用情形，并且继续开发此产品</font><font style="color:rgb(32, 33, 34);"> </font><a href="https://zh.wikipedia.org/wiki/%E6%9C%80%E7%B0%A1%E5%8F%AF%E8%A1%8C%E7%94%A2%E5%93%81#cite_note-Ries,_Eric-1" target="_blank"><sup><font style="color:rgb(51, 102, 204);">[1]</font></sup></a><font style="color:rgb(32, 33, 34);">。由最简可行产品来搜集相关想法常常会比开发有更多机能的产品要便宜。开发更多机能产品的的费用较高，也会有产品失败的风险（例如产品基本假设有误的情形）。最简可行产品一词是由法兰克·罗宾生（Frank Robinson）创建</font><a href="https://zh.wikipedia.org/wiki/%E6%9C%80%E7%B0%A1%E5%8F%AF%E8%A1%8C%E7%94%A2%E5%93%81#cite_note-2" target="_blank"><sup><font style="color:rgb(51, 102, 204);">[2]</font></sup></a><font style="color:rgb(32, 33, 34);">，因</font><a href="https://zh.wikipedia.org/wiki/%E5%8F%B2%E8%92%82%E5%A4%AB%C2%B7%E5%B8%83%E5%85%B0%E5%85%8B" target="_blank"><font style="color:rgb(51, 102, 204);">史蒂夫·布兰克</font></a><font style="color:rgb(32, 33, 34);">及</font><a href="https://zh.wikipedia.org/wiki/%E5%9F%83%E9%87%8C%E5%85%8B%C2%B7%E8%8E%B1%E6%96%AF" target="_blank"><font style="color:rgb(51, 102, 204);">埃里克·莱斯</font></a><font style="color:rgb(32, 33, 34);">的使用而流行</font><a href="https://zh.wikipedia.org/wiki/%E6%9C%80%E7%B0%A1%E5%8F%AF%E8%A1%8C%E7%94%A2%E5%93%81#cite_note-def-3" target="_blank"><sup><font style="color:rgb(51, 102, 204);">[3]</font></sup></a><a href="https://zh.wikipedia.org/wiki/%E6%9C%80%E7%B0%A1%E5%8F%AF%E8%A1%8C%E7%94%A2%E5%93%81#cite_note-4" target="_blank"><sup><font style="color:rgb(51, 102, 204);">[4]</font></sup></a><a href="https://zh.wikipedia.org/wiki/%E6%9C%80%E7%B0%A1%E5%8F%AF%E8%A1%8C%E7%94%A2%E5%93%81#cite_note-5" target="_blank"><sup><font style="color:rgb(51, 102, 204);">[5]</font></sup></a><a href="https://zh.wikipedia.org/wiki/%E6%9C%80%E7%B0%A1%E5%8F%AF%E8%A1%8C%E7%94%A2%E5%93%81#cite_note-6" target="_blank"><sup><font style="color:rgb(51, 102, 204);">[6]</font></sup></a><font style="color:rgb(32, 33, 34);">。</font></p><p><font style="color:rgb(32, 33, 34);">利用最简可行产品，也可以提早进行</font><a href="https://zh.wikipedia.org/w/index.php?title=%E5%B8%82%E5%A0%B4%E5%88%86%E6%9E%90&amp;action=edit&amp;redlink=1" target="_blank"><font style="color:rgb(191, 60, 44);">市场分析</font></a><font style="color:rgb(32, 33, 34);">。</font></p></blockquote><br/><h4 id="mvp%E6%9C%80%E4%BD%B3%E6%A1%88%E4%BE%8B%EF%BC%9Adropbox" tabindex="-1">MVP最佳案例：Dropbox</h4><blockquote><p><a href="https://www.dropbox.com/" target="_blank">https://www.dropbox.com/</a></p></blockquote><p>Dropbox 是一个云存储和文件同步服务，允许用户在线存储、分享和访问文件。用户可以将文件上传到 Dropbox 云端，通过电脑、手机或平板等设备随时随地访问，并与他人共享文件或文件夹。它提供免费和付费计划，适合个人和团队协作，强调安全性和易用性。</p><p>Dropbox 由德鲁·休斯顿（Drew Houston）和阿拉什·费多西（Arash Ferdowsi）于2007年创立。创业灵感源于休斯顿的一次个人经历：在一次巴士旅行中，他忘记携带U盘，无法访问文件。这让他意识到文件同步和云存储的痛点。当时，尽管市场上已有一些云存储解决方案，但大多数产品复杂、不可靠或用户体验较差。休斯顿看到了机会，决定开发一个简单、跨平台、无缝同步文件的工具。</p><p>但是休斯顿没有直接开发产品，而是做了一个Demo视频，详细介绍了产品了功能并演示了产品的原型，然后发布到了YouTube，并留下了邮箱来吸引用户关注（接收反馈验证想法）。</p><p>很快他就收到了非常多咨询的邮件（验证了自己的想法、需求），他又继续沟通了很多用户（倾听用户痛点 矫正需求方向）。</p><p>精妙的一点是随后休斯顿做了一个网站，但是Dropbox仍然没有开始开发。他将产品介绍以及售价放在官网上，记录用户点击付款按钮的数据（测试用户支付意愿）。随后休斯顿根据收集到的数据估算用户规模以及付费率，估算出来了收益和规模。</p><p>休斯顿根据估算到的数据开始有计划的投入和开发产品，最终取得成功。休斯顿将MVP应用到了极致，用极低的成本验证了产品的可行性，甚至在开始投入资源之前就计算清楚了大概利润。</p><br/><p><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext>最好的</mtext><mi>M</mi><mi>V</mi><mi>P</mi><mtext>就是拿嘴说</mtext></mrow><annotation encoding="application/x-tex">最好的MVP就是拿嘴说</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord cjk_fallback">最</span><span class="mord cjk_fallback">好</span><span class="mord cjk_fallback">的</span><span class="mord mathnormal" style="margin-right:0.10903em;">M</span><span class="mord mathnormal" style="margin-right:0.22222em;">V</span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mord cjk_fallback">就</span><span class="mord cjk_fallback">是</span><span class="mord cjk_fallback">拿</span><span class="mord cjk_fallback">嘴</span><span class="mord cjk_fallback">说</span></span></span></span></p><p>其实用嘴就能做产品，没有必要非要把产品雏形开发出来。只要我们把我们的想法讲清楚，做一些Demo图或者一个视频都可以开始MVP。</p><br/><h3 id="%E4%B8%89%E3%80%81%E5%8F%8D%E6%80%9D" tabindex="-1">三、反思</h3><p>之前我也进行过很多尝试，我也看到过很多程序员创业者产品做的相当出色但是没做起来。原因如下：</p><ol><li><strong>没有进行MVP，没有验证市场需求是不是真实的</strong>，一意孤行投入大量资源开发产品。这类损失其实对于个人互联网创业者还算可以接受，最大的损失其实就是花费了大量精力和时间。但是对于很多实体行业创业者简直就是灭顶之灾，拿一个简单的小吃店来说，租金+装修+雇佣员工等成本是巨大的。我见过一个老板有了想法之后又是租高档写字楼又是装修一个十分奢华的公司前台，最终亏的一塌糊涂的。</li><li><strong>技术派创业者通病</strong>：有很多技术派创业者比如程序员，这类创业者有个通病就是不喜欢听用户的声音，并且有很强的技术信仰，总是用做技术的思维去做产品。他们要求很严苛，追求完美主义，喜欢把产品做到极致。非常容易沉迷在自己的技术追求中，其结果是付出了大量的成本去开发但没能验证产品可行性，很容易偏离用户制造伪需求。</li></ol><p>所以在MVP的加持下，创业流程不应该是直接投身开发自己的产品，而是先设计Demo图或者视频，然后讲好自己的产品功能，必要时进行最极简化的开发，低成本做出原型。然后在市场上不断验证和收集用户反馈。当收集足够多的数据来证明产品是可行的时再投入开发，提高创业产品的成功率。</p><p><img src="https://file.mcaoyuan.com/blog/mvp2.avif" alt="mvp2" /></p><br/>]]>
                </content>
            </entry>
            <entry>
                <title><![CDATA[五一 · 河南]]></title>
                <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com/archives/2025henan" />
                <id>tag:https://www.mcaoyuan.com,2025-05-03:2025henan</id>
                <published>2025-05-03T17:14:28+08:00</published>
                <updated>2025-05-03T17:14:28+08:00</updated>
                <author>
                    <name>马草原</name>
                    <uri>https://www.mcaoyuan.com</uri>
                </author>
                <content type="html">
                        <![CDATA[<h2 id="%E4%BA%94%E4%B8%80-%C2%B7-%E6%B2%B3%E5%8D%97" tabindex="-1">五一 · 河南</h2><p>2025.05.01 晴☀️</p><h4 id="%E6%8A%B5%E8%BE%BE%E6%B2%B3%E5%8D%97%EF%BC%8C%E4%BB%8E%E4%B8%80%E7%A2%97%E8%83%A1%E8%BE%A3%E6%B1%A4%E5%BC%80%E5%A7%8B" tabindex="-1">抵达河南，从一碗胡辣汤开始</h4><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050204.avif" alt="xinmi2025050204" /></p><h4 id="%E5%BC%80%E5%A7%8B%E5%A0%B5%E8%BD%A6%E2%80%A6" tabindex="-1">开始堵车…</h4><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050202.avif" alt="xinmi2025050202" /></p><h4 id="%E7%BB%88%E4%BA%8E%E8%B5%B0%E5%87%BA%E4%BA%86%E9%83%91%E5%B7%9E%E8%BF%9B%E5%85%A5%E6%96%B0%E5%AF%86" tabindex="-1">终于走出了郑州进入新密</h4><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050203.avif" alt="xinmi2025050203" /></p><h4 id="%E5%AE%B6%E7%9A%84%E5%A4%95%E9%98%B3%F0%9F%8C%87" tabindex="-1">家的夕阳🌇</h4><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050207.avif" alt="xinmi2025050207" /></p><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050206.avif" alt="xinmi2025050206" /></p><h4 id="%E6%9D%A5%E4%B8%80%E4%BB%BD5%E5%9D%97%E9%92%B16%E4%B8%B2%E7%9A%84%E9%9D%A2%E7%AD%8B" tabindex="-1">来一份5块钱6串的面筋</h4><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050205.avif" alt="xinmi2025050205" /></p><h4 id="%E6%B2%B3%E5%8D%97%E6%B5%B7%E5%BA%95%E6%8D%9E%E8%B0%83%E6%96%99%E5%8F%B0%E6%9C%89%E8%83%A1%E8%BE%A3%E6%B1%A4" tabindex="-1">河南海底捞调料台有胡辣汤</h4><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050208.avif" alt="xinmi2025050208" /></p><h2 id="%E5%9B%9E%E5%88%B0%E5%B0%8F%E6%97%B6%E5%80%99" tabindex="-1">回到小时候</h2><h4 id="%E5%B0%8F%E6%97%B6%E5%80%99%E5%9C%A8%E6%9D%91%E9%87%8C%E7%8E%A9%E7%9A%84%E5%B1%B1%E5%A4%B4" tabindex="-1">小时候在村里玩的山头</h4><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050209.avif" alt="xinmi2025050209" /></p><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050211.avif" alt="xinmi2025050211" /></p><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050212.avif" alt="xinmi2025050212" /></p><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050214.avif" alt="xinmi2025050214" /></p><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050213.avif" alt="xinmi2025050213" /></p><h4 id="%E5%9C%A8%E4%B9%A1%E9%97%B4" tabindex="-1">在乡间</h4><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050210.avif" alt="xinmi2025050210" /></p><h4 id="%E4%B9%A1%E9%97%B4%E7%83%A4%E4%B8%B2" tabindex="-1">乡间烤串</h4><p><img src="https://file.mcaoyuan.com/blog/xinmi2025050201.avif" alt="xinmi2025050201" /></p>]]>
                </content>
            </entry>
            <entry>
                <title><![CDATA[春日 · 西湖]]></title>
                <link rel="alternate" type="text/html" href="https://www.mcaoyuan.com/archives/2025xihu" />
                <id>tag:https://www.mcaoyuan.com,2025-04-13:2025xihu</id>
                <published>2025-04-13T19:05:24+08:00</published>
                <updated>2025-05-11T12:06:06+08:00</updated>
                <author>
                    <name>马草原</name>
                    <uri>https://www.mcaoyuan.com</uri>
                </author>
                <content type="html">
                        <![CDATA[<h2 id="%E6%98%A5%E6%97%A5-%C2%B7-%E8%A5%BF%E6%B9%96" tabindex="-1">春日 · 西湖</h2><p>2025.04.13 晴☀️</p><p>最近换工作了，来杭州啦</p><p><img src="https://file.mcaoyuan.com/blog/xihu2025041303.avif" alt="xihu2025041303" /></p><p><img src="https://file.mcaoyuan.com/blog/xihu2025041301.avif" alt="xihu2025041301" /></p><p><img src="https://file.mcaoyuan.com/blog/xihu2025041304.avif" alt="xihu2025041304" /></p><p><img src="https://file.mcaoyuan.com/blog/xihu2025041305.avif" alt="xihu2025041305" /></p><p><img src="https://file.mcaoyuan.com/blog/xihu2025041306.avif" alt="xihu2025041306" /></p><p><img src="https://file.mcaoyuan.com/blog/xihu2025041302.avif" alt="xihu2025041302" /></p>]]>
                </content>
            </entry>
</feed>
