Learning What Helps: Task-Aligned Context Selection for Vision Tasks
Jingyu Guo, Emir Konuk, Fredrik Strand, Christos Matsoukas, Kevin Smith
Abstract
Humans often resolve visual uncertainty by comparing an image with relevant examples, but ViTs lack the ability to identify which examples would improve their predictions. We present Task-Aligned Context Selection (TACS), a framework that learns to select paired examples which truly improve task performance rather than those that merely appear similar. TACS jointly trains a selector network with the task model through a hybrid optimization scheme combining gradient-based supervision and reinforcement learning, making retrieval part of the learning objective. By aligning selection with task rewards, TACS enables discriminative models to discover which contextual examples genuinely help. Across 18 datasets covering fine-grained recognition, medical image classification, and medical image segmentation, TACS consistently outperforms similarity-based retrieval, particularly in challenging or data-limited settings.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 0024e7e8-6b1e-4cf9-ab46-16a08d5297baBuilds on22
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
- Flamingo: a Visual Language Model for Few-Shot LearningJean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech et al.NeurIPS 2022 · 6,707 citations
- Retrieval Augmented Language Model Pre-TrainingKelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat et al.ICML 2020 · 2,937 citations
- Vision Transformers for Dense PredictionRené Ranftl, Alexey Bochkovskiy, Vladlen KoltunICCV 2021 · 2,647 citations
Related papers
- When does perceptual alignment benefit vision representations?Shobhita Sundaram, Stephanie Fu, Lukas Muttenthaler, Netanel Tamir et al.NeurIPS 2024 · 24 citations
- Show and Segment: Universal Medical Image Segmentation via In-Context LearningYunhe Gao, Di Liu, Zhuowei Li, Yunsheng Li et al.CVPR 2025
- FOCUS: Forcing In-Context Object Localization through Visual Support Constraints and Policy OptimizationMohammed Asad Karim, Vinay Kumar VermaICML 2026 · 1 citation
- Retrieving Counterfactuals Improves Visual In-Context LearningGuangzhi Xiong, Sanchit Sinha, Zhenghao He, Aidong ZhangCVPR 2026 · 3 citations
- Tuning Computer Vision Models With Task RewardsAndré Susano Pinto, Alexander Kolesnikov, Yuge Shi, Lucas Beyer et al.ICML 2023 · 56 citations
