生成式AI入门与AWS实战
上QQ阅读APP看书,第一时间看更新

2.5.3 少样本推理

以下示例展示了在上下文中添加多个样本会发生什么。

提示:

User: Answer the question using the format shown in the context.
Who won the baseball World Series in 2022?
The Houston Astros won the World Series in 2022. They defeated the Philadelphia 
Phillies.
 
Who won the baseball World Series in 2021?
The Atlanta Braves won the World Series in 2021. They defeated the Houston 
Astros.
 
Who won the baseball World Series in 2020?
The Los Angeles Dodgers won the World Series in 2020. They defeated the Tampa 
Bay Rays.
 
Who won the 2016 baseball World Series?
Assistant:

补全:

The Chicago Cubs won the World Series in 2016. They defeated the Cleveland Indians.

可以发现,随着在上下文中增加更多称为shot的数量,模型会针对特定的请求生成更为专注和相关的回答。

2016年对本书的某位作者来说是美好的一年,他是芝加哥小熊队的终身粉丝。

零样本推理、单样本推理和少样本推理之间存在细微的差异。随着更多样本或shot被添加到提示中,模型将更紧密地遵循上下文中提示-补全对的响应模式。