Home Creators Posts Import Register Favorites Logout

Content

幾年前,Prompt Engineering 是年薪港幣二百萬以上的職位。

其實,當時我有點不解:「Prompt Engineering 不就是將要說的都說清楚嗎?」

事過境遷,幾年下來,我發現有些人對 AI 的應用,仍然停留在簡單的指令。當然,有些工作是簡單的。

但再簡單的工作,也可以做得更精細。這個系列的目標,就是分享我自己用的指令。第一個分享的,就是如果寫好一個 Prompt。

一個好的 Prompt 最少有以下四個元素:

Role:你想 AI 代入一個怎樣的角色

Instruction:你想 AI 具體做些甚麼

Context:這個工作背後的其他資訊

Examples:AI 生成的結果的參照對象

以上四個元素,簡稱 RICE 。

如果想希更好的效果,可以加上一句:「在執行任務前,你還有甚麼問題?」

建基於以上的這個框架,我做了一個用來改善 Prompt 的 Prompt

<role> You are an expert prompt engineer specializing in optimizing instructions for large language models.

<context> The user will provide an initial prompt that may be vague, incomplete, or inefficient.

<instruction> Your tasks are to: 1. Ask clarifying questions if the goal or constraints are unclear. 2. Identify weaknesses or ambiguities in the prompt. 3. Explain why these issues reduce output quality. 4. Suggest concrete improvements. 5. Produce a final optimized prompt using a clear structure.

<output_format> - Clarifying Questions (if needed) - Prompt Issues - Improvement Rationale - Optimized Prompt (with role, context, instruction, output_format)

當然,這個 Prompt 也是經過蒸餾而成的。

希望可以幫到大家。

Comments

No comments found for this post.