# RAG Retrieves. Fine-Tuning Forgets. HyperNetworks Inject - and Now We Have the Scaling Laws.

> Source: <https://dev.to/vsbd_vlad/rag-retrieves-fine-tuning-forgets-hypernetworks-inject-and-now-we-have-the-scaling-laws-3hmm>
> Published: 2026-07-28 10:47:30+00:00

There are two mainstream answers to "how do I get my LLM to reliably use proprietary data?" RAG retrieves relevant chunks at inference time. Fine-tuning bakes new knowledge into the weights. Both are widely deployed. Both have well-documented failure modes.

A new paper from Nace AI and Purdue University proposes a third path backed by the first systematic scaling laws: **HyperNetwork-based knowledge injection**. Instead of modifying the LLM, you train a second network that generates LoRA adapters from a batch of facts. The base model never changes.

LoRA reduces cost but shares the same structural problems. You still forget.

A **HyperNetwork** is a secondary model conditioned on input facts. It generates LoRA adapters (ΔW) inserted into the target model at inference time. The base model is frozen. Always.

Architecture: Fact batch enters a Transformer encoder (no causal mask, Post-LayerNorm, RoPE) -> Mean pooling -> Linear -> ΔW (LoRA rank 4, α=8) -> adapters into upper half of target model layers. Only the HyperNetwork trains.

The team built **MegaWikiQA** -- 10M+ multi-hop QA pairs from Wikidata5M (4.6M entities, 822 relations, 39 domains, 1-4 hops, explicit OOD splits).

Hypernetworks from 167M to 2.8B parameters. Four findings:

Most enterprise teams face this: proprietary knowledge that can't go into pretraining, too dynamic for static fine-tuning, too specific for general RAG.

The hypernetwork approach: no base model modification, predictable scaling, OOD generalization to new entities and regulations, independently upgradable layers.

RAG retrieves. Fine-tuning forgets. HyperNetworks inject -- learning to generate weight adaptations from facts, not memorizing facts themselves. The scaling laws make this a design principle: steeper OOD scaling exponents, gap widening at scale, smooth power laws you can engineer around.

Paper: [https://arxiv.org/abs/2607.19604](https://arxiv.org/abs/2607.19604) | Code and data: [https://huggingface.co/collections/nace-ai/hypernetwork-datasets](https://huggingface.co/collections/nace-ai/hypernetwork-datasets)

*Originally published at vsebude.it*
