LLM Augmented LLMs: Expanding Capabilities through Composition

Rachit Bansal, Bidisha Samanta, Siddharth Dalmia, Nitish Gupta, Sriram Ganapathy, Abhishek Bapna, Prateek Jain, Partha Talukdar

Abstract

Large Language Models (LLMs) are typically monolithic, making the acquisition of specialized skills computationally expensive and prone to catastrophic forgetting. This paper introduces Composition to Augment Language Models (CALM), a framework that enables the integration of specialized augmenting models into a large anchor LLM via cross-attention. By keeping original model weights frozen and only training a small set of "glue" parameters, CALM allows for the efficient composition of new capabilities—such as coding or low-resource language proficiency—without retraining. Experimental results across synthetic arithmetic, translation, and code generation tasks demonstrate that CALM achieves performance comparable to full fine-tuning while maintaining the anchor model's general reasoning strengths at a fraction of the cost.

Introduction: The Monolithic Challenge

The current paradigm for enhancing Large Language Models (LLMs) involves further pre-training or fine-tuning on specialized datasets. While effective, this approach faces three significant hurdles. First is the computational cost: retraining models with hundreds of billions of parameters requires massive infrastructure. Second is catastrophic forgetting, where a model loses its general-purpose proficiency while learning a niche skill. Finally, data silos often prevent the pooling of proprietary or sensitive domain-specific data into a single, massive training run.

To address these issues, the authors propose a modular alternative: instead of retraining, can we simply "plug in" a specialized model to an existing general-purpose anchor?

The CALM Framework: Architecture and Composition

CALM (Composition to Augment Language Models) facilitates a deep, representation-level interaction between two models. The system consists of a large, frozen anchor model ($m_B$) and a smaller, frozen augmenting model ($m_A$).

Overview of the CALM architecture across different tasks, showing the interaction between the augmenting model (mA) and the anchor model (mB) via cross-attention.

The integration is achieved through:

  1. Learnable Projections: Linear layers map the internal representations of $m_A$ into the dimensionality of $m_B$.
  2. Cross-Attention Layers: A small number of trainable cross-attention layers allow the anchor model to query features from the augmenting model at various stages of the transformer stack.
  3. Iterative Decoding: During text generation, the output token is fed back into both models simultaneously, ensuring their internal states remain synchronized.

Crucially, the original weights of both models remain untouched. Only the "glue" parameters—the projections and cross-attention layers—are trained, representing only about 1.5% of the anchor model's total parameter count.

Experimental Setup and Datasets

The researchers evaluated CALM across three distinct domains to test its versatility:

  • Synthetic Key-Value Arithmetic: A task designed to test information extraction and reasoning. $m_A$ holds string-to-integer mappings (e.g., $x_1 = 10$), while $m_B$ performs arithmetic.
  • Low-Resource Languages: Using the FLORES-200 dataset for translation and a multilingual GSM-8K for math word problems in over 10 low-resource languages.
  • Code Understanding: Evaluation on HumanEval, MBPP, and CodeXGlue across Python, Java, and Go to measure code generation and explanation capabilities.

Key Insights: Generalization and Synergy

One of the most striking findings was CALM's ability to generalize. In the synthetic task, the model was trained on arithmetic using only 20% of the available keys but generalized perfectly to the remaining 80%. This indicates that CALM learns the underlying logic of how to extract and use information from the augmenting model rather than just memorizing specific mappings.

Furthermore, CALM demonstrates true synergy. In many cases, neither the anchor nor the augment could solve a problem independently, but the composed model succeeded.

Performance comparison on synthetic tasks showing how CALM (mA ⊕ B) outperforms individual models by combining their specialized knowledge.

As shown in the table above, for the $D_{KV-MATH}$ task, both $m_A$ and $m_B$ fail completely (0.7% and 0.0% accuracy respectively), yet the composed CALM model achieves 84.3% accuracy.

Performance Results

CALM's efficiency does not come at the cost of performance. Key results include:

  • Language Inclusivity: Augmenting PaLM2-S with a low-resource language model improved translation and reasoning tasks by up to 13% absolute.
  • Coding Prowess: A code-augmented PaLM2-S saw a 40% relative improvement in generation and explanation compared to the base model.
  • Resource Efficiency: Training CALM cost only 12% of the resources required for full fine-tuning, while preserving the anchor's original strengths—avoiding the "skyline trap" where fine-tuning often caps performance at the level of the specialized dataset.

Limitations and Future Work

Despite its advantages, CALM introduces inference overhead, as running two models increases memory usage and latency. Future research will explore scaling the framework to support multiple augmenting models simultaneously and developing more sophisticated "wiring" heuristics for layer selection to further optimize performance.

Summary updated

BibTeX
@inproceedings{bansal2024llm,
  author = {Rachit Bansal and Bidisha Samanta and Siddharth Dalmia and Nitish Gupta and Sriram Ganapathy and Abhishek Bapna and Prateek Jain and Partha Talukdar},
  title = {{LLM Augmented LLMs: Expanding Capabilities through Composition}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=jjA4O1vJRz},
}
Figure