Skip to content

JiahongLiu21/PerFit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PerFit iconPerFit: Exploring Personalization Shifts in Representation Space of LLMs

Homepage Paper Venue

Public release of PerFit: Exploring Personalization Shifts in Representation Space of LLMs (accepted at ICLR 2026) for parameter-efficient personalization on LaMP tasks.

PerFit overview

✨ Overview

💡 Hypothesis (Observation)

  • Personalized preference information induces structured, low-rank shifts in the LLM representation space.
  • These shifts can be decomposed into a shared global direction plus user-specific deviations, enabling parameter-efficient personalization.

PerFit hypothesis figure

🛠️ Methodology

PerFit is a representation-space personalization method for LLMs. Instead of tuning full model parameters, it learns low-rank interventions on hidden states to steer outputs toward user preferences with much lower parameter cost.

PerFit is trained in two stages:

  1. Stage 1 (collective shift learning): learn a shared task-level shift from all users.
  2. Stage 2 (personalized shift learning): adapt user-specific local shifts on top of the shared shift.

PerFit methodology figure

🧩 Environment Setup

  • Python: 3.12
  • OS: Linux recommended
  • GPU: CUDA-capable GPU recommended for training/inference

Create environment and install dependencies:

conda create -n perfit python=3.12 -y
conda activate perfit
pip install -r requirements.txt

🚀 Quick Start

Set --model_path to your local base model directory (required for local/offline usage).

Run a task:

bash run.sh --task_name=movie_tagging --cuda_device=0 --model_path /path/to/base-model
bash run.sh --task_name=news_categorize --cuda_device=0 --model_path /path/to/base-model
bash run.sh --task_name=news_headline --cuda_device=0 --model_path /path/to/base-model

If the stage-1 checkpoint already exists, run.sh reuses it automatically.

🗂️ Repository Structure

.
├── run.sh
├── train/
│   ├── stage1_train.py
│   └── stage2_train.py
├── lib/
│   ├── reft_module.py
│   └── utils.py
├── Config
│   ├── requirements.txt
│   ├── configs/presets.json
│   └── configs/prompt.json
├── Evaluation
│   └── eval/
│       ├── eval_task.py
│       ├── evaluation.py
│       └── metrics/
│           ├── accuracy/
│           ├── f1/
│           └── rouge/
└── Data
    └── data/
        ├── movie_tagging/
        ├── news_categorize/
        └── news_headline/
File Role
run.sh Runs the full pipeline
train/stage1_train.py Stage-1 training
train/stage2_train.py Stage-2 training and prediction
lib/reft_module.py Core intervention modules
eval/eval_task.py Final metric computation
configs/presets.json Default task presets

📦 Required Data Files

Each task directory under data/<task>/ should contain:

  • user_others.json
  • user_top_100_history.json
  • user_top_100_history_label.json

🎯 Default Presets

Task LRank ULRank IL PL EP
movie_tagging 32 4 14;15 f7+l7 4
news_categorize 16 32 14;15;16 f7+l7 6
news_headline 32 4 14;15;16 l7 4

You can override the main preset values in run.sh with:

  • --task_name
  • --cuda_device
  • --run_dir_name
  • --seed
  • --batch_size
  • --model_name
  • --model_path
  • --low_rank_dimension
  • --user_low_rank_dimension
  • --intervene_layer
  • --positions
  • --max_epoch

In configs/presets.json, each task includes a model_path placeholder ("") for user-side configuration.

📁 Outputs

A completed run writes:

output/<dataset>/lr=..._ulr=..._il=..._pl=..._ul=..._ua=.../task_reft/ckpt/...
output/<dataset>/lr=..._ulr=..._il=..._pl=..._ul=..._ua=.../perfit_data_type=.../predictions.json
output/<dataset>/lr=..._ulr=..._il=..._pl=..._ul=..._ua=.../result_data_type=.../user_top_100_history_all.json

📚 Citation

@inproceedings{liuperfit,
  title={PerFit: Exploring Personalization Shifts in Representation Space of LLMs},
  author={Liu, Jiahong and Yu, Wenhao and Dai, Quanyu and Li, Zhongyang and Zhu, Jieming and Yang, Menglin and Chua, Tat-Seng and King, Irwin},
  booktitle={The Fourteenth International Conference on Learning Representations},
  year={2026}
}

About

Public release of PerFit: Exploring Personalization Shifts in Representation Space of LLMs (accepted at ICLR 2026).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors