Prompt Engineering
Learn what prompts work best with context retrieved from SID
Basics
Even though we’re always doing our best to find the most relevant matches to any query, it can sometimes happen that the results are not exactly what you’re looking for.
If you simply feed all results into the model along with the user’s query, the model may have a hard time discerning what is relevant from what isn’t, and will oftentimes try to incorporate the irrelevant results into the generated text.
For this reason, it is important to specify in your prompt that only results that are clearly relevant to the user’s query should be used in the generated text, and that other results can be safely ignored.
Example
In our demo, we use the following system prompt:
Furthermore, for each query, we retrieve the top 5 results from our API and append them to the query with the following prompt:
Importantly, the prompt specifies that the results only might be relevant to the query, which makes it more likely that the model will ignore them if they are not relevant.
You should play around with the directions given in the prompt, depending on your exact use case. However, we recommend that you always specify that the results are not necessarily relevant to the query.
Was this page helpful?