LLMs Learn Better In-Context from Rules than from Examples
cs.CL
Submitted: 2026-09-02
Updated: 2026-09-02
Code: https://github.com/tinlaboratory/rul
License: http://creativecommons.org/licenses/by-nc-sa/4.0/
The gist: Large language models (LLMs) exhibit in-context learning capabilities, where they can learn new tasks from prompt contexts without weight updates.
Terminology
Abstract
Large language models (LLMs) exhibit in-context learning capabilities, where they can learn new tasks from prompt contexts without weight updates. We compare the learning efficacies of two prominent modes of in-context learning: (1) learning from descriptions of rules (instruction following); and (2) learning from examples of input-output demonstrations (few-shot prompting). Through five learning tasks that cover diverse domains (games, arithmetic, linguistic inferences), we compare two modes of learning (rules vs. examples) specifying the same underlying task. We furthermore explore model and task properties that modulate the learning efficacies. We find that models generally learn more reliably from rules than from examples alone, and additional examples on top of rules or simply scaling up the number of examples do not lead to consistent and significant gains. Instruction tuning amplifies the benefit of rule-based learning while keeping example-based learning capacities intact. Surprisingly, we find no privileged effect of example-based learning in base models, and rules still lead to gains in algebraic task domains. Overall, the comparative efficacy of rules over examples is larger when the task recruits algebraic abstractions and computations, and smaller when the task requires distributional sensitivity and/or recruits parametric knowledge.
Sources
- Transformers generalize differently from information stored in context vs in weights
- Gemma 3 Technical Report
- Efficient Memory Management for Large Language Model Serving with PagedAttention
- The broader spectrum of in-context learning
- Can LLMs Follow Simple Rules?
- Qwen2.5 Technical Report
- Qwen3 Technical Report
- Olmo 3
- Minimization of Boolean Complexity in In-Context Concept Learning
- Shared Lexical Task Representations Explain Behavioral Variability In LLMs
- Large Language Models can Learn Rules
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering