NEW
Small trainable layers inserted into pretrained models for parameter-efficient tuning while most weights remain frozen.
DESCRIPTION
Adapters are lightweight modules added to each layer of a pretrained model, trained on downstream tasks while keeping core weights fixed. They enable rapid customization with minimal memory and compute overhead. This approach simplifies deployment of multiple task-specific variants without duplicating entire models. Adapters fit well in constrained environments and facilitate continual learning. Popularized in NLP Transformers, adapters extend to vision and multimodal models.
ALTERNATIVE DEFINITIONS
Wikipedia
In software engineering, the adapter pattern is a software design pattern that allows the interface of an existing class to be used as another interface.
Classic GoF definition focusing on interface conversion.
Hugging Face
Adapters are lightweight layers added to a model that enable parameter-efficient fine-tuning.
Defines adapters in the context of PEFT for large models.
RELATED TERMS
Adapter Pattern Wrappers Parameter-Efficient Fine-Tuning Integration API Gateway Plugin Bridge Pattern Transformer Model Prompt Tuning Fine-Tuning Bottleneck Frozen Pretrained Model
COMPETING TERMS
Middleware LoRA Prefix Tuning Full Fine-Tuning
RELATIONS
KNOWLEDGE AREAS
Software Engineering Platform & Tooling AI Data Engineering MLOps Data Science
TARGET AUDIENCE
Software Developer AI Engineer MLOps Engineer Data Engineer Solution Architect Data Scientist
EXTERNAL SOURCES
- Wikipedia - Adapter pattern
- PEFT - PEFT library docs for adapters
- Refactoring.Guru - Adapter pattern explanation and examples
TOP QUESTIONS
When should I use an Adapter pattern in integration?
Use adapters when you can’t change an existing component but must match a new interface or protocol.
Category: How-To
How do ML Adapters reduce fine-tuning cost?
They introduce small trainable modules while freezing most parameters, drastically reducing compute and memory.
Category: Benefits
How do Adapters compare to LoRA?
Both are parameter-efficient. LoRA injects low-rank updates; adapters add bottleneck layers. Choice depends on model and tooling.
Category: Comparison
What are pitfalls of using Adapters in software?
Overuse can hide design issues, add indirection, and complicate debugging. Use judiciously.
Category: Mistakes
Do ML Adapters affect inference latency?
Adapters add minimal overhead; latency impact is usually small compared to full fine-tuning.
Category: Performance
How are Adapters deployed in LLM pipelines?
Load base weights with adapter weights merged or applied at runtime; manage versions in a model registry.
Category: Operations
Can I stack multiple Adapters?
Yes, multi-task adapters can be composed or switched to tailor behavior across domains.
Category: Techniques
How do I test Adapters?
Write contract tests for interface adapters and evaluate task metrics, robustness, and regression for ML adapters.
Category: Testing
Where do Adapters fit in ETL tools?
They act as connectors or plugins translating sources’ APIs into uniform ingestion interfaces.
Category: Application