The Day Ava Met Dr. Vector / 艾娃遇见Vector博士的那一天
第 1 章:艾娃遇见 Vector 博士的那一天
> The Day Ava Met Dr. Vector
---
走廊尽头的展厅里,蓝紫色的霓虹灯把整面墙照得发亮。投影屏幕上,「Westlake High AI Showcase · 西湖高中人工智能展示会」几个大字正在缓缓呼吸般地明灭。
> In the exhibition hall at the end of the corridor, blue and purple neon lights washed the entire wall in a soft glow. On the projection screen, the words "Westlake High AI Showcase" pulsed gently, as if breathing.
十六岁的艾娃·陈 (Ava Chen) 站在人群边缘,手里捏着一杯已经凉透的柠檬水。她刚刚在自己的展台前回答了十几个同学的问题——「这玩意儿 (this thing) 是怎么生成图像的?」「它能帮我写作业吗?」——但真正让她心里咯噔一下的,是一个没人问出来的问题:
> Sixteen-year-old Ava Chen stood at the edge of the crowd, holding a cup of lemonade that had already gone cold. She had just answered a dozen questions at her own booth—"How does this thing generate images?" "Can it help me with my homework?"—but the question that really made her heart skip a beat was one no one had asked:
「我亲手训练的那个模型,它到底『知道』什么?」
> "What does the model I trained with my own hands actually *know*?"
她的展台叫「Hello, Muse」。那是一个用十亿参数的文本生成图像模型微调 (fine-tuned) 出来的小东西,只会画一种东西:猫。各种各样的猫——胖的、瘦的、戴眼镜的、坐在钢琴上的——但它不会画狗,不会画树,更不会告诉你今天星期几。
> Her booth was called "Hello, Muse." It was a small thing she had fine-tuned from a billion-parameter text-to-image model, capable of drawing only one subject: cats. All kinds of cats—fat, thin, bespectacled, sitting at pianos—but it couldn't draw dogs, couldn't draw trees, and certainly couldn't tell you what day of the week it was.
「很酷,」走过她展台的评委老师说,「但它有记忆吗?」
> "Cool," said the judge who passed her booth, "but does it have memory?"
艾娃张了张嘴,没有回答上来。
> Ava opened her mouth but had no answer.
——因为她自己也不知道。
> —Because she didn't know either.
---
就在她低头看着杯子里柠檬籽打转的时候,一个穿深灰色风衣的男人不知什么时候已经站在了她身旁。他大概四十多岁,头发里夹着几根不太服帖的银丝,鼻梁上架着一副圆框眼镜,镜片后面的眼睛带着一种「我等这个问题等了二十年」的神情。
> Just as she looked down at the lemon seeds swirling in her cup, a man in a dark gray trench coat had somehow appeared beside her. He was probably in his forties, with a few rebellious strands of silver in his hair and round-frame glasses perched on his nose. Behind those lenses, his eyes carried an expression that said, "I've been waiting for this question for twenty years."
「你叫艾娃,对吧?」他的声音很轻,但每个字都清楚得像敲在玻璃上,「我看了你训练的 LoRA,权重衰减 (weight decay) 调得不错。」
> "You're Ava, right?" His voice was soft, but each word was as clear as a tap on glass. "I saw the LoRA you trained. The weight decay was tuned nicely."
艾娃差点把柠檬水洒出来。
> Ava nearly spilled her lemonade.
「你——你怎么看过我的训练日志?」
> "H-how did you see my training logs?"
男人笑了笑,从风衣口袋里掏出一张皱巴巴的名片。名片上印着:
> The man smiled and pulled a crumpled business card from his coat pocket. The card read:
``` ┌──────────────────────────────────┐ │ │ │ Dr. Vector │ │ 知识探险家 · Knowledge Explorer│ │ │ │ "Memory is the mother of all │ │ invention." │ │ │ └──────────────────────────────────┘ ```
「叫我 Vector 博士 (Dr. Vector),」他说,把名片塞进艾娃手里,「我以前在某个现在已经倒闭的实验室里做大模型。后来我意识到,把更多参数塞进显卡并不能让机器真的『知道』什么。于是我改行了。」
> "Call me Dr. Vector," he said, pressing the card into her hand. "I used to work on large models at a lab that no longer exists. Then I realized that stuffing more parameters into a GPU doesn't make a machine truly *know* anything. So I changed careers."
「改去做什么?」
> "Changed to do what?"
「教人问更好的问题,」他指了指展厅中央那台正在循环播放演示的巨型屏幕,「比如——你刚才被问『它有记忆吗』,你为什么没回答?」
> "To teach people to ask better questions," he said, pointing to the giant screen in the center of the hall cycling through its demo. "For example—someone just asked you 'does it have memory?' Why didn't you answer?"
艾娃咬了咬嘴唇:「因为……我不确定『记忆』这个词对模型来说是什么意思。我们训练它的时候,它确实『记住』了猫的样子——但这种记忆,跟我背一首诗的那种记忆,好像完全不是一回事。」
> Ava bit her lip. "Because... I'm not sure what the word 'memory' even means for a model. When we trained it, it did 'remember' what cats look like—but that kind of memory seems completely different from the way I memorize a poem."
Vector 博士的眼睛亮了一下。
> Dr. Vector's eyes lit up.
「好答案,」他说,「『好像完全不是一回事』——这句话值一整章。来,我们找个安静的地方,我送你一个故事。听完之后,你大概会明白,为什么全世界最聪明的工程师都在重新发明一种叫做『检索增强生成 (Retrieval-Augmented Generation, RAG)』的老办法。」
> "Good answer," he said. "'Seems completely different'—that sentence is worth an entire chapter. Come, let's find a quiet place. I'll give you a story. After you hear it, you'll probably understand why the smartest engineers in the world are reinventing an old technique called Retrieval-Augmented Generation, or RAG."
「RAG?」艾娃的耳朵竖了起来,「那不是……狗叫的声音吗?」
> "RAG?" Ava's ears perked up. "Isn't that... the sound a dog makes?"
Vector 博士噗嗤一声笑了出来。
> Dr. Vector let out a snort of laughter.
「也是一个英文俚语,意思是『衣衫褴褛 (ragged) 的』。但在我们这个领域,R-A-G 是三个英文单词的首字母缩写。R 是 Retrieval——检索;A 是 Augmented——增强;G 是 Generation——生成。合起来,就是『用检索来增强生成』。这四个字,会重新定义你今天看到的这个展厅里所有的东西。」
> "It's also English slang for 'ragged.' But in our field, R-A-G is an acronym for three words: R for Retrieval, A for Augmented, G for Generation. Put together: 'use retrieval to augment generation.' These four words will redefine everything you see in this exhibition hall today."
他顿了顿,又补了一句:「而且,它会让你那只只会画猫的模型,第一次能回答『今天天气怎么样』这种问题。」
> He paused, then added: "And it will let your cat-drawing model answer questions like 'What's the weather today?' for the first time."
---
他们走到展厅后面的露天阳台,十一月的风带着桂花和冷却液的味道。Vector 博士靠在栏杆上,从另一个口袋里掏出一支记号笔和一张餐巾纸。
> They walked to the open balcony at the back of the exhibition hall. The November wind carried the scent of osmanthus and cooling fluid. Dr. Vector leaned against the railing and pulled out a marker and a napkin from another pocket.
「艾娃,我先问你一个问题。你养过金鱼吗?」
> "Ava, let me ask you a question first. Have you ever kept a goldfish?"
「没有,但我表姐养过。它三天就……你懂的。」
> "No, but my cousin did. It lasted three days before... you know."
「三天,」Vector 博士在餐巾纸上写下一个数字:3 秒,「金鱼被传说有 3 秒的记忆。科学上这是错的——金鱼其实能记住好几个月的训练。但这个传说的核心直觉是对的:它的『工作记忆 (working memory)』非常小。你把鱼食丢进鱼缸,它很快就会忘记自己刚才游过哪儿。」
> "Three days," Dr. Vector wrote a number on the napkin: 3 seconds. "Goldfish are rumored to have a 3-second memory. Scientifically, this is wrong—goldfish can actually remember training for several months. But the core intuition of the legend is correct: their working memory is tiny. Drop fish food into the tank, and the fish will quickly forget where it just swam."
「而大语言模型 (LLM),」他画了一个比金鱼大得多的圆——画工很差,像一团会发光的云——「它的『工作记忆』比金鱼大很多,但也没你想的那么大。GPT-4 级别的模型,上下文窗口 (context window) 大概是 12.8 万个 token。Claude 3 的大概是 20 万。你听上去觉得很多,对吧?」
> "As for large language models (LLMs)," he drew a circle much larger than the goldfish—his drawing was terrible, like a glowing cloud—"their 'working memory' is much larger than a goldfish's, but not as large as you might think. GPT-4-class models have a context window of roughly 128,000 tokens. Claude 3's is about 200,000. Sounds like a lot, right?"
「嗯,」艾娃说,「12.8 万个 token……我好像能塞进一整本《哈利·波特》?」
> "Hmm," Ava said, "128,000 tokens... I could probably fit an entire Harry Potter book in there?"
「差不多。但艾娃,你上学期的生物课本一共多少字?」
> "Roughly. But Ava, how many words were in last semester's biology textbook?"
艾娃算了算:「大概……15 万字?加上图、表、注释,可能 20 万?」
> Ava calculated. "Maybe... 150,000 words? With images, tables, annotations, probably 200,000?"
Vector 博士点了点头:「所以你一整个学期的生物书,勉强能塞进一个上下文窗口。但你高中三年有多少课本?全中国的法规有多少条?你的医学百科有多少条目?人类目前产生过的所有文字加起来又有多少?」
> Dr. Vector nodded. "So your entire semester's biology book barely fits in a context window. But how many textbooks do you have over three years of high school? How many regulations does all of China have? How many entries are in a medical encyclopedia? How much text has humanity ever produced in total?"
他在餐巾纸最下面画了一根非常非常长的横线,横线下面写了一个词:∞。
> He drew a very, very long horizontal line at the bottom of the napkin and wrote one word below it: ∞.
「上下文窗口是有限的,」他敲了敲那个圆,「而世界是无限的。这,就是金鱼记忆的真正问题。」
> "The context window is finite," he tapped the circle, "and the world is infinite. That, Ava, is the real goldfish memory problem."
---
大模型的「金鱼记忆」问题
> ## The Goldfish Memory Problem of LLMs
回到艾娃的问题之前,我们先做一件 Vector 博士反复强调的事:**把直觉翻译成术语 (translate intuition into terminolog