Metacognitive Capabilities of LLMs: An Exploration in Mathematical Problem Solving

Aniket Rajiv Didolkar, Anirudh Goyal, Nan Rosemary Ke, Siyuan Guo, Michal Valko, Timothy P Lillicrap, Danilo Jimenez Rezende, Yoshua Bengio, Michael Curtis Mozer, Sanjeev Arora

Introduction

Researchers have discovered that Large Language Models (LLMs) possess "metacognitive knowledge"—the intuitive ability to identify and categorize the specific reasoning skills they need to solve a problem. By leveraging this capability, the authors developed a Skill-Based Prompting framework that identifies the required skill for a given question and retrieves relevant examples. This approach leads to significant performance gains on challenging math benchmarks like MATH and GSM8K.

The Challenge of Mathematical Reasoning

While LLMs have made massive strides in natural language processing, mathematical problem-solving remains a significant hurdle. Standard techniques like Chain-of-Thought (CoT) prompting provide the model with a few fixed examples to follow. However, these examples are often "one-size-fits-all" and may not be relevant to the specific logic required for a new, complex problem.

In human pedagogy, metacognition (thinking about thinking) is a key component of learning. When a student sees a geometry problem, they don't just start calculating; they identify it as a "triangle properties" problem and recall relevant strategies. This paper investigates whether LLMs have a similar internal catalog of skills and whether "bootstrapping" this knowledge can help them solve math problems more accurately.

Methodology: Skill-Based Prompting

The authors propose an automated three-stage pipeline for Skill Discovery and application:

Overview of the Skill-Based Prompting pipeline, detailing the creation of a skill exemplar repository and the inference process.
  1. Skill Labeling: They use a powerful model (GPT-4) to analyze thousands of training questions from math datasets. The model assigns a highly descriptive "fine-grained" skill label to each (e.g., "understanding of triangle properties and circle radius calculation").
  2. Semantic Clustering: Because the first step generates thousands of unique labels (over 5,000 for the MATH dataset), the LLM is then asked to group these into "coarse-grained" clusters. This reduces the list to a manageable set of human-interpretable skills (e.g., 117 skills for the MATH dataset).
  3. Skill-Based Inference: At test time, the process works in reverse:
  4. The LLM is shown the list of coarse skills and asked to identify which one is needed for the current test question.
  5. The system then retrieves "exemplars" (solved examples) from the training set that match that specific skill.
  6. Finally, the LLM solves the question using these contextually relevant examples.

The researchers also tested Transferability, using skills discovered by GPT-4 to improve the performance of weaker models like Mixtral-8x7B.

Evaluation Datasets

The study primarily evaluates mathematical reasoning using:

  • GSM8K: Grade-school math word problems.
  • MATH: A much more difficult dataset featuring competition-level problems across topics like Algebra, Geometry, and Calculus.
  • Transfer Datasets: To test generalization, they used SVAMP, ASDIV, and the MAWPS suite (SingleOP, SingleEQ, AddSub, MultiArith).
  • Alignment Dataset: To prove the method is domain-agnostic, they applied it to the just-eval dataset (derived from Alpaca, LIMA, and HH-RLHF) to improve general instruction following.

Key Insights

  • LLMs as Taxonomists: One of the most striking findings is that LLMs can create their own meaningful hierarchies of knowledge. The "coarse" skills identified by GPT-4 (like "logarithmic and exponential skills") are highly intuitive to humans.
  • Relevance Trumps Complexity: Previous research suggested that providing complex examples was the best way to prompt models. This paper argues that relevance is more important. A model performs better with a simple example that uses the correct skill than a difficult example that uses an irrelevant one.
  • Metacognitive Portability: Metacognitive knowledge is transferable. The "Skill Exemplar Repository" created by GPT-4 significantly boosted the performance of the open-weights Mixtral model, suggesting that frontier models can be used to "teach" smaller models how to categorize problems.
  • Error Reduction: Analysis showed that this method specifically reduces "Main Skill Errors"—instances where the model fundamentally misunderstands what kind of math it needs to perform.

Experimental Results

  • MATH Dataset: Skill-Based Prompting achieved an 11.6% improvement over standard CoT for GPT-4.
  • Program-Aided Reasoning: When combined with PAL (where the model generates Python code to solve the math), the method yielded a 7.52% improvement.
  • GSM8K: The approach pushed GPT-4's accuracy to 95.38% (when combined with self-consistency).
  • Cross-Model Boost: Using GPT-4’s skill labels, the Mixtral-8x7B model saw its overall accuracy on the MATH dataset jump from a baseline of 28.4% to 32.44%.
Performance comparison of CoT, PAL, and Skill-Based prompting across various transfer datasets.
  • Transferability: As shown in the results above, Skill-Based Prompting generalizes well to other math datasets (like SVAMP and ASDIV), often matching or exceeding the performance of combined CoT + PAL approaches.
  • Alignment: In non-math tasks, the method improved scores across metrics like helpfulness, factuality, and safety compared to random example selection.

Limitations and Future Directions

  • The "Single Skill" Constraint: Most of the paper focuses on assigning one primary skill per question. However, many competition-level problems are "compound" and require multiple skills. Preliminary tests in the paper showed that allowing Multiple Skills (assigning several labels per question) improved results even further, suggesting a path for future optimization.
  • Frontier Model Dependency: The current pipeline relies on a very high-end model (GPT-4) to perform the initial labeling and clustering. It remains to be seen if smaller models can discover their own skills as effectively.
  • Beyond Prompting: The authors suggest that these discovered skill labels could be used for fine-tuning models, potentially baking this metacognitive awareness directly into the weights rather than relying on long context windows during inference.

Summary updated

BibTeX
@inproceedings{didolkar2024metacognitive,
  author = {Aniket Rajiv Didolkar and Anirudh Goyal and Nan Rosemary Ke and Siyuan Guo and Michal Valko and Timothy P Lillicrap and Danilo Jimenez Rezende and Yoshua Bengio and Michael Curtis 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