Skip to content

Official Pytorch Implementation for "State-offset Tuning: State-based Parameter-Efficient Fine-Tuning for State Space Models"

Notifications You must be signed in to change notification settings

furiosa-ai/ssm-state-tuning

Repository files navigation

State-offset Tuning: State-based Parameter-Efficient Fine-Tuning for State Space Models

GitHub release

Paper Link: arXiv

State Space Models (SSMs) have emerged as efficient alternatives to Transformers, mitigating their quadratic computational cost. However, the application of Parameter-Efficient Fine-Tuning (PEFT) methods to SSMs remains largely unexplored. In particular, prompt-based methods like Prompt Tuning and Prefix-Tuning, which are widely used in Transformers, do not perform well on SSMs. To address this, we propose state-based methods as a superior alternative to prompt-based methods. This new family of methods naturally stems from the architectural characteristics of SSMs. State-based methods adjust state-related features directly instead of depending on external prompts. Furthermore, we introduce a novel state-based PEFT method: State-offset Tuning. At every timestep, our method directly affects the state at the current step, leading to more effective adaptation. Through extensive experiments across diverse datasets, we demonstrate the effectiveness of our method.

Updates

  • [03/05/25] Code released.

Setup

  • Install dependencies

    # Create env
    conda create -n mamba-ssm python=3.10
    conda activate mamba-ssm
    
    # Install pytorch, e.g.,
    conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 -c pytorch -c nvidia
    
    pip install "numpy<2"
    
    # Install mamba
    pip install "causal-conv1d==1.2.0.post2"
    cd src/mamba
    pip install -e . --no-build-isolation
    cd -
    
    # Install requirements
    pip install -r requirements.txt
    pip install peft==0.9.0 accelerate --no-deps
  • For Spider evaluation, download Spider and extract to "data/xlangai_spider/spider"

Run

# train
python run_all.py train.py --device 0 --cfg cfg/final/exps/mamba-*/*/*.yaml

About

Official Pytorch Implementation for "State-offset Tuning: State-based Parameter-Efficient Fine-Tuning for State Space Models"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published