Understand What LLM Needs: Dual Preference Alignment for Retrieval-Augmented Generation