\(\bullet\)_Heuristic approaches._ Due to their simplicity and low costs, existing work widely adopts heuristic methods to select demonstrations. Several studies employ a \(k\)-NN based retriever to select examples that are semantically relevant to the query [428, 480]. However, they perform the selection individually for each example, rather than evaluating the example set as a whole. To resolve this issue, diversity-based selection strategies are proposed to choose the most representative set of examples for specific tasks [481, 482]. Furthermore, in [483], both relevance and diversity are taken into consideration when selecting demonstrations.