第 03 章

如何使用大模型:从聊天框到工具箱

以 Karpathy 的日常使用为线索,拆解上下文窗口、模型档位、推理模型、联网搜索、深度研究、文件与代码工具、语音图像视频,以及记忆、自定义指令与 Custom GPT。重点不是功能清单,而是每种能力适合什么任务、在哪里会翻车。

How I use LLMs: from chat box to toolbox

Following Karpathy's everyday usage: context windows, model tiers, reasoning models, web search, deep research, files and code tools, voice, images and video, plus memory, custom instructions and Custom GPTs. The focus is what each capability is good for and where it fails.

首发于 2025.02.28中 / EN
系统课程llmtool-usemultimodalworkflows
语言
字号
目录
篇内目录

从「一个文本框」到一整套工具

上一篇讲的是模型怎么被训练出来;这一篇讲实际怎么用。Karpathy 的出发点很朴素:ChatGPT 是 2022 年第一个让人们能直接和模型对话的产品,但到 2025 年,生态已经变成一堆互相竞争的聊天应用,每个都在加自己的工具。

他的使用原则可以先用一句话概括:先判断这个任务需要模型的哪种能力,再决定用哪个模型、开哪个工具、要不要给材料。剩下的内容都是这句话的展开。

时间轴

时间内容
0:00LLM 应用生态:ChatGPT、Gemini、Copilot、Claude、Grok 等
3:04聊天背后的 Token 流与上下文窗口
13:31基础问答示例:咖啡因含量、感冒药成分
18:18模型档位与定价:免费、Plus、Pro
23:07推理(思考)模型与适用场景
31:31工具:联网搜索
42:08工具:深度研究
51:22上传文件,把文档放进上下文
59:11工具:Python 解释器与生态碎片化
1:04:42高级数据分析:作图、拟合与翻车
1:09:10Claude Artifacts:小应用与概念图
1:14:18Cursor 与 Composer:在代码库里写代码
1:22:48语音输入与朗读输出
1:27:47高级语音:模型原生处理音频
1:37:30NotebookLM 与播客生成
1:40:37图像输入与 OCR
1:47:08图像生成
1:49:29视频输入:摄像头对话
1:52:24视频生成
1:53:53记忆与自定义指令
1:58:53Custom GPT:把常用提示词固化
2:06:45总结

先理解你在操作什么

聊天气泡背后是一条 Token 流

界面上是你一句、模型一句。底层只有一条一维 Token 序列:你写一段,模型接着往下写一段,写完发一个「我说完了」的特殊 Token,控制权交回给你。

点「新对话」,就是把这条 Token 序列清空,从头开始。

这条序列就是上下文窗口,也就是模型的工作记忆:窗口里的内容,模型每一步都能直接读到;窗口外的内容,模型一无所知。

模型是一个压缩包

Karpathy 给了一个有点粗糙但很好用的比喻:模型像一个几 TB 的压缩包。

  • 预训练把互联网压进参数,这是有损压缩,留下的是统计规律与模糊记忆,不是原文数据库;
  • 后训练给它加上「助手人格」,相当于给压缩包贴了一张笑脸;
  • 压缩包本身不会上网、不会算数、不会运行代码——除非你给它接工具。

这个比喻直接推出两条使用原则:

  1. 知识有截止日期,越近期、越冷门的信息越不可靠;
  2. 默认状态下它没有工具,所有「查一下」「算一下」都只能靠记忆猜。

基础用法与两个习惯

什么时候可以放心问

咖啡因含量、常见药物成分、旅游建议这类问题,Karpathy 会直接问,理由是:

  • 不涉及近期变化;
  • 互联网上讨论极多,模型记忆充分;
  • 不是高风险决策,答案错了代价可控。

即便如此,他仍会核对原始来源。对药物成分,他直接拿起药盒对照——因为模型给的是概率性回忆,不是事实查询。

