Metacognitive Capabilities of LLMs: An Exploration in Mathematical Problem Solving

Aniket Didolkar, Anirudh Goyal, Nan Rosemary Ke, Siyuan Guo, Michal Valko, Timothy P. Lillicrap, Danilo J. Rezende, Yoshua Bengio, Michael Mozer, Sanjeev Arora · OpenReview

Abstract

Metacognitive knowledge refers to humans' intuitive knowledge of their own thinking and reasoning processes. Today's best LLMs clearly possess some reasoning processes. The paper gives evidence that they also have metacognitive knowledge, including the ability to name skills and procedures to apply given a task. We explore this primarily in the context of math reasoning, developing a prompt-guided interaction procedure to get a powerful LLM to assign sensible skill labels to math questions, followed by having it perform semantic clustering to obtain coarser families of skill labels. These coarse skill labels look interpretable to humans. To validate that these skill labels are meaningful and relevant to the LLM's reasoning processes, we perform experiments asking GPT-4 to assign skill labels to training questions in math datasets GSM8K and MATH. When using an LLM to solve test questions, we present it with the full list of skill labels and ask it to identify the skill needed, followed by randomly selected exemplar solved questions associated with that skill. This improves accuracy on GSM8K and MATH for several strong LLMs, including code-assisted models. The methodology presented is domain-agnostic, even though this article applies it to math problems.

Introduction

While Large Language Models (LLMs) have made massive strides in natural language processing, mathematical reasoning remains a significant hurdle. Standard techniques like Chain-of-Thought (CoT) prompting help, but they often rely on fixed, human-selected examples that might not be relevant to the specific problem at hand.

This research investigates a fundamental question in AI pedagogy: Do LLMs have metacognition? In humans, metacognition is "thinking about thinking"—knowing which strategies to apply and when. The paper explores whether we can "bootstrap" an LLM’s internal knowledge of its own reasoning processes to identify the specific skills needed for a task and then use that knowledge to provide more relevant examples during problem-solving.

Methodology: Automated Skill Discovery

The researchers developed an automated three-stage pipeline to create a "Skill Exemplar Repository" and utilize it during inference. This process allows the model to effectively act as its own teacher by categorizing its cognitive requirements.

The complete pipeline for creating a Skill Exemplar Repository and performing skill-based inference.
  1. Skill Labeling: A powerful model (GPT-4) analyzes thousands of math problems and assigns a fine-grained "skill label" to each (e.g., "understanding_of_triangle_properties_and_circle_radius_calculation").
  2. Semantic Clustering: Because initial labeling produces thousands of overly specific skills, the LLM groups these into coarser, more interpretable "skill families." For example, this step reduced 5,000 skills to 117 for the MATH dataset, finding a "Goldilocks zone" of granularity that is broad enough to be useful but specific enough to be relevant.
  3. Skill-Based Inference: When faced with a new test question, the LLM first identifies which skill from its discovered catalog is required. It is then provided with randomly selected "exemplars" (solved examples) specifically associated with that skill, rather than random or fixed examples.

Skill-Based vs. Topic-Based Reasoning

A key insight of this work is that LLM-discovered skills are functionally relevant to how the model processes information, often outperforming broad human-assigned categories like "Algebra" or "Geometry."

Comparison between topic-based and skill-based solutions, highlighting how skill-based prompts lead to more accurate reasoning paths.

As illustrated in the comparison above, skill-based solutions can correct fundamental reasoning errors. In Example 2, a topic-based approach incorrectly concludes that a cube root of a negative number is not real, leading to an undefined result. In contrast, the skill-based approach correctly identifies the mathematical properties required, computes the value, and applies the ceiling function accurately.

Key Results and Insights

The study utilized several prominent mathematical reasoning benchmarks, including GSM8K (grade-school math) and MATH (competition-level problems). The results demonstrate the power of metacognitive bootstrapping:

  • Significant Performance Gains: The skill-based approach achieved an 11.6% improvement on the MATH dataset over standard CoT prompting. On GSM8K, the method reached an accuracy of 94.31% (95.38% with self-consistency).
  • Cross-Model Transferability: Metacognitive knowledge is transferable. Skill labels and exemplars generated by a "strong" model (GPT-4) significantly improved the performance of "weaker" models like Mixtral-8x7B.
  • Robustness Across Domains: Using a repository built on GSM8K, the models saw performance gains across six transfer datasets (SVAMP, ASDIV, and the MAWPS suite), proving the discovered skills are robust and generalizable.
  • Targeting "Main Skill Errors": Detailed error analysis found that this method specifically reduces instances where a model doesn't understand which mathematical concept to apply, rather than just fixing minor calculation mistakes.

Limitations and Future Work

While successful, the current methodology typically assigns only one primary skill to each question. However, complex math often requires a combination of multiple skills. Future research may focus on developing a hierarchy of skills to address this complexity. Additionally, while this study focuses on in-context learning, using these discovered skills to fine-tune models could lead to even more permanent and significant capability boosts. The framework is inherently domain-agnostic, suggesting potential applications in any complex reasoning task beyond mathematics.

Summary updated

BibTeX
@inproceedings{didolkar2024metacognitive,
  author = {Aniket Didolkar and Anirudh Goyal and Nan Rosemary Ke and Siyuan Guo and Michal Valko and Timothy P. Lillicrap and Danilo J. Rezende and Yoshua Bengio and Michael Mozer and Sanjeev Arora},
  title = {{Metacognitive Capabilities of LLMs: An Exploration in Mathematical Problem Solving}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=D19UyP4HYk},
}
Figure