Papers
Topics
Authors
Recent
Search
2000 character limit reached

Dynamic Activation Composition (Dyn)

Updated 17 November 2025
  • Dynamic Activation Composition (Dyn) is a neural network technique that combines adaptive activation mixing and dynamic steering to enhance model adaptability and control.
  • It utilizes trainable, normalized convex combinations of basis activations and contrastive steering vectors during decoding to optimize expressiveness and property-specific behavior.
  • Empirical evaluations show that Dyn improves performance in image classification and language generation tasks through robust multi-property conditioning with minimal fluency loss.

Dynamic Activation Composition (Dyn) refers to a class of neural network interventions in which activation functions or steering interventions are constructed or applied dynamically with trainable coefficients, or with decoding-time adaptive control, in order to enhance model expressiveness, interpretability, or property-specific behavior. Dyn has emerged as a unifying term for two distinct but related methodologies: (1) dynamic learned mixtures of basis activation functions, and (2) dynamic composition of steering directions with adaptive intensities in LLMs.

1. Formal Definition and Motivation

Dynamic Activation Composition denotes two principal mechanisms:

  1. Adaptive Activation Mixing: Each layer's nonlinearity is defined as a convex combination of several canonical activation functions, with learnable, normalized mixture weights per layer. Concretely, for base functions {fj(x)}j=1K\{f_j(x)\}_{j=1}^K and non-negative layer-wise weights wjw_j, the Dyn activation is

A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}

The network learns both the usual feature weights and these activation mixture coefficients.

  1. Dynamic Steering in LLMs: During autoregressive decoding, steering vectors Ai(μ)A_i^{(\mu)}—computed via contrastive prompt pairs—are injected into attention head outputs with a stepwise scalar weight αi(μ)\alpha_i^{(\mu)} for property μ\mu. The steering intensity is not fixed but set dynamically per token based on information-theoretic contrast between distributions:

zi=zi+αi(μ)Ai(μ)z_i' = z_i + \alpha_i^{(\mu)}A_i^{(\mu)}

For multi-property steering, Dyn composes:

zi=zi+μ=1Mαi(μ)Ai(μ)z_i' = z_i + \sum_{\mu=1}^M \alpha_i^{(\mu)}A_i^{(\mu)}

The primary motivations are heightened adaptability to input distributions (activation mixing), and robust, minimally disruptive conditioning of model outputs (dynamic steering).

2. Mathematical Frameworks

2.1 Basis Activation Mixtures

Let KK candidate base activations, e.g., ReLU\mathrm{ReLU}, wjw_j0, wjw_j1. For each layer wjw_j2:

  • Parameter vector: wjw_j3
  • Normalized coefficients: wjw_j4
  • Layer activation: wjw_j5

Parameterization strategies:

  • wjw_j6 (unconstrained wjw_j7)
  • Initialization: uniform weights or small random noise wjw_j8

Joint optimization alternates between network weight updates and activation weight updates, typically using an Adam-based three-phase freezing/unfreezing schedule.

2.2 Dynamic Activation Steering (LLMs)

Activation steering in LLMs operates by adding steering vectors to intermediate activations. For step wjw_j9 and property A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}0, the steering intensity is inferred via KL-divergence between unsteered and strongly-steered next-token distributions, nucleus-filtered to top-A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}1 tokens:

  • KL-guided weighting:

A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}2

where A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}3 and A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}4 are renormalized probabilities over the nucleus set A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}5.

A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}6

The procedure enables both single- and multi-property steering.

3. Decoding and Optimization Procedures

3.1 Basis Activation Learning

Training schedule:

  • Epochs 1–10: Freeze activation weights A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}7; optimize network weights A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}8.
  • Epochs 11–20: Freeze A(x)=j=1KPjfj(x),wherePj=wji=1KwiA(x) = \sum_{j=1}^K P_j\,f_j(x), \quad \text{where}\quad P_j = \frac{w_j}{\sum_{i=1}^K w_i}9; optimize activation weights Ai(μ)A_i^{(\mu)}0.
  • Epochs 21–30: Freeze Ai(μ)A_i^{(\mu)}1; optimize Ai(μ)A_i^{(\mu)}2. No explicit Ai(μ)A_i^{(\mu)}3 or Ai(μ)A_i^{(\mu)}4 regularization on Ai(μ)A_i^{(\mu)}5, beyond non-negativity and normalization constraints.

Pseudocode

αi(μ)\alpha_i^{(\mu)}7

3.2 Dynamic Steering in LLMs

Dyn decoding pseudocode (high-level):

αi(μ)\alpha_i^{(\mu)}8

4. Empirical Evaluations

4.1 Activation Mixing (Image Classification)

Empirical results (MNIST, FashionMNIST, KMNIST) reveal learned layer-wise preference for base activations:

  • First layer: Ai(μ)A_i^{(\mu)}6 (ReLU) Ai(μ)A_i^{(\mu)}7, network exhibits classical ReLU-like behavior.
  • Second/Third layer: Increasing reliance on tanh/sin, Ai(μ)A_i^{(\mu)}8 (sin) becomes dominant at depth, up to Ai(μ)A_i^{(\mu)}9.

Behavior by input range: For small αi(μ)\alpha_i^{(\mu)}0, mixtures mimic LeakyReLU; for large αi(μ)\alpha_i^{(\mu)}1, ReLU dominates due to unbounded growth.

4.2 Dynamic Steering in LLMs (Conditioned Generation)

Datasets: Alpaca QA (multi-lingual), BeaverTails (safety), GYAFC/XFORMAL (formality) Model: Mistral-7B-Instruct v0.2 Baselines: Start, Fixed, Dim schedules; In-Context Learning; noICL

Metrics:

  • Conditioning strength: property-specific confidence (langdetect, LLama Guard 2 8B, XLM-R classifier)
  • Fluency: αi(μ)\alpha_i^{(\mu)}2 perplexity vs. ICL baseline

Results:

  • Dyn matches or outperforms static baselines, securing strong multi-property accuracy with minimal perplexity increase.
  • For multi-property prompts (“Italian + Unsafe”, “French + Informal”), Dyn delivers robust conditioning and fluency preservation, outperforming fixed and decaying schedules.
  • αi(μ)\alpha_i^{(\mu)}3-schedules spike at segment starts, decay as property is established.

5. Constraints, Limitations, and Extensions

Constraints:

  • Non-negativity and normalization of mixture weights.
  • KL divergence is capped at αi(μ)\alpha_i^{(\mu)}4; nucleus filtering constrains contrast computation.

Limitations:

  • Activation mixing with only three basis functions omits newer forms (Swish, GELU).
  • LLM steering vector extraction hinges on synthetic/MT-generated parallel data; human-labeled corpora may offer refinement.
  • Only Mistral-7B was studied; broader architecture validation is pending.
  • Conditioning and fluency metrics are automatic and proxy-based; human-grade evaluation is desirable.
  • Training schedules for activation mixing introduce complexity.
  • Hyperparameters (αi(μ)\alpha_i^{(\mu)}5, αi(μ)\alpha_i^{(\mu)}6) are coarsely tuned.

Potential Extensions:

  • Activation mixing over larger dictionaries (Mish, ELU, SELU).
  • End-to-end, joint weight optimization with regularization on mixture entropy.
  • Investigate alternative steering vector extraction methods (probing-classifiers, PCA).
  • Adaptive, per-property or per-layer steering schedules.

6. Significance and Impact

Dynamic Activation Composition unifies advances in neural function expressiveness (layerwise activation blending) and controlled LLM output conditioning (robust multi-property steering), yielding models capable of task- or property-specific adaptation without manual schedule tuning or loss of output fluency. The Dyn paradigm demonstrates empirical gains—layerwise specialization in image tasks and robust multi-property conditioning in LLMs—using relatively modest architectural or computational changes, with promising prospects for generalization to richer activation sets, steering vectors, and broader model classes.

Dynamic activation mixing and steering are thematically allied with dynamic network parameterization, meta-learning, and neural network interpretability. Research parallels exist in dynamic composition in tree-structured models, wherein meta-networks synthesize composition functions at each parse node (Liu et al., 2017), further highlighting the utility of adaptive mixtures and dynamic, context-sensitive interventions. A plausible implication is that further exploration into both Dyn-style activation mixtures and dynamic steering may yield new directions for universal neural adaptation mechanisms, bridging fine-grained representation, robust output control, and minimal disruption to underlying model fluency.

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 Dynamic Activation Composition (Dyn).