irthomasthomas / undecidability

2 stars 2 forks source link

Prompt engineering - OpenAI API #836

Open ShellLM opened 2 weeks ago

ShellLM commented 2 weeks ago

Prompt Engineering - OpenAI API

Six strategies for getting better results

Write clear instructions

These models can't read your mind. If outputs are too long, ask for brief replies. If outputs are too simple, ask for expert-level writing. If you dislike the format, demonstrate the format you'd like to see. The less the model has to guess at what you want, the more likely you'll get it.

Tactics:

Provide reference text

Language models can confidently invent fake answers, especially when asked about esoteric topics or for citations and URLs. Providing reference text can help the model answer with fewer fabrications.

Tactics:

Split complex tasks into simpler subtasks

Complex tasks tend to have higher error rates than simpler tasks. Decomposing a complex task into a workflow of simpler tasks can improve reliability.

Tactics:

Give the model time to "think"

Models make more reasoning errors when trying to answer right away, rather than taking time to work out an answer. Asking for a "chain of thought" can help the model reason its way toward correct answers more reliably.

Tactics:

Use external tools

Compensate for the weaknesses of the model by feeding it the outputs of other tools, such as text retrieval systems, code execution engines, or specific functions.

Tactics:

Test changes systematically

Improving performance is easier if you can measure it. Define a comprehensive test suite to ensure that changes are net positive to performance.

Tactic:

Suggested labels

None

ShellLM commented 2 weeks ago

Related content

663 similarity score: 0.92

369 similarity score: 0.91

659 similarity score: 0.9

832 similarity score: 0.88

665 similarity score: 0.88

484 similarity score: 0.87