Agentic Context Learning with Self-Discovered Specification
This paper identifies that the primary challenge in context learning for large language models is not merely accessing content but acquiring implicit, task-specific specifications distributed across the context, and demonstrates that a simple intervention called PSCI, which extracts and enforces these specifications through adversarial checking, significantly outperforms existing baselines on the CL-Bench benchmark.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you've just been handed a massive, 40,000-page instruction manual for a brand-new, super-complex video game. The manual is full of lore, character backstories, and world history. Then, your friend asks you a simple question: "What happens if I skip a level?"
You might think the hardest part is finding the answer in that giant book. You'd think, "If I just search for 'skip level,' I'll find the rule!" But here's the twist: the paper argues that for modern AI models, the real problem isn't finding the answer (the content). The real problem is finding the rules of the game that tell you how to write that answer correctly (the specifications).
The "Near-Miss" Mystery
The researchers tested this on a benchmark called CL-Bench, which contains 1,899 tricky tasks where the AI has to learn new rules from long texts. The results were surprising. Even the smartest AI models (like GPT-5.1) only got about 22.55% of the tasks perfectly right.
But when they looked closer at the mistakes, they found something weird. The AI wasn't usually getting the facts wrong. It was getting the format wrong.
- The Fact: The AI knew the missing ID was "404."
- The Rule: The manual said, "If you see a missing ID, you must write the exact flag
Sequence_Gap_Warning." - The Mistake: The AI wrote "404" but forgot the flag.
It was a "near-miss." The AI knew the content but missed the local specification. In fact, the paper found that 55.4% of all the rules in the test were about these specific behaviors (formats, ordering, exact phrases), while only 22.6% were about factual content.
Why "Searching" Didn't Work
A natural guess would be: "Maybe the AI just can't find the right page in the manual." So, the researchers tried 12 different methods to help the AI search better, like summarizing the text or pulling out relevant chunks.
The result? None of them worked well. The best of these search-heavy methods still only scored around 23%. This suggests that simply finding the right page isn't the issue. The problem is that the rules are often hidden in the background—like a footnote in a paragraph about "event semantics"—and the AI doesn't realize it needs to follow them unless it explicitly looks for them.
The "Private Contract" Solution
To prove this, the researchers designed a simple trick called PSCI (Private Specification-Contract Induction). Think of it like this:
Before the AI tries to answer the question, they force it to do a "pre-game meeting."
- Induce: The AI reads the whole manual and writes down a "Private Contract" of all the hidden rules it found (e.g., "Rule 1: Always use the flag
Sequence_Gap_Warning"). - Generate: The AI writes its answer, but it has to follow that contract.
- Check: A "referee" (another AI step) checks the answer against the contract. Did you use the flag? Did you follow the order?
- Repair: If the referee says "No," the AI fixes the answer before showing it to you.
The result? This simple four-step process boosted the GPT-5.1 score from 22.55% to 28.14%. That's a 5.59 percentage point jump, which is huge in this world. It also worked on other models like Qwen3.5-27B (jumping from 14.14% to 19.42%) and Gemini 3 Pro (jumping from 16.14% to 22.31%).
What This Rules Out
The paper is very clear about what doesn't work:
- Just searching more: Throwing more search tools at the problem didn't help.
- Just thinking harder: Using the "GPT 5.1 (High)" setting from the original CL-Bench evaluation only got the model to 23.7%, which is still lower than the 28.14% achieved by the PSCI trick.
- Generic checklists: If you just ask the AI to "check your work" without first making it write down the specific rules from this context, it doesn't help. The rules must be specific to the task at hand.
How Sure Are They?
The authors are quite confident in their findings because they tested this rigorously. They didn't just guess; they ran 17 different "ablation" experiments (breaking the method apart to see what works).
- They proved that if you shuffle the rules (give the AI the wrong contract), the score crashes back down to 19.80%, proving the rules must match the specific task.
- They proved that if you skip the "contract" step and just ask the AI to check its own work later, it fails. The contract must be written before the answer is generated.
- They even had human experts check 100 of the AI's answers. The humans agreed with the computer's judgment 96% of the time, confirming the AI was actually getting better, not just guessing.
The Bottom Line
The paper suggests that for AI to learn new rules from long texts, it can't just be a good librarian who finds the right book. It needs to be a good lawyer who reads the fine print, writes down a contract of the rules, and then signs that contract before doing any work.
While the score of 28.14% is the best so far, the authors note it's not a "solved" problem yet. There's still a lot of room for improvement, especially in the "enforcement" part—making sure the AI actually follows the contract it wrote for itself. But the main takeaway is clear: Context learning isn't just about finding the answer; it's about discovering the rules of the game first.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.