NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Embedding Recycling for Language Models

Jon Saad-Falcon, Amanpreet Singh, Luca Soldaini, Mike D'Arcy, Arman Cohan, Doug Downey · DOI

Abstract

Embedding Recycling (ER) is a technique designed to reduce redundant computations in NLP pipelines by caching intermediate activations of language models. By reusing these embeddings across multiple tasks and employing task-specific adapters, researchers achieve significant speedups—over 90% in training and ~90% in inference—with minimal impact on accuracy. This paper evaluates ER across various model architectures and tasks, highlighting its practical benefits and hardware-specific performance.

Introduction

In contemporary NLP, it is common to deploy a suite of specialized models—such as named entity recognizers, sentiment classifiers, and question-answering systems—over a single, static corpus of text. Standard practice involves a full forward pass through every layer of a Transformer for every individual task. This approach is inherently redundant. Research indicates that the initial layers of these models capture "universal" linguistic features that remain largely invariant across different tasks. Re-computing these layers repeatedly consumes excessive time, energy, and financial resources.

While the concept of "embedding recycling" has been explored previously, earlier studies often overlooked the practical overheads of storage and I/O. This work provides a comprehensive evaluation of ER across models ranging from 17M to 900M parameters and 14 distinct tasks.

Methodology: Layer Recycling

The core proposal is a straightforward approach termed Layer Recycling. The process involves three primary stages:

  1. Caching: A pretrained model (e.g., BERT, DeBERTa) is run once over the target corpus. Activations from an intermediate layer (typically the midpoint, such as layer 12 of a 24-layer model) are saved to disk.
  2. Reduced Models: For subsequent tasks or training epochs, the first half of the model is bypassed. The cached embeddings serve as the direct input to the remaining layers.
  3. Adapters: Rather than full fine-tuning, the authors utilize Parameter-Efficient Adapters. These small, trainable modules are added to the remaining layers while the base weights are kept frozen. This strategy minimizes the parameter update count while maintaining high performance.
The Embedding Recycling workflow: caching intermediate activations to skip redundant early-layer computations.

To ensure practical viability, the implementation uses FP16 storage to halve cache size and pre-fetching to overlap disk I/O with GPU computation, effectively hiding latency.

Key Results and Efficiency

The evaluation spanned text classification, NER, and QA tasks, including the GLUE benchmark.

Performance and Accuracy

A significant finding was the "Adapter Advantage": recycling embeddings combined with adapters often matched or slightly exceeded the performance of full fine-tuning. This suggests that later layers are highly capable of task-specific modeling when provided with high-quality intermediate representations. Across eight models, the average accuracy drop was a negligible 0.19%.

Speedups and Hardware Sensitivity

The benefits of ER are highly dependent on hardware. On "smaller" GPUs like the NVIDIA A10G, the relative speedups were more pronounced than on high-end A6000s. This is because the compute-to-memory-bandwidth ratio on less powerful hardware makes skipping layers more impactful.

Inference time speedups and accuracy differences across various models and hardware configurations.

For the DeBERTa-v2 XL model, ER achieved over 90% speedup during training and 87-91% speedup for inference. On an A10G, running BERT-base with recycling achieved speeds comparable to the much smaller MiniLM model, but with the superior accuracy of the larger architecture.

Discussion and Limitations

While ER offers substantial efficiency gains, it introduces new challenges:

  • Storage Bottleneck: Caching activations for massive datasets is resource-intensive. For instance, a sequence of 512 tokens requires approximately 0.8 MB in FP16. Future work must address compression and quantization.
  • Static Content Assumption: ER assumes the underlying text is static. Dynamic content requires cache invalidation and recomputation.
  • Model Architecture: This study focused on encoder-only and encoder-decoder models. Applying ER to autoregressive generative models (e.g., GPT) remains an open research area.
  • Cross-Model Recycling: Attempts to use embeddings from a large "teacher" model for a smaller "student" model did not yield significant gains, suggesting that internal representations are not easily interchangeable across different architectures.

Conclusion

Embedding Recycling is a highly effective method for optimizing multi-task NLP pipelines on static corpora. By trading storage for compute, it enables significant speedups with minimal loss in accuracy, making large-scale model deployment more sustainable and cost-effective.

Summary updated

BibTeX
@inproceedings{saadfalcon2023embedding,
  author = {Jon Saad-Falcon and Amanpreet Singh and Luca Soldaini and Mike D'Arcy and Arman Cohan and Doug Downey},
  title = {{Embedding Recycling for Language Models}},
  booktitle = {EACL (Findings)},
  year = {2023},
  doi = {10.18653/v1/2023.findings-eacl.145},
}
Figure