欢迎光临
我们一直在努力

AI 黑话扫盲:Prompt、RAG、Fine-tuning……这些词到底在说啥?

一个刚接触 AI 的 Java 开发者,混进技术群里听别人聊天,大概率是这种体验:

「这个需求用 RAG 就行,别急着 Fine-tuning。」
「你 System Prompt 写清楚点,再调一下 Temperature。」
「这模型上下文窗口不够,Token 超了,得做切片 Embedding 存向量库。」
「它又幻觉了,得加个 Function Calling 让它自己查数据。」

听完你满脑子都是:这些词每个都好像在哪听过,但到底啥意思?RAG 和 Fine-tuning 有啥区别?Token 和参数是一回事吗?

别慌,你不是一个人。这些「AI 黑话」,本质就是一层「专业术语的包装纸」——剥开看,每个词背后都是一个挺简单、挺直观的概念。

今天这篇,就是一篇扫盲文。我用「一个 Java 开发者也听得懂」的方式,把这些高频黑话一次讲透,每个词都给你一句「人话解释」和一个「通俗类比」。


一、一张图看懂 AI 黑话的「全家福」

先别急着逐个背,我们先建立一张「地图」,把这些黑话分门别类。它们其实可以归成四大类:

#mermaid-svg-wKTztpVKLWyaZrRN{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-wKTztpVKLWyaZrRN .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-wKTztpVKLWyaZrRN .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-wKTztpVKLWyaZrRN .error-icon{fill:#552222;}#mermaid-svg-wKTztpVKLWyaZrRN .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-wKTztpVKLWyaZrRN .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-wKTztpVKLWyaZrRN .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-wKTztpVKLWyaZrRN .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-wKTztpVKLWyaZrRN .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-wKTztpVKLWyaZrRN .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-wKTztpVKLWyaZrRN .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-wKTztpVKLWyaZrRN .marker{fill:#333333;stroke:#333333;}#mermaid-svg-wKTztpVKLWyaZrRN .marker.cross{stroke:#333333;}#mermaid-svg-wKTztpVKLWyaZrRN svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-wKTztpVKLWyaZrRN p{margin:0;}#mermaid-svg-wKTztpVKLWyaZrRN .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-wKTztpVKLWyaZrRN .cluster-label text{fill:#333;}#mermaid-svg-wKTztpVKLWyaZrRN .cluster-label span{color:#333;}#mermaid-svg-wKTztpVKLWyaZrRN .cluster-label span p{background-color:transparent;}#mermaid-svg-wKTztpVKLWyaZrRN .label text,#mermaid-svg-wKTztpVKLWyaZrRN span{fill:#333;color:#333;}#mermaid-svg-wKTztpVKLWyaZrRN .node rect,#mermaid-svg-wKTztpVKLWyaZrRN .node circle,#mermaid-svg-wKTztpVKLWyaZrRN .node ellipse,#mermaid-svg-wKTztpVKLWyaZrRN .node polygon,#mermaid-svg-wKTztpVKLWyaZrRN .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-wKTztpVKLWyaZrRN .rough-node .label text,#mermaid-svg-wKTztpVKLWyaZrRN .node .label text,#mermaid-svg-wKTztpVKLWyaZrRN .image-shape .label,#mermaid-svg-wKTztpVKLWyaZrRN .icon-shape .label{text-anchor:middle;}#mermaid-svg-wKTztpVKLWyaZrRN .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-wKTztpVKLWyaZrRN .rough-node .label,#mermaid-svg-wKTztpVKLWyaZrRN .node .label,#mermaid-svg-wKTztpVKLWyaZrRN .image-shape .label,#mermaid-svg-wKTztpVKLWyaZrRN .icon-shape .label{text-align:center;}#mermaid-svg-wKTztpVKLWyaZrRN .node.clickable{cursor:pointer;}#mermaid-svg-wKTztpVKLWyaZrRN .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-wKTztpVKLWyaZrRN .arrowheadPath{fill:#333333;}#mermaid-svg-wKTztpVKLWyaZrRN .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-wKTztpVKLWyaZrRN .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-wKTztpVKLWyaZrRN .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-wKTztpVKLWyaZrRN .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-wKTztpVKLWyaZrRN .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-wKTztpVKLWyaZrRN .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-wKTztpVKLWyaZrRN .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-wKTztpVKLWyaZrRN .cluster text{fill:#333;}#mermaid-svg-wKTztpVKLWyaZrRN .cluster span{color:#333;}#mermaid-svg-wKTztpVKLWyaZrRN div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-wKTztpVKLWyaZrRN .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-wKTztpVKLWyaZrRN rect.text{fill:none;stroke-width:0;}#mermaid-svg-wKTztpVKLWyaZrRN .icon-shape,#mermaid-svg-wKTztpVKLWyaZrRN .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-wKTztpVKLWyaZrRN .icon-shape p,#mermaid-svg-wKTztpVKLWyaZrRN .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-wKTztpVKLWyaZrRN .icon-shape .label rect,#mermaid-svg-wKTztpVKLWyaZrRN .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-wKTztpVKLWyaZrRN .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-wKTztpVKLWyaZrRN .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-wKTztpVKLWyaZrRN :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

AI 黑话

模型相关(模型本身是啥)

提示词相关(你怎么跟它说)

调优相关(怎么让它变强)

应用相关(怎么用它干活)

大模型 LLM

Token

上下文窗口

参数

Temperature / Top-p

Prompt

System Prompt

Prompt Engineering

Few-shot / Zero-shot

Prompt(不改模型)

RAG(给资料)

Fine-tuning(教模型)

Agent

Function Calling

幻觉 Hallucination

多模态

推理 Reasoning

一句话:AI 黑话虽多,但逃不出四件事——模型是什么、怎么跟它说话、怎么让它变强、怎么用它干活。抓住这四条线,所有词都能各归其位。

下面,我们一条线一条线地拆。


二、模型相关黑话

2.1 大模型(LLM)

LLM(Large Language Model,大语言模型),就是那个「AI 的大脑」。它的本质,用一句话说:

一个巨大的「概率机器」——你给它一段文字,它预测下一个字最可能是什么,一个字一个字地接下去。

#mermaid-svg-MsMhmaiYhf3yyZk9{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-MsMhmaiYhf3yyZk9 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-MsMhmaiYhf3yyZk9 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-MsMhmaiYhf3yyZk9 .error-icon{fill:#552222;}#mermaid-svg-MsMhmaiYhf3yyZk9 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-MsMhmaiYhf3yyZk9 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-MsMhmaiYhf3yyZk9 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-MsMhmaiYhf3yyZk9 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-MsMhmaiYhf3yyZk9 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-MsMhmaiYhf3yyZk9 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-MsMhmaiYhf3yyZk9 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-MsMhmaiYhf3yyZk9 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-MsMhmaiYhf3yyZk9 .marker.cross{stroke:#333333;}#mermaid-svg-MsMhmaiYhf3yyZk9 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-MsMhmaiYhf3yyZk9 p{margin:0;}#mermaid-svg-MsMhmaiYhf3yyZk9 .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-MsMhmaiYhf3yyZk9 .cluster-label text{fill:#333;}#mermaid-svg-MsMhmaiYhf3yyZk9 .cluster-label span{color:#333;}#mermaid-svg-MsMhmaiYhf3yyZk9 .cluster-label span p{background-color:transparent;}#mermaid-svg-MsMhmaiYhf3yyZk9 .label text,#mermaid-svg-MsMhmaiYhf3yyZk9 span{fill:#333;color:#333;}#mermaid-svg-MsMhmaiYhf3yyZk9 .node rect,#mermaid-svg-MsMhmaiYhf3yyZk9 .node circle,#mermaid-svg-MsMhmaiYhf3yyZk9 .node ellipse,#mermaid-svg-MsMhmaiYhf3yyZk9 .node polygon,#mermaid-svg-MsMhmaiYhf3yyZk9 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-MsMhmaiYhf3yyZk9 .rough-node .label text,#mermaid-svg-MsMhmaiYhf3yyZk9 .node .label text,#mermaid-svg-MsMhmaiYhf3yyZk9 .image-shape .label,#mermaid-svg-MsMhmaiYhf3yyZk9 .icon-shape .label{text-anchor:middle;}#mermaid-svg-MsMhmaiYhf3yyZk9 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-MsMhmaiYhf3yyZk9 .rough-node .label,#mermaid-svg-MsMhmaiYhf3yyZk9 .node .label,#mermaid-svg-MsMhmaiYhf3yyZk9 .image-shape .label,#mermaid-svg-MsMhmaiYhf3yyZk9 .icon-shape .label{text-align:center;}#mermaid-svg-MsMhmaiYhf3yyZk9 .node.clickable{cursor:pointer;}#mermaid-svg-MsMhmaiYhf3yyZk9 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-MsMhmaiYhf3yyZk9 .arrowheadPath{fill:#333333;}#mermaid-svg-MsMhmaiYhf3yyZk9 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-MsMhmaiYhf3yyZk9 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-MsMhmaiYhf3yyZk9 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-MsMhmaiYhf3yyZk9 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-MsMhmaiYhf3yyZk9 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-MsMhmaiYhf3yyZk9 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-MsMhmaiYhf3yyZk9 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-MsMhmaiYhf3yyZk9 .cluster text{fill:#333;}#mermaid-svg-MsMhmaiYhf3yyZk9 .cluster span{color:#333;}#mermaid-svg-MsMhmaiYhf3yyZk9 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-MsMhmaiYhf3yyZk9 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-MsMhmaiYhf3yyZk9 rect.text{fill:none;stroke-width:0;}#mermaid-svg-MsMhmaiYhf3yyZk9 .icon-shape,#mermaid-svg-MsMhmaiYhf3yyZk9 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-MsMhmaiYhf3yyZk9 .icon-shape p,#mermaid-svg-MsMhmaiYhf3yyZk9 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-MsMhmaiYhf3yyZk9 .icon-shape .label rect,#mermaid-svg-MsMhmaiYhf3yyZk9 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-MsMhmaiYhf3yyZk9 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-MsMhmaiYhf3yyZk9 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-MsMhmaiYhf3yyZk9 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

预测下一个字

再接下一个字

输入:"今天天气真"

大模型 LLM

"好"

"今天天气真好,适合…"

一句话:大模型不是「会思考」,而是「极其擅长预测下一个字」。当这个「预测」准到一定程度,看起来就像「真的会说话、会思考」了。

2.2 Token:AI 世界的「最小单位」

Token 是模型处理文本的最小单位,也是计费单位。

  • 它不完全是「一个字」,也不是「一个词」,而是介于两者之间;
  • 大致上,一个汉字 ≈ 1 个 Token,一个英文单词 ≈ 1~2 个 Token。

「我喜欢编程」 → 大约 4~5 个 Token
「I love coding」 → 大约 3~4 个 Token

一句话:Token 就是 AI 的「字符计数单位」。为什么重要?因为模型的收费、上下文长度限制,全按 Token 算——你用 AI 花钱,本质就是在买 Token。

2.3 上下文窗口(Context Window):模型「一次能看多少」

上下文窗口,就是模型一次能「看见」的文字总量上限。

你可以把模型想象成一个人,盯着一块有限大小的白板。白板上写着所有信息(你的问题、历史对话、查到的资料),但白板有限,写满了就得擦掉最早的。

#mermaid-svg-0tsSEqDLPg9Js7Rz{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-0tsSEqDLPg9Js7Rz .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-0tsSEqDLPg9Js7Rz .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-0tsSEqDLPg9Js7Rz .error-icon{fill:#552222;}#mermaid-svg-0tsSEqDLPg9Js7Rz .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-0tsSEqDLPg9Js7Rz .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-0tsSEqDLPg9Js7Rz .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-0tsSEqDLPg9Js7Rz .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-0tsSEqDLPg9Js7Rz .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-0tsSEqDLPg9Js7Rz .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-0tsSEqDLPg9Js7Rz .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-0tsSEqDLPg9Js7Rz .marker{fill:#333333;stroke:#333333;}#mermaid-svg-0tsSEqDLPg9Js7Rz .marker.cross{stroke:#333333;}#mermaid-svg-0tsSEqDLPg9Js7Rz svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-0tsSEqDLPg9Js7Rz p{margin:0;}#mermaid-svg-0tsSEqDLPg9Js7Rz .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-0tsSEqDLPg9Js7Rz .cluster-label text{fill:#333;}#mermaid-svg-0tsSEqDLPg9Js7Rz .cluster-label span{color:#333;}#mermaid-svg-0tsSEqDLPg9Js7Rz .cluster-label span p{background-color:transparent;}#mermaid-svg-0tsSEqDLPg9Js7Rz .label text,#mermaid-svg-0tsSEqDLPg9Js7Rz span{fill:#333;color:#333;}#mermaid-svg-0tsSEqDLPg9Js7Rz .node rect,#mermaid-svg-0tsSEqDLPg9Js7Rz .node circle,#mermaid-svg-0tsSEqDLPg9Js7Rz .node ellipse,#mermaid-svg-0tsSEqDLPg9Js7Rz .node polygon,#mermaid-svg-0tsSEqDLPg9Js7Rz .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-0tsSEqDLPg9Js7Rz .rough-node .label text,#mermaid-svg-0tsSEqDLPg9Js7Rz .node .label text,#mermaid-svg-0tsSEqDLPg9Js7Rz .image-shape .label,#mermaid-svg-0tsSEqDLPg9Js7Rz .icon-shape .label{text-anchor:middle;}#mermaid-svg-0tsSEqDLPg9Js7Rz .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-0tsSEqDLPg9Js7Rz .rough-node .label,#mermaid-svg-0tsSEqDLPg9Js7Rz .node .label,#mermaid-svg-0tsSEqDLPg9Js7Rz .image-shape .label,#mermaid-svg-0tsSEqDLPg9Js7Rz .icon-shape .label{text-align:center;}#mermaid-svg-0tsSEqDLPg9Js7Rz .node.clickable{cursor:pointer;}#mermaid-svg-0tsSEqDLPg9Js7Rz .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-0tsSEqDLPg9Js7Rz .arrowheadPath{fill:#333333;}#mermaid-svg-0tsSEqDLPg9Js7Rz .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-0tsSEqDLPg9Js7Rz .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-0tsSEqDLPg9Js7Rz .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-0tsSEqDLPg9Js7Rz .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-0tsSEqDLPg9Js7Rz .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-0tsSEqDLPg9Js7Rz .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-0tsSEqDLPg9Js7Rz .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-0tsSEqDLPg9Js7Rz .cluster text{fill:#333;}#mermaid-svg-0tsSEqDLPg9Js7Rz .cluster span{color:#333;}#mermaid-svg-0tsSEqDLPg9Js7Rz div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-0tsSEqDLPg9Js7Rz .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-0tsSEqDLPg9Js7Rz rect.text{fill:none;stroke-width:0;}#mermaid-svg-0tsSEqDLPg9Js7Rz .icon-shape,#mermaid-svg-0tsSEqDLPg9Js7Rz .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-0tsSEqDLPg9Js7Rz .icon-shape p,#mermaid-svg-0tsSEqDLPg9Js7Rz .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-0tsSEqDLPg9Js7Rz .icon-shape .label rect,#mermaid-svg-0tsSEqDLPg9Js7Rz .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-0tsSEqDLPg9Js7Rz .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-0tsSEqDLPg9Js7Rz .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-0tsSEqDLPg9Js7Rz :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

上下文窗口(有限的白板)

你的问题

历史对话

查到的资料

白板写满 → 最早的内容被挤掉

一句话:上下文窗口就是模型「一次能记住多少」。窗口越大,一次能塞进的信息越多;但超出窗口,最早的内容就被「忘掉」了。

2.4 参数(Parameters):模型的「脑容量」

参数,可以粗略理解成模型「脑容量」的度量——参数越多,模型越「大」,通常也越聪明。

小模型:7B 参数(70 亿)
大模型:70B / 200B / 更大

一句话:参数越多 ≈ 脑子越大 ≈ 通常越聪明,但也越贵、越慢。「7B」「70B」这种数字,说的就是参数量。

2.5 Temperature / Top-p:控制「随机性」的旋钮

这两个词控制的是同一个东西——模型回答的「随机性/创造性」。

参数作用低值高值
Temperature 控制随机程度 更严谨、稳定 更有创造性、发散
Top-p 控制候选范围 只选最可能的 允许更多可能

#mermaid-svg-CrY5R38VHwn7wTwq{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-CrY5R38VHwn7wTwq .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-CrY5R38VHwn7wTwq .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-CrY5R38VHwn7wTwq .error-icon{fill:#552222;}#mermaid-svg-CrY5R38VHwn7wTwq .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-CrY5R38VHwn7wTwq .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-CrY5R38VHwn7wTwq .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-CrY5R38VHwn7wTwq .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-CrY5R38VHwn7wTwq .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-CrY5R38VHwn7wTwq .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-CrY5R38VHwn7wTwq .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-CrY5R38VHwn7wTwq .marker{fill:#333333;stroke:#333333;}#mermaid-svg-CrY5R38VHwn7wTwq .marker.cross{stroke:#333333;}#mermaid-svg-CrY5R38VHwn7wTwq svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-CrY5R38VHwn7wTwq p{margin:0;}#mermaid-svg-CrY5R38VHwn7wTwq .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-CrY5R38VHwn7wTwq .cluster-label text{fill:#333;}#mermaid-svg-CrY5R38VHwn7wTwq .cluster-label span{color:#333;}#mermaid-svg-CrY5R38VHwn7wTwq .cluster-label span p{background-color:transparent;}#mermaid-svg-CrY5R38VHwn7wTwq .label text,#mermaid-svg-CrY5R38VHwn7wTwq span{fill:#333;color:#333;}#mermaid-svg-CrY5R38VHwn7wTwq .node rect,#mermaid-svg-CrY5R38VHwn7wTwq .node circle,#mermaid-svg-CrY5R38VHwn7wTwq .node ellipse,#mermaid-svg-CrY5R38VHwn7wTwq .node polygon,#mermaid-svg-CrY5R38VHwn7wTwq .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-CrY5R38VHwn7wTwq .rough-node .label text,#mermaid-svg-CrY5R38VHwn7wTwq .node .label text,#mermaid-svg-CrY5R38VHwn7wTwq .image-shape .label,#mermaid-svg-CrY5R38VHwn7wTwq .icon-shape .label{text-anchor:middle;}#mermaid-svg-CrY5R38VHwn7wTwq .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-CrY5R38VHwn7wTwq .rough-node .label,#mermaid-svg-CrY5R38VHwn7wTwq .node .label,#mermaid-svg-CrY5R38VHwn7wTwq .image-shape .label,#mermaid-svg-CrY5R38VHwn7wTwq .icon-shape .label{text-align:center;}#mermaid-svg-CrY5R38VHwn7wTwq .node.clickable{cursor:pointer;}#mermaid-svg-CrY5R38VHwn7wTwq .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-CrY5R38VHwn7wTwq .arrowheadPath{fill:#333333;}#mermaid-svg-CrY5R38VHwn7wTwq .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-CrY5R38VHwn7wTwq .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-CrY5R38VHwn7wTwq .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-CrY5R38VHwn7wTwq .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-CrY5R38VHwn7wTwq .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-CrY5R38VHwn7wTwq .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-CrY5R38VHwn7wTwq .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-CrY5R38VHwn7wTwq .cluster text{fill:#333;}#mermaid-svg-CrY5R38VHwn7wTwq .cluster span{color:#333;}#mermaid-svg-CrY5R38VHwn7wTwq div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-CrY5R38VHwn7wTwq .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-CrY5R38VHwn7wTwq rect.text{fill:none;stroke-width:0;}#mermaid-svg-CrY5R38VHwn7wTwq .icon-shape,#mermaid-svg-CrY5R38VHwn7wTwq .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-CrY5R38VHwn7wTwq .icon-shape p,#mermaid-svg-CrY5R38VHwn7wTwq .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-CrY5R38VHwn7wTwq .icon-shape .label rect,#mermaid-svg-CrY5R38VHwn7wTwq .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-CrY5R38VHwn7wTwq .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-CrY5R38VHwn7wTwq .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-CrY5R38VHwn7wTwq :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

Temperature 低(接近 0)

回答稳定、可预测适合:写代码、翻译

Temperature 高(接近 1)

回答发散、有创意适合:写诗、头脑风暴

一句话:Temperature 和 Top-p 是「创造力的旋钮」——想要严谨稳定就调低,想要天马行空就调高。


三、提示词相关黑话

3.1 Prompt:你对模型说的话

Prompt 就是「你输入给模型的那段话」。它是你和 AI 沟通的唯一接口。

一个 Prompt 的例子:
「你是一位资深 Java 工程师,帮我解释一下 HashMap 的底层原理」

3.2 System Prompt:给模型定的「人设和规矩」

System Prompt 是最开头、最优先的那段指令,用来给模型定人设、立规矩。

System Prompt(定人设):
「你是一个严谨的代码审查助手,只回答技术问题,
不闲聊,回答要简洁,用中文,别夹英文缩写。」

#mermaid-svg-PY1EjdqaR1GA9vXu{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-PY1EjdqaR1GA9vXu .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-PY1EjdqaR1GA9vXu .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-PY1EjdqaR1GA9vXu .error-icon{fill:#552222;}#mermaid-svg-PY1EjdqaR1GA9vXu .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-PY1EjdqaR1GA9vXu .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-PY1EjdqaR1GA9vXu .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-PY1EjdqaR1GA9vXu .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-PY1EjdqaR1GA9vXu .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-PY1EjdqaR1GA9vXu .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-PY1EjdqaR1GA9vXu .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-PY1EjdqaR1GA9vXu .marker{fill:#333333;stroke:#333333;}#mermaid-svg-PY1EjdqaR1GA9vXu .marker.cross{stroke:#333333;}#mermaid-svg-PY1EjdqaR1GA9vXu svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-PY1EjdqaR1GA9vXu p{margin:0;}#mermaid-svg-PY1EjdqaR1GA9vXu .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-PY1EjdqaR1GA9vXu .cluster-label text{fill:#333;}#mermaid-svg-PY1EjdqaR1GA9vXu .cluster-label span{color:#333;}#mermaid-svg-PY1EjdqaR1GA9vXu .cluster-label span p{background-color:transparent;}#mermaid-svg-PY1EjdqaR1GA9vXu .label text,#mermaid-svg-PY1EjdqaR1GA9vXu span{fill:#333;color:#333;}#mermaid-svg-PY1EjdqaR1GA9vXu .node rect,#mermaid-svg-PY1EjdqaR1GA9vXu .node circle,#mermaid-svg-PY1EjdqaR1GA9vXu .node ellipse,#mermaid-svg-PY1EjdqaR1GA9vXu .node polygon,#mermaid-svg-PY1EjdqaR1GA9vXu .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-PY1EjdqaR1GA9vXu .rough-node .label text,#mermaid-svg-PY1EjdqaR1GA9vXu .node .label text,#mermaid-svg-PY1EjdqaR1GA9vXu .image-shape .label,#mermaid-svg-PY1EjdqaR1GA9vXu .icon-shape .label{text-anchor:middle;}#mermaid-svg-PY1EjdqaR1GA9vXu .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-PY1EjdqaR1GA9vXu .rough-node .label,#mermaid-svg-PY1EjdqaR1GA9vXu .node .label,#mermaid-svg-PY1EjdqaR1GA9vXu .image-shape .label,#mermaid-svg-PY1EjdqaR1GA9vXu .icon-shape .label{text-align:center;}#mermaid-svg-PY1EjdqaR1GA9vXu .node.clickable{cursor:pointer;}#mermaid-svg-PY1EjdqaR1GA9vXu .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-PY1EjdqaR1GA9vXu .arrowheadPath{fill:#333333;}#mermaid-svg-PY1EjdqaR1GA9vXu .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-PY1EjdqaR1GA9vXu .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-PY1EjdqaR1GA9vXu .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-PY1EjdqaR1GA9vXu .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-PY1EjdqaR1GA9vXu .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-PY1EjdqaR1GA9vXu .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-PY1EjdqaR1GA9vXu .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-PY1EjdqaR1GA9vXu .cluster text{fill:#333;}#mermaid-svg-PY1EjdqaR1GA9vXu .cluster span{color:#333;}#mermaid-svg-PY1EjdqaR1GA9vXu div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-PY1EjdqaR1GA9vXu .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-PY1EjdqaR1GA9vXu rect.text{fill:none;stroke-width:0;}#mermaid-svg-PY1EjdqaR1GA9vXu .icon-shape,#mermaid-svg-PY1EjdqaR1GA9vXu .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-PY1EjdqaR1GA9vXu .icon-shape p,#mermaid-svg-PY1EjdqaR1GA9vXu .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-PY1EjdqaR1GA9vXu .icon-shape .label rect,#mermaid-svg-PY1EjdqaR1GA9vXu .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-PY1EjdqaR1GA9vXu .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-PY1EjdqaR1GA9vXu .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-PY1EjdqaR1GA9vXu :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

System Prompt(人设 + 规矩)

模型

User Prompt(用户具体问题)

按人设 + 规矩回答

一句话:Prompt 是「你问什么」,System Prompt 是「你让它是谁」。System Prompt 优先级最高,能「约束」模型后续的所有行为。

3.3 Prompt Engineering:提示词工程

Prompt Engineering,就是「怎么把话说到位」的技巧。核心思想:说清楚、给框架、给示例。

❌ 差 Prompt:「写个排序」
✅ 好 Prompt:「用 Java 写一个冒泡排序,加上详细注释,
解释时间复杂度,再给一个使用示例」

