On-Device Adaptation and Personalization › Adapters Under a Tight Budget

Michael BrenndoerferDecember 1, 20263 min read
Language AI HandbookAll chapters
Part 43 of 67Small and On-Device Language Models
Chapter 329On-Device Adaptation and Personalization › Adapters Under a Tight Budget
Reading section 5 of 11 · Adapters Under a Tight Budget · 3 minSection 5 of 11 · 3 min

Section 5 of 11 · 3 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Keep the update small enough to train and separate enough to replace. Which matrices to adapt is a capacity and deployment decision.

Why adapters and not full fine-tuning

For a frozen layer matrix WW with dd rows and kk columns, LoRA parameterizes a layer update as

W′=W+(α/r)BA.W'=W+(\alpha/r)BA.

Here AA has shape r×kr\times k, BB has shape d×rd\times r, and r>0r>0 is the chosen inner dimension. The product fits the original matrix and has rank at most rr. The scalar α/r\alpha/r scales its contribution. It does not guarantee that two trained adapters with different ranks have the same update norm.

The adapter holds r(d+k)r(d+k) trainable entries for this layer. At d=k=4096d=k=4096 and r=8r=8, that is 65,536 entries versus 16,777,216 dense entries. At two bytes per entry, the factors are 128 KiB before metadata. Each separately adapted projection adds its own entries.

Specify which projections and what rank you train. Also specify the maximum sequence length and microbatch size. A smaller microbatch can reduce activation memory per forward and backward pass. If you accumulate gradients across microbatches, count both microbatches and optimizer steps in the update budget.

The local training loop

  1. Collect consented examples that match the training purpose. Split before training and group related examples if the intended evaluation is transfer to new situations.
  2. Optionally include rehearsal examples that represent baseline behavior you want to retain. Keep the final canaries separate from rehearsal.
  3. Fit a separate candidate adapter for a bounded number of optimizer steps. Track wall time and peak memory as well as the count.
  4. Evaluate both adaptation success and preservation of baseline behavior on local held-out cases. Inspect behavior after a reset and include targeted checks for any sensitive information the training pipeline could have admitted.
  5. Activate the candidate only if it passes the acceptance criteria. Keep the current version until the new version and its metadata are ready to swap together.

A step limit bounds the amount of optimization you run. It is not a differential-privacy parameter.

Keeping it private

Carlini et al. found that a trained language model could retain examples verbatim. Treat the adapter, any merged copies, and intermediate checkpoints as potentially sensitive artifacts. Under the local-only design, none of these are uploaded. Sync needs a separate threat model and consent choice. Aggregation for a population-level update and syncing an individual adapter are different operations.

Abadi et al. describe training with differential privacy. A formal claim needs a defined unit of privacy, a mechanism such as clipping and adding calibrated noise, and accounting for the released outputs. Local execution, a small adapter or a short training run alone does not establish such a claim.

The overfitting cliff

A lower training loss can accompany worse behavior on independent examples. Compare two things before installing a candidate. First, does it improve the intended behavior on cases that were not used to fit it? Second, does it preserve behavior on other tasks? These tests can fail independently.

A test that checks whether a classifier returns one output for every input detects collapse on those probes. It does not measure whether a generative model reproduces training text. Run a dedicated audit if that failure mode matters, and report its coverage. The toy below uses both seen probes and independent inputs, which exposes what a gate built only from training topics can miss.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy