Skip to main content

Prompt Engineering

Prompt Engineering - 提示工程

生成式 AI 應用程式傳回的回應品質不僅取決於模型本身,也取決於其所提供的提示類型。 「提示工程」一詞描述提示改善的流程。 設計應用程式的開發人員和使用這些應用程式的取用者,都可以考慮使用提示工程來改善生成式 AI 的回應品質。

提示是我們告知應用程式預期執行操作的方式。 工程師可以利用提示來新增程式的指示。 例如,開發人員可以為教師建置生成式 AI 應用程式,以建立與學生閱讀文字相關的複選問題。 在應用程式開發期間,開發人員可以新增其他規則,定義程式應該根據收到的提示執行哪些操作。

為什麼要使用英文 prompt 而不使用中文提問?

  1. 英文的訓練語料庫占比超過93%,中文約0.04%,使用英文提問時,它能返回更準確的解答。
  2. ChatGPT在一次輸入中,最多處理4096 token——超過上限的任何字符都將被忽略而不會顯示訊息。相較之下,英文的token使用量少,使用英文提問時,它能給予更多篇幅的答案(中文消耗的token約是英文兩倍)。詳細的可參考OpenAI token解答,以及使用官方的token計算器
  3. 返回英文答案後,再使用ChatGPT翻譯成中文就行了。例如:Please write in Traditional Chinese language.

Prompt Fundamentals
Prompt Tips

提示詞框架

Prompt Dev
Prompt Generator
P-A-R-T-S

Write an effective promt using P-A-R-T-S

Persona: Identify your role

Examples:

  • I am a Math Department Lead analyzing resource gaps.

  • I am a Spanish educator designing activities on cultural immersion.

Aim: State your objective

Examples:

  • Brainstorm ideas for [enter context].

  • Create an assessment on [enter context].

Recipients: Specify the audience

Examples:

  • School budget committee

  • Sophomores with at least four years of Spanish

  • 9th grade life skills educators

Theme: Describe the style, tone, and any related parameters

Examples:

  • Use a formal voice.

  • Write no more than 50 words.

  • Include pop culture references.

  • Be enthusiastic.

Structure: Note the desired format of the output

Examples: Ask the AI tool to 

  • Use bullet points.

  • Include metaphors or analogies.

  • Create a quiz or game.

  • Write code.

CoT - Chain of Thought

我要AI幫我{XXXX},請幫我用Chain-of-Thought來寫AI提示詞。

我要AI幫我從英文翻譯成中文(先直譯,再反思,再意譯),請幫我用Chain-of-Thought來寫AI提示詞。
我希望翻譯的英文句子如下,請使用上面的提示詞翻譯。
Cheat Sheet

chatgpt_prompt.jpg