Is Instruct and Query are keywords or we can use any?

#4
by Talha - opened

In following
f'Instruct: {task_description}\nQuery: {query}'
Is Instruct and Query are keywords of we can use any?

What if we need to add instructions for our document , can we do that ? I mean is it optional or model is not designed to do so

Talha changed discussion title from Is Instruct and Query are keywords of we can use any? to Is Instruct and Query are keywords or we can use any?

For query side, you have to follow the prompt template f'Instruct: {task_description}\nQuery: {query}' to be consistent with the model training.

Similar for the document side, you should not add instructions to the documents as the model is not designed to do so.

@intfloat Hello, I am looking for some guidance in optimizing instructions.

Use case - Embedding ~500 token passages of text (if a smaller size is optimal let me know) from a Swedish novel for later search and retrieval in a RAG pipeline.

When creating the embeddings:
I have just used very general instructions, which are likely not optimized. Seeking guidance. In the context of exerpts from a specific novel, how should this be structured to optimize retrieval comprehension?
query_instruction="Represent the query for retrieval:"

When querying:
I have used instructions like the ones below (to generalize). Are instructions like this appropriate? Should english or the language of the text be used? Should the instructions be further optimized for each given query and if so, what methodology would you follow?

#query_instruction="Given a query about a character or a plot point from the novel, retrieve passages that provide more details or insights about the query:"
query_instruction="Med tanke på en fråga om en karaktär eller en handlingspunkt från romanen, hämta passager som ger mer detaljer eller insikter om frågan:"

Sincerely appreciate any and all assistance :) much respect for your great work.

Sign up or log in to comment