arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2506.08060cs.LGcs.AI
收藏

通过推理时技术激发微调 Transformer 的能力

Eliciting Fine-Tuned Transformer Capabilities via Inference-Time Techniques

Patched Codes, Inc.(Patched Codes 公司)

Asankhaya Sharma

AI总结:

本文证明基础 Transformer 可通过 ICL 等推理时技术近似 SFT 能力,并给出文本生成与线性分类所需数据集规模界,为高效部署提供理论依据。

摘要:

大语言模型已经改变了自然语言处理,但监督微调(SFT)仍然需要大量计算。本文形式化证明:在理想化假设下,包括无界计算资源以及能够访问微调数据集,通过 SFT 获得的能力可以由基础 transformer 模型借助推理时技术来近似,具体而言是上下文学习(ICL),且无需改变模型参数。我们将这些结果扩展到上下文长度有限且只能访问部分数据集的实际情形。对于输出长度固定为 $l$ 的文本生成任务,规模为 $\mathrm{O}\left( \frac{mV}{\varepsilon^2} \log \frac{m}{δ} \right)$ 的数据集,或者在上下文有界时规模为 $\mathrm{O}\left( \frac{l \log V}{\varepsilon^2} \log \frac{1}{δ} \right)$ 的数据集,足以在 $m$ 个上下文中以误差 $\varepsilon$ 近似微调后的行为,其中 $V$ 是词表大小,$δ$ 是失败概率。对于线性分类,规模为 $\mathrm{O}\left( \frac{d}{\varepsilon} \right)$ 的数据集,或者在上下文固定时规模为 $\mathrm{O}\left( \frac{1}{\varepsilon^2} \log \frac{1}{δ} \right)$ 的数据集即已足够,其中 $d$ 是输入维度。这些结果以 transformer 的图灵完备性为基础,为大语言模型的资源高效部署提供了理论基础,而检索增强生成等实用技术则在理论与现实应用之间建立了桥梁。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