Prompt Engineering Tips

Prompt engineering is a technique used in natural language processing and machine learning to design effective prompts for generating desired outputs from large language models (LLMs). It involves crafting specific instructions or queries that guide the model towards producing desired responses or completing specific tasks. By carefully designing prompts, researchers and engineers can improve the performance and control of generative AI.

Thus, knowing prompt engineering techniques can directly improve the performance of the Modeling Assistant (MA). Here, we list a few techniques to keep in mind when using our tools

Define a persona

Instruct the MA to take over a specific persona. These personas are already tuned in our Assistants, but it could be useful to give additional specific instructions for particular cases.

Example
You are an expert in the field of condensed matter physics and....

Templates

Using predefined templates with placeholders can help structure the prompt and guide the model's response. These templates can ensure consistency.

Example
In the following, when talking about users, always format output this way:
```
user: {username}
age: {age}
profession: {profession}
```

Examples

Using examples in your question can considerably improve the output's quality.

Step-by-step

Breaking down complex questions into smaller ones is often helpful to get better answers.

Example
Instead of
"What is the sum of all positive integers lower than 10 which are divisible by 3?"
use
"What are the numbers below 10 that are divisible by 3?"
and after the first answer
"Add them up."

Chain-of-thought

Simply asking the LLM to show you the reasoning behind a certain answer improves the quality of the output.

Example
"How do I write a unit test for Python? Explain step by step"