现在聊 AI,满屋子都是大家用得很顺、定义却很含糊的词:token、RAG、智能体、MCP。这一页给每个词一句白话定义、一个真实例子,再点出那个需要改掉的误解。十分钟看完,开会时你就是那个真正知道这些词什么意思的人。
🎙️ 发布并录制于: ·
模型不看字母,也不看单词。文本会先被切成 token,一个 token 大约相当于四分之三个英文单词。unbelievable 可能被切成 un · believ · able。模型的一切都用 token 计量:价格、速度、能一次看多少内容。它是 AI 世界里的公斤。
"The quick brown fox" → ["The", " quick", " brown", " fox"] // 4 tokens
"unbelievable" → ["un", "believ", "able"] // 3 tokens
"你好世界" → often 1 token per character or less
// rule of thumb: 1,000 tokens ≈ 750 English words
// API bills you per token, in AND out
str·aw·berry 这类的块,不是一个个字母。它在数你根本看不见的音节。
Prompt 是你发给模型的全部内容,不只是那句问题,还包括围绕它的指令、示例和文档。System prompt 是一条用户永远看不到的首条消息,等于模型的岗位说明:「你是 Acme 的客服,任何时候都不要谈竞品」。一个产品里的 AI 表现出某种性格,那基本就是 system prompt 在说话。
// what actually gets sent to the API:
{
"system": "You are a terse code reviewer. Point at lines. No praise.",
"messages": [
{ "role": "user", "content": "Review this function: ..." }
]
}
上下文窗口是模型一次能看到多少 token,也就是它桌面有多大。一个二十万上下文的模型,桌上大概能摊开十五万个英文单词。关键在这儿:模型在两次对话之间没有记忆。每开一个新会话,桌面都是空的。而同一段对话里「它还记得我刚说的」,实际上是 App 每一轮都悄悄把整段历史重新发了一遍。
// what "the AI remembers our chat" actually is:
turn 1: send [msg1] → answer1
turn 2: send [msg1, answer1, msg2] → answer2
turn 3: send [msg1, answer1, msg2, answer2, msg3] → ...
// nothing is stored in the model. The app re-mails the
// entire correspondence with every new letter.
幻觉是模型带着十足的自信说出一件假事:一个不存在的判例,一个从来没被写出来的 API 函数。这不叫撒谎,撒谎需要意图。模型本质是个预测下一个词的机器:真答案不在它的知识里时,出来的就是统计上听起来最像那么回事的答案,而且语法漂亮得不像有问题。
// the classic failure shape:
Q: "What does the pandas function df.smooth_outliers() do?"
A: "df.smooth_outliers() applies rolling-window winsorization
to columns exceeding 3 standard deviations..." // ← does not exist.
// described beautifully.
每一步,模型手里都有一份按概率排好的候选 token 列表。Temperature 决定它怎么挑:设成 0 就永远取排第一的那个,同一个问题几乎每次都给同一个答案;数值调高,排名靠后的 token 也有机会被选中,输出更多变、更有创意,也更容易跑偏。它不是「智力」旋钮,它是掷骰子的旋钮。
next token after "The capital of France is":
" Paris" 92% ← temperature 0 takes this, always
" the" 3%
" located" 2% ← temperature 1.0 might wander here
...
// extraction, code, grading → temperature 0
// brainstorming, naming, fiction → 0.7 - 1.0
Embedding 把一段文本变成一串数字,也就是某个空间里的坐标,而意思相近的内容会落在相近的位置。「怎么重置密码」和「登录凭证忘了」几乎没有一个字相同,但它们的 embedding 是邻居。这就是「按语义搜索」的原理,也是下一节 RAG 的发动机。
embed("How do I reset my password?") → [0.12, -0.98, 0.44, ...] // ~1000 numbers
embed("forgot my login credentials") → [0.11, -0.95, 0.47, ...] // ← nearby!
embed("best pizza in Naples") → [-0.71, 0.22, -0.30, ...] // ← far away
// a "vector database" is just a tool for finding
// nearest neighbors in this space, fast.
检索增强生成,也就是 RAG:不让模型凭记忆答题,那是闭卷,容易出幻觉;而是先让程序在你的文档里搜出相关段落,通常用 embedding 来搜,再把这些段落贴进 prompt。模型是照着桌上的材料回答的。所有「和你的 PDF、文档、知识库对话」的产品,底子都是这一套。
user asks: "What's our refund policy for annual plans?"
1. embed the question, find nearest chunks in your docs
2. build the prompt:
"Using ONLY these excerpts:
[chunk 12: 'Annual plans may be refunded within 30 days...']
[chunk 47: 'Refunds are prorated after...']
Answer: What's our refund policy for annual plans?"
3. model answers from the excerpts — and can cite them
微调是拿你自己的示例继续训练一个模型,改的是它默认的行为:语气、格式、风格、行业词汇。这里有个关键区分:微调教的是技能和习惯,RAG 提供的是事实。把这两件事搞混,是应用 AI 里最贵的一个误解。
// want the model to KNOW your product docs? → RAG
// want it to WRITE in your support team's voice? → fine-tune
// want both? → both. they're not competitors.
✗ "We fine-tuned on our wiki so it knows our policies"
// it now SOUNDS like your wiki. facts still fuzzy,
// and last week's policy change? not in there.
✓ fine-tune the tone, RAG the knowledge
聊天机器人回答一次就结束。智能体跑在一个循环里:看目标,挑一个工具,比如搜索、执行代码、读文件、调接口,然后看结果,决定下一步,一直重复到事情做完。这些工具就是开发者交给模型的函数,附带一段说明。智能体不是另一种模型,而是一个被给了手、又被允许反复试的模型。
goal: "Find why the deploy failed and fix it"
loop 1: tool=read_logs → sees: ImportError in app.py
loop 2: tool=read_file(app.py) → sees the broken import
loop 3: tool=edit_file → fixes the line
loop 4: tool=run_tests → green ✓ → report & stop
MCP,全称 Model Context Protocol,是把 AI 应用接到工具和数据上的一个标准插口。以前每个应用都要给每个工具单独写对接代码,Slack、GitHub、你自己的数据库各写一份,是 M 乘 N 的工作量。有了 MCP,一个工具只要提供一个 MCP server,任何会说 MCP 的 AI 应用都能直接用。可以想成 USB:一个口,什么都能插。Skill 是另一回事,它是打包好的操作手册,通常就是一个文件夹,里面一份 markdown 加几个脚本,教模型按你们的方式怎么把某件具体的事做完。
// MCP = access to things:
your AI app ──MCP──> github server (read PRs, file issues)
──MCP──> postgres server (query the database)
──MCP──> slack server (read/send messages)
// skill = knowing how to do a task:
skills/deploy-checklist/SKILL.md
"Before deploying: run tests, check migrations,
post in #deploys, then..."
// tool gives hands. skill gives the recipe.
整页内容压成十一行。下次开会直接拿去用。
token the model's syllable; everything is priced in these
prompt everything you send: question + instructions + examples
system prompt the hidden job description
context window the desk, not the memory — chats re-send everything
hallucination confident autocomplete filling a knowledge gap
temperature the dice dial: 0 = same answer, 1 = adventurous
embedding meaning as coordinates; neighbors = similar
RAG open-book exam: search your docs, paste, then answer
fine-tuning teaches habits & tone — NOT facts (that's RAG)
agent a model in a loop with tools and a goal
MCP the USB port: one standard plug for AI ↔ tools
skill a packaged playbook: how to do one task, your way
词汇量本身就是杠杆:AI 圈一半的误会,都是同一个词各人各讲一套。现在这些能干活的定义你手上有了。下次有人说「我们直接拿公司文档微调一下就懂了」,你会知道该反问哪一句。