Papers
Topics
Authors
Recent
Search
2000 character limit reached

CompAs: Compositional Adapter Synthesis

Updated 2 July 2026
  • CompAs is a meta-learning framework that generates LoRA-format adapters from context chunks, enabling scalable and efficient LLM inference.
  • It employs a two-stage pipeline with a generator network and a student model to emulate prompt concatenation through additive adapter composition.
  • Empirical results demonstrate improved accuracy, reduced inference costs, and robustness compared to traditional in-context learning techniques.

CompAs

CompAs denotes a meta-learning framework for compositional adapter generation in LLMs, introduced by Jukić, Lin, and Šnajder in "Context Parametrization with Compositional Adapters" (Jukić et al., 26 Sep 2025). It provides a differentiable mechanism for mapping input context—such as instructions, demonstrations, or retrieved passages—into low-rank adapters whose linear combination emulates standard prompt concatenation. The design addresses context-window inefficiencies, inefficacy and instability of conventional in-context learning (ICL), and the inflexibility of supervised fine-tuning, supporting scalable and robust LLM deployment.

1. Architectural and Methodological Foundations

CompAs operates as a two-stage, meta-learned pipeline. A generator network, GG, reads each context chunk ci\mathbf{c}_i and emits a LoRA-format adapter ϕi\boldsymbol{\phi}_i parameterizing a subspace in the adapter space Φ⊂Rm\Phi \subset \mathbb{R}^m. These adapters are independently generated and composed additively: ϕcomb=∑i=1kϕi.\boldsymbol{\phi}_{\text{comb}} = \sum_{i=1}^{k} \boldsymbol{\phi}_i. A frozen "student" LLM then answers queries q\mathbf{q} with the joint adapter loaded, mimicking the effect of concatenating all context segments before inference. Distillation occurs by matching the logits of the adapter-equipped student with those of a teacher LLM exposed to token-level concatenation.

The generator GG is architected around a shared frozen backbone complemented by a lightweight contextual encoder and a linear bottleneck, producing LoRA adapter modules per transformer layer. The LoRA mechanism ensures efficient, low-parameter updates, while the linear projection and absence of nonlinearity between context encoding and adapter vectors enforce compositionality.

2. Mathematical Formulation and Training Objectives

For each context chunk ci\mathbf{c}_i, G(ci)→ϕiG(\mathbf{c}_i) \to \boldsymbol{\phi}_i. The student model with cumulative adapter Φ=∑iϕi\Phi = \sum_i \boldsymbol{\phi}_i processes only the query sequence ci\mathbf{c}_i0, while the teacher receives the entire [context; query] prompt. Three key objectives are optimized:

  1. Distillation loss: KL divergence between student (adapter) and teacher logits, over both single- and multi-chunk settings,

ci\mathbf{c}_i1

  1. Additivity regularizer: Encourages generator linearity by matching the sum of single-chunk adapters to the adapter generated from concatenated context,

ci\mathbf{c}_i2

with ci\mathbf{c}_i3 the LoRA matrices per module and normalization/statistical stabilization parameter ci\mathbf{c}_i4.

  1. Reconstruction (invertibility) loss: A special reconstruction token is prepended, and the student is trained to autoregressively decode ci\mathbf{c}_i5 given ci\mathbf{c}_i6, enforcing that adapters retain full context information:

ci\mathbf{c}_i7

Total loss is a weighted sum ci\mathbf{c}_i8.

3. Composable Adapter Merging and Context Recovery

A core property of CompAs is that addition in adapter space approximates concatenation in prompt space: for context blocks ci\mathbf{c}_i9,

ϕi\boldsymbol{\phi}_i0

Adapters consist of low-rank pairs ϕi\boldsymbol{\phi}_i1 per layer, summed module-wise for merging. No extra nonlinearity or combinatorial layer is introduced, yielding a monoid-homomorphic structure.

Reversibility is achieved: given a merged adapter, prompting the student with ϕi\boldsymbol{\phi}_i2 allows accurate reconstruction of input context, verified via token-level ϕi\boldsymbol{\phi}_i3 scores (high-80s to low-90s maintained for up to 3 chunks summed) (Jukić et al., 26 Sep 2025). This property enables both safety (adapter auditing) and theoretical frameworks for context inversion.

4. Comparison with In-Context Learning and Generator-Based Alternatives

Standard ICL requires re-encoding the prompt for every inference, yielding hard context limits and quadratic scaling with context length. CompAs amortizes context encoding: each chunk is processed once to produce an adapter. Subsequent queries involving the same context incur inference costs independent of total ϕi\boldsymbol{\phi}_i4: ϕi\boldsymbol{\phi}_i5 Empirical evaluation shows up to ϕi\boldsymbol{\phi}_i6 speedup and 20% lower peak memory at 16-shot scale, with superior accuracy and variance reduction relative to ICL and generator hypernetwork methods (e.g., GenAda). Compositionality failures and instability present in non-linear hypernetwork generators are minimized. CompAs matches or exceeds fine-tuned per-context adapters (WILDA) in 11 of 12 high-shot tasks, but with greater flexibility since no retraining is required per chunk (Jukić et al., 26 Sep 2025).

5. Empirical Results and Theoretical Guarantees

CompAs is validated on multiple-choice and extractive QA tasks: MMLU (59 subjects), ARC-Challenge, HotpotQA. With increasing context length (shots or supporting paragraphs), CompAs maintains or improves performance where baseline ICL and generator-based approaches degrade. At 16-shots, CompAs delivers a 2–6 point accuracy gain (absolute), up to +4 EM and +2–4 F1 (HotpotQA), and reduces inference costs by a factor of four (Jukić et al., 26 Sep 2025).

Theoretical bounds (Theorem 1) relate divergence between student and teacher logits under compositional adapter addition to generator additivity error ϕi\boldsymbol{\phi}_i7 and student–teacher alignment error ϕi\boldsymbol{\phi}_i8: ϕi\boldsymbol{\phi}_i9 extending linearly in Φ⊂Rm\Phi \subset \mathbb{R}^m0. This underpins the empirical observation of stable accuracy as context scales.

6. Applications, Limitations, and Extensions

CompAs is beneficial in three primary regimes:

  1. Overlong prompts: Contexts exceeding the LM’s window can be chunked, encoded as adapters, and summed, sidestepping hard window limits.
  2. Efficient batch LLM serving: Repeated queries on shared context amortize cost, crucial for retrieval-augmented pipelines, multi-task orchestration, or interactive applications.
  3. Safety and control: Reversible adapter encoding enables extraction, verification, or repudiation of encoded context.

Limitations include non-exact linearity in generator (small but finite Φ⊂Rm\Phi \subset \mathbb{R}^m1), and that errors can compound linearly with the number of composed chunks. Extension areas include handling chunk ordering, scaling additivity to even higher Φ⊂Rm\Phi \subset \mathbb{R}^m2, and incorporating richer compression or attention mechanisms within the generator for extreme prompt lengths.

CompAs builds upon the LoRA adapter paradigm, prior adapter generation schemes (e.g., context-conditioned hypernetworks), and literature on efficient parameter-efficient fine-tuning. Its algebraic composition property contrasts with both vanilla ICL and explicit multi-step prompt concatenation, and it establishes a new regime for task-conditioned, context-parametric inference in LLMs (Jukić et al., 26 Sep 2025). Empirical and theoretical validation position it as the most compositional, efficient, and robust context parametrization technique among published meta-learning adapter frameworks as of its introduction.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to CompAs.