让大模型自选最佳提示,提升个性化效果
Contexting as Recommendation: Evolutionary Collaborative Filtering for Context Engineering

- 把提示工程当作推荐问题,为不同输入动态匹配最优上下文
- 在多个数据集上准确率提升3.2%~7.8%,显著优于全局统一策略
- 适合需要高精度提示设计的场景,如复杂推理与生成任务
大型语言模型对输入上下文高度敏感,推动了自动化上下文工程的发展。然而,现有方法多将其视为全局搜索问题,寻找单一上下文策略以最大化整体性能,这种假设忽略了不同输入可能需要不同引导,导致大量实例级性能提升空间未被挖掘。本文提出范式转变:将上下文工程重构为推荐问题。我们提出神经协同上下文工程(NCCE)框架,将优化从静态全局搜索转变为动态的实例级路由。NCCE首先构建多样化的锚点上下文库,再通过创新的上下文-协同过滤共进化机制建立协同反馈循环:轻量级神经协同过滤(NCF)模型学习实例-上下文偏好,指导生成特定上下文变体;新评估的上下文持续优化NCF模型对潜在偏好的理解。推理时,训练好的NCF模型作为上下文路由器,为每个未见实例动态分配最适配的上下文策略。理论证明与全面实验表明,通过将个体输入与其最优上下文匹配,NCCE显著提升任务准确率,凸显个性化在大模型上下文工程中的关键作用。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。