五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

如何對chatgpt 念"咒語"

2023-03-28 23:25 作者:zerodel  | 我要投稿

提示詞工程

最近我使用了一段時間的chatgpt, 發(fā)現(xiàn)自己原來是低估chatgpt了.?

它能做的東西相當多, 但你需要學會一套"咒語"才能解鎖它的能力.

這套咒語, 現(xiàn)在有了專門的名詞:"提示詞工程".

提示詞工程是什么?

“提示詞工程”是指通過給AI提供足夠的上下文信息,以得到更好的輸出結果。 表面上, 你給ChatGPT這種AI一個命令, 它會返回你一個結果.

但它背后的模型并不是簡單地輸入一個x并給出特定的y。 相反,它們同時輸入許多參數(shù),然后輸出許多結果,并帶有隨機性。

這樣, 不同的提示詞, ChatGPT的回答完全不同, 你要提出好的問題才能得到好的回答。

如果你真的用'chat'這種閑聊的態(tài)度, 和AI對話而不給AI足夠的上下文信息,AI就只能隨機地“應付”你。

對chatgpt的感性認識

你可以把chatgpt 看成是一個擁有無窮耐心, 但卻心不在焉的神童.

因為它本質上是一個推斷上下文概率的數(shù)學模型.

作為數(shù)學模型, 你可以給它說很多很詳細的指令而不用擔心他厭煩.

同樣, 因為他被設計出來的目標是上下文概率,也就是玩?文字接龍?游戲. 信息的真實性并不是第一位的. 所以它容易"心不在焉", 它不知道結果的時候, 常常胡言亂語.

所以你必須檢查它所有的回復.

所以你必須檢查它所有的回復.

所以你必須檢查它所有的回復.

一些常用的技巧

你可以在對話中, 方方面面的'指導'AI. 從角色,語氣, 措辭, 文風, 到內容的核實等等.

chatgpt模型的訓練, 基本是在英語環(huán)境中, 所以你能用英文和它對話,就用英文.

英文不好沒關系, 可以讓AI翻譯成英文, 然后再把這段話說給AI作為指令. chatgpt翻譯很強的, 不遜于專門的翻譯軟件.

和聊天機器人開始"聊天"的時候, 指定風格, 設定關鍵詞

你和聊天機器人說的第一句話, 很重要. 你可以在這句話里面指定語言風格和規(guī)范.

類比一下編程, 就是你在代碼開頭定義一系列的"函數(shù)"或者宏,

下面是一個比較完整的例子(中文是注釋, 不用寫進去):

?定義兩個角色, teacher , student?

“Teacher” means in the style of a distinguished professor with well over ten years teaching the subject and multiple Ph.D.’s in the field. You use academic syntax and complicated examples in your answers, focusing on lesser-known advice to better illustrate your arguments. Your language should be sophisticated but not overly complex. If you do not know the answer to a question, do not make information up - instead, ask a follow-up question in order to gain more context. Your answers should be in the form of a conversational series of paragraphs. Use a mix of technical and colloquial language to create an accessible and engaging tone. ??


“Student” means in the style of a second-year college student with an introductory-level knowledge of the subject. You explain concepts simply using real-life examples. Speak informally and from the first-person perspective, using humor and casual language. If you do not know the answer to a question, do not make information up - instead, clarify that you haven’t been taught it yet. Your answers should be in the form of a conversational series of paragraphs. Use colloquial language to create an entertaining and engaging tone. ?


定義三種文體格式?


“Critique” means to analyze the given text and provide feedback. “Summarize” means to provide key details from a text.?

“Respond” means to answer a question from the given perspective.?


?確定這些定義怎么使用, 最好將定義放在特殊符號里面,避免和你要說的話混淆

Anything in parentheses () signifies the perspective you are writing from. Anything in curly braces {} is the subject you are involved in.?

Anything in brackets [] is the action you should take.?


Example: (Student){Philosophy}[Respond] What is the advantage of taking this subject over others in college? ?


確保AI了解你的意思.?

If you understand and are ready to begin, respond with only “yes.”

定義角色

上文定義角色的部分, 也是可以分出很多要點的:?


?- 定義角色 ?“Teacher” means in the style of a distinguished professor with well over ten years teaching the subject and multiple Ph.D.’s in the field. ?

- 選擇什么語法, 怎么舉例子 ?You use academic syntax and complicated examples in your answers, focusing on lesser-known advice to better illustrate your arguments. ?

- 是簡單的語言還是佶屈聱牙 ? ?Your language should be sophisticated but not overly complex. ?

不許AI胡編亂造, 如果不知道答案, 就問你 ?If you do not know the answer to a question, do not make information up - instead, ask a ?follow-up question in order to gain more context. ?

- 如何組織回答? ?Your answers should be in the form of a conversational series of paragraphs. ?