习惯一:换话题就开新对话

上下文窗口有两种成本:

  • 注意力成本:历史越长,无关内容越会分散模型注意力,降低回答质量;
  • 计算成本:Token 越多,每生成一个词就越慢、越贵。

所以换话题时开新对话,是最便宜的质量优化。

习惯二:知道自己用的是哪个模型

同一家公司往往有多个档位:免费版可能是小模型,付费版才是旗舰。Karpathy 的做法是明确记住自己当前在用哪个模型,并根据任务决定值不值得升级。

他的个人取舍是:日常大部分问题用旗舰非推理模型;遇到难题再切推理模型;专业工作中同时订阅多家,形成自己的「LLM 议会」——同一个问题问几家,比较答案。

什么时候需要推理模型

推理模型是在强化学习阶段额外训练过的模型:它会花更多 Token 在内部试错、回退、重算。代价是慢,收益是难题上的准确率。

一个真实例子:Karpathy 的梯度检查失败,他把代码贴给 GPT-4o,模型列出一堆「可能的原因」,但没有指出真正的问题。换成推理模型后,它思考了一分钟,发现是参数打包与解包时顺序不匹配。

但要注意两点:

  • 简单问题用推理模型是浪费,查资料、闲聊不需要等一分钟;
  • 推理能力不是推理模型独有。同一个 bug,Claude 3.5 Sonnet(当时并非推理模型)也直接找到了。

实践策略:先用快速模型;如果回答明显不够好,再切到推理模型重问。

工具:让模型「看到」而不是「回忆」

联网搜索

模型的知识截止在训练时,近期信息它不可能知道。搜索工具的做法是:模型发出一个搜索请求的特殊 Token,应用程序暂停生成,去搜索引擎取回网页文本,把文本塞进上下文窗口,然后模型基于这些文本回答,并附上引用。

适合搜索的问题有明显特征:

  • 有时效性(今天的行情、这周的上映时间);
  • 冷门(某部剧在哪里拍的);
  • 会变化(某公司是否提供某服务)。

引用必须点开核对。搜索降低了幻觉,但没有消除:它可能误读网页,也可能引用不支持结论的来源。

不同产品的搜索集成程度不同。有的模型会自动判断需要搜索,有的必须手动开启,有的根本没有这个工具——同一个问题在不同应用里的结果可能完全不同。

深度研究

深度研究是「搜索 + 推理 + 长时间运行」的组合:模型会发起几十次搜索、读大量论文与网页,几十分钟后交出一份带引用的报告。

它适合:

  • 需要多来源整合的主题(某补剂的机制、安全性与人体试验证据);
  • 产品对比(两个浏览器的隐私策略)。

它不适合:

  • 需要精确数字的表格。Karpathy 让它整理「美国主要 LLM 实验室」的规模与融资表,结果漏掉了 xAI,还把非美国机构算了进来。

结论:把它当高质量初稿 + 文献入口,不要当事实数据库。

把材料放进上下文

上传文件

比起让模型「记得」某篇论文,直接把 PDF 拖进对话更可靠。文件会被转成文本、载入上下文,然后可以逐段提问。

一个实际做法是「一起读书」:找到《国富论》某一章的原文,粘贴进对话,先让模型总结,再边读边问。Karpathy 说这显著提高了他的理解与记忆,尤其是跨领域或年代久远的文本。

注意底层细节:大 PDF 里的图片很可能被丢弃,只保留文字;扫描件效果取决于 OCR。

Python 解释器

心算不可靠,代码可靠。ChatGPT 会在遇到复杂计算时自动写 Python、执行、把结果读回来。

对比实验很说明问题:

  • ChatGPT 调用了解释器,结果正确;
  • Grok 3(当时没有解释器)硬算,答案非常接近但错了;
  • Claude 写 JavaScript 算,正确;
  • Gemini 心算,简单题对、加大数字后错。

同一个问题,工具决定了对错。所以遇到数字、日期、字符串处理,主动要求「用代码算」。

高级数据分析

上传表格后,模型可以写代码做统计与作图。它确实能很快产出图表,但也会悄悄做假设。

Karpathy 的例子:让模型画 OpenAI 估值曲线,2015 年数据是 N/A,模型在代码里直接写成 0.1(即 1 亿美元),没有告诉他;后来拟合外推 2030 年估值,口头说 1.7 万亿,代码里打印的却是另一个数量级。

教训是:把它当粗心的初级分析师。看它写的代码,核对它做的假设,不要只看结论。

Artifacts 与概念图

Claude 的 Artifacts 会把生成的 React 代码直接在浏览器里渲染成一个小应用,比如用它生成的单词卡应用。对个人使用很方便,但没有后端与数据库。

Karpathy 最常用的是概念图:让 Claude 把一章内容画成 Mermaid 图,把论证结构空间化。对视觉型学习者,这比线性摘要更容易记住。

在代码库里工作

专业写代码时,网页聊天不够用:它看不到你的文件。Cursor 这类工具直接读取项目文件,把相关上下文自动组织好,再调用模型。

演进路径很清晰:Cmd-K 改一行 → Cmd-L 解释一段 → Cmd-I(Composer)让 Agent 跨文件改代码、执行命令。最后这种「把控制权交给 Agent、看它能不能跑通」的方式,就是所谓 vibe coding。

风险同样明显:它可能引入不存在的依赖、下载来路不明的资源。Karpathy 的态度是:最终仍然可以回到普通编程,文件都在,随时可以自己改。

多模态:语音、图像、视频

语音输入输出

最简单的形态是「语音转文字」:麦克风把话转成文本,再走普通对话流程;输出侧用「朗读」把文字转成语音。桌面端没有内置麦克风时,可以用系统级的转写工具。

它的本质仍是文本,只是把输入输出变快了。Karpathy 说大约一半的查询是语音,因为打字太慢。

高级语音

高级语音是「真音频」:模型直接把音频切成片段、量化成 Token,与文本同一套机制处理。它可以直接听、直接说,中间没有文本。

演示里能听出区别:可以让它换声音、讲故事、数数、模仿动物;它也会因为安全策略拒绝某些请求。

不同产品的风格差异很大,有的克制,有的几乎不设限。

NotebookLM 与播客

把资料作为「来源」上传后,NotebookLM 可以生成一段播客式对话,还能在中途插话提问。适合通勤、散步时了解一个自己只有泛兴趣的冷门主题。

图像输入

图像会被切成小块、量化成 Token,和文本进入同一个模型。实际使用时,Karpathy 有一个很值得抄的习惯:先让模型把图里的关键信息转写成表格,确认它看对了数字,再基于文本提问。

他做过的事包括:读营养成分表、读体检报告截图、读牙膏成分、解释一个梗图。对医疗类信息,他的判断是:常见检查指标模型大概率见过足够多资料,但仍应与医生核对。

图像与视频生成

图像生成在 ChatGPT 里不是同一个模型:语言模型先写出描述,再交给专门的图像模型。视频生成同理,Sora、Veo 等工具负责这一环。

视频输入则是摄像头实时对话:把镜头对准书本、仪器、地图,模型能识别并解释。底层很可能仍是按帧取图,但用户体验上像在「看视频」。

让它更懂你:记忆与自定义

记忆

默认每次新对话都从零开始。ChatGPT 的记忆功能会把「关于你的几条事实」存进一个独立数据库,并在每次对话开头自动附加。

Karpathy 的体验是:用久了确实更贴合个人偏好,但记忆需要显式触发,也可以手动增删。其他产品当时还没有同等功能。

自定义指令

把「希望它怎么说话」写成全局设置:语气、是否展开解释、语言学习时的敬语级别等。这样不必每次重复交代。

Custom GPT