一句话:Prompt Engineering 不是玄学,本质就是「把需求说清楚」——目标、约束、格式、示例,交代得越全,模型做得越准。

3.4 Few-shot / Zero-shot:给不给示例

这两个词描述「你给模型示例了吗」:

术语含义类比
Zero-shot 不给示例,直接问 让没见过的题
Few-shot 给几个示例,再问 先看例题再做

Few-shot 示例:
「把英文转中文。示例1:hello → 你好;示例2:world → 世界。
现在请翻译:java → ?」

一句话:Few-shot 就是「先给它看几个答案,它照着学」,往往比 Zero-shot 更准。


四、让模型「变聪明」的三种方式(重点)

这一章是全文的核心。 很多人分不清 Prompt、RAG、Fine-tuning,其实它们对应「让 AI 变强」的三条完全不同的路。

#mermaid-svg-YdvQB4KbtJanXf1A{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-YdvQB4KbtJanXf1A .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-YdvQB4KbtJanXf1A .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-YdvQB4KbtJanXf1A .error-icon{fill:#552222;}#mermaid-svg-YdvQB4KbtJanXf1A .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-YdvQB4KbtJanXf1A .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-YdvQB4KbtJanXf1A .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-YdvQB4KbtJanXf1A .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-YdvQB4KbtJanXf1A .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-YdvQB4KbtJanXf1A .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-YdvQB4KbtJanXf1A .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-YdvQB4KbtJanXf1A .marker{fill:#333333;stroke:#333333;}#mermaid-svg-YdvQB4KbtJanXf1A .marker.cross{stroke:#333333;}#mermaid-svg-YdvQB4KbtJanXf1A svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-YdvQB4KbtJanXf1A p{margin:0;}#mermaid-svg-YdvQB4KbtJanXf1A .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-YdvQB4KbtJanXf1A .cluster-label text{fill:#333;}#mermaid-svg-YdvQB4KbtJanXf1A .cluster-label span{color:#333;}#mermaid-svg-YdvQB4KbtJanXf1A .cluster-label span p{background-color:transparent;}#mermaid-svg-YdvQB4KbtJanXf1A .label text,#mermaid-svg-YdvQB4KbtJanXf1A span{fill:#333;color:#333;}#mermaid-svg-YdvQB4KbtJanXf1A .node rect,#mermaid-svg-YdvQB4KbtJanXf1A .node circle,#mermaid-svg-YdvQB4KbtJanXf1A .node ellipse,#mermaid-svg-YdvQB4KbtJanXf1A .node polygon,#mermaid-svg-YdvQB4KbtJanXf1A .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-YdvQB4KbtJanXf1A .rough-node .label text,#mermaid-svg-YdvQB4KbtJanXf1A .node .label text,#mermaid-svg-YdvQB4KbtJanXf1A .image-shape .label,#mermaid-svg-YdvQB4KbtJanXf1A .icon-shape .label{text-anchor:middle;}#mermaid-svg-YdvQB4KbtJanXf1A .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-YdvQB4KbtJanXf1A .rough-node .label,#mermaid-svg-YdvQB4KbtJanXf1A .node .label,#mermaid-svg-YdvQB4KbtJanXf1A .image-shape .label,#mermaid-svg-YdvQB4KbtJanXf1A .icon-shape .label{text-align:center;}#mermaid-svg-YdvQB4KbtJanXf1A .node.clickable{cursor:pointer;}#mermaid-svg-YdvQB4KbtJanXf1A .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-YdvQB4KbtJanXf1A .arrowheadPath{fill:#333333;}#mermaid-svg-YdvQB4KbtJanXf1A .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-YdvQB4KbtJanXf1A .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-YdvQB4KbtJanXf1A .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-YdvQB4KbtJanXf1A .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-YdvQB4KbtJanXf1A .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-YdvQB4KbtJanXf1A .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-YdvQB4KbtJanXf1A .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-YdvQB4KbtJanXf1A .cluster text{fill:#333;}#mermaid-svg-YdvQB4KbtJanXf1A .cluster span{color:#333;}#mermaid-svg-YdvQB4KbtJanXf1A div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-YdvQB4KbtJanXf1A .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-YdvQB4KbtJanXf1A rect.text{fill:none;stroke-width:0;}#mermaid-svg-YdvQB4KbtJanXf1A .icon-shape,#mermaid-svg-YdvQB4KbtJanXf1A .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-YdvQB4KbtJanXf1A .icon-shape p,#mermaid-svg-YdvQB4KbtJanXf1A .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-YdvQB4KbtJanXf1A .icon-shape .label rect,#mermaid-svg-YdvQB4KbtJanXf1A .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-YdvQB4KbtJanXf1A .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-YdvQB4KbtJanXf1A .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-YdvQB4KbtJanXf1A :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

成本最低

成本中等

成本最高

想让 AI 更懂你的业务

① Prompt不改模型,只改「怎么说」

② RAG不改模型,给它「查资料」

③ Fine-tuning改模型,用数据「教」它

零成本

中成本

高成本

方式改不改模型核心动作类比成本
Prompt ❌ 不改 优化输入 换个说法问 最低
RAG ❌ 不改 给它查资料 开卷考试 中等
Fine-tuning ✅ 改 用数据训练 补课/深造 最高

#mermaid-svg-fVzQpwDphBd7oP6P{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-fVzQpwDphBd7oP6P .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-fVzQpwDphBd7oP6P .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-fVzQpwDphBd7oP6P .error-icon{fill:#552222;}#mermaid-svg-fVzQpwDphBd7oP6P .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-fVzQpwDphBd7oP6P .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-fVzQpwDphBd7oP6P .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-fVzQpwDphBd7oP6P .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-fVzQpwDphBd7oP6P .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-fVzQpwDphBd7oP6P .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-fVzQpwDphBd7oP6P .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-fVzQpwDphBd7oP6P .marker{fill:#333333;stroke:#333333;}#mermaid-svg-fVzQpwDphBd7oP6P .marker.cross{stroke:#333333;}#mermaid-svg-fVzQpwDphBd7oP6P svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-fVzQpwDphBd7oP6P p{margin:0;}#mermaid-svg-fVzQpwDphBd7oP6P .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-fVzQpwDphBd7oP6P .cluster-label text{fill:#333;}#mermaid-svg-fVzQpwDphBd7oP6P .cluster-label span{color:#333;}#mermaid-svg-fVzQpwDphBd7oP6P .cluster-label span p{background-color:transparent;}#mermaid-svg-fVzQpwDphBd7oP6P .label text,#mermaid-svg-fVzQpwDphBd7oP6P span{fill:#333;color:#333;}#mermaid-svg-fVzQpwDphBd7oP6P .node rect,#mermaid-svg-fVzQpwDphBd7oP6P .node circle,#mermaid-svg-fVzQpwDphBd7oP6P .node ellipse,#mermaid-svg-fVzQpwDphBd7oP6P .node polygon,#mermaid-svg-fVzQpwDphBd7oP6P .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-fVzQpwDphBd7oP6P .rough-node .label text,#mermaid-svg-fVzQpwDphBd7oP6P .node .label text,#mermaid-svg-fVzQpwDphBd7oP6P .image-shape .label,#mermaid-svg-fVzQpwDphBd7oP6P .icon-shape .label{text-anchor:middle;}#mermaid-svg-fVzQpwDphBd7oP6P .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-fVzQpwDphBd7oP6P .rough-node .label,#mermaid-svg-fVzQpwDphBd7oP6P .node .label,#mermaid-svg-fVzQpwDphBd7oP6P .image-shape .label,#mermaid-svg-fVzQpwDphBd7oP6P .icon-shape .label{text-align:center;}#mermaid-svg-fVzQpwDphBd7oP6P .node.clickable{cursor:pointer;}#mermaid-svg-fVzQpwDphBd7oP6P .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-fVzQpwDphBd7oP6P .arrowheadPath{fill:#333333;}#mermaid-svg-fVzQpwDphBd7oP6P .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-fVzQpwDphBd7oP6P .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-fVzQpwDphBd7oP6P .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-fVzQpwDphBd7oP6P .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-fVzQpwDphBd7oP6P .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-fVzQpwDphBd7oP6P .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-fVzQpwDphBd7oP6P .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-fVzQpwDphBd7oP6P .cluster text{fill:#333;}#mermaid-svg-fVzQpwDphBd7oP6P .cluster span{color:#333;}#mermaid-svg-fVzQpwDphBd7oP6P div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-fVzQpwDphBd7oP6P .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-fVzQpwDphBd7oP6P rect.text{fill:none;stroke-width:0;}#mermaid-svg-fVzQpwDphBd7oP6P .icon-shape,#mermaid-svg-fVzQpwDphBd7oP6P .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-fVzQpwDphBd7oP6P .icon-shape p,#mermaid-svg-fVzQpwDphBd7oP6P .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-fVzQpwDphBd7oP6P .icon-shape .label rect,#mermaid-svg-fVzQpwDphBd7oP6P .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-fVzQpwDphBd7oP6P .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-fVzQpwDphBd7oP6P .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-fVzQpwDphBd7oP6P :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

Fine-tuning

用数据训练

模型变了

RAG

检索外部资料

模型不变

Prompt

改输入

模型不变

一句话:Prompt 是「换个方式问」,RAG 是「给它开卷考试」,Fine-tuning 是「给它补课深造」。 记住这三句类比,三者的区别一辈子忘不掉。

一个实用的选择口诀:

场景选哪个
只是想让回答更准 先优化 Prompt
需要模型知道「私有知识」(文档、数据库) 用 RAG
需要模型「学会某种风格/能力」(如专业术语、特定格式) 用 Fine-tuning
知识经常变 RAG(更新资料即可,不用重训)
知识相对固定、要深度内化 Fine-tuning

五、RAG 深入:给模型「开卷考试」

RAG(Retrieval-Augmented Generation,检索增强生成),是现在最火的落地方式。它解决一个痛点:大模型不知道你的私有数据(你的文档、你的数据库,它训练时没见过)。

RAG 的思路很简单:不让模型「背」,而是让它「现场查」。

5.1 RAG 的完整流程

#mermaid-svg-YjonOgHfE4kQvrjh{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-YjonOgHfE4kQvrjh .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-YjonOgHfE4kQvrjh .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-YjonOgHfE4kQvrjh .error-icon{fill:#552222;}#mermaid-svg-YjonOgHfE4kQvrjh .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-YjonOgHfE4kQvrjh .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-YjonOgHfE4kQvrjh .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-YjonOgHfE4kQvrjh .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-YjonOgHfE4kQvrjh .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-YjonOgHfE4kQvrjh .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-YjonOgHfE4kQvrjh .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-YjonOgHfE4kQvrjh .marker{fill:#333333;stroke:#333333;}#mermaid-svg-YjonOgHfE4kQvrjh .marker.cross{stroke:#333333;}#mermaid-svg-YjonOgHfE4kQvrjh svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-YjonOgHfE4kQvrjh p{margin:0;}#mermaid-svg-YjonOgHfE4kQvrjh .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-YjonOgHfE4kQvrjh .cluster-label text{fill:#333;}#mermaid-svg-YjonOgHfE4kQvrjh .cluster-label span{color:#333;}#mermaid-svg-YjonOgHfE4kQvrjh .cluster-label span p{background-color:transparent;}#mermaid-svg-YjonOgHfE4kQvrjh .label text,#mermaid-svg-YjonOgHfE4kQvrjh span{fill:#333;color:#333;}#mermaid-svg-YjonOgHfE4kQvrjh .node rect,#mermaid-svg-YjonOgHfE4kQvrjh .node circle,#mermaid-svg-YjonOgHfE4kQvrjh .node ellipse,#mermaid-svg-YjonOgHfE4kQvrjh .node polygon,#mermaid-svg-YjonOgHfE4kQvrjh .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-YjonOgHfE4kQvrjh .rough-node .label text,#mermaid-svg-YjonOgHfE4kQvrjh .node .label text,#mermaid-svg-YjonOgHfE4kQvrjh .image-shape .label,#mermaid-svg-YjonOgHfE4kQvrjh .icon-shape .label{text-anchor:middle;}#mermaid-svg-YjonOgHfE4kQvrjh .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-YjonOgHfE4kQvrjh .rough-node .label,#mermaid-svg-YjonOgHfE4kQvrjh .node .label,#mermaid-svg-YjonOgHfE4kQvrjh .image-shape .label,#mermaid-svg-YjonOgHfE4kQvrjh .icon-shape .label{text-align:center;}#mermaid-svg-YjonOgHfE4kQvrjh .node.clickable{cursor:pointer;}#mermaid-svg-YjonOgHfE4kQvrjh .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-YjonOgHfE4kQvrjh .arrowheadPath{fill:#333333;}#mermaid-svg-YjonOgHfE4kQvrjh .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-YjonOgHfE4kQvrjh .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-YjonOgHfE4kQvrjh .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-YjonOgHfE4kQvrjh .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-YjonOgHfE4kQvrjh .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-YjonOgHfE4kQvrjh .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-YjonOgHfE4kQvrjh .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-YjonOgHfE4kQvrjh .cluster text{fill:#333;}#mermaid-svg-YjonOgHfE4kQvrjh .cluster span{color:#333;}#mermaid-svg-YjonOgHfE4kQvrjh div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-YjonOgHfE4kQvrjh .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-YjonOgHfE4kQvrjh rect.text{fill:none;stroke-width:0;}#mermaid-svg-YjonOgHfE4kQvrjh .icon-shape,#mermaid-svg-YjonOgHfE4kQvrjh .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-YjonOgHfE4kQvrjh .icon-shape p,#mermaid-svg-YjonOgHfE4kQvrjh .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-YjonOgHfE4kQvrjh .icon-shape .label rect,#mermaid-svg-YjonOgHfE4kQvrjh .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-YjonOgHfE4kQvrjh .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-YjonOgHfE4kQvrjh .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-YjonOgHfE4kQvrjh :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

用户提问

① 检索 Retrieval从资料库找相关内容

② 增强 Augmented把查到的资料拼进问题

③ 生成 Generation模型基于资料回答

带依据的回答


用户问:「我们公司的年假政策是什么?」

RAG 过程:
① 检索:从「员工手册」里找到「年假」相关段落
② 增强:把这段手册内容,拼在用户问题后面
③ 生成:模型读着手册内容,回答「贵司年假是…」

5.2 关键配套:Embedding 和向量数据库

RAG 的「检索」不是靠关键词,而是靠 Embedding(向量化):

Embedding 就是把一段文字,变成一串「坐标数字」,保证「意思越近的文字,坐标离得越近」。

#mermaid-svg-Og7unyAM0Nq46azw{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-Og7unyAM0Nq46azw .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-Og7unyAM0Nq46azw .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-Og7unyAM0Nq46azw .error-icon{fill:#552222;}#mermaid-svg-Og7unyAM0Nq46azw .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-Og7unyAM0Nq46azw .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-Og7unyAM0Nq46azw .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-Og7unyAM0Nq46azw .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-Og7unyAM0Nq46azw .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-Og7unyAM0Nq46azw .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-Og7unyAM0Nq46azw .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-Og7unyAM0Nq46azw .marker{fill:#333333;stroke:#333333;}#mermaid-svg-Og7unyAM0Nq46azw .marker.cross{stroke:#333333;}#mermaid-svg-Og7unyAM0Nq46azw svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-Og7unyAM0Nq46azw p{margin:0;}#mermaid-svg-Og7unyAM0Nq46azw .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-Og7unyAM0Nq46azw .cluster-label text{fill:#333;}#mermaid-svg-Og7unyAM0Nq46azw .cluster-label span{color:#333;}#mermaid-svg-Og7unyAM0Nq46azw .cluster-label span p{background-color:transparent;}#mermaid-svg-Og7unyAM0Nq46azw .label text,#mermaid-svg-Og7unyAM0Nq46azw span{fill:#333;color:#333;}#mermaid-svg-Og7unyAM0Nq46azw .node rect,#mermaid-svg-Og7unyAM0Nq46azw .node circle,#mermaid-svg-Og7unyAM0Nq46azw .node ellipse,#mermaid-svg-Og7unyAM0Nq46azw .node polygon,#mermaid-svg-Og7unyAM0Nq46azw .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-Og7unyAM0Nq46azw .rough-node .label text,#mermaid-svg-Og7unyAM0Nq46azw .node .label text,#mermaid-svg-Og7unyAM0Nq46azw .image-shape .label,#mermaid-svg-Og7unyAM0Nq46azw .icon-shape .label{text-anchor:middle;}#mermaid-svg-Og7unyAM0Nq46azw .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-Og7unyAM0Nq46azw .rough-node .label,#mermaid-svg-Og7unyAM0Nq46azw .node .label,#mermaid-svg-Og7unyAM0Nq46azw .image-shape .label,#mermaid-svg-Og7unyAM0Nq46azw .icon-shape .label{text-align:center;}#mermaid-svg-Og7unyAM0Nq46azw .node.clickable{cursor:pointer;}#mermaid-svg-Og7unyAM0Nq46azw .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-Og7unyAM0Nq46azw .arrowheadPath{fill:#333333;}#mermaid-svg-Og7unyAM0Nq46azw .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-Og7unyAM0Nq46azw .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-Og7unyAM0Nq46azw .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Og7unyAM0Nq46azw .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-Og7unyAM0Nq46azw .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Og7unyAM0Nq46azw .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-Og7unyAM0Nq46azw .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-Og7unyAM0Nq46azw .cluster text{fill:#333;}#mermaid-svg-Og7unyAM0Nq46azw .cluster span{color:#333;}#mermaid-svg-Og7unyAM0Nq46azw div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-Og7unyAM0Nq46azw .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-Og7unyAM0Nq46azw rect.text{fill:none;stroke-width:0;}#mermaid-svg-Og7unyAM0Nq46azw .icon-shape,#mermaid-svg-Og7unyAM0Nq46azw .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Og7unyAM0Nq46azw .icon-shape p,#mermaid-svg-Og7unyAM0Nq46azw .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-Og7unyAM0Nq46azw .icon-shape .label rect,#mermaid-svg-Og7unyAM0Nq46azw .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Og7unyAM0Nq46azw .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-Og7unyAM0Nq46azw .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-Og7unyAM0Nq46azw :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

