理解 AI 中的零样本学习Understanding Zero-Shot Learning in AI

AI 基础15 分钟阅读更新于 2026 年 6 月

让今天的 AI 模型把客户投诉归进它从未见过的类别,或翻译一对从未专门匹配过的语言,它往往说做就做。不用重新训练、不用标注样本、不用微调。下文我们会确切拆解什么是零样本学习、模型如何做到,以及它仍会失手的地方。

◆知微•AI 基础 · 15 分钟阅读 · 2026 年 6 月 30 日
AI Fundamentals15 min readUpdated June 2026

Ask a present-day AI model to bucket customer complaints into labels it has never met, or to translate a language pair it was never expressly matched on, and it frequently just goes ahead. No fresh training, no labelled cases, no fine-tuning. Below we unpack precisely what zero-shot learning is, how a model carries it off, and the points at which it still falters.

◆知微•AI Fundamentals · 15 min read · June 30, 2026
AI 中的零样本学习(zero-shot learning)是什么?(2026 指南)

设想你递给某人一张他这辈子从未见过的动物照片——一只穿山甲——却听到一句靠谱的回答:“某种带鳞片的哺乳动物”,而这纯粹来自他对鳞片、哺乳动物和动物的一般认识。穿山甲从未出现在他的受训经验里,他是靠脑子里已有的其他知识推断出答案的。这个画面正好抓住了现代 AI 一项真正令人惊叹之能力背后的直觉。

那么零样本学习究竟指什么?它是指一个训练好的模型,在该情形没有任何标注样本的情况下,仍能处理自己训练时从未遇到过的任务、类别或案例。模型并不需要一份专为新任务搭建的数据集,而是从已掌握的广博知识出发进行推断,把它用到真正陌生的事物上。

这个概念正是当今大型语言模型让人感觉如此灵活的核心所在。每当聊天机器人处理了它的构建者从未专门训练它做的事、却仍给出合理回答,你就亲眼看到了零样本学习。我们关于自然语言处理(NLP)的指南,铺陈了这项能力所依赖的语言基础。

01简短回答:不靠重新训练也能推断

传统机器学习像一个只会复习提纲上那些确切题目的学生。把一张标注好的猫照片给模型看一千遍,它认猫认得出神入化,可一旦指向从未见过标注的东西,它就一脸茫然。零样本学习解除了这一限制:它在训练阶段赋予模型一种丰富得多、也普遍得多的“意义感”,宽广到足以当场对全新类别进行推理。

只有当模型在庞大而多样、而非狭窄单一的数据集上训练之后,这种能力才真正具备规模化的可行性。巨大的规模正是它在那个时点浮现的原因;我们关于AI 推理与训练的文章提供了有用背景:零样本能力是在昂贵的训练阶段铸就的,之后每次你查询模型时又几乎瞬间被调用。

用日常的话说,零样本模型并不是在背诵答复,而是在识别意义与关联的模式,再把这种理解带到它从未正式“学过”的事情上。

02逐步拆解:零样本学习如何运作

当模型处理一项从未被专门训练过的工作时,表面之下会发生这些:

03互动演示:亲眼看看零样本分类

下面放着一句模型从未以标注形式见过的示例句。点击控件,看它如何在没有针对此任务之训练样本的情况下选定正确类别。

04零样本、少样本与微调:它在光谱上的位置

零样本学习标记的是一条光谱的一端,而非孤立的技术。一端是完全微调的模型,靠数千个标注样本为单一任务打磨;另一端是零样本,完全没有任务专属样本,只能依靠已有知识。夹在中间的是少样本学习:任务开始前先给模型看寥寥几个例子,往往能把准确率明显抬到零样本之上。

不妨把它框成两种风格迥异的 AI 行为。垃圾邮件过滤器这类系统高度依赖随时间打磨、经过训练的标注模式,我们关于AI 如何检测垃圾邮件的指南有详细说明。另一些则依赖纯粹推断、几乎没有任务专属训练,那就是光谱的零样本一端。如今大多数生产环境中的 AI 其实会根据任务、以及现实中能拿到多少标注数据,把两者混合使用。

这一点也值得与“模型最初如何构建”的更大分歧放在一起理解。我们关于生成式 AI 与判别式 AI 的讲解,剖析了一种相关却不同的划分——创造新内容的系统,与只对既有输入分类或打分的系统——而这会影响一种架构究竟能在多大程度上支持零样本行为。

方法所需标注样本典型准确率
零样本学习新任务一个都不需要不错,但通常低于经过训练的方案
少样本学习寥寥几个,通常 1-10 个明显强于零样本
微调模型数百到数千个样本最高,但成本高、准备慢
从零完整训练庞大的任务专属数据集所能达到的最高水平,但对小众任务通常不现实

05零样本学习已经出现在哪里

这并非实验室里的稀罕物。零样本能力早已悄悄运行在你很可能用过的产品中:

灵活的聊天机器人

给 AI 助手一套生造的指令格式,或一种它从未明确见过的谜题风格,它常常仅凭通用推理就能成功。

开放词表分类

文本和图像分类器可以把内容归入使用当下才设定的全新类别,不必为每个新标签重新训练。

跨语言翻译

模型有时能翻译从未在训练中直接配对出现的语言对,办法是从每种语言与其他语言的联系中推断。

开放集图像搜索

搜索工具能把图像与从不属于固定标签集的文字描述配对,识别用日常语言描述的新对象。

可适应的内容审核

审核工具可以标记当场描述的、全新类别的有害或违规内容,无需等待下一轮重新训练。

推荐冷启动

系统能为几乎没有互动历史的新用户或新物品给出合理建议,这个问题与零样本推理十分相近。

把它与那些几乎完全建立在累积行为数据、而非推断之上的系统做个对比。我们对 YouTube 上的 AI 推荐如何运作的拆解,展示了一个高度依赖观看历史的系统,作为有用的反例,帮你看清推断在哪里帮助最大。

06它到底有多准,又在哪些地方仍然吃力?

零样本学习确实有用,却远非魔法,很少能匹敌专门为眼前任务训练或微调过的模型。新任务离任何类似原始训练数据的东西漂得越远,它的表现往往越不稳。

零样本学习仍然不足的地方:

  1. ✗

    高度专门的领域

    自带行话的小众技术、法律或科学工作,常常让零样本模型犯糊涂,因为相关模式在训练中只得到稀疏体现。

  2. ✗

    自信却错误的回答

    当一个新类别离此前见过的任何东西都太远时,模型仍可能给出听起来很有把握、实则完全错误的回答,且几乎看不出它在猜。

  3. ✗

    模糊的类别定义

    如果标签本身措辞含糊、或在意义上相互重叠,模型在把输入与每个选项比对时能抓住的东西就更少。

  4. ✗

    规模化后可靠性较弱

    对于每秒处理数千请求的高风险生产系统,这一准确率差距可能转化为数量可观的真实错误。

  5. ✗

    随模型大小而表现不一

    较小模型的零样本能力往往明显弱于大模型,因为宽广的推断在规模之下才最有力地显现。

07零样本学习在未来为何重要

它实际的吸引力很朴素:收集和标注数据既慢又贵,对小众或快速变化的任务有时干脆不可能。零样本学习为现实中相当一部分问题移除了这个瓶颈,让一个经过广泛训练的模型,能处理它的构建者从未明确预见到的任务。

简言之,正因为有零样本学习,AI 工具才不那么像僵硬、单一用途的计算器,而更像能在你实际问题所在之处附近与你会合的灵活协作者。

08常见问题

AI 中的零样本学习是什么意思?
零样本学习是 AI 模型的一种能力:它能完成从未被专门训练过的任务、或识别从未被专门训练过的类别,办法是从训练中获得的相关知识出发推断,而不要求为那件具体工作提供标注样本。
零样本学习实际上如何运作?
零样本学习的运作方式,是把输入和可能的标签映射进同一个共享意义空间——通常建立在对文本或图像的大规模预训练之上——这样一个新的、没见过的类别就能与已掌握的概念相比较,并匹配到最接近的项。
零样本学习和少样本学习有何区别?
零样本意味着新任务没有任何标注样本、纯靠一般知识;少样本则先提供寥寥几个样本,通常能把准确率抬到零样本之上。
零样本学习在现实中的例子有哪些?
现实案例包括:语言模型翻译一对训练中从未一起出现过的语言;图像分类器认出一个从未见过标注的物种;聊天机器人遵循一种从未被专门微调过的全新指令格式。
零样本学习对 AI 为何重要?
零样本学习之所以重要,是因为它免去了为每项任务收集和标注庞大新数据集的需要,让 AI 在标注数据稀少、昂贵或尚不存在的情况下,也更加灵活、可扩展、有用。
ChatGPT 算零样本学习的一个例子吗?
算。当 ChatGPT 或同类大型语言模型完成一项从未被专门微调过的任务——用一种生造格式写作,或解一种新风格的谜题——并且仅凭通用训练就成功时,那就是零样本学习在起作用。
零样本学习有哪些局限?
零样本学习通常不及专门为目标任务训练或微调过的模型,在高度专门或技术性的领域里尤其吃力;当一个新类别离预训练中见过的任何东西都太远时,它还可能给出自信却错误的回答。

零样本学习静静提醒我们:最有用的 AI 飞跃未必总是耀眼的新产品,有时它只是模型训练方式上的微妙转变,却让建立在其上的一切都灵活得多。下次当 AI 在你没有任何特别准备的情况下、处理了一件你没料到它能搞定的任务,背后很可能就是零样本推断。它并不完美,在准确率真正要紧时也替代不了专门训练,但它跻身于最清晰的迹象之列,表明现代 AI 开始更像我们一点地推理:把陌生的东西,与它已经知道的东西联系起来。

◆

知微

Varun 撰写当代 AI 系统究竟如何学习与推断,把错综复杂的模型行为拆成人人能跟上的思路。有问题?我们在这里帮忙!

Imagine handing someone a picture of an animal they have never once encountered, a pangolin, and hearing the sound reply some form of scaled mammal, drawn purely from general knowledge of scales, mammals, and animals. Pangolins were never part of their training; they reasoned to the answer using everything else already in mind. That image captures the intuition behind one of modern AI's more genuinely striking abilities.

So what does zero-shot learning actually denote? It is the capacity of a trained model to handle a task, category, or case it never encountered while training, supplied with zero labelled examples for that situation. Rather than demanding a dataset assembled solely for the new job, the model extrapolates from the broad knowledge already inside it and applies it to something genuinely novel.

This notion lies at the heart of why today's large language models feel so adaptable. Whenever a chatbot has handled a job its builders never expressly trained it for and still returned a sensible answer, you have watched zero-shot learning at first hand. Our guide on natural language processing (NLP) lays out the language foundations this ability rests upon.

01The Short Answer: Extrapolating Without Fresh Training

Classical machine learning behaves like a student who knows only the precise questions on the study sheet. Show the model a labelled cat photo a thousand times and it recognises cats superbly, yet point it at something never seen labelled and it draws a blank. Zero-shot learning lifts that limit by furnishing, during training, a far richer and more general sense of meaning, broad enough to reason about wholly new categories on the spot.

This grew practical at scale only once models trained on vast, varied datasets rather than narrow, single-task ones. Massive scale is precisely why the ability surfaced when it did, and our piece on AI inference versus training offers useful background: zero-shot capacity is forged during the costly training stage and then invoked almost instantly each time you query the model.

In everyday words, a zero-shot model is not memorising replies; it is recognising patterns of meaning and connection and then carrying that understanding onto something it has never formally studied.

02Step by Step: How Zero-Shot Learning Works

What unfolds beneath the surface when a model handles a job it was never expressly trained for:

03Interactive Demo: See Zero-Shot Classification at Work

Underneath sits a sample sentence the model has never met in labelled form. Move through the controls to watch how it settles on the correct category with no training examples for this precise job.

04Zero-Shot vs Few-Shot vs Fine-Tuned: Its Place on the Line

Zero-shot learning marks one end of a spectrum rather than standing alone. At one extreme sit fully fine-tuned models, schooled on thousands of labelled examples for a single job; at the other sits zero-shot, with no task-specific examples at all and nothing but prior knowledge to lean on. Between lies few-shot learning, where a small handful of examples is shown immediately before the task, often lifting accuracy visibly above the zero-shot case.

It helps to frame this as two contrasting styles of AI behaviour. Systems such as spam filters lean heavily on trained, labelled patterns honed over time, which our guide on how AI detects spam emails details. Others lean on pure extrapolation with little or no task-specific training, the zero-shot end. Most production AI today in fact blends the two according to the task and how much labelled data is realistically within reach.

This is also worth grasping beside the larger split in how models are first constructed. Our explainer on generative versus discriminative AI digs into a related yet distinct division, systems that create new content versus those that merely classify or score what already exists, and this shapes how readily an architecture can support zero-shot behaviour at all.

ApproachLabelled examples requiredTypical accuracy
Zero-shot learningNone for the new taskGood, yet usually beneath trained alternatives
Few-shot learningA small handful, often 1-10 examplesVisibly stronger than zero-shot
Model after fine-tuningSomewhere between hundreds and thousands of examplesThe top tier of accuracy, though preparation is slow and costly
Fully trained from scratchVast task-specific datasetsThe highest attainable, yet rarely practical for niche jobs

05Where Zero-Shot Learning Already Appears

This is no laboratory curiosity. Zero-shot capacity is already quietly at work inside products you have likely used:

Adaptable Chatbots

Give an AI assistant a made-up instruction format or a style of puzzle it has never expressly met and it frequently succeeds through general reasoning alone.

Open-Vocabulary Classification

Text and image classifiers can file content under wholly new categories set at the moment of use, with no retraining for each fresh label.

Cross-Language Translation

Models can at times translate between language pairs never directly seen together, by extrapolating from each language's ties to others.

Open-Set Image Search

Search tools can pair images with text descriptions that never belonged to a fixed label set, recognising new objects described in everyday words.

Flexible Content Moderation

Moderation tools can flag entirely new categories of harmful or rule-breaking content described on the spot, without awaiting a retraining cycle.

Recommendation Cold-Starts

Systems can offer sensible suggestions for new users or items with little or no interaction history, a problem closely akin to zero-shot reasoning.

Contrast this with systems built almost wholly on accumulated behavioural data rather than extrapolation. Our breakdown of how AI recommendations work on YouTube examines a setup built chiefly around watch history, a helpful contrast when judging where generalization offers the most.

06How Accurate Is It, and Where Does It Still Falter?

Zero-shot learning is genuinely useful yet far from magic, rarely matching a model trained or fine-tuned expressly for the job in front of you. The farther a new task drifts from anything resembling the original training data, the shakier its performance tends to become.

Points at Which Zero-Shot Learning Remains Weak:

  1. ✗

    Highly Specialised Fields

    Niche technical, legal, or scientific work carrying its own jargon frequently confuses zero-shot models, since the relevant patterns were sparsely represented during training.

  2. ✗

    Confidently Wrong Replies

    When a new category sits too far from anything previously met, the model may still return a confident-sounding reply that is simply wrong, with little sign that it is guessing.

  3. ✗

    Vague Category Definitions

    If the labels themselves are worded vaguely or overlap in meaning, the model has less to grasp while measuring the input against each choice.

  4. ✗

    Weaker Reliability at Scale

    For high-stakes production systems fielding thousands of requests, the accuracy gap can translate into a meaningful tally of real-world errors.

  5. ✗

    Inconsistent Across Model Sizes

    Smaller models tend to show visibly weaker zero-shot capacity than large ones, since broad extrapolation emerges most strongly at scale.

07Why Zero-Shot Learning Matters Ahead

The practical allure is plain: gathering and labelling data is slow, costly, and at times outright impossible for niche or fast-moving jobs. Zero-shot learning removes that bottleneck for a meaningful share of real problems, letting one broadly trained model handle tasks its builders never expressly foresaw.

Put briefly, this capacity helps explain why AI no longer behaves like an inflexible device built for one fixed job; instead it comes across as a versatile partner, ready to meet you somewhere near the actual problem in front of you.

08Frequently Asked Questions

What does zero-shot learning mean in AI?
Zero-shot learning is the capacity of an AI model to perform a task or recognise a category it was never expressly trained on, by extrapolating from related knowledge gained during training rather than demanding labelled examples for that precise job.
How does zero-shot learning actually function?
Zero-shot learning functions by projecting inputs and possible labels into a single common space of meaning, one generally formed through large-scale pretraining over text or images. A fresh, unseen category can then be set beside concepts the model already grasps and paired with the closest fit.
How do zero-shot and few-shot learning differ?
Zero-shot means zero labelled examples for the new task, relying purely on general knowledge. Few-shot first supplies a small handful of examples, which typically raises accuracy above the zero-shot case.
What are real-world zero-shot learning examples?
Real cases include a language model translating a pair never seen together during training, an image classifier recognising a species it never met labelled, and a chatbot following a wholly new instruction format it was never expressly fine-tuned on.
Why does zero-shot learning matter for AI?
This capacity carries weight because it strips away the requirement to gather fresh data and label large datasets anew for each task. AI consequently grows far more adaptable and scalable, particularly in settings where labelled data is scarce, expensive, or has yet to come into existence.
Is ChatGPT an instance of zero-shot learning?
Yes. When ChatGPT or a comparable large language model performs a task it was never expressly fine-tuned for, writing in an invented format or solving a new puzzle style, and succeeds through general training alone, zero-shot learning is at work.
What limits does zero-shot learning carry?
Zero-shot learning usually lands beneath models trained or fine-tuned expressly for the target task, struggles in highly specialised or technical fields, and can return confidently wrong replies when a new category sits too far from anything seen during pretraining.

Zero-shot learning is a quiet reminder that the most useful AI leaps are not always flashy new products; sometimes they are a subtle shift in how a model is trained that makes everything built above it far more adaptable. So when an AI next pulls off something you assumed lay beyond it, and you supplied no preparation of your own, the likely explanation is zero-shot generalization. The effect is imperfect, and wherever accuracy genuinely matters it cannot take the place of dedicated training. Even so, it stands among the clearest hints that present-day AI is edging toward a more human style of reasoning: tying whatever seems novel back to knowledge it already holds.

◆

知微

Varun writes on how present-day AI systems actually learn and extrapolate, breaking intricate model behaviour into ideas anyone can follow. Questions? We are here to help!