本质是把一段常用提示词固化下来。Karpathy 用它做韩语学习工具:

  • 词汇提取器:给一句话,输出「韩语;英语」格式,可直接导入 Anki;
  • 详细翻译器:先给整句翻译,再逐词拆解,并允许追问;
  • 截图翻译器:先 OCR,再翻译,再拆解。

关键在于提示词里给了具体示例(few-shot),而不只是描述任务。这和训练模型时的「用示例编程」是同一个道理:描述决定方向,示例决定精度。

本节结论

  • 上下文窗口是模型的工作记忆;换话题就开新对话,既省注意力也省钱。
  • 先确认自己在用哪个模型与档位,再决定是否升级。
  • 推理模型适合难题,不适合日常;先用快的,不够好再换。
  • 搜索、深度研究、文件上传、代码执行,本质都是把可靠信息放进上下文,替代不可靠的记忆。
  • 引用要核对;数据要验算;代码要读。工具降低幻觉,但不消除幻觉。
  • 多模态只是把音频、图像也变成 Token,机制不变。
  • 记忆、自定义指令、Custom GPT 都是在减少重复交代,把稳定的偏好前置。

理解检验

1. 为什么「换话题就开新对话」既提升质量又降低成本?

参考答案:质量方面,注意力权重在每个请求的所有可见 Token 上归一化,历史里与新任务无关的内容会分走权重,稀释关键指令,模型更容易跑题或抓错重点。成本方面,上下文越长,每生成一个 Token 需要读取和计算的内容越多,延迟与费用都上升;若开启了提示词缓存,前缀变化还会导致缓存失效。开新对话会把窗口清空,让注意力集中在当前任务,同时减少每次请求携带的 Token。

2. 联网搜索为什么能减少幻觉?它为什么不能消除幻觉?

参考答案:搜索把网页正文放进上下文窗口,模型回答时可以引用眼前的文本,而不是依赖参数里的模糊记忆;这解决了「知识截止」和「冷门事实记不清」两类问题,并附带可核对的来源。但它不能消除幻觉,因为:模型可能误读网页内容;可能引用并不支持结论的来源;也可能在整合多段文本时做出错误推断。搜索改变的是信息来源,不改变模型「生成最可能的下一个 Token」这一本质。

3. 在 Karpathy 的乘法对比实验中,为什么不同模型的结果差异那么大?这对日常使用有什么启示?

参考答案:差异主要来自是否真的调用了代码执行工具。调用解释器的模型把计算交给 Python,得到精确结果;没有该工具、或选择心算的模型只能在一个 Token 里完成大数乘法,容易出错,而且错误很接近正确答案,具有迷惑性。启示是:遇到数字计算、字符串处理、日期换算这类「一步到位但计算量大」的任务,应主动要求模型使用代码工具,而不是接受它给出的心算结果;同时要清楚不同应用提供的工具并不相同。

4. 深度研究适合什么任务?为什么它产出的表格不能直接采信?

参考答案:它适合需要多来源整合、需要读大量文献或网页、且结论允许一定模糊性的任务,例如研究某个补剂的机制与安全性、比较两个产品的隐私策略。它不适合需要精确、完整、可核对的数字表格。因为报告由模型在长时间运行中整合生成,仍可能遗漏关键对象(如漏掉某家实验室)、把非目标对象算进来、或给出未经核实的数字。正确用法是把它当作高质量初稿与文献入口,再回到原始来源逐条核对。

5. 高级数据分析的例子说明了什么风险?使用这类工具时应该检查什么?

参考答案:例子中模型在代码里把缺失值 N/A 擅自替换成 0.1(1 亿美元),又在报告里把 2030 年外推值说成 1.7 万亿,而代码实际打印的是另一个数量级。风险在于:模型会静默地做假设,并可能在文字结论与代码结果之间出现不一致。使用时应检查三件事:它如何处理缺失值与异常值;代码里的关键常数与单位是否正确;口头结论是否与代码输出一致。把模型当粗心的初级分析师,而不是可信的分析师。