意思近,距离近

意思远,距离远

「年假怎么休」

坐标 A

「休假政策」

坐标 B

「今天吃什么」

坐标 C

这些「坐标」存在 向量数据库(Vector Database) 里。提问时,把问题也转成坐标,找「离它最近的几段资料」。

一句话:RAG = 检索 + 增强 + 生成。它让模型不用「背下所有知识」,而是「用到时现查」。Embedding 负责「把意思变成坐标」,向量数据库负责「存坐标、找最近的」。


六、Fine-tuning 深入:给模型「补课」

Fine-tuning(微调),是「用你自己的数据,去训练/调整模型」,让它真正「学会」某种知识或风格。

6.1 RAG vs Fine-tuning:本质区别

维度RAGFine-tuning
知识放哪 外部资料库 内化进模型参数
模型变了吗 没变 变了
更新知识 换资料即可 要重新训练
类比 开卷考试 把知识背下来

#mermaid-svg-M1aIpx8tiq6ZV8e6{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .error-icon{fill:#552222;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .marker.cross{stroke:#333333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-M1aIpx8tiq6ZV8e6 p{margin:0;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .cluster-label text{fill:#333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .cluster-label span{color:#333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .cluster-label span p{background-color:transparent;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .label text,#mermaid-svg-M1aIpx8tiq6ZV8e6 span{fill:#333;color:#333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .node rect,#mermaid-svg-M1aIpx8tiq6ZV8e6 .node circle,#mermaid-svg-M1aIpx8tiq6ZV8e6 .node ellipse,#mermaid-svg-M1aIpx8tiq6ZV8e6 .node polygon,#mermaid-svg-M1aIpx8tiq6ZV8e6 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .rough-node .label text,#mermaid-svg-M1aIpx8tiq6ZV8e6 .node .label text,#mermaid-svg-M1aIpx8tiq6ZV8e6 .image-shape .label,#mermaid-svg-M1aIpx8tiq6ZV8e6 .icon-shape .label{text-anchor:middle;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .rough-node .label,#mermaid-svg-M1aIpx8tiq6ZV8e6 .node .label,#mermaid-svg-M1aIpx8tiq6ZV8e6 .image-shape .label,#mermaid-svg-M1aIpx8tiq6ZV8e6 .icon-shape .label{text-align:center;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .node.clickable{cursor:pointer;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .arrowheadPath{fill:#333333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-M1aIpx8tiq6ZV8e6 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-M1aIpx8tiq6ZV8e6 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-M1aIpx8tiq6ZV8e6 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .cluster text{fill:#333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .cluster span{color:#333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-M1aIpx8tiq6ZV8e6 rect.text{fill:none;stroke-width:0;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .icon-shape,#mermaid-svg-M1aIpx8tiq6ZV8e6 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .icon-shape p,#mermaid-svg-M1aIpx8tiq6ZV8e6 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .icon-shape .label rect,#mermaid-svg-M1aIpx8tiq6ZV8e6 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-M1aIpx8tiq6ZV8e6 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-M1aIpx8tiq6ZV8e6 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-M1aIpx8tiq6ZV8e6 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

Fine-tuning(背下来)

训练

数据

模型(知识内化)

RAG(开卷)

现场查

模型

资料库

6.2 LoRA:低成本的微调

Fine-tuning 很贵(要动整个大模型)。LoRA(Low-Rank Adaptation) 是一种「省钱版微调」——不重训整个模型,只训练「一小部分参数」,成本大幅降低。

一句话:如果 Fine-tuning 是「回炉重造整个脑子」,LoRA 就是「只补一小块课」。

6.3 RLHF:用人类反馈训练

RLHF(Reinforcement Learning from Human Feedback,基于人类反馈的强化学习),是让模型「学会什么回答是人类喜欢的」。

#mermaid-svg-H1tL4YwHVGN1Ct2y{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-H1tL4YwHVGN1Ct2y .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-H1tL4YwHVGN1Ct2y .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-H1tL4YwHVGN1Ct2y .error-icon{fill:#552222;}#mermaid-svg-H1tL4YwHVGN1Ct2y .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-H1tL4YwHVGN1Ct2y .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-H1tL4YwHVGN1Ct2y .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-H1tL4YwHVGN1Ct2y .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-H1tL4YwHVGN1Ct2y .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-H1tL4YwHVGN1Ct2y .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-H1tL4YwHVGN1Ct2y .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-H1tL4YwHVGN1Ct2y .marker{fill:#333333;stroke:#333333;}#mermaid-svg-H1tL4YwHVGN1Ct2y .marker.cross{stroke:#333333;}#mermaid-svg-H1tL4YwHVGN1Ct2y svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-H1tL4YwHVGN1Ct2y p{margin:0;}#mermaid-svg-H1tL4YwHVGN1Ct2y .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-H1tL4YwHVGN1Ct2y .cluster-label text{fill:#333;}#mermaid-svg-H1tL4YwHVGN1Ct2y .cluster-label span{color:#333;}#mermaid-svg-H1tL4YwHVGN1Ct2y .cluster-label span p{background-color:transparent;}#mermaid-svg-H1tL4YwHVGN1Ct2y .label text,#mermaid-svg-H1tL4YwHVGN1Ct2y span{fill:#333;color:#333;}#mermaid-svg-H1tL4YwHVGN1Ct2y .node rect,#mermaid-svg-H1tL4YwHVGN1Ct2y .node circle,#mermaid-svg-H1tL4YwHVGN1Ct2y .node ellipse,#mermaid-svg-H1tL4YwHVGN1Ct2y .node polygon,#mermaid-svg-H1tL4YwHVGN1Ct2y .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-H1tL4YwHVGN1Ct2y .rough-node .label text,#mermaid-svg-H1tL4YwHVGN1Ct2y .node .label text,#mermaid-svg-H1tL4YwHVGN1Ct2y .image-shape .label,#mermaid-svg-H1tL4YwHVGN1Ct2y .icon-shape .label{text-anchor:middle;}#mermaid-svg-H1tL4YwHVGN1Ct2y .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-H1tL4YwHVGN1Ct2y .rough-node .label,#mermaid-svg-H1tL4YwHVGN1Ct2y .node .label,#mermaid-svg-H1tL4YwHVGN1Ct2y .image-shape .label,#mermaid-svg-H1tL4YwHVGN1Ct2y .icon-shape .label{text-align:center;}#mermaid-svg-H1tL4YwHVGN1Ct2y .node.clickable{cursor:pointer;}#mermaid-svg-H1tL4YwHVGN1Ct2y .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-H1tL4YwHVGN1Ct2y .arrowheadPath{fill:#333333;}#mermaid-svg-H1tL4YwHVGN1Ct2y .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-H1tL4YwHVGN1Ct2y .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-H1tL4YwHVGN1Ct2y .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-H1tL4YwHVGN1Ct2y .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-H1tL4YwHVGN1Ct2y .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-H1tL4YwHVGN1Ct2y .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-H1tL4YwHVGN1Ct2y .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-H1tL4YwHVGN1Ct2y .cluster text{fill:#333;}#mermaid-svg-H1tL4YwHVGN1Ct2y .cluster span{color:#333;}#mermaid-svg-H1tL4YwHVGN1Ct2y div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-H1tL4YwHVGN1Ct2y .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-H1tL4YwHVGN1Ct2y rect.text{fill:none;stroke-width:0;}#mermaid-svg-H1tL4YwHVGN1Ct2y .icon-shape,#mermaid-svg-H1tL4YwHVGN1Ct2y .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-H1tL4YwHVGN1Ct2y .icon-shape p,#mermaid-svg-H1tL4YwHVGN1Ct2y .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-H1tL4YwHVGN1Ct2y .icon-shape .label rect,#mermaid-svg-H1tL4YwHVGN1Ct2y .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-H1tL4YwHVGN1Ct2y .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-H1tL4YwHVGN1Ct2y .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-H1tL4YwHVGN1Ct2y :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

反馈

模型给出回答

人类打分/排序

调整模型

一句话:RLHF 就是「人给答案打分,模型照着改」,让模型的回答更符合人类的偏好。

6.4 什么时候该微调?

情况建议
知识频繁更新 ❌ 别微调,用 RAG
需要模型「稳定输出某种格式/风格」 ✅ 可微调
有大量高质量标注数据 ✅ 可微调
只是想让它知道你的文档 ❌ 用 RAG 更划算

一句话:能 RAG 就 RAG,非必要不微调。因为 RAG 灵活(换资料就行),微调又贵又不灵活(知识变了要重训)。


七、应用相关黑话

7.1 Agent:能自主干活的 AI

Agent(智能体),是「能自主规划、调用工具、完成复杂任务的 AI 应用」。它不只是「一问一答」,而是「自己拆任务、自己干、自己检查」。

#mermaid-svg-y0Hc0wIXiwMzCtXz{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-y0Hc0wIXiwMzCtXz .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-y0Hc0wIXiwMzCtXz .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-y0Hc0wIXiwMzCtXz .error-icon{fill:#552222;}#mermaid-svg-y0Hc0wIXiwMzCtXz .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-y0Hc0wIXiwMzCtXz .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-y0Hc0wIXiwMzCtXz .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-y0Hc0wIXiwMzCtXz .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-y0Hc0wIXiwMzCtXz .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-y0Hc0wIXiwMzCtXz .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-y0Hc0wIXiwMzCtXz .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-y0Hc0wIXiwMzCtXz .marker{fill:#333333;stroke:#333333;}#mermaid-svg-y0Hc0wIXiwMzCtXz .marker.cross{stroke:#333333;}#mermaid-svg-y0Hc0wIXiwMzCtXz svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-y0Hc0wIXiwMzCtXz p{margin:0;}#mermaid-svg-y0Hc0wIXiwMzCtXz .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-y0Hc0wIXiwMzCtXz .cluster-label text{fill:#333;}#mermaid-svg-y0Hc0wIXiwMzCtXz .cluster-label span{color:#333;}#mermaid-svg-y0Hc0wIXiwMzCtXz .cluster-label span p{background-color:transparent;}#mermaid-svg-y0Hc0wIXiwMzCtXz .label text,#mermaid-svg-y0Hc0wIXiwMzCtXz span{fill:#333;color:#333;}#mermaid-svg-y0Hc0wIXiwMzCtXz .node rect,#mermaid-svg-y0Hc0wIXiwMzCtXz .node circle,#mermaid-svg-y0Hc0wIXiwMzCtXz .node ellipse,#mermaid-svg-y0Hc0wIXiwMzCtXz .node polygon,#mermaid-svg-y0Hc0wIXiwMzCtXz .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-y0Hc0wIXiwMzCtXz .rough-node .label text,#mermaid-svg-y0Hc0wIXiwMzCtXz .node .label text,#mermaid-svg-y0Hc0wIXiwMzCtXz .image-shape .label,#mermaid-svg-y0Hc0wIXiwMzCtXz .icon-shape .label{text-anchor:middle;}#mermaid-svg-y0Hc0wIXiwMzCtXz .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-y0Hc0wIXiwMzCtXz .rough-node .label,#mermaid-svg-y0Hc0wIXiwMzCtXz .node .label,#mermaid-svg-y0Hc0wIXiwMzCtXz .image-shape .label,#mermaid-svg-y0Hc0wIXiwMzCtXz .icon-shape .label{text-align:center;}#mermaid-svg-y0Hc0wIXiwMzCtXz .node.clickable{cursor:pointer;}#mermaid-svg-y0Hc0wIXiwMzCtXz .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-y0Hc0wIXiwMzCtXz .arrowheadPath{fill:#333333;}#mermaid-svg-y0Hc0wIXiwMzCtXz .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-y0Hc0wIXiwMzCtXz .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-y0Hc0wIXiwMzCtXz .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-y0Hc0wIXiwMzCtXz .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-y0Hc0wIXiwMzCtXz .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-y0Hc0wIXiwMzCtXz .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-y0Hc0wIXiwMzCtXz .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-y0Hc0wIXiwMzCtXz .cluster text{fill:#333;}#mermaid-svg-y0Hc0wIXiwMzCtXz .cluster span{color:#333;}#mermaid-svg-y0Hc0wIXiwMzCtXz div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-y0Hc0wIXiwMzCtXz .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-y0Hc0wIXiwMzCtXz rect.text{fill:none;stroke-width:0;}#mermaid-svg-y0Hc0wIXiwMzCtXz .icon-shape,#mermaid-svg-y0Hc0wIXiwMzCtXz .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-y0Hc0wIXiwMzCtXz .icon-shape p,#mermaid-svg-y0Hc0wIXiwMzCtXz .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-y0Hc0wIXiwMzCtXz .icon-shape .label rect,#mermaid-svg-y0Hc0wIXiwMzCtXz .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-y0Hc0wIXiwMzCtXz .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-y0Hc0wIXiwMzCtXz .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-y0Hc0wIXiwMzCtXz :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

完成

用户目标

规划:拆步骤

调用工具干活

完成了吗?

交付结果

一句话:普通 AI 是「你问它答」,Agent 是「你给目标,它自己跑完全程」。

7.2 Function Calling:让模型会「调工具」

Function Calling(函数调用),是让模型能「调用外部工具/函数」的能力。模型不再只会「说」,还能「动手」——查数据库、调 API、发请求。

注意:模型并不真的「执行」工具,它只是「决定调哪个、传什么参」,真正执行的是外面的程序。这和你写 Java 时「调用一个方法」是类似的思路。

#mermaid-svg-dYFMP14LakWIc947{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-dYFMP14LakWIc947 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-dYFMP14LakWIc947 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-dYFMP14LakWIc947 .error-icon{fill:#552222;}#mermaid-svg-dYFMP14LakWIc947 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-dYFMP14LakWIc947 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-dYFMP14LakWIc947 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-dYFMP14LakWIc947 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-dYFMP14LakWIc947 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-dYFMP14LakWIc947 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-dYFMP14LakWIc947 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-dYFMP14LakWIc947 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-dYFMP14LakWIc947 .marker.cross{stroke:#333333;}#mermaid-svg-dYFMP14LakWIc947 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-dYFMP14LakWIc947 p{margin:0;}#mermaid-svg-dYFMP14LakWIc947 .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-dYFMP14LakWIc947 .cluster-label text{fill:#333;}#mermaid-svg-dYFMP14LakWIc947 .cluster-label span{color:#333;}#mermaid-svg-dYFMP14LakWIc947 .cluster-label span p{background-color:transparent;}#mermaid-svg-dYFMP14LakWIc947 .label text,#mermaid-svg-dYFMP14LakWIc947 span{fill:#333;color:#333;}#mermaid-svg-dYFMP14LakWIc947 .node rect,#mermaid-svg-dYFMP14LakWIc947 .node circle,#mermaid-svg-dYFMP14LakWIc947 .node ellipse,#mermaid-svg-dYFMP14LakWIc947 .node polygon,#mermaid-svg-dYFMP14LakWIc947 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-dYFMP14LakWIc947 .rough-node .label text,#mermaid-svg-dYFMP14LakWIc947 .node .label text,#mermaid-svg-dYFMP14LakWIc947 .image-shape .label,#mermaid-svg-dYFMP14LakWIc947 .icon-shape .label{text-anchor:middle;}#mermaid-svg-dYFMP14LakWIc947 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-dYFMP14LakWIc947 .rough-node .label,#mermaid-svg-dYFMP14LakWIc947 .node .label,#mermaid-svg-dYFMP14LakWIc947 .image-shape .label,#mermaid-svg-dYFMP14LakWIc947 .icon-shape .label{text-align:center;}#mermaid-svg-dYFMP14LakWIc947 .node.clickable{cursor:pointer;}#mermaid-svg-dYFMP14LakWIc947 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-dYFMP14LakWIc947 .arrowheadPath{fill:#333333;}#mermaid-svg-dYFMP14LakWIc947 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-dYFMP14LakWIc947 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-dYFMP14LakWIc947 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-dYFMP14LakWIc947 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-dYFMP14LakWIc947 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-dYFMP14LakWIc947 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-dYFMP14LakWIc947 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-dYFMP14LakWIc947 .cluster text{fill:#333;}#mermaid-svg-dYFMP14LakWIc947 .cluster span{color:#333;}#mermaid-svg-dYFMP14LakWIc947 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-dYFMP14LakWIc947 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-dYFMP14LakWIc947 rect.text{fill:none;stroke-width:0;}#mermaid-svg-dYFMP14LakWIc947 .icon-shape,#mermaid-svg-dYFMP14LakWIc947 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-dYFMP14LakWIc947 .icon-shape p,#mermaid-svg-dYFMP14LakWIc947 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-dYFMP14LakWIc947 .icon-shape .label rect,#mermaid-svg-dYFMP14LakWIc947 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-dYFMP14LakWIc947 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-dYFMP14LakWIc947 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-dYFMP14LakWIc947 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

决定调用

宿主执行

回填

模型:"我要查订单"

query_order(id=1001)

返回结果

一句话:Function Calling 让模型从「只会说」进化到「能干活」——它是 Agent 的「手」。

7.3 幻觉(Hallucination):一本正经胡说八道

幻觉,是模型「一本正经地编造不存在的答案」。它不知道自己不知道,还会编得有理有据。

你问:「xxx 公司的 CEO 是谁?」
模型幻觉:「是张三。」(实际上张三根本不存在,模型瞎编的)

一句话:幻觉是 AI 最危险的毛病——它不会说「我不知道」,而是会自信地编一个。所以关键信息,别光信它,要核实。

7.4 多模态(Multimodal):能看图、听声音

多模态,就是模型不再只处理文字,还能处理图像、语音、视频。

#mermaid-svg-SHaaZctCWWnWmLIi{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-SHaaZctCWWnWmLIi .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-SHaaZctCWWnWmLIi .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-SHaaZctCWWnWmLIi .error-icon{fill:#552222;}#mermaid-svg-SHaaZctCWWnWmLIi .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-SHaaZctCWWnWmLIi .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-SHaaZctCWWnWmLIi .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-SHaaZctCWWnWmLIi .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-SHaaZctCWWnWmLIi .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-SHaaZctCWWnWmLIi .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-SHaaZctCWWnWmLIi .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-SHaaZctCWWnWmLIi .marker{fill:#333333;stroke:#333333;}#mermaid-svg-SHaaZctCWWnWmLIi .marker.cross{stroke:#333333;}#mermaid-svg-SHaaZctCWWnWmLIi svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-SHaaZctCWWnWmLIi p{margin:0;}#mermaid-svg-SHaaZctCWWnWmLIi .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-SHaaZctCWWnWmLIi .cluster-label text{fill:#333;}#mermaid-svg-SHaaZctCWWnWmLIi .cluster-label span{color:#333;}#mermaid-svg-SHaaZctCWWnWmLIi .cluster-label span p{background-color:transparent;}#mermaid-svg-SHaaZctCWWnWmLIi .label text,#mermaid-svg-SHaaZctCWWnWmLIi span{fill:#333;color:#333;}#mermaid-svg-SHaaZctCWWnWmLIi .node rect,#mermaid-svg-SHaaZctCWWnWmLIi .node circle,#mermaid-svg-SHaaZctCWWnWmLIi .node ellipse,#mermaid-svg-SHaaZctCWWnWmLIi .node polygon,#mermaid-svg-SHaaZctCWWnWmLIi .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-SHaaZctCWWnWmLIi .rough-node .label text,#mermaid-svg-SHaaZctCWWnWmLIi .node .label text,#mermaid-svg-SHaaZctCWWnWmLIi .image-shape .label,#mermaid-svg-SHaaZctCWWnWmLIi .icon-shape .label{text-anchor:middle;}#mermaid-svg-SHaaZctCWWnWmLIi .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-SHaaZctCWWnWmLIi .rough-node .label,#mermaid-svg-SHaaZctCWWnWmLIi .node .label,#mermaid-svg-SHaaZctCWWnWmLIi .image-shape .label,#mermaid-svg-SHaaZctCWWnWmLIi .icon-shape .label{text-align:center;}#mermaid-svg-SHaaZctCWWnWmLIi .node.clickable{cursor:pointer;}#mermaid-svg-SHaaZctCWWnWmLIi .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-SHaaZctCWWnWmLIi .arrowheadPath{fill:#333333;}#mermaid-svg-SHaaZctCWWnWmLIi .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-SHaaZctCWWnWmLIi .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-SHaaZctCWWnWmLIi .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-SHaaZctCWWnWmLIi .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-SHaaZctCWWnWmLIi .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-SHaaZctCWWnWmLIi .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-SHaaZctCWWnWmLIi .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-SHaaZctCWWnWmLIi .cluster text{fill:#333;}#mermaid-svg-SHaaZctCWWnWmLIi .cluster span{color:#333;}#mermaid-svg-SHaaZctCWWnWmLIi div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-SHaaZctCWWnWmLIi .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-SHaaZctCWWnWmLIi rect.text{fill:none;stroke-width:0;}#mermaid-svg-SHaaZctCWWnWmLIi .icon-shape,#mermaid-svg-SHaaZctCWWnWmLIi .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-SHaaZctCWWnWmLIi .icon-shape p,#mermaid-svg-SHaaZctCWWnWmLIi .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-SHaaZctCWWnWmLIi .icon-shape .label rect,#mermaid-svg-SHaaZctCWWnWmLIi .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-SHaaZctCWWnWmLIi .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-SHaaZctCWWnWmLIi .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-SHaaZctCWWnWmLIi :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

文字

多模态模型

图片

语音

统一理解并回答

一句话:单模态 = 只会看字;多模态 = 字、图、音、视频都能看懂。

7.5 推理(Reasoning):让模型「先想后说」

推理,是让模型在回答前「先在内部思考、拆解、推理」,而不是「脱口而出」。现在很多模型都有「深度思考」模式。

普通模式:直接给答案(可能没想清楚)
推理模式:先拆解问题 → 逐步推理 → 再给结论(更准,但更慢)

一句话:推理就是「让模型先打草稿,再答题」。慢一点,但更靠谱。


八、一张「AI 黑话速查表」

最后,把这篇讲过的所有词,压成一张速查表。建议收藏,随时查阅:

术语一句话解释类比
LLM 大语言模型,AI 的大脑 概率机器
Token 文本最小单位,计费单位 字符计数
上下文窗口 模型一次能看多少 有限的白板
参数 模型脑容量 神经元数量
Temperature 控制随机性 创造力旋钮
Prompt 你输入的话 提问
System Prompt 定人设规矩 立规矩
Prompt Engineering 把话说到位 提问技巧
Few-shot / Zero-shot 给不给示例 给不给例题
RAG 检索增强生成 开卷考试
Fine-tuning 微调模型 补课深造
LoRA 省钱版微调 只补一小块课
RLHF 用人类反馈训练 打分改答案
Embedding 文字变坐标 意思→位置
向量数据库 存坐标找最近 坐标库
Agent 自主干活的 AI 会办事的助手
Function Calling 让模型调工具 给 AI 装手
幻觉 一本正经瞎编 不懂装懂
多模态 能看图听声 五感俱全
推理 先想后说 先打草稿

写在最后

我们从「听群友聊天像听天书」出发,把这堆 AI 黑话分门别类地扫了一遍盲。回顾这条主线:

  • 四大类:模型是什么、怎么说话、怎么变强、怎么干活;
  • 模型相关:LLM、Token、上下文窗口、参数、Temperature;
  • 提示词相关:Prompt、System Prompt、Prompt Engineering、Few-shot;
  • 三种变强方式(核心):Prompt 是「换个说法」,RAG 是「开卷考试」,Fine-tuning 是「补课深造」;
  • RAG 深入:检索 + 增强 + 生成,靠 Embedding 和向量数据库;
  • Fine-tuning 深入:LoRA 省钱、RLHF 打分,能 RAG 就别微调;
  • 应用相关:Agent、Function Calling、幻觉、多模态、推理。
  • 最后送你一句话:

    AI 黑话,没有一个是「黑科技」,它们都是「用一个新词,包装一个挺朴素的想法」。 你缺的不是智商,只是一张「把词和意思对上」的对照表——而这篇文章,就是给你的那张表。

    下次再听到「这个用 RAG 就行」「调一下 Temperature」「它又幻觉了」,你可以微微一笑:原来,就是那么回事。

    如果这篇对你有帮助,欢迎点赞收藏转发,我们下期见 🚀

    赞(0)
    未经允许不得转载:171主机测评 » AI 黑话扫盲:Prompt、RAG、Fine-tuning……这些词到底在说啥?
    分享到: 更多 (0)

    评论 抢沙发

    • 昵称 (必填)
    • 邮箱 (必填)
    • 网址