ExpNote: Black-box Large Language Models are better Task Solvers with Experience Notebook

Wangtao Sun, Xuanqing Yu, Shizhu He, Jun Zhao, Kang Liu

Abstract

Black-box Large Language Models (LLMs) have shown great power in solving various tasks and are considered general problem solvers. However, LLMs still fail in many specific tasks although they understand the task instruction. In this paper, we focus on the problem of boosting the ability of black-box LLMs to solve downstream tasks. We propose ExpNote, an automated framework to help LLMs better adapt to unfamiliar tasks through reflecting and noting experiences from training data and retrieving them from external memory during testing. We evaluate ExpNote on multiple tasks and the experimental results demonstrate that the proposed method significantly improves the performance of black-box LLMs. The data and code are available at https://github.com/forangel2014/ExpNote.

Introduction

While Large Language Models (LLMs) like GPT-4 are powerful general-purpose solvers, they often stumble on niche, task-specific logic—such as complex kinship reasoning or medical entity recognition. Because these models are "black-box" (accessible only via API), users cannot fine-tune their internal weights to learn these specific rules.

Existing solutions like Chain-of-Thought (CoT) prompting help, but they do not allow the model to "learn" and accumulate knowledge across different instances of a task. Other memory-based methods often rely on expensive human-annotated facts. The authors of ExpNote propose an automated framework to enable an LLM to learn, store, and reuse its own task-specific experiences without human intervention or model fine-tuning.

The ExpNote Framework

The ExpNote (Experience Notebook) framework treats the LLM as an agent interacting with a dynamic external memory. It operates in two distinct stages:

  1. Training Stage (Learning): The LLM is given a training sample and asked to solve it using CoT. After receiving the ground-truth answer as feedback, the LLM is prompted to reflect on its performance. It uses a NOTE command to extract an abstract rule (e.g., "If A is B’s father and B is C’s husband, then A is C’s father-in-law") and saves it as a key-value pair in the notebook.
  2. Testing Stage (Inference): When faced with a new question, the system uses a retriever to search the notebook for relevant experiences using a RECALL command. The LLM then uses a THINK command to integrate these retrieved rules into its reasoning process to reach the final answer.
The ExpNote framework consists of a training stage for learning and noting experiences, and a testing stage for recalling and applying them.

This "Reflect-Note-Retrieve" cycle allows the model to build a library of "mental shortcuts" and domain-specific logic that it can apply to future, unseen problems.

Experimental Evaluation

The researchers evaluated ExpNote across four diverse tasks:

  • CLUTRR: Inductive reasoning focused on kinship relationships (e.g., "Who is Jack to Maria?").
  • METS-CoV: Medical entity recognition from social media posts (identifying diseases, symptoms, etc.).
  • EMOJI: Predicting the most appropriate emoji for a given text snippet.
  • LETS (Letter Splicing): A newly introduced benchmark testing symbolic reasoning by asking the model to splice specific letters from multiple words. This task is particularly difficult for LLMs because it requires precise character-level manipulation.

Results and Analysis

ExpNote consistently outperformed all baselines, including zero-shot, few-shot, and standard CoT.

Performance Gains

ExpNote achieved the best performance on all four datasets, showing an average improvement of 20.5% over standard CoT. On the difficult LETS dataset, ExpNote reached 89% accuracy, whereas few-shot prompting struggled at a mere 1%. It also outperformed Reflexion, even when Reflexion was given a "golden" function for retries, highlighting the power of cross-instance learning.

Learning and Generalization

A key finding was that storing abstracted rules is significantly more effective for generalization than simply storing the original training cases. This suggests that the "reflection" step is crucial for distilling noise into usable knowledge. Furthermore, ExpNote benefits from both positive and negative experiences; reflecting on failures allows the model to create "guardrail" notes that prevent repeating mistakes.

The training curve demonstrates that ExpNote's accuracy improves steadily as it accumulates more training samples, outperforming static baselines like CoT and Reflexion.

As shown in the training curve, the model's performance on the test set grows steadily as the number of training samples increases, proving that the LLM is effectively "learning" new knowledge during the training phase.

Conclusion

ExpNote provides a robust mechanism for black-box LLMs to adapt to unfamiliar tasks by maintaining an external "Experience Notebook." While highly effective for tasks governed by consistent rules, it is less suited for "case-by-case" tasks like creative writing or summarization where universal rules are scarce. Future research will explore more sophisticated retrieval mechanisms and methods to prune redundant or conflicting experiences from the notebook.

Summary updated

BibTeX
@inproceedings{sun2023expnote,
  author = {Wangtao Sun and Xuanqing Yu and Shizhu He and Jun Zhao and Kang Liu},
  title = {{ExpNote: Black-box Large Language Models are better Task Solvers with Experience Notebook}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=1Xht3SKAoY},
}
Figure