Skip to main content

EigenTune: An extremely parameter-efficient fine-tuning method via singular value scaling.

Project description

EigenTune: Surgical Fine-Tuning via Singular Value Scaling

PyPI version License: Apache 2.0

EigenTune is a novel Parameter-Efficient Fine-Tuning (PEFT) method inspired by the mathematical properties of model weights. Instead of adding new matrices like LoRA, EigenTune identifies the most important "feature directions" in existing weight matrices (via SVD) and only fine-tunes their magnitudes.

This approach is highly parameter-efficient and aims to preserve pre-trained knowledge by re-calibrating existing features rather than introducing new ones.

How it Works

  1. A target nn.Linear layer's weight matrix W is decomposed using SVD: W = UΣVᵀ.
  2. The orthogonal matrices U and V (representing feature directions) are frozen.
  3. A tiny, trainable vector δ of size r (rank) is introduced.
  4. The fine-tuned weight W' is implicitly represented as W' = U(Σ + diag(δ))Vᵀ.
  5. The forward pass is efficiently calculated as y = Wx + (U_r diag(δ) Vh_r)x, avoiding the formation of the full W' matrix.

Installation

pip install eigentune

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eigentune-0.1.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eigentune-0.1.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file eigentune-0.1.0.tar.gz.

File metadata

  • Download URL: eigentune-0.1.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for eigentune-0.1.0.tar.gz
Algorithm Hash digest
SHA256 922b01526abb31d65d8ee2de3bb93426b3ef39299e37b788ea6a3a53e0708bda
MD5 9dc00d294df2aa9ba61b99d965848106
BLAKE2b-256 e220790a064d2d86d0d680828c4069b3697ed12d4a785e4e0009d56b0366a030

See more details on using hashes here.

File details

Details for the file eigentune-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: eigentune-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for eigentune-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 648fa89f0e084c2fc402af4af4d8483eb15bd1abf0748657b5aeec29d9b5ca2f
MD5 90b7a1f7fcbc3680f7b77fefb3423267
BLAKE2b-256 00919a9097d73956259d247a1891f70dbebd3ffa3aad3f99ba833638336f516e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page