In-context learning (ICL) enables large language models to perform few-shot learning by conditioning on labeled examples in the prompt. Despite its flexibility, ICL suffers from instability -- especially as prompt length increases with more demonstrations. To address this, we treat ICL as a source of weak supervision and propose a parameter-efficient method that disentangles demonstration-induced latent shifts from those of the query. An ICL-based teacher generates pseudo-labels on unlabeled queries, while a student predicts them using only the query input, updating a lightweight adapter. This captures demonstration effects in a compact, reusable form, enabling efficient inference while remaining composable with new demonstrations. Although trained on noisy teacher outputs, the student often outperforms its teacher through pseudo-label correction and coverage expansion, consistent with the weak-to-strong generalization effect. Empirically, our method improves generalization, stability, and efficiency across both in-domain and out-of-domain tasks, surpassing standard ICL and prior disentanglement methods.
翻译:上下文学习(ICL)使大型语言模型能够通过以提示中的标注示例为条件进行小样本学习。尽管具有灵活性,ICL 仍存在不稳定性问题——尤其是随着提示长度因演示示例增多而增加时。为解决此问题,我们将 ICL 视为一种弱监督源,并提出一种参数高效的方法,将演示诱导的潜在偏移与查询的潜在偏移解耦。一个基于 ICL 的教师在未标注的查询上生成伪标签,而一个学生仅使用查询输入来预测这些标签,并更新一个轻量级适配器。这以紧凑、可重用的形式捕获了演示效应,在保持与新演示可组合性的同时实现了高效推理。尽管在噪声教师输出上训练,学生模型通过伪标签校正和覆盖范围扩展,其表现通常优于其教师模型,这与弱到强的泛化效应一致。实证结果表明,我们的方法在领域内和领域外任务上均提升了泛化能力、稳定性和效率,超越了标准 ICL 及先前的解耦方法。