Scaling Laws for Hypernetwork-Based Knowledge Injection in Large Language Models

Nischay Dhankhar, Dos Baha, Abulhair Saparov

arXiv:2607.19604 · 2026-07-23 공개 · arXiv · PDF

scaling-laws ood-generalization llm-adaptation large-scale-datasets knowledge-injection fact-reasoning hypernetworks lora-adapter

Abstract

Injecting factual knowledge into large language models (LLMs) reliably and at scale remains an open challenge. Hypernetworks provide a promising solution to large-scale knowledge injection. Although hypernetworks are typically applied for test-time adaptation, we explore their use in train-time knowledge injection, where, given a large corpus of facts, we train a hypernetwork to generate a fixed LoRA adapter that, when inserted into the target model, enable the model to answer questions about those facts. In this work, we investigate whether hypernetworks can be used to perform train-time knowledge injection and how this ability varies with scale. The scaling behavior of hypernetworks remains largely unstudied. Our design decouples the hypernetwork's injection capacity from the target model's general capability, enabling, for the first time, a rigorous study of scaling laws for hypernetwork architectures. We characterize how loss, reasoning accuracy, and out-of-distribution (OOD) generalization vary with hypernetwork depth, width, and target network size. We construct a large-scale dataset, called MegaWikiQA, containing tens of millions of multi-hop question-answer examples across 39 domains constructed from examples in Wikidata5M. Our results reveal: (i) hypernetwork-based injection exhibits broadly predictive power law scaling along all architecture axes; and (ii) hypernetworks are capable of reliable OOD generalization at increasing scales, suggesting that hypernetwork provides a promising alternative to other train-time adaptation methods such as LoRA finetuning and full fine-tuning, exhibiting steeper scaling exponents in all OOD evaluations. Together, these results establish hypernetworks as a principled and scalable substrate for train-time adaptation, and provide the first empirically grounded scaling laws to guide hypernetworks for factual reasoning in large language models.

한국어 요약

한 줄 요약

하이퍼네트워크 기반 지식 주입이 대규모 언어 모델에서 예측 가능한 스케일링 법칙과 우수한 OOD 일반화를 보인다.

핵심 기여도

핵심 아이디어

기존 지식 주입 방법은 파라미터 수정을 통해 이루어지며, 이는 카테고리컬 포팅이나 OOD 일반화에 약점을 가진다. 본 연구는 하이퍼네트워크를 활용하여, **LoRA 어댑터를 생성하는 방식**으로 기존 모델 파라미터를 수정하지 않고 지식을 주입하는 새로운 접근법을 제안한다. 이는 **트레인타임 지식 내재화**(train-time knowledge internalization)를 목표로 하며, 주입된 사실에 조건을 주어 어댑터를 생성하는 방식으로, **기본 모델의 파라미터를 보존**하면서도 새로운 지식을 학습한다.

핵심 통찰은 하이퍼네트워크가 **트랜스포머 아키텍처 내에서 깊이, 너비, 주입된 사실 수에 따라 예측 가능한 성능 향상**을 보인다는 점이다. 특히, OOD 일반화에서 하이퍼네트워크가 기존 PEFT 방법보다 더 빠르게 성능이 향상된다는 점이 주목할 만하다.

기술적 접근법

주요 결과

의의 및 한계

본 연구는 하이퍼네트워크 기반 지식 주입의 **스케일링 법칙을 체계적으로 분석**하여, 대규모 언어 모델의 지식 주입 전략에 실질적 지침을 제공한다. 특히, 하이퍼네트워크가 **기존 PEFT 방법보다 OOD 일반화에서 우수한 성능**을 보인다는 점은 실용적 가치가 크다.

그러나, 하이퍼네트워크 자체의 파라미터 수가 타겟 모델과 비슷한 수준(예: 2.5B vs. 1.5B)에 도달하면 **배포성 문제가 발생**하며, 이는 효율적인 하이퍼네트워크 아키텍처 설계를 위한 추가 연구가 필요하다는 한계를 드러낸다. 또한, **멀티홉 추론의 깊이**가 증가할 경우 하이퍼네트워크의 성능 변화는 아직 분석되지 않았다.

실용적 활용

본 연구는 **의료, 법률, 금융** 등 민감한 도메인에서의 지식 주입에 적합한 방식을 제시한다. 특히, **로컬 모델에 지식을 내재화**하면서도 외부 데이터에 접근하지 않는 방식은 데이터 보안과 일반화 능력을 동시에 확보할 수 있다. 또한, **대규모 지식 베이스를 활용한 QA 시스템**이나 **사후 트레이닝**(post-training) 과정에도 활용 가능하다.