2D转换器:将大型语言模型扩展到具有很少内存的长文本.
IEEE transactions on neural networks and learning systems
|March 21, 2025
概括
本研究介绍了二维变压器 (2D-former),这是一种新的架构,可以有效地扩展大型语言模型 (LLMs) 的上下文窗口. 2D-former显著降低了计算成本和GPU内存,通过全注意力机制弥合了性能差距.
科学领域:
- 人工智能的人工智能
- 自然语言处理自然语言处理.
- 机器学习 机器学习
背景情况:
- 对于大型语言模型 (LLM) 来说,处理长文本至关重要,但培训需要大量的计算资源.
- 现有的稀疏注意力机制在捕获远距离信息时,与完全注意力相比,表现差距较大.
- 这种限制阻碍了LLMs有效的长文本处理能力.
研究的目的:
- 提出一种新的稀疏变压器架构,即二维变压器 (2D-former).
- 扩展预训练LLM的上下文窗口,同时降低GPU内存需求.
- 为了弥合稀疏和全注意力机制之间的绩效差距,以增强长文本处理.
主要方法:
- 引入了一个2D注意力机制,包括一个远距离信息压缩器 (LDIC) 和一个块式注意力 (BA) 机制.
- LDIC使用卷积来提取区块的特征,并根据区块的意义压缩远距离信息.
- BA集成了这些功能,允许令牌之间进行直接通信,用于稀疏注意力计算.
主要成果:
- 2D-former需要不到0.14%的额外可训练参数,以在4个A100 GPU上将LLaMA2 7B上下文扩展到32k.
- 实现了高效的长文本扩展,使用最小的GPU内存和计算时间.
- 在LongTuning数据集上微调后,在长文本和短文本下游任务上表现出卓越的性能.
结论:
- 2D-former有效地延长了LLM的上下文长度,大大减少了计算需求.
- 该架构与当前的加速技术和参数有效微调 (PEFT) 方法兼容.
- 这种方法提供了一个实际的解决方案,以提高LLM在处理扩展的背景的能力.
相关概念视频
Types Of Transformers
941
Transformers can provide desired voltages to a circuit by modifying the number of turns in the secondary windings.
If the ratio of the number of turns in the secondary winding to that of the primary winding is greater than one, then the transformer is said to be a step-up transformer. In a step-up transformer, the voltage at the secondary winding is greater than the voltage applied at the primary winding.
However, if this ratio is less than one, the transformer is said to be a step-down...
If the ratio of the number of turns in the secondary winding to that of the primary winding is greater than one, then the transformer is said to be a step-up transformer. In a step-up transformer, the voltage at the secondary winding is greater than the voltage applied at the primary winding.
However, if this ratio is less than one, the transformer is said to be a step-down...
941
Improving Translational Accuracy
2.5K
2.5K
The Ideal Transformer
337
In single-phase two-winding transformers, two windings are coiled around a magnetic core characterized by cross-sectional area A and magnetic permeability μ. A phasor current i1 enters the left winding while i2 exits the right winding, establishing the fundamental working of the transformer through electromagnetic principles.
Ampere's Law forms the basis of understanding the magnetic field within the transformer. It states that the integral of the magnetic field intensity's...
Ampere's Law forms the basis of understanding the magnetic field within the transformer. It states that the integral of the magnetic field intensity's...
337
Transformers in Distribution System
98
Transformers in distribution systems can be broadly categorized into distribution substation transformers and other distribution transformers. They are crucial for stepping down high transmission voltages to levels suitable for distribution and end-user applications.
Distribution substation transformers come in various ratings and typically use mineral oil for insulation and cooling. To prevent moisture and air from entering the oil, some transformers use an inert gas like nitrogen to fill the...
Distribution substation transformers come in various ratings and typically use mineral oil for insulation and cooling. To prevent moisture and air from entering the oil, some transformers use an inert gas like nitrogen to fill the...
98
Transformers with Off-Nominal Turns Ratios
129
In scenarios involving parallel transformers with disparate ratings, developing per-unit models requires accommodating off-nominal turns ratios. This situation arises when the selected base voltages are not proportional to the transformer’s voltage ratings. Consider a transformer where the rated voltages are related by the term a. If the chosen voltage bases satisfy a relationship involving term b, term c is defined as the ratio of these bases. This ratio is then substituted into the...
129
Language and Cognition
302
Language serves as a bridge between ideas and communication, influencing how individuals perceive and interact with the world. Psychologists have long debated whether language shapes thought or vice versa. This discussion gained grip with Edward Sapir and Benjamin Lee Whorf in the 1940s, who proposed that language determines thought, a concept known as linguistic determinism. They suggested that the vocabulary and structure of a language influence how its speakers think and perceive reality.
302


