Prompts And Instructions
# Prompts and Instructions
Modern embedding models (E5, BGE, GTE, Qwen3-Embedding, Nomic, Instructor, etc.) use **prompts** / **instructions** at encode time — short prefixes like `"query: "`, `"passage: "`, or `"Represent this sentence for retrieval:"` — to signal task intent.
In sentence-transformers, prompts work during both **training** and **inference**, and the library keeps them aligned automatically.
The prompt is literally prepended to the input text before tokenization.
## Model-level prompts
Set prompts on the model so `encode()`, `encode_query()`, `encode_document()` use them automatically:when to use it
Community prompt sourced from the open-source GitHub repo Pyfagorass/bookofspells (no explicit license). A "Prompts And Instructions" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
educationcommunitygeneral
source
Pyfagorass/bookofspells · no explicit license