Hypernetworks predict weight updates for better adapting language models

Learning to Predict Distributions over Weight Updates for Test-Time Adaptation

Machine Learning

Summary

It can be hard for large language models to quickly adjust to new tasks just by looking at a single question or input. The authors explored a way to help these models adapt better by predicting not just one best tweak but a whole range of possible tweaks to their settings. This approach lets the model try different versions of itself and choose the best answers, improving performance. They also found these tweaks can be useful for different questions, meaning the model learns reusable ways to improve.

What this means in practice

  • For natural language processing engineers: Generate multiple model adaptations per input query to improve real-time language understanding and generation.
  • For customer support chatbot teams: Deploy chatbots that adapt on the fly to new questions by sampling weight updates, improving answer accuracy without retraining.$Commercial implications: Enables selling smarter adaptive chatbot services with superior real-time response customization.

Authors

Azal Ahmad Khan, Keshav Ramji, Tahira Naseem, Ali Anwar, Ramón Fernandez Astudillo

Abstract

Hypernetworks have recently shown success in dynamically adapting the parameters of Large Language Models (LLMs) at runtime based on signals such as task descriptions or additional demostrations. Here we ask: how much adaptation signal can be obtained using only the input query to an LLM?. To answer this, we study query-conditioned Hypernetworks for LoRA estimation. Further, we introduce distributional Hypernetworks, able to produce not only point estimates of parameter adaptors, but also a distribution over possible LoRAs. For this we propose a simple end-to-end loss using a differentiable Monte Carlo approximation and explore multiple distribution parametrizations including regression and convex combination variants. Results show that even using the mean of the learned distribution can outperform deterministic hypernetworks. Crucially, the learned distribution enables a different form of test-time scaling: instead of spending additional compute only by sampling more token sequences from a fixed model, we sample weight updates, yielding multiple adapted models for the same query. Performance improves as more weight samples are considered and remains stronger than corresponding token-sampling adaptation baselines. Finally, we find that generated updates can transfer across queries, suggesting that the hypernetwork learns reusable structure in how the model should adapt. Together, these results show that query-conditioned distributions over weight updates can support both adaptation and test-time scaling.