6. 为什么 Custom GPT/自定义指令能提高效果?它的本质是什么?

参考答案:本质是把一段稳定的提示词(含角色、任务描述与若干示例)固化下来,避免每次重复输入,并保证每次任务使用同一套约束。效果提升主要来自两点:一是提示词里包含具体示例(few-shot),示例比纯描述更能约束输出格式与判断标准;二是全局指令把长期偏好前置,减少每轮对话中的重复与遗漏。它没有改变模型能力,只是把「提示工程」变成了可复用、可管理的配置。

与前后内容的关系

这一篇是使用层的地图:哪些能力存在、各自适合什么、在哪里会翻车。上一篇《大语言模型全流程》解释这些能力是怎么被训练出来的;《注意力与 KV Cache》解释为什么上下文管理如此重要。三篇合起来,构成从原理到日常使用的完整链条。再往后就是工程化:把这些能力组合成稳定可交付的 Agent 工作流。

From one text box to a toolbox

The previous lecture covered how models are trained. This one covers how to actually use them. Karpathy starts from a simple observation: ChatGPT was the first product, in 2022, that let people talk to a large model through a text box, but by 2025 the ecosystem is a crowd of competing chat apps, each adding its own tools.

His operating principle fits in one sentence: decide what kind of capability the task needs, then choose the model, the tool, and whether to supply material. Everything else in the lecture elaborates on that sentence.

Timeline

TimeTopic
0:00The LLM app ecosystem: ChatGPT, Gemini, Copilot, Claude, Grok and others
3:04The token stream and context window behind a chat
13:31Everyday knowledge questions: caffeine, cold medicine
18:18Model tiers and pricing: free, Plus, Pro
23:07Thinking models and when to use them
31:31Tool use: web search
42:08Tool use: deep research
51:22Uploading files into context
59:11Tool use: the Python interpreter and a fragmented ecosystem
1:04:42Advanced Data Analysis: plots, fits and a failure
1:09:10Claude Artifacts: small apps and concept diagrams
1:14:18Cursor and Composer: writing code inside a repository
1:22:48Speech input and read-aloud output
1:27:47Advanced Voice: audio handled natively
1:37:30NotebookLM and podcast generation
1:40:37Image input and OCR
1:47:08Image generation
1:49:29Video input: pointing a camera at things
1:52:24Video generation
1:53:53Memory and custom instructions
1:58:53Custom GPTs: freezing a prompt into a tool
2:06:45Summary

First, understand what you are operating

A chat is a token stream

The screen shows alternating bubbles. Underneath there is a single one-dimensional token sequence: you write a segment, the model continues it, then emits a special "I am done" token and hands control back.

Starting a new chat wipes that sequence and begins again.

That sequence is the context window, the model's working memory: anything inside it can be read directly at every step; anything outside it is invisible.

The model is a compressed archive

Karpathy's rough but useful metaphor: the model is like a multi-terabyte archive.

  • Pretraining compresses the internet into parameters. It is lossy: what remains is statistical structure and vague recollection, not a searchable copy of the web.
  • Post-training adds an assistant persona, like a smiley sticker on the archive.
  • The archive cannot browse, calculate, or run code on its own — unless you attach tools.

Two practical rules follow immediately:

  1. Knowledge has a cutoff; recent and obscure facts are the least reliable.
  2. By default there are no tools, so "look it up" and "calculate it" are really "guess from memory".

Everyday use and two habits

When it is safe to just ask

For questions like caffeine content, common medicine ingredients or travel suggestions, Karpathy asks directly, because:

  • the topic does not change recently;
  • it is discussed abundantly online, so the model has strong recollection;
  • it is not a high-stakes decision, so an error is tolerable.

Even then he checks primary sources. For medicine ingredients he reads the box — because the model is producing a probabilistic recollection, not performing a lookup.

