NAS-LoRA: Empowering Parameter-Efficient Fine-Tuning for Visual Foundation Models with Searchable Adaptation

Renqi Chen, Haoyang Su, Shixiang TangarXiv 2025 · DOI

Abstract

NAS-LoRA introduces a searchable, lightweight adapter for the Segment Anything Model (SAM) designed to automatically discover optimal "spatial priors" (such as convolutions or pooling) for specific downstream tasks. By integrating Neural Architecture Search (NAS) directly into the Low-Rank Adaptation (LoRA) framework, the proposed method achieves state-of-the-art segmentation performance across medical, agricultural, and remote sensing domains. Notably, it reduces training costs by 24.14% compared to standard implementations while maintaining zero additional inference overhead.

Introduction

The Segment Anything Model (SAM) has emerged as a foundation model powerhouse for natural image segmentation. However, its performance often degrades when applied to specialized domains like medical imaging or satellite data. This is largely because SAM’s Transformer-based architecture lacks the necessary inductive bias—the inherent structural rules, such as local spatial relationships, required to interpret specialized data effectively.

While Low-Rank Adaptation (LoRA) is the standard for efficient fine-tuning, it typically only updates linear weights, failing to address the need for task-specific structural adjustments. Previous attempts to incorporate these biases, such as Conv-LoRA, apply fixed convolutions across all layers. This approach is computationally expensive and fails to account for the fact that different tasks (e.g., detecting small lesions versus long roads) require different structural priors.

Methods

NAS-LoRA addresses these limitations by inserting a searchable NAS Cell between the encoder and decoder matrices of a standard LoRA module. This allows the model to adapt its internal structure to the specific requirements of the target dataset.

The NAS-LoRA framework integrates a searchable NAS Cell into the SAM fine-tuning pipeline, utilizing a two-stage optimization process.

Searchable Adaptation and Optimization

  1. Search Space: The NAS cell selects from a diverse menu of operations, including 3x3 and 5x5 separable convolutions, dilated convolutions, max/average pooling, and skip connections.
  2. Partial Connections (NAS-PC-LoRA): To maintain efficiency, only a subset of feature channels is processed by the searchable NAS cell, while the remainder bypasses it. This significantly lowers the computational cost during the architecture search phase.
  3. Stage-wise Optimization: Training follows a decoupled two-stage process. Stage 1 updates model weights while keeping the architecture fixed. Stage 2 updates the architecture parameters while freezing the weights. This prevents architectural noise from destabilizing the weight training.
  4. Seamless Inference Merging: Post-training, the discovered NAS operations and weights are mathematically merged back into the original pre-trained weights. This ensures the final model retains the original SAM architecture, resulting in zero deployment latency increase.

Experimental Results

The model was evaluated across nine diverse benchmarks, including medical (Kvasir, ISIC 2017), agricultural (Leaf Disease), and remote sensing (Massachusetts Roads) datasets.

Quantitative comparison showing that NAS-LoRA reduces training costs and maintains identical inference speeds to standard LoRA.

Key Performance Metrics

  • Superior Accuracy: NAS-LoRA consistently outperformed standard LoRA and other PEFT variants like DoRA and Conv-LoRA. For example, on the Leaf dataset, it achieved a 75.4% IoU, surpassing LoRA's 73.7%.
  • Efficiency Gains: The partial connection mechanism led to a 24.14% reduction in training costs.
  • Inference Speed: The model maintains an inference speed of 4.62 iter/s, which is identical to standard LoRA due to the weight-merging strategy.
  • Refined Focus: Visual analysis using Grad-CAM indicates that NAS-LoRA helps the model focus on finer-grained details, which is critical for high-precision tasks like medical lesion segmentation.

Discussion and Limitations

NAS-LoRA demonstrates that "one size does not fit all" in model adaptation. Analysis showed that different tasks naturally gravitate toward different operations; for instance, leaf disease tasks prefer separable convolutions, while transparent object detection benefits from dilated convolutions.

Despite its success, the framework's performance remains sensitive to the LoRA rank ($r$), requiring a balance between accuracy and parameter count in resource-constrained settings. Future work may explore expanding the search space to include more complex operations or applying the NAS-LoRA framework to other Transformer-based foundation models like DINOv2 or CLIP.

Summary updated

BibTeX
@misc{chen2025nas,
  author = {Renqi Chen and Haoyang Su and Shixiang Tang},
  title = {{NAS-LoRA: Empowering Parameter-Efficient Fine-Tuning for Visual Foundation Models with Searchable Adaptation}},
  year = {2025},
  eprint = {2512.03499},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.03499},
}
Figure