π€ AI Summary
This work addresses the limitations of traditional context engineering, which relies on global search strategies and fails to accommodate the personalized contextual guidance required by diverse input instances, thereby constraining instance-level performance gains in large language models. To overcome this, the paper introduces Neural Collaborative Context Engineering (NCCE), a novel framework that integrates collaborative filtering into context engineering for the first time. NCCE employs a lightweight neural collaborative filtering model, an anchor context catalog, and a context-CF co-evolution algorithm to dynamically match each input instance with its optimal context strategy. Experimental results demonstrate that NCCE substantially improves task accuracy, confirming the effectiveness and critical role of personalized context routing in enhancing model performance.
π Abstract
Large Language Models (LLMs) are highly sensitive to their input contexts, motivating the development of automated context engineering. However, existing methods predominantly treat this as a global search problem, seeking a single context strategy that maximizes average performance across a dataset. This restrictive assumption overlooks the fact that different inputs often require distinct guidance, leaving substantial instance-level performance gains untapped. In this paper, we propose a paradigm shift by formulating context engineering as a recommendation problem. We introduce \textbf{Neural Collaborative Context Engineering (NCCE)}, a framework that transitions optimization from a static global search to dynamic, instance-wise routing. NCCE first bootstraps a diverse catalog of anchor contexts and then employs a novel \textbf{Context-CF Co-Evolution} mechanism. This stage establishes a synergistic feedback loop: a lightweight Neural Collaborative Filtering (NCF) model learns instance-context preferences to guide the generation of specialized context variants, while the newly evaluated contexts continuously refine the NCF model's understanding of latent preferences. At inference time, the trained NCF model acts as a context router, dynamically assigning the most suitable context strategy to each unseen instance. Theoretical Proofs and comprehensive experiments demonstrate that by matching individual inputs with their optimal contexts, NCCE significantly improves task accuracy, highlighting the critical importance of personalization in LLM context engineering.