Habit one: start a new chat when switching topics

A long context costs twice:

  • Attention cost — irrelevant history dilutes attention and degrades answers;
  • Compute cost — more tokens means slower and more expensive generation.

Starting a new chat is the cheapest quality optimisation available.

Habit two: know which model you are using

Each provider sells several tiers: the free tier may be a small model, the paid tier the flagship. Karpathy makes a point of knowing which model is active and deciding whether a task justifies an upgrade.

His personal trade-off: use the flagship non-reasoning model for most daily work, switch to a reasoning model for hard problems, and subscribe to several providers to form his "LLM council" — the same question asked of several models, answers compared.

When reasoning models help

Reasoning models receive extra reinforcement-learning training. They spend more tokens thinking, backtracking and recomputing. The cost is latency; the benefit is accuracy on hard problems.

A concrete example: Karpathy's gradient check failed, so he pasted the code into GPT-4o. The model listed several plausible causes but missed the real one. Swapping to a reasoning model, it thought for a minute and found that the parameters were packed and unpacked in the wrong order.

Two caveats:

  • Reasoning models are wasted on simple lookups and chit-chat;
  • Reasoning is not exclusive to reasoning models. For the same bug, Claude 3.5 Sonnet — not a thinking model at the time — also found the issue immediately.

Practical strategy: start with the fast model; if the answer is clearly not good enough, resend the same prompt to a reasoning model.

Tools: let the model read instead of remember

Model knowledge stops at training time, so recent information is simply unavailable. Search works like this: the model emits special search tokens, the application pauses generation, queries a search engine, pastes the retrieved page text into the context window, and the model answers from that text with citations.

Search is the right tool when the answer is:

  • time-sensitive (today's market, this week's release date);
  • obscure (where a show was filmed);
  • subject to change (whether a company offers a feature).

Citations must be opened and checked. Search reduces hallucination but does not remove it: the model can misread a page or cite something that does not support the claim.

Integration varies by product. Some models decide to search automatically, some require a manual toggle, some have no search tool at all — the same question can give completely different results across apps.

Deep research

Deep research combines search, reasoning and long run time: the model issues dozens of searches, reads papers and pages, and returns a cited report tens of minutes later.

It suits:

  • topics that require synthesising many sources (a supplement's mechanism, safety and human trials);
  • product comparisons (privacy policies of two browsers).

It does not suit:

  • precise numeric tables. Asked to compile "major US LLM labs" with size and funding, the result omitted xAI and included a non-US organisation.

Treat the output as a strong first draft and a bibliography, not a database of facts.

Putting material into context

Uploading files

Instead of hoping the model remembers a paper, drag the PDF into the chat. It is converted to text, loaded into context, and can be questioned section by section.

One practice Karpathy uses heavily is reading a book together with the model: find the raw text of a chapter, paste it in, ask for a summary, then read and ask questions as he goes. He reports a marked improvement in comprehension and retention, especially for other fields or very old texts.

Note the underlying detail: images inside large PDFs are likely discarded, leaving only text; scanned documents are only as good as the OCR.

The Python interpreter

Mental arithmetic is unreliable; code is not. ChatGPT is trained to write Python, run it, and read the result when a calculation exceeds what it can do in its head.

The comparison is instructive:

  • ChatGPT called the interpreter and got the right answer;
  • Grok 3, without an interpreter, guessed in its head and was very close but wrong;
  • Claude wrote JavaScript and was correct;
  • Gemini did the arithmetic mentally: right on the easy case, wrong once the numbers grew.

The tool decides correctness. So for numbers, dates and string manipulation, explicitly ask the model to use code.

Advanced Data Analysis

With a data file uploaded, the model writes code, computes statistics and draws charts. It produces figures quickly, but it also makes assumptions silently.

Karpathy's example: plotting OpenAI's valuation over time, the 2015 entry was N/A, and the model wrote 0.1 (i.e. 100M)intothecodewithoutsayingso.Later,extrapolatingto2030,thenarrativeclaimed100M) into the code without saying so. Later, extrapolating to 2030, the narrative claimed 1.7 trillion while the printed variable implied a different order of magnitude entirely.

