Skip to content

Instantly share code, notes, and snippets.

@shreyanshp-cactus
Last active February 7, 2025 09:52
Show Gist options
  • Save shreyanshp-cactus/44da575978ce9d50c8afa7baa8bd7ae8 to your computer and use it in GitHub Desktop.
Save shreyanshp-cactus/44da575978ce9d50c8afa7baa8bd7ae8 to your computer and use it in GitHub Desktop.
Prompt Guidelines

Principles of Prompting

1. Write clear and specific instructions

short != clear, Write as much as you would like to add.
Tactic 1: Use delimiters
```
Triple quotes: “””
Triple backticks: ```,
Triple dashes: ---,
Angle brackets: < >,
XML tags: <tag> </tag>
```
Tactic 2: Ask for strctured output
Html, json
Tactic 3: Check whether conditions are satisfied,

Check assumptions required to do the task

Tactic 4: Fet shot prompting

Show modal example of successful task, then ask it to perform.


2. Give the model time to think

Tactic 1: Specify steps to complete a task
```
1. Summaries the text delimited by triple quotes.
2. Translate the summary into french
3. Output a json object that contains following keys: summary, translation
```
Tactic 2: Instruct the modal to work out it's own solution before rushing to a conclusion.
```
Your task is to determine if the student's solution \
is correct or not.
To solve the problem do the following:
- First, work out your own solution to the problem including the final total.
- Then compare your solution to the student's solution \
and evaluate if the student's solution is correct or not.
Don't decide if the student's solution is correct until
you have done the problem yourself.

Use the following format:
"Question:"
"Student's solution:"
"Actual solution:"
"Is the student's solution the same as actual solution: Yes/No"
```
Reduce Hallucinations:
First find relevant information, then answer the question based on the relevant information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment