Skip to content
module

RoAd

4 members
lucid.peft.tuners.road

lucid.peft.tuners.road — RoAd: a rotation and scaling of pairs of output features.

RoAd (Liao and Monz, 2024, arXiv:2409.00119 — 2D Rotary Adaptation) pairs the output features of a layer into 2-D vectors, within groups of group_size (element ii with element i+group/2i + \text{group}/2), and rotates and scales each pair by a learned angle and scale. The rotation folds into the weight and the bias at no inference cost. Pick it for an adapter with very few parameters (about half a number per output feature) that merges into the weight.

Where the reference library keeps them, so isinstance(m, RoadLayer) and from lucid.peft.tuners.road import RoadConfig, Linear read as they do there. One layer type for the one module the method adapts, nn.Linear. RoadConfig and RoadModel are here and exported from lucid.peft. Importing the package registers the method (its config under PeftType.ROAD, its tuner and layer), which is what makes get_peft_model and PeftModel.from_pretrained know it.

Paper

Liao, Baohao, et al. "3-in-1: 2D Rotary Adaptation for Efficient Finetuning, Efficient Batching and Composability." [arXiv:2409.00119](https://arxiv.org/abs/2409.00119), 2024.

Overview

RoAd (Liao and Monz, 2024, arXiv:2409.00119 — 2D Rotary Adaptation) pairs the output features of a layer into 2-D vectors and rotates and scales each pair (section 3.2, Eq. 3),

Classes