SHINE: A Scalable In-Context Hypernetwork for Mapping Context to LoRA in a Single Pass
About
We propose SHINE (Scalable Hyper In-context NEtwork), a scalable hypernetwork that can map diverse meaningful contexts into high-quality LoRA adapters for large language models (LLM). By reusing the frozen LLM's own parameters in an in-context hypernetwork design and introducing architectural innovations, SHINE overcomes key limitations of prior hypernetworks and achieves strong expressive power with a relatively small number of parameters. We introduce a pretraining and instruction fine-tuning pipeline, and train our hypernetwork to generate high quality LoRA adapters from diverse meaningful contexts in a single forward pass. It updates LLM parameters without any fine-tuning, and immediately enables complex question answering tasks related to the context without directly accessing the context, effectively transforming in-context knowledge to in-parameter knowledge in one pass. Our work achieves outstanding results on various tasks, greatly saves time, computation and memory costs compared to SFT-based LLM adaptation, and shows great potential for scaling. Our code is available at https://github.com/Yewei-Liu/SHINE
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Multi-hop Question Answering | 2WikiMultihopQA | -- | 278 | |
| Multi-hop Question Answering | HotpotQA | F1 Score59 | 221 | |
| Question Answering | SQuAD (test) | F163.6 | 111 | |
| Single-hop Question Answering | SQuAD | F1 Score63.6 | 21 | |
| Single-hop Question Answering | MS MARCO V1 | F1 Score (Answer)40.7 | 6 | |
| Single-hop Question Answering | MS MARCO V2 | Answer F1 Score40.8 | 6 | |
| Long-context Question Answering | SQuAD 512 | Answer F10.534 | 6 | |
| Long-context Question Answering | SQuAD 1K | Answer F144.5 | 6 | |
| Multi-hop Question Answering | MuSiQue | Answer F128.5 | 6 | |
| Long-context Question Answering | SQuAD 2K | Answer F1 Score37.5 | 6 |