The lesson: treat it as an absent-minded junior analyst. Read the code, check the assumptions, and do not trust the conclusion alone.

Artifacts and concept diagrams

Claude Artifacts renders generated React code directly in the browser, producing a small app — flashcards, for example. Convenient for personal use, with no backend or database.

What Karpathy uses most is concept diagrams: ask Claude to draw a chapter as a Mermaid diagram, turning the argument structure into something spatial. For visual thinkers this is easier to remember than a linear summary.

Working inside a codebase

Web chat is not enough for professional programming because it cannot see your files. Tools like Cursor read the project, assemble the relevant context, and call the model.

The evolution is clear: Cmd-K to change a line → Cmd-L to explain a block → Cmd-I (Composer) to let an agent edit across files and run commands. Handing over control and hoping it works is what people now call vibe coding.

The risks are real: it may import nonexistent dependencies or download resources from unknown sources. Karpathy's stance is that you can always fall back to ordinary programming — the files are there and you can edit them yourself.

Multimodality: voice, images, video

Speech in and out

The simplest form is speech-to-text: the microphone transcribes your voice, and the rest is an ordinary text conversation; on the output side, read-aloud converts text back to speech. On desktop without a built-in microphone, a system-wide transcription tool fills the gap.

The mechanism is still text — only the input and output are faster. Karpathy estimates about half his queries are spoken because typing is too slow.

Advanced Voice

Advanced Voice is true audio: audio is chunked, quantised into tokens, and processed by the same machinery as text. It listens and speaks directly, with no text in between.

The difference is audible in the demo: it can change voice, tell a story, count, imitate animals; it also refuses some requests because of safety policies.

Styles differ sharply between products: some are highly constrained, others barely at all.

NotebookLM and podcasts

Upload sources, and NotebookLM can generate a podcast-style conversation, with the ability to break in and ask questions. Useful for commutes and walks when you have a passing interest in an obscure topic.

Image input

Images are split into patches, quantised into tokens, and fed to the same model. Karpathy's habit is worth copying: first ask the model to transcribe the key information into a table, confirm it read the numbers correctly, then ask questions about the text.

He has used this on nutrition labels, blood-test screenshots, toothpaste ingredients and memes. For medical information his judgement is that common lab values are well represented in training data, but a doctor should still be consulted.

Image and video generation

Image generation is not the same model: the language model writes a caption, which is passed to a dedicated image model. Video generation works the same way, with Sora, Veo and similar tools handling that stage.

Video input is real-time camera conversation: point the lens at a book, an instrument, a map, and the model identifies and explains. Under the hood it is probably sampling frames, but the experience feels like streaming video.

Making it know you: memory and customisation

Memory

By default every conversation starts from zero. ChatGPT's memory feature stores a small set of facts about you in a separate database and prepends them to every conversation.

Karpathy's experience: over time it does become more relevant to his preferences, but it must be triggered explicitly and can be reviewed and edited. Other products did not have an equivalent at the time.

Custom instructions

Write down how you want the model to speak: tone, whether to expand explanations, the level of formality for a language you are learning. This removes the need to repeat it every conversation.

Custom GPTs

In essence, freezing a frequently used prompt into a tool. Karpathy uses them for Korean:

  • a vocabulary extractor that turns a sentence into "Korean;English" pairs ready for Anki;
  • a detailed translator that gives the whole sentence, then breaks it down piece by piece, with follow-up questions allowed;
  • a screenshot translator that OCRs, translates, then breaks down.

The key is that the prompt contains concrete examples (few-shot), not just a description. This mirrors how models themselves are trained: the description sets direction, the examples set precision.

Takeaways

  • The context window is working memory; start a new chat when switching topics to save both attention and money.
  • Know which model and tier you are using before deciding whether to upgrade.
  • Reasoning models are for hard problems, not daily ones; start fast, escalate when needed.
  • Search, deep research, file uploads and code execution all do the same thing: put reliable information into context instead of relying on memory.
  • Check citations, re-verify numbers, read the code. Tools reduce hallucination but do not remove it.
  • Multimodality is just audio and images turned into tokens; the machinery is unchanged.
  • Memory, custom instructions and Custom GPTs all reduce repetition by moving stable preferences to the front.

Comprehension check

1. Why does starting a new chat both improve quality and reduce cost?

Reference answer: Attention weights are normalised over all visible tokens in a request, so irrelevant history takes weight away from the current instruction and dilutes the model's focus, making drift or missed constraints more likely. On cost, a longer context means more content to read and compute for every generated token, raising latency and price; if prompt caching is active, a changed prefix also invalidates the cache. A new chat clears the window, concentrating attention on the current task and shrinking each request.

2. Why does web search reduce hallucination, and why can it not eliminate it?

Reference answer: Search places page text in the context window, so the model can rely on text in front of it rather than on vague parameter memory. This addresses both the knowledge cutoff and poorly remembered obscure facts, and it provides sources that can be checked. It cannot eliminate hallucination because the model may misread a page, cite a source that does not support the claim, or draw a wrong inference while combining several passages. Search changes the information available, not the underlying next-token prediction.

3. In Karpathy's multiplication comparison, why do models differ so much, and what does that imply?

Reference answer: The difference comes mainly from whether the model actually invoked a code-execution tool. Models with an interpreter hand the calculation to Python and get an exact result; models without one, or that choose to compute mentally, must finish the whole multiplication inside a single token and frequently err — and the error is close to the right answer, which makes it deceptive. The implication: for arithmetic, string processing and date conversion, explicitly require code execution rather than accepting a mental result, and be aware that different apps expose different tools.

4. What is deep research good for, and why can't its tables be trusted directly?

Reference answer: It suits tasks that need many sources synthesised, that require reading papers and web pages, and where some fuzziness is acceptable — for example the mechanism and safety of a supplement, or the privacy policies of two browsers. It is unsuitable for precise, complete, verifiable numeric tables. The report is assembled over a long run and can omit a key entity (xAI was missing), include an out-of-scope one, or state numbers that were not verified. Use it as a strong first draft and a bibliography, then check the primary sources.

5. What risk does the Advanced Data Analysis example illustrate, and what should you inspect?

Reference answer: The model silently replaced a missing N/A value with 0.1 (100M)inthecode,andlaterreportedanextrapolated2030valuationof100M) in the code, and later reported an extrapolated 2030 valuation of 1.7 trillion while the printed variable implied a different order of magnitude. The risks are silent assumptions and inconsistency between the narrative and the code output. Inspect three things: how missing values and outliers were handled; whether key constants and units in the code are correct; and whether the stated conclusion matches what the code actually prints. Treat the model as a careless junior analyst.

6. Why do Custom GPTs and custom instructions improve results, and what are they really?

Reference answer: They freeze a stable prompt — role, task description and several examples — so it need not be retyped each time and every run uses the same constraints. The improvement comes from two things: concrete examples (few-shot) constrain output format and judgement more tightly than description alone, and global instructions move long-term preferences to the front, reducing repetition and omission per turn. They do not add capability; they turn prompt engineering into a reusable, manageable configuration.

How this connects

This lecture is the map of the usage layer: which capabilities exist, what each is good for, and where each fails. The deep-dive lecture explains how those capabilities were trained; the attention and KV-cache note explains why context management matters so much. Together they form a chain from mechanism to daily practice. The next step is engineering: combining these capabilities into agent workflows that deliver reliably.

来源