Skip to content

TamSiuhin/P2P

Repository files navigation


🛠️ Installation

Install uv if you don't have uv (see https://docs.astral.sh/uv/getting-started/installation/)

With uv installed, run the following to install the dependencies.

git clone https://github.com/TamSiuhin/P2P.git
cd p2p
# make sure you have `uv` installed
# (see https://docs.astral.sh/uv/getting-started/installation/)
uv self update
uv venv --python 3.10 --seed
uv sync
# we use the following wheel for installation
# you might have to change the wheel to be compatible with your hardware
uv pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.6.3/flash_attn-2.6.3+cu123torch2.3cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
uv pip install src/fishfarm
uv pip install openai rank-bm25

🏋️ Training

Download Dataset

We store the processed dataset on huggingface. The data processing code can be found in ./data_p13n directory. Download the data using the following command

uv run huggingface-cli login
uv run huggingface-cli download Zhaoxuan/P2P_data --local-dir ./data_p13n/P2P_data

Setup Embedding Model API

We use the vllm to serve the embedding model for faster inference. Due to the version camparibility, we use the docker vllm/vllm-openai:v0.10.0.

docker pull vllm/vllm-openai:v0.10.0
bash launch_vllm_emb.sh

After setting up the embedding model api, we then run the following script for a hypernetwork training using one GPU (80G A100 in our experiment).

bash scripts/uv_train_p2p_qwen_unified.sh

📊 Baselines and Evluation

Base model

bash ./scripts/eval_base_models_qwen.sh

Retrieval-Augmented Generation (RAG)

bash ./scripts/eval_RAG_models.sh

Profile-Augmented Generation (PAG)

bash ./scripts/eval_PAG_model.sh

All History Prompting

bash ./scripts/eval_all_history_models.sh

Multi-task LoRA (MT-LoRA)

bash train_mt_lora_qwen_baselines.sh

One-PEFT-Per-User (OPPU)

bash train_oppu_baselines.sh

Trained Model

You can download the trained model here.

Acknolwedgement

Our codebase is built upon the Text-to-LoRA repo. Thanks for the great work!


📖 BibTex

If you find our code useful for your research, please kindly cite the following paper.

@article{tan2025instant,
  title={Instant Personalized Large Language Model Adaptation via Hypernetwork},
  author={Tan, Zhaoxuan and Zhang, Zixuan and Wen, Haoyang and Li, Zheng and Zhang, Rongzhi and Chen, Pei and Mo, Fengran and Liu, Zheyuan and Zeng, Qingkai and Yin, Qingyu and others},
  journal={arXiv preprint arXiv:2510.16282},
  year={2025}
}

About

source code for "Instant Personalized Large Language Model Adaptation via Hypernetwork"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors