不用微调,靠推理时技巧也能让大模型实现微调效果。
Eliciting Fine-Tuned Transformer Capabilities via Inference-Time Techniques
- 用上下文学习模拟微调后的模型能力,不改参数。
- 文本生成任务需约 $ \frac{m V}{\varepsilon^2} \log \frac{m}{\delta} $ 条数据。
- 适合追求低资源部署的开发者和研究者。
大型语言模型已改变自然语言处理,但监督微调(SFT)仍计算成本高。本文在理想假设下证明,通过推理时技术(如上下文学习,ICL),无需修改模型参数即可近似微调后的能力。我们将其扩展至实际场景:固定输出长度 $l$ 的文本生成任务中,数据集大小为 $\mathrm{O}\left( \frac{m V}{\varepsilon^2} \log \frac{m}{\delta} \right)$(无限上下文)或 $\mathrm{O}\left( \frac{l \log V}{\varepsilon^2} \log \frac{1}{\delta} \right)$(有限上下文)即可在 $m$ 个上下文中以误差 $\varepsilon$ 近似微调行为,其中 $V$ 为词表大小,$\delta$ 为失败概率。线性分类任务中,数据集大小为 $\mathrm{O}\left( \frac{d}{\varepsilon} \right)$(无限上下文)或 $\mathrm{O}\left( \frac{1}{\varepsilon^2} \log \frac{1}{\delta} \right)$(固定上下文),其中 $d$ 为输入维度。基于 Transformer 的图灵完备性,该结果为高效部署大模型提供了理论基础,实际技术如检索增强生成正推动理论落地。
原文摘要 · Abstract (English)
Large language models have transformed natural language processing, yet supervised fine-tuning (SFT) remains computationally intensive. This paper formally proves that capabilities acquired through SFT can be approximated by a base transformer model using inference-time techniques, specifically in-context learning (ICL), without altering model parameters, under idealized assumptions including unbounded computational resources and access to the fine-tuning dataset. We extend these results to practical scenarios with finite context lengths and partial dataset access. For text generation tasks with fixed output length $l$, datasets of size $\mathrm{O}\left( \frac{m V}{\varepsilon^2} \log \frac{m}δ \right)$ or, with bounded context, $\mathrm{O}\left( \frac{l \log V}{\varepsilon^2} \log \frac{1}δ \right)$ suffice to approximate fine-tuned behavior across $m$ contexts within error $\varepsilon$, where $V$ is the vocabulary size and $δ$ is the failure probability. For linear classification, datasets of size $\mathrm{O}\left( \frac{d}{\varepsilon} \right)$ or, with fixed context, $\mathrm{O}\left( \frac{1}{\varepsilon^2} \log \frac{1}δ \right)$ are sufficient, where $d$ is the input dimension. Grounded in the Turing completeness of transformers, these results provide a theoretical foundation for resource-efficient deployment of large language models, with practical techniques like retrieval-augmented generation bridging theory to real-world applications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。