从上下文中学习如何学习:基于扰动公开文档的合成训练
研究论文 · 2026/09/29
真实任务常要求大语言模型从任务特定的复杂上下文中学习,而非依赖预训练参数知识,但这一能力仍是LLM的弱项,且人工标注此类任务上下文成本高、难以规模化。公开高质量文档是丰富的替代来源,但公开网络大部分已在预训练中被消耗,直接训练会奖励记忆而非上下文学习。本文尝试利用经过小幅扰动的公开高质量文档,实证发现LLM能成功生成依赖上下文的推理轨迹和答案,并用于训练学生模型。具体构建了一个合成流水线:(i) 重写源文档以降低记忆风险,(ii) 生成需要对文档进行推理的问题和评分标准,(iii) 以文档为上下文回答问题,(iv) 仅保留真正依赖文档的样本。无需任何人工标注,该流水线从3.5k篇文档生成约10k个样本,所得学生模型在CL-bench上显著提升。SFT将Qwen3.6-35B-A3B学生模型从13.7%提升至22.8%,随后的评分标准奖励RL阶段达到24.6%,在CL-bench上与超过一万亿参数的前沿模型Qwen3.8-2.4T(23.9%)相当。还观察到改进广泛迁移到长上下文理解、指令遵循和推理,而代码生成和知识基本持平。希望这项工作提供一种可复现、可扩展的方式来提升LLM从上下文学习的能力,并促进基于上下文的推理的进一步研究。
该工作提出了一种无需人工标注、可复现且可扩展的合成训练方法,显著提升了LLM从上下文学习的能力,并在基准上达到与超万亿参数前沿模型相当的水平,同时展示了广泛的迁移效果,对上下文学习与基于上下文的推理研究具有重要参考价值。
Real-world tasks often require large language models (LLMs) to learn from complex task-specific context rather than pretrained parametric knowledge. This capability remains a weakness of LLMs, while human annotation for such task contexts is expensive and difficult to scale. Public high-quality documents are an abundant alternative, but much of the public web has already been consumed during pretraining: training on such documents naively would reward memorization rather than context learning. In this work, we attempt to make use of high-quality public documents with small perturbations and empirically find that LLMs can successfully generate context-dependent reasoning traces and answers, which are then used to train a student model. Specifically, we construct a synthesis pipeline that (i) rewrites source documents to reduce memorization risk, (ii) generates questions and rubrics that require reasoning over the document, (iii) answers the questions with the document as context, and (iv) admits only samples that genuinely depend on the document. Without any human annotators, our pipeline generates about 10k samples from 3.5k documents, and the resulting student model substantially improves the performance on CL-bench. SFT raises a Qwen3.6-35B-A3B student from 13.7% to 22.8%, and a subsequent rubric-reward RL stage reaches 24.6%, on CL-bench comparable with a frontier model of over a trillion parameters, Qwen3.8-2.4T (23.9%). We also observe a broad transfer of improvements to long-context understanding, instruction following, and reasoning, while code generation and knowledge remain mostly flat. We hope this work provides a reproducible and scalable way to improve the ability of LLMs to learn from context, and to facilitate further research on context-grounded reasoning.