← All questions
System DesignHard· RAG· Security & Safety· Reranking

Your reranking team wants to raise k from 10 to 50 cand...

The conflict between recall and security should not be treated as a binary choice. By calculating the actual exposure risk, you can maintain the performance benefits of a larger candidate pool (k=50) while mitigating the security risk through a defense layer. This involves running injection checks on all retrieved passages before they reach the generation phase, effectively neutralizing the threat regardless of the number of candidates retrieved.

Code playground (Python)