Zhyper: Factorized Hypernetworks for Conditioned LLM Fine-Tuning
M. H. I. Abdalla, Zhipin Wang, Christian Frey, Steffen Eger, Josif Grabocka
TL;DR
Zhyper introduces a parameter-efficient factorized hypernetwork that conditions LoRA adapters via context-specific modulation signals, enabling dynamic LLM fine-tuning from textual descriptions. For each transformer layer and attention type, a hypernetwork outputs a rank-r vector that modulates the corresponding LoRA matrices through either a diagonal or full-rank context matrix, enabling context-aware adaptation with far fewer parameters. The method achieves competitive accuracy on diverse tasks while reducing trainable parameters by up to 26x compared to strong baselines, and demonstrates superior generalization in cultural alignment across unseen regions and countries. This approach supports more sustainable, fine-grained LLM conditioning by decoupling context encoding from full adapter generation, facilitating efficient deployment in multi-context settings.
Abstract
Large Language Model (LLM) conditioning refers to instructing an LLM to generate content in accordance with the norms and values of a specific culture, beliefs of a particular political orientation, or any desired text-specified semantic conditioning. Unfortunately, prompt engineering does not ensure that LLMs behave in accordance with a desired conditioning due to the inductive bias of the pre-training and alignment datasets. Prior works have focused on fine-tuning LLMs by directly conditioning the LoRA weights; however, such methods introduce a large number of parameters. As a remedy, we propose Zhyper, a parameter-efficient factorized hypernetwork framework that generates context-aware LoRA adapters from textual descriptions. Experiments on multiple benchmarks show that Zhyper achieves competitive performance with up to 26x fewer parameters than the state-of-the-art baselines. Furthermore, we extend Zhyper to cultural alignment, demonstrating improved generalization to out-of-domain settings and a better capturing of fine-grained contextual values.
