This short note is written for rapid communication of long context training and to share the idea of how to train it with low memory usage. In the note, we generalize the attention algorithm and neural network of Generative Pre-Trained Transformers and reinterpret it in Path integral formalism. First, the role of the transformer is understood as the time evolution of the token state and second, it is suggested that the all key-token states in the same time as the query-token can attend to the attention with the query token states. As a result of the repetitive time evolution, it is discussed that the token states in the past sequence meats the token states in the present sequence so that the attention between separated sequences becomes possible for maintaining infinite contextual information just by using low memory for limited size of sequence. For the experiment, the $12$ input token window size was taken and one GPU with $24$GB memory was used for the pre-training. It was confirmed that more than $150$ length context is preserved. The sampling result of the training, the code and the other details will be included in the revised version of this note later.
翻译:本文是一篇短论,旨在快速传达长上下文训练方法,并分享如何以低内存使用进行训练的思路。文中,我们推广了生成式预训练Transformer的注意力机制与神经网络,并在路径积分形式下对其重新诠释。首先,将Transformer的角色理解为令牌态的时间演化;其次,提出在查询令牌同一时间点上的所有键令牌态均可与查询令牌态进行注意力交互。通过重复的时间演化过程,我们论证了序列中过去的令牌态会与当前序列的令牌态相遇,从而使得仅利用有限序列大小的低内存即可维持无限上下文信息的注意力成为可能。实验采用12个输入令牌的窗口大小,并使用单块24GB显存的GPU进行预训练,结果证实可保留超过150长度的上下文。训练采样结果、代码及其他细节将在后续修订版本中补充。