SakanaAI/self-adaptive-llms
SakanaAI/self-adaptive-llms has 1,227 GitHub stars and 142 forks. GitHot measured -1 in 7 days. Last checked 2026-11-10 21:23 UTC. Last push 2025-01-30.
A Self-adaptation Framework🐙 that adapts LLMs for unseen tasks in real-time!
Measured star growth
- in 24h
- Update delayed
- in 7 days
- -1
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalTransformer2: Self-adaptive LLMs 🐙
Self-adaptive large language models (LLMs) aim to solve the challenges posed by traditional fine-tuning methods, which are often computationally intensive and static in their ability to handle diverse tasks.
We are excited to introduce Transformer², a novel self-adaptation framework that adapts LLMs for unseen tasks in real-time by selectively adjusting only the singular components of their weight matrices. During inference, Transformer² employs a two-pass mechanism: first, a dispatch system identifies the task properties, and then task-specific "expert" vectors, trained using reinforcement learning, are dynamically mixed to obtain targeted behavior for the incoming prompt.
Installation
1. Clone the Repo
git clone https://github.com/SakanaAI/self-adaptive-llms
cd self-adaptive-llms
2. Install Libraries
conda create -n t2 python=3.11 -y
conda activate t2
pip install --upgrade pip
pip install -r requirements.txt
3. Install Tasks Evaluator
cd evaluation/fishfarm
pip install -e .
Usage
We provide example scripts for both training and evaluation.
Please change the argument in the provided script to choose among models and tasks
Training
bash scripts/train_task_expert.sh
Evaluation
Prompt-based evaluation
Classification experts can be loaded by specifying the CLS_EXPERT_PATH in the script.
bash scripts/eval_prompt_based.sh
Few-shots evaluation
bash scripts/eval_few_shot.sh
Citation
If you find Transformer^2 useful for your research, please cite using this BibTeX:
@misc{sun2025transformersquaredselfadaptivellms,
title={Transformer-Squared: Self-adaptive LLMs},
author={Qi Sun and Edoardo Cetin and Yujin Tang},
year={2025},
eprint={2501.06252},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2501.06252},
}
Explore related projects
affaan-m/ECC
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
300,936 starsNousResearch/hermes-agent
The agent that grows with you
262,531 starsmultica-ai/andrej-karpathy-skills
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
231,973 starsfirecrawl/firecrawl
Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
200,444 stars