arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.01189cs.CLcs.LG
收藏

可训练的 Transformer 中的 Transformer

Trainable Transformer in Transformer

Princeton University(普林斯顿大学)

Abhishek Panigrahi, Sadhika Malladi, Mengzhou Xia, Sanjeev Arora

AI总结:

提出 Transformer 中的 Transformer(TinT)高效构造,使大型预训练语言模型能在单次前向传播中内部模拟并微调复杂模型,显著提升性能。

摘要:

近期研究将大型预训练语言模型中上下文学习(ICL)的能力归因于在推理过程中隐式模拟并微调内部模型(例如线性模型或两层MLP)。然而,此类构造需要大量内存开销,使得模拟更复杂的内部模型变得难以处理。在本工作中,我们提出了一种高效构造——Transformer 中的 Transformer(简称 TinT),它允许 Transformer 在推理过程中内部模拟并微调复杂模型(例如预训练语言模型)。特别地,我们引入了创新的近似技术,使得参数量少于20亿的 TinT 模型能够在单次前向传播中模拟并微调一个1.25亿参数的 Transformer 模型。TinT 支持多种常见的 Transformer 变体,其设计思想也提升了以往在 Transformer 内部模拟简单模型的实例的效率。我们进行了端到端实验,以验证 TinT 在各种语言建模和下游任务上的内部微调过程。例如,即使在一小步预算的限制下,我们观察到 TinT 对 OPT-125M 模型相比 OPT-125M 平均提升了4-16%的绝对性能。这些发现表明,大型预训练语言模型能够执行复杂的子程序。为促进进一步研究,我们提供了 TinT 的模块化、可扩展的代码库。

英文摘要:

Recent works attribute the capability of in-context learning (ICL) in large pre-trained language models to implicitly simulating and fine-tuning an internal model (e.g., linear or 2-layer MLP) during inference. However, such constructions require large memory overhead, which makes simulation of more sophisticated internal models intractable. In this work, we propose an efficient construction, Transformer in Transformer (in short, TinT), that allows a transformer to simulate and fine-tune complex models internally during inference (e.g., pre-trained language models). In particular, we introduce innovative approximation techniques that allow a TinT model with less than 2 billion parameters to simulate and fine-tune a 125 million parameter transformer model within a single forward pass. TinT accommodates many common transformer variants and its design ideas also improve the efficiency of past instantiations of simple models inside transformers. We conduct end-to-end experiments to validate the internal fine-tuning procedure of TinT on various language modeling and downstream tasks. For example, even with a limited one-step budget, we observe TinT for a OPT-125M model improves performance by 4-16% absolute on average compared to OPT-125M. These findings suggest that large pre-trained language models are capable of performing intricate subroutines. To facilitate further work, a modular and extensible codebase for TinT is included.

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

↑