Schema for In-Context Learning

Pan Chen, Shaohong Chen, Mark Wang, Shi Xuan Leong, Priscilla Fung, Varinia Bernales, Alán Aspuru-Guzik · DOI

Abstract

Large Language Models (LLMs) frequently rely on surface-level pattern matching during In-Context Learning (ICL), often failing to capture the underlying logical structures required for complex tasks. We introduce Schema-Activated In-Context Learning (SA-ICL), a framework inspired by human cognitive Schema Theory. SA-ICL requires models to construct, retrieve, and "activate" abstract mental templates—schemas—before problem-solving. Our results demonstrate that SA-ICL significantly outperforms standard ICL on PhD-level scientific benchmarks, improving accuracy by up to 40% while enhancing reasoning efficiency and model interpretability.

Introduction

In-Context Learning (ICL) has revolutionized how we interact with Large Language Models, allowing them to perform new tasks with just a few examples. However, a persistent challenge remains: LLMs often engage in "shallow retrieval," latching onto keywords or surface-level similarities rather than the deep logical structure of a problem. This leads to failures in complex reasoning tasks where the surface appearance of a problem may differ significantly from its underlying solution path.

In contrast, human cognition relies on Schema Theory. When faced with a novel challenge, humans do not simply look for a similar-looking past event; they activate a "mental framework" or schema (e.g., a "Conservation of Momentum" schema in physics) that provides a structured template for reasoning. This paper introduces Schema-Activated In-Context Learning (SA-ICL) to bridge this gap, forcing LLMs to move beyond simple mimicry toward structured, schema-driven cognition.

The SA-ICL Framework

The proposed SA-ICL framework moves beyond standard prompting by implementing a five-stage cognitive workflow designed to activate and refine abstract knowledge:

  1. Problem Representation: The model first generates a high-level abstraction or "initial schema" of the target question, identifying the core concepts involved.
  2. Prior Schema Retrieval: The system searches a memory bank to find the most relevant abstract schema based on past demonstrations or domain knowledge.
  3. Episodic Retrieval: Once a schema is identified, the model retrieves specific past examples that align with that structural template.
  4. Schema Activation (Assimilation and Accommodation): This is the core of the framework. The model integrates the retrieved schema with the current problem. It either fits the new information into the existing template (Assimilation) or restructures the template to account for the unique constraints of the new problem (Accommodation).
  5. Schema-Guided Solving: Finally, the model solves the problem using the refined, structured template. To ensure precision, SA-ICL often enforces a rigid, JSON-like structure for the reasoning steps.

Experimental Evaluation

The researchers evaluated SA-ICL across several high-difficulty datasets and a variety of state-of-the-art models, including Llama-3.1, Qwen-3, GPT-4o, and Gemini 1.5 Flash.

Datasets

  • GPQA (Graduate-Level Google-Proof Q&A): A benchmark consisting of PhD-level questions in Chemistry, Physics, and Biology designed to be difficult even for human experts.
  • Humanity's Last Exam (HLE): A high-difficulty dataset used to test the limits of next-generation models like GPT-5.
  • Synthetic Variants: To test "knowledge density," the authors generated variants of GPQA questions categorized as "Essentially Same," "Similar," or "Different" in surface appearance but sharing the same underlying logic.

Key Results

The implementation of SA-ICL led to substantial performance improvements:

  • Accuracy Gains: On the GPQA dataset, SA-ICL improved accuracy by 39.67% in Chemistry and 34.45% in Physics compared to standard one-shot prompting.
  • GPT-5 Performance: Even on the cutting-edge GPT-5, SA-ICL provided a 7% accuracy boost on the HLE dataset, despite the model's already high baseline performance.
  • Efficiency: Unlike Chain-of-Thought (CoT) reasoning, which can be verbose and repetitive, SA-ICL’s structured templates allowed models to reach correct answers using fewer tokens, improving computational efficiency.

Insights into Model Cognition

The study revealed several critical insights into how LLMs process information:

  • Schema Dormancy: A significant finding was that simply including an abstract schema in a prompt is often insufficient. Without an explicit "activation" step—forcing the model to reflect on and refine the schema—the structure remains "dormant," and the model reverts to shallow pattern matching.
  • Structural vs. Surface Alignment: SA-ICL allows models to succeed even when a problem looks different on the surface, provided it shares the same "Building Blocks of Cognition" with the retrieved schema.
  • Interpretability: By analyzing the model's internal confidence (log-probabilities), the researchers found that SA-ICL leads to much higher confidence in correct answers, whereas standard ICL often produces "confused" or overfitted outputs.

Limitations and Future Directions

While SA-ICL represents a major advancement, it is not without limitations. The framework's success is heavily dependent on the quality and relevance of the retrieved examples; its "win rate" decreases when the available knowledge base is sparse. Additionally, the current version primarily generates schemas from a single demonstration.

Future research will focus on:

  • Multi-Example Synthesis: Developing methods to synthesize robust schemas from multiple disparate examples to improve generalization.
  • Multimodal Integration: Extending SA-ICL to visual and sensory inputs, as human schemas are often triggered by more than just text. This could have significant implications for robotics and autonomous agents.

Conclusion

Schema-Activated In-Context Learning (SA-ICL) provides a powerful mechanism for enhancing the reasoning capabilities of LLMs. By mimicking the human ability to use abstract mental templates, SA-ICL enables models to tackle complex, graduate-level scientific problems with unprecedented accuracy and efficiency, moving the field one step closer to true artificial general intelligence.

Summary updated

BibTeX
@misc{chen2025schema,
  author = {Pan Chen and Shaohong Chen and Mark Wang and Shi Xuan Leong and Priscilla Fung and Varinia Bernales and Alán Aspuru-Guzik},
  title = {{Schema for In-Context Learning}},
  year = {2025},
  eprint = {2510.13905},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.13905},
}
Figure