AI术语词典

A comprehensive multilingual AI terminology dictionary

Definition

这种方法利用大型语言模型的上下文学习能力,直接在提示词中提供几个说明性示例。与需要更新模型权重的微调不同,少样本提示通过展示期望的输出格式或逻辑,让模型在不重新训练的情况下适应新任务。

Summary

少样本提示是一种技术,通过在提示词中提供少量输入-输出示例来引导大型语言模型的行为。

Key Concepts

Use Cases

Code Example

1
2
3
4
5
6
response = llm.generate(
    prompt="Translate English to French:\n"
           "Hello -> Bonjour\n"
           "World -> Monde\n"
           "Cat -> ?"
)