MCPcopy
hub / github.com/Continual-Intelligence/SEAL

github.com/Continual-Intelligence/SEAL @main sqlite

repository ↗ · DeepWiki ↗
418 symbols 1,629 edges 47 files 66 documented · 16%
README

Self-Adapting Language Models

Paper, Website

Adam Zweiger, Jyothish Pari, Han Guo, Ekin Akyürek, Yoon Kim, Pulkit Agrawal

MIT CSAIL

SEAL

SEAL (Self-Adapting LLMs) is a framework for training language models via RL to generate self-edits (finetuning data and other update directives for themselves) in response to new inputs.

We explore SEAL in two domains: - general-knowledge: Incorporating new factual knowledge - few-shot: Adapting to new tasks from few-shot examples

Both folders include code, data, and documentation.

🔧 Setup

1. Clone the repository

git clone https://github.com/Continual-Intelligence/SEAL.git
cd SEAL

2. Set up a virtual environment

Using conda:

conda create -n seal_env python=3.12
conda activate seal_env

Using venv:

python3.12 -m venv seal_env
source seal_env/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Configure environment

Create a .env file in the project root and add your OpenAI API key:

OPENAI_API_KEY=your_openai_api_key_here

5. SLURM users

Before running any shell scripts, make sure to update the SLURM directives at the top of each .sh file to match your system configuration. All experiments can be run with 2 A100/H100 GPUs. Other setups may require refactoring and/or changing model sizes.

📄 Citation

If you found this work useful, please cite:

@misc{zweiger2025selfadaptinglanguagemodels,
      title={Self-Adapting Language Models}, 
      author={Adam Zweiger and Jyothish Pari and Han Guo and Ekin Akyürek and Yoon Kim and Pulkit Agrawal},
      year={2025},
      eprint={2506.10943},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2506.10943}, 
}

Core symbols most depended-on inside this repo

encode
called by 61
few-shot/arclib/messagers.py
encode
called by 33
few-shot/arclib/representers.py
decode
called by 27
few-shot/arclib/representers.py
apply_to_task
called by 16
few-shot/arclib/augmenters.py
to_tuple
called by 13
few-shot/arclib/arc.py
to_list
called by 11
few-shot/arclib/arc.py
read_tasks_from_single_file
called by 11
few-shot/arclib/arc.py
read_tasks_from_dict
called by 6
few-shot/arclib/arc.py

Shape

Method 202
Function 157
Class 59

Languages

Python100%

Modules by API surface

few-shot/arclib/augmenters.py103 symbols
few-shot/arclib/representers.py81 symbols
few-shot/arclib/messagers.py50 symbols
few-shot/arclib/arc.py26 symbols
general-knowledge/src/utils.py17 symbols
few-shot/self-edit.py14 symbols
few-shot/ttt.py13 symbols
few-shot/utils/np_cache.py10 symbols
general-knowledge/src/continual/continual_self_edits.py9 symbols
general-knowledge/src/query/CPT_GA.py8 symbols
general-knowledge/src/inner/GA_server.py6 symbols
general-knowledge/src/data_generation/make_squad_data_entigraph.py6 symbols

Dependencies from manifests, versioned

accelerate1.7.0 · 1×
datasets3.6.0 · 1×
flashinfer-python0.2.2 · 1×
ipdb0.13.13 · 1×
litellm1.72.4 · 1×
matplotlib3.10.3 · 1×
numpy2.2.6 · 1×
openai1.86.0 · 1×
peft0.15.2 · 1×
pyzmq27.0.0 · 1×
rich14.0.0 · 1×
scipy1.15.3 · 1×

For agents

$ claude mcp add SEAL \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact