Skip to main content
QUICK REVIEW

[Paper Review] RET-LLM: Towards a General Read-Write Memory for Large Language Models

Ali Modarressi, Ayyoob Imani|arXiv (Cornell University)|May 23, 2023
Topic ModelingComputer Science6 citations
TL;DR

Ret-LLM introduces a general-purpose read-write memory module for large language models (LLMs), enabling explicit knowledge storage and retrieval through triplet-based representations (e.g., <subject, relation, object>) inspired by Davidsonian semantics. The framework uses a fine-tuned LLM as a controller to generate memory API calls, supports scalable, interpretable, and updatable knowledge storage from diverse sources—including databases—and demonstrates superior performance in question answering, especially for temporal and aggregative tasks, outperforming zero-shot LLMs even when all required information is present in context.

ABSTRACT

Large language models (LLMs) have significantly advanced the field of natural language processing (NLP) through their extensive parameters and comprehensive data utilization. However, existing LLMs lack a dedicated memory unit, limiting their ability to explicitly store and retrieve knowledge for various tasks. In this paper, we propose RET-LLM a novel framework that equips LLMs with a general write-read memory unit, allowing them to extract, store, and recall knowledge from the text as needed for task performance. Inspired by Davidsonian semantics theory, we extract and save knowledge in the form of triplets. The memory unit is designed to be scalable, aggregatable, updatable, and interpretable. Through qualitative evaluations, we demonstrate the superiority of our proposed framework over baseline approaches in question answering tasks. Moreover, our framework exhibits robust performance in handling temporal-based question answering tasks, showcasing its ability to effectively manage time-dependent information.

Motivation & Objective

  • To address the lack of explicit, persistent memory in large language models (LLMs), which currently encode knowledge implicitly in parameters.
  • To enable LLMs to explicitly store, retrieve, and update knowledge from diverse sources such as text, SQL, NoSQL, and spreadsheets.
  • To support scalable, interpretable, and aggregatable memory operations, allowing models to combine scattered facts across multiple documents.
  • To improve performance on complex question-answering tasks, particularly those involving temporal context or multi-document aggregation.
  • To provide a modular, controller-based architecture that decouples memory operations from the LLM for better maintainability and interpretability.

Proposed method

  • The framework integrates a language model (Alpaca-7B), a controller, and a memory unit, with the controller orchestrating interactions between user input, LLM, and memory.
  • Knowledge is extracted from text in the form of triplets <concept1, relationship, concept2> using a fine-tuned LLM, inspired by Davidsonian semantics.
  • The memory unit stores triplets and their vector embeddings, enabling exact-match and fuzzy retrieval via LSH-based hashing of embeddings.
  • A memory API is generated by the LLM to handle write (store) and read (retrieve) operations, with the LLM generating API calls based on input context.
  • Fine-tuning is performed using instruction tuning with LoRA for parameter efficiency, applying loss only to the API generation part of the input sequence.
  • The system supports dynamic updates and aggregation of related facts, enabling tasks like listing all cities in a country from multiple documents.

Experimental results

Research questions

  • RQ1Can a general-purpose, read-write memory module be effectively integrated into LLMs to enable explicit knowledge storage and retrieval?
  • RQ2How does the triplet-based memory representation support interpretable and aggregatable knowledge management across multiple documents and data sources?
  • RQ3Can the proposed framework improve LLM performance on question-answering tasks where the required information is present in context but not correctly utilized by zero-shot models?
  • RQ4How does the system handle temporal knowledge updates, such as changes in political leadership, without retraining?
  • RQ5To what extent can the memory module be extended to support non-textual data sources like SQL and NoSQL databases?

Key findings

  • The Ret-LLM framework successfully enables LLMs to store and retrieve knowledge explicitly, even when the required information is already present in the input context, correcting failures observed in zero-shot settings.
  • In a zero-shot evaluation, the base Alpaca-7B model failed to answer a question correctly despite having all necessary information in context, while Ret-LLM correctly retrieved and used the stored triplet from memory.
  • The framework demonstrated robust performance on temporal question-answering tasks, such as identifying the current U.S. president, by allowing memory updates without model retraining.
  • The use of triplet-based storage enabled effective aggregation of scattered facts, such as compiling a list of cities from multiple documents.
  • The controller-based architecture with LLM-generated memory API calls enabled seamless, interpretable, and modular interaction between the LLM and memory unit.
  • The implementation using LoRA allowed efficient fine-tuning on a single A6000 GPU, demonstrating feasibility in resource-constrained environments.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.