← All questions
RAGHard· Optimization· Gradient Analysis· Retriever Training

You minimize KL(PR‖QLM). Is that objective better at pr...

The gradient on logit j is Pj (ℓj − L). When the generator dislikes a passage that the retriever likes, ℓj is large, causing a significant ‘push-down’ effect. Conversely, if the generator likes a passage that the retriever ignores, the effect is capped by a small Pj, and it becomes zero outside the top-k. Consequently, if a retriever never surfaces the correct passage, it will not learn to do so. This necessitates pairing the objective with hard-negative mining and periodic index refreshes to ensure the retriever explores relevant space.

Code playground (Python)