When to Adapt: Conditional Memory Adapters for Retention-Preserving Domain Specialization

Jiayu Hou, Lei Wang


Abstract
Large language models deployed in specialized domains must improve in-domain performance without sacrificing general capabilities. Existing parameter-efficient fine-tuning methods are typically always on: their learned perturbations are applied to every input, which can degrade out-of-domain (OOD) performance. We propose Engram Adapter, a framework that repurposes pretraining-time conditional memory as a post-hoc adapter for frozen LLMs. It uses multi-channel matching over local n-gram patterns with explicit occupancy tracking as a lightweight selectivity prior, making residual injection more likely on in-domain inputs while a learned scalar gate suppresses incoherent OOD retrievals. We evaluate on Qwen3-4B and Qwen3-8B with AG-News and MedMCQA as adaptation tasks and OOD benchmarks spanning reasoning, translation, code generation, and legal reasoning. Engram Adapter improves in-domain accuracy while preserving 99.4% to 100.1% of average OOD performance; on LegalBench it slightly exceeds the frozen base model on average, whereas comparable always-on baselines degrade sharply. Mechanistic analyses show that although OOD activations are non-zero, gate and projection attenuation reduce residuals to approximately 0.08% of hidden-state norm, yielding small KL drift and negligible accuracy change. These results suggest conditional activation is a promising route toward modular, retention-preserving domain specialization over frozen backbones.
Anthology ID:
2026.findings-emnlp.200
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
4224–4245
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.200/
DOI:
Bibkey:
Cite (ACL):
Jiayu Hou and Lei Wang. 2026. When to Adapt: Conditional Memory Adapters for Retention-Preserving Domain Specialization. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 4224–4245, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
When to Adapt: Conditional Memory Adapters for Retention-Preserving Domain Specialization (Hou & Wang, Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.200.pdf