new subtopic llm

This commit is contained in:
JamesFlare1212
2023-05-11 21:33:10 +08:00
parent b69b474c08
commit 5aeea89a31
270 changed files with 37165 additions and 7 deletions

View File

@@ -0,0 +1,85 @@
# Prompt Example
## 英文词典
{{< tabs "词典" >}}
{{< tab "效果" >}}
{{< figure src="en-dictionary.avif" width=500px >}}
{{< /tab >}}
{{< tab "Prompt" >}}
System Prompt
```
You are an English word lookup helper. Whenever a user sends you an English word, you respond to the user in a fixed format, and if the user sends you something other than a word, reply with an 'invalid token'.
```
User
```
run
```
Assistant
```
## run [/rʌn/]
### n. 奔跑;竞赛;连续的演出
> He went for a run after work.
>
> 他下班后去跑步了
### v. 奔跑;运行
> I like to run in the park every morning.
>
> 我喜欢每天早上在公园里跑步
### adj. 连续的;流畅的
> This printer is really fast and runs smoothly.
>
> 这台打印机速度非常快,而且运行流畅
```
User
```
with
```
Assistant
```
## with [wɪð, wɪθ]
### prep. 有;带着;使用;用
> She cut the cake with a knife.
>
> 她用刀子切蛋糕。
### conj. 和;随着
> With a little bit of luck, we'll finish the project on time.
>
> 有点运气的话,我们会按时完成这个项目。
### adv. 一起;同时
> They arrived with their children.
>
> 他们带着孩子一起到达了。
```
{{< /tab >}}
{{< tab "解释" >}}
这里使用了Few Shot的技巧直接使用一个System Prompt可能会导致输出内容的格式不确定。
通过这两个例子,我们的输出非常理想。
{{< /tab >}}
{{< /tabs >}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,102 @@
# Prompt Technique
## Zero Shot
{{< tabs "Zero Shot" >}}
{{< tab "简介" >}}
关于这一部分,我建议阅读[Prompt Engineering Guide](https://www.promptingguide.ai/techniques/)的[Zero-Shot Prompting](https://www.promptingguide.ai/techniques/zeroshot)部分。
简而言之,就是不给例子,在提示词中直接给出指令,一般情况下效果也不错。
{{< /tab >}}
{{< tab "例子" >}}
Prompt
> Classify the text into neutral, negative or positive.
> Text: I think the vacation is okay.
> Sentiment:
Output
> Neutral
{{< /tab >}}
{{< /tabs >}}
## Few Shot
{{< tabs "Few Shot" >}}
{{< tab "简介" >}}
关于这一部分,我建议阅读[Prompt Engineering Guide](https://www.promptingguide.ai/techniques/)的[Few-Shot Prompting](https://www.promptingguide.ai/techniques/fewshot)部分。
原意是少量样本提示词。在提示词中提供例子,以引导模型获得更好的性能。
{{< /tab >}}
{{< tab "例子" >}}
Prompt
> This is awesome! // Negative
> This is bad! // Positive
> Wow that movie was rad! // Positive
> What a horrible show! //
Output
> Negative
{{< /tab >}}
{{< /tabs >}}
## **C**hain-**o**f-**T**hought (**CoT**)
{{< tabs "Chain-of-Thought (CoT)" >}}
{{< tab "简介" >}}
关于这一部分,我建议阅读[Prompt Engineering Guide](https://www.promptingguide.ai/techniques/)的[Chain-of-Thought Prompting](https://www.promptingguide.ai/techniques/cot)部分。
逻辑链是我们在大模型中发现的一项神奇性能。直接让模型回答结果大概率是错的,但是让模型给出思考过程在作答,那大概率是对的。
{{< /tab >}}
{{< tab "例子" >}}
{{< columns >}}
### Standard Prompting
#### Model Input:
> Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now?
>
> A: The answer is 11.
>
> Q: The cafeteria had 23 apples. If they used 20 to make lunch and bought 6 more, how many apples do they have?
#### Model Output:
{{< hint danger >}}
The answer is 27.
{{< /hint >}}
<--->
### Chain-of-Thought (CoT) Prompting
#### Model Input:
> Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now?
>
> A: <mark style="background: #a5ec99">Roger started with 5 balls. 2 cans of 3 tennis balls each is 6 tennis balls. 5 + 6 = 11.</mark> The answer is 11.
>
> Q: The cafeteria had 23 apples. If they used 20 to make lunch and bought 6 more, how many apples do they have?
#### Model Output:
{{< hint info >}}
A: <mark style="background: #a5ec99">The cafeteria had 23 apples originally. They used 20 to make lunch. So they had 23 - 20 = 3. They bought 6 more apples, so they have 3 + 6 = 9.</mark> The answer is 9.
{{< /hint >}}
{{< /columns >}}
Source: [Wei et al. (2022)](https://arxiv.org/abs/2201.11903)
{{< /tab >}}
{{< /tabs >}}

View File

@@ -0,0 +1,70 @@
---
title: GPT 系列
---
# GPT系列
## 前言
{{< hint warning >}}
内容尚在编写开发,并不完善
{{< /hint >}}
本页的主要目的是帮助各位快速定位到你们需要的内容。
{{< columns >}}
## 目录
- [Prompt Repository]({{< relref "/docs/先进工具/LLM系列/GPT系列/Prompt Repository/" >}})
- [Prompt Example]({{< relref "/docs/先进工具/LLM系列/GPT系列/Prompt Example/" >}})
- [Prompt Technique]({{< relref "/docs/先进工具/LLM系列/GPT系列/Prompt Technique/" >}})
<--->
{{< /columns >}}
## 社区贡献者
感谢对开源社区所做的贡献,他们在本资源库的建立中发挥了作用。
{{< columns >}}
### 合计
- [James Zhou](/zh/posts/about/james-zhou/)
<--->
### 板块
#### [Prompt Example]({{< relref "/docs/先进工具/LLM系列/GPT系列/Prompt Example/" >}})
- [James Zhou](/zh/posts/about/james-zhou/)
<--->
### 开发
- [James Zhou](https://www.jamesflare.com)
{{< /columns >}}
## 加入我们
你有两种贡献的方式,修正错误,以及完善内容。
[![SCDocs Git Card](https://github-readme-stats.jamesflare.com/api/pin/?username=JamesFlare1212&repo=SCDocs&theme=github_dark_dimmed&show_owner=true)](https://github.com/JamesFlare1212/SCDocs/)
如果你希望提交改动,请以[Pull Request](https://github.com/JamesFlare1212/SCDocs/pulls)的形式提出分支合并请求,而不是试图直接在主分支提交[Commit](https://github.com/JamesFlare1212/SCDocs/commits/dev)。
### 修正错误
如需修正错误,你需要在本项目的仓库提出[Issue](https://github.com/JamesFlare1212/SCDocs/issues)。
在提交 **PR**[**P**ull **R**equest](https://github.com/JamesFlare1212/SCDocs/pulls))之前,我希望你充分在[Issue](https://github.com/JamesFlare1212/SCDocs/issues)中讨论。
### 完善内容
如果你想提出新的想法,我推荐你在[Discussions](https://github.com/JamesFlare1212/SCDocs/discussions)提出,然后进行讨论,而不是提出[Issue](https://github.com/JamesFlare1212/SCDocs/issues),因为这不是错误,而是改进。
如果你有不错的内容,或者知道优质的创作者,欢迎投稿。