Topics
Basically, do Zero-shot prompting by feeding pairs of query and document and ask for relevancy score, followed by sorting.
One can also perform LLM fine-tuning for such task. E.g. RankT5 (Encode-Decoder) model is fine-tuned to generate classification tokens for relevant or irrelevant query-document pairs. Similarly, RankZephyr and RankGPT which are decoder-only models, propose various methods for relevance calculation.