Skip to content

An intelligent Maths Agent that mimics human mathematical reasoning by decomposing complex problems into step-by-step tasks, solving each atomic step efficiently, and providing detailed, structured solutions.

Notifications You must be signed in to change notification settings

siddM23/Math_Agent

Repository files navigation

#Biological Cognition-Inspired Math Reasoning in LLMs

Overview

This project explores a novel perspective: using cognitive neuroscience and psychology research to guide how large language models (LLMs) solve mathematical problems. The central idea is to understand how humans — particularly experts — approach mathematical problem-solving and to recreate a similar structured approach in LLMs through decomposition.

🧬 Biological & Cognitive Inspirations

  1. Innate Number Sense & Symbolic Transition • Humans have an innate ability to distinguish between quantities even without symbolic math knowledge. • LLMs also exhibit a kind of “proto-numerical” behavior — they can compare or reason about quantities and numbers with little explicit knowledge. • Hypothesis: LLMs may have a parallel to our number sense, which can be harnessed more effectively with structured tasks.

  2. Cognitive Stages of Problem Solving • Human problem-solving often involves: • Comprehension • Decomposition • Planning • Execution • Verification • LLMs struggle with long-chain reasoning tasks because they lack structured planning. We can design an LLM system to explicitly decompose tasks into cognitively inspired stages.

  3. Working Memory & Executive Control • In humans, the prefrontal cortex manages active problem-solving through limited-capacity working memory. • In LLMs, the context window serves as an analog. • Solution: Use smart decomposers and aggregation strategies to manage information within the context window efficiently, like executive control in humans.

  4. Chunking & Expertise • Experts chunk information differently than novices. For example: • A professor might instantly simplify or solve large expressions, • A student might break it into smaller pieces, • A beginner might struggle to see the structure at all. • Proposed Method: • Study and model different chunking styles by expertise, • Determine optimal chunk size for different levels of reasoning complexity.

🛠️ Technical Strategy

🧩 Decomposer • An LLM module that takes a problem and breaks it down into chunks or subproblems, simulating how humans use chunking. • Can be tuned to simulate reasoning at different levels of expertise.

🧠 Executor • Solves each chunked subproblem using a base model. • Incorporates mathematical tools or solvers (e.g., SymPy, Wolfram Alpha) where needed.

🧲 Aggregator • Collects partial answers and assembles them into a final, verifiable solution. • Can also simulate human-style checking or verification.

✍️ Temporary Working Title

“Cognitively-Inspired Decomposition for Mathematical Reasoning in LLMs”

Alternative names you could consider later: • “Mimicking Minds: Cognition-Driven Math with LLMs” • “NeuroSymbolic Decomposition for LLM Math Solving” • “Chunking Like a Human: Teaching LLMs to Think in Pieces”

🧠 Research Goals • Investigate brain and psychology research on mathematical cognition. • Identify parallels in LLM behavior (number sense, working memory, etc.). • Build a system that simulates human mathematical reasoning stages. • Evaluate whether decomposition + aggregation improves math performance. • Explore if expertise simulation in decomposition impacts accuracy.

📚 Initial References • Dehaene, S. The Number Sense (2000) • Sweller, J. Cognitive Load Theory • Anderson, J.R. ACT-R Cognitive Architecture • Kahneman, D. Thinking, Fast and Slow (for dual-system models) • Research on mathematical chunking, working memory limits, and problem-solving in experts vs novices

Setup and Usage

  1. Create and activate the conda environment:
    conda env create -f environment.yml
    conda activate ma
  2. Set your MATHSAGENT API key:
    export MATHSAGENT_API_KEY="your_api_key_here"
  3. Run the decomposer application:
    python main.py
  4. In the GUI:
    • Select the model from the dropdown.
    • Enter a math problem.
    • Click "Decompose" to see the recursive decomposition tree.

About

An intelligent Maths Agent that mimics human mathematical reasoning by decomposing complex problems into step-by-step tasks, solving each atomic step efficiently, and providing detailed, structured solutions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages