Agentic Context Learning with Self-Discovered Specification
Abstract
Context learning is an emerging inference-time task where LLMs learn and apply novel, task-specific knowledge from complex contexts. Unlike demonstration-based in-context learning, which emphasizes inferring task mappings from examples, context learning requires acquiring genuinely new knowledge that may be absent from pre-training—a capability that remains challenging even for frontier models today. In this work, we conduct a comprehensive empirical study to understand why models struggle with this capability. A natural hypothesis is that failures stem from content access; however, across twelve retrieval, reflection, and verification baselines on CL-Bench, we find limited gains over direct full-context prompting. Instead, our analysis reveals a key insight: recovering relevant content is insufficient; models must also infer local specifications—domain-specific formats, local rules, and completeness conditions—that are often unstated in the query but recoverable from the context. Our rubric-level analysis finds that specification acquisition is evaluated more than twice as often as content acquisition. Most specifications are unstated in the user query, yet nearly all are traceable to the context, indicating learnable obligations rather than hidden requirements. To validate this diagnosis, we introduce PSCI (private specification-contract induction), a deliberately simple intervention that extracts local specifications and enforces them through adversarial checking and repair. PSCI improves GPT-5.1 from 22.55% to a state-of-the-art 28.14% task success on CL-Bench, with consistent gains on Qwen3.5-27B and Gemini 3 Pro. Extensive ablations further isolate the role of task-specific specifications. Together, our findings suggest that effective context learning hinges not only on content acquisition but also on specification acquisition.
est. 32% chance this paper gets accepted at ICLR 2027.
What do you think this paper will get?
All positions stay anonymous.