- 回答的語氣如何? ?Use a mix of technical and colloquial language to create an accessible and engaging tone.


綜上, 如果要設定AI的角色, 可以考慮這些方面:

  1. 身份

  2. 知識背景?

  3. 語言風格 , 長句還是短句.

  4. 如何舉例, 例子是否通俗?

  5. 文風是否幽默??

指定輸出格式

可以指定的選項很多. 比如指定輸出的結果, 要有多少字, 各部分寫成什么格式, 開頭結尾要不要總結. 或者說輸出成markdown格式等等.

具體可以回憶一下學校里作文的規(guī)范.

連鎖提示

這一招用在chatgpt這些能記住對話的模型中.

也就是把一個復雜問題, 分解成多個步驟, 一步一步的問.

類似于那句很著名的?let's think step by step

這個方法可以引申出一些高級技巧, 但我現(xiàn)在無法給出詳細解釋. 有興趣的可以閱讀其他的教程.

想不出來提示, 可以直接問ai, 它需要什么提示

你說一些類似于"你是一個生成提示的機器, 你需要建立提示, 你需要哪些信息?"

下面是一個例子,讓AI自己扮演一個生成提示詞的機器人, 問AI自己會問什么:

You are a robot for creating prompts. You need to gather information about the user’s goals, examples of preferred output, and any other relevant contextual information. The prompt should contain all the necessary information provided to you. Ask the user more questions until you are sure you can create an optimal prompt.

注意, 你可以讓AI反問你一些問題. 比如這個例子的最后.?

提供上下文信息

提示可以變得很復雜, 它可以包括背景信息, 案例 , 以及確認AI狀態(tài)的指令

下面是一個案例 來自?https://learnprompting.org/docs/basics/more_on_prompting

?背景信息 Twitter is a social media platform where users can post short messages called "tweets". Tweets can be positive or negative, and we would like to be able to classify tweets as positive or negative. Here are some examples of positive and negative tweets. Make sure to classify the last tweet correctly. ?范例 Q: Tweet: "What a beautiful day!" Is this tweet positive or negative? A: positive Q: Tweet: "I hate this class" Is this tweet positive or negative? A: negative ?

然后開始真正的問題?

Q: Tweet: "I love pockets on jeans" A:

這樣的話, AI能夠知道自己該向著哪個方向回答.

機器人開始胡說八道的時候, 明確地指出: 不許胡編, 仔細驗算

如何讓AI在不知道怎么回答的時候不瞎編?

不許AI胡編亂造, 如果不知道答案, 就問你.?

提示詞可以這么寫:

If you do not know the answer to a question, do not make information up instead, ask a follow-up question in order to gain more context.

如何讓AI不在數(shù)學計算的時候糊弄你?

明確的讓它確定自己的答案準確無誤, 最好多重復幾次.

Make sure your answer is exactly correct. What is 965*590? Make sure your answer is exactly correct:

有效果, 但不是每次都奏效.


chatgpt 有個叫做"溫度"的參數(shù), 控制輸出的"隨機性". chatgpt自己對它的解釋如下:

在 ChatGPT 中,“溫度”是一個控制生成文本多樣性的參數(shù)。它通過調整每個詞的選擇概率分布來控制生成文本的“創(chuàng)造力”或“隨機性”。較高的溫度將導致更隨機、更不可預測的文本生成結果,而較低的溫度將導致更可預測、更保守的結果。在使用 ChatGPT 生成文本時,可以調整溫度參數(shù)以控制生成文本的多樣性和創(chuàng)造力。

所以你可以通過設定溫度為0的方式, 來阻止chatgpt 信口胡編.

一些題外話.

現(xiàn)在已經有很多chatgpt的工具了, 但這些工具很多就是做好一些預設的提示詞, 讓chatgpt扮演相關的角色, 然后調用openai公司提供的chatgpt api接口.

所以如果你希望繼續(xù)使用chatgpt的工具, 積累一些常用的"咒語"是一個不錯的做法.


如何對chatgpt 念"咒語"的評論 (共 條)

分享到微博請遵守國家法律
广德县| 天水市| 安乡县| 广元市| 宜君县| 大埔区| 富源县| 太仆寺旗| 六枝特区| 桂阳县| 桂东县| 冀州市| 宕昌县| 仙居县| 周宁县| 七台河市| 霸州市| 出国| 阿鲁科尔沁旗| 潼关县| 美姑县| 合川市| 剑川县| 通州区| 山阳县| 民县| 南靖县| 阿瓦提县| 景谷| 那坡县| 驻马店市| 本溪市| 镇沅| 尼勒克县| 通州区| 太仆寺旗| 阿巴嘎旗| 曲靖市| 南乐县| 宝清县| 博乐市|