Skip to content
프로젝트

SakanaAI/self-adaptive-llms

GitHub에서 보기

소개

실시간으로 LLM을 접해 보지 않은 작업에 맞게 적응시키는 자기 적응 프레임워크🐙입니다!

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
-1
in 1 month
-1

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Transformer2: Self-adaptive LLMs 🐙

📚 [Paper] | 📄 [Blog]

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}, 
}

관련 프로젝트 살펴보기

불러오는 중…