home/productivity/few-shot-prompt-optimization-guide

Few Shot Prompt Optimization Guide

GPTClaudeDeepSeek··523 copies·updated 2026-07-14
few-shot-prompt-optimization-guide.prompt
# Few-Shot Prompt Optimizer

The **Few-Shot Prompt Optimizer** helps you improve your system instructions by learning from examples.

You provide your current instructions you want to tune along with a CSV file containing questions(prompts), the model's current responses, and your feedback. The optimizer analyzes where the model fell short and automatically updates your instructions to fix those gaps.

Your example data must be saved as a CSV file in Google Cloud Storage (GCS). You can format your feedback using one of two methods:

## Method 1: Target Responses

Use this method to show the optimizer exactly what the model *should* have said. The tool compares the actual output to your ideal output and adjusts the instructions to bridge the gap.

Your CSV must include these three columns:

* **`prompt`**: The original user instruction or question.
* **`model_response`**: The current model output that needs improvement.
* **`target_response`**: The ideal, correct response you want the model to generate.

## Method 2: Rubrics (Grading Criteria)

Use this method to score responses based on specific rules. The tool learns from which rules the model passed or failed. Rubrics can be consistent across all rows or customized for each individual example.

Your CSV must include these four columns:

* **`prompt`**: The original user instruction or question.
* **`model_response`**: The actual output generated by the model.
* **`rubrics`**: A list of specific grading criteria (formatted as a string representation of a Python list of strings, e.g., `"['Tone is polite', 'Mentions pricing']"`).
* **`rubrics_evaluations`**: True/False scores indicating if the model met each rule (formatted as a string representation of a Python list of booleans, e.g., `"['True', 'False']"`).

when to use it

Community prompt sourced from the open-source GitHub repo hzy9981/vertex-ai-mcp-bridge (Apache-2.0). A "Few Shot Prompt Optimization Guide" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

productivitycommunitydeveloper

source

hzy9981/vertex-ai-mcp-bridge · Apache-2.0