Last updated on October 3, 2024
Technique | Institution | Date of Publication | Paper | Code |
---|---|---|---|---|
Memory-of-Thought (MoT) Prompting | Fudan University | May 2023 | MoT: Memory-of-Thought Enables ChatGPT to Self-Improve | LeeSureman/MoT |
Memory-of-Thought (MoT) is a novel framework designed to let Large Language Models (LLMs) like ChatGPT self-improve without requiring high-quality labeled datasets or computationally expensive fine-tuning. Inspired by human self-reflection and memory, MoT equips LLMs with the ability to pre-think, store, and recall past reasoning paths, enhancing their performance on various reasoning tasks.
This approach contrasts traditional methods that rely heavily on annotated datasets and fine-tuning, both of which are costly and limit the accessibility of improvement for LLMs. MoT leverages external memory to improve performance across various reasoning tasks, including arithmetic, commonsense, and factual reasoning.
The framework operates in two key stages:
Pre-thinking: Before the test stage, the LLM thinks over an unlabeled dataset and saves the high-confidence reasoning paths (called thoughts) in an external memory system.
Recalling: During the test stage, when the LLM encounters a new question, it retrieves the relevant thoughts from memory to aid its reasoning process.
This method allows the LLM to improve its reasoning capabilities without updating its parameters, making it more efficient and scalable.
MoT mimics human cognition by allowing the LLM to think, store, and recall. Just as humans remember past decisions to make better future ones, the LLM can rely on stored reasoning chains to enhance its current reasoning. This improves performance across a wide range of tasks by eliminating reliance on random or irrelevant examples, focusing instead on high-quality, relevant memories.
In this stage, the LLM processes unlabeled examples and saves the most consistent reasoning paths (thoughts) as memory. This process involves the following steps:
Q1: [Question 1] A1: [Answer 1] Q2: [Question 1] A2: [Answer 1]
Qn: [Sample question]
When the LLM encounters a new test question:
Test Question: Maddie has 24 apples. If she gives 12 to Mike, how many does she have left?
Memory Retrieval: A similar thought retrieved from memory involves someone giving away apples:
- "If Tom has 30 apples and gives 15 away, he has 30 - 15 = 15 apples left."
Answer: Using the thought from memory, Maddie has 24 - 12 = 12 apples left.
By recalling a similar scenario from its memory, the LLM quickly resolves the new question using an analogous reasoning process.
The code for MoT is open-sourced by Fudan University and available for further research and implementation at LeeSureman/MoT.
MoT was tested on multiple reasoning benchmarks, demonstrating significant improvements in various tasks compared to standard techniques.
Task | Few-Shot CoT | MoT | Improvement |
---|---|---|---|
Arithmetic Reasoning | 49.7% | 54.1% | +4.4% |
Commonsense Reasoning | 80.0% | 82.3% | +2.3% |
Natural Language Inference | 67.7% | 71.5% | +3.8% |
Factual Reasoning | 65.2% | 68.0% | +2.8% |
Memory-of-Thought (MoT) enhances LLMs' reasoning capabilities by enabling them to learn from their own past experiences and leverage stored memories. MoT offers a cost-effective and efficient solution compared to traditional methods relying on extensive datasets and fine-tuning.
Li, X., & Qiu, X. (2023). MoT: Memory-of-Thought Enables ChatGPT to Self-Improve. https://arxiv.org/abs/2305.05181 ↩