rlm  by alexzhang13

Minimal Recursive Language Models (RLMs) with REPL environments

Created 1 month ago
273 stars

Top 94.6% on SourcePulse

GitHubView on GitHub
Project Summary

Recursive Language Models (RLMs) with REPL Environments This repository provides a minimal, gist-like implementation of Recursive Language Models (RLMs) designed for users to experiment with and build upon. It offers a simplified framework for creating recursive LLM interactions within REPL environments, targeting developers and researchers seeking a foundational RLM codebase. The primary benefit is ease of modification and a clear starting point for custom RLM applications.

How It Works

The core approach utilizes a REPL environment to manage language model interactions, enabling recursive calls. The RLM_REPL class in rlm_repl.py handles the RLM logic, with its completion() method designed to replace standard LLM completion calls. A basic exec-based REPL in repl.py facilitates sub-calls. While depth=1 recursion is directly supported, achieving deeper recursion requires replacing Sub_RLM with RLM_REPL, potentially necessitating adjustments to the exec environment. Utility functions for LLM clients and prompts reside in rlm/utils/.

Quick Start & Requirements

  • Primary install/run: Direct code integration or standard Python execution. pip install rich is recommended for enhanced logging.
  • Prerequisites: openai (for LM API calls), dotenv (for environment variable loading). rich is optional but useful.
  • Example: A main.py script demonstrates a "needle-in-the-haystack" task.

Highlighted Details

  • Minimal implementation of Recursive Language Models (RLMs) with REPL environments for OpenAI clients.
  • Supports recursive sub-calls, with depth=1 as the default configuration.
  • Includes a "needle-in-the-haystack" example showcasing RLM.completion() replacing standard LM.completion() calls.

Maintenance & Community

This project is presented as a simplified, "gist-like" implementation. No specific details regarding active maintenance, community channels (like Discord/Slack), or a roadmap are provided in the README.

Licensing & Compatibility

The README does not specify a software license. This lack of explicit licensing information may pose compatibility concerns for commercial use or integration into proprietary projects.

Limitations & Caveats

This is a stripped-down version, omitting features like detailed logging, cost tracking, and advanced REPL execution logic found in more complex implementations. Achieving recursion beyond depth=1 may require significant modifications to the exec-based REPL environments. The project is positioned as a foundational example rather than a production-ready library.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
46 stars in the last 30 days

Explore Similar Projects

Starred by Noah Snavely Noah Snavely(Research Scientist at Google DeepMind; Professor at Cornell Tech), Lukas Biewald Lukas Biewald(Cofounder of Weights & Biases), and
2 more.

nle by facebookresearch

0.1%
971
RL environment for NetHack game research
Created 5 years ago
Updated 1 year ago
Feedback? Help us improve.