让模型预测未来多个词,提升文本连贯性与主题一致性。
Future Token Prediction -- Causal Language Modelling with Per-Token Semantic State Vector for Multi-Token Prediction
- 用编码器生成未来语义向量,解码器预测接下来N个词。
- 生成文本主题连贯性显著优于传统GPT模型,相同困惑度下表现更优。
- 适合需要长距离语义理解的场景,如代码生成、内容创作。
基于因果解码器的Transformer模型(如GPT)通常仅根据前序词预测下一个词,导致顶层嵌入向量高度聚焦于单个词。本文提出未来词预测(FTP)预训练方法:使用大型Transformer编码器为每个词位置生成顶层嵌入向量,经线性扩展形成伪序列,再由小型解码器交叉注意力机制预测该位置之后的未来N个词。实验表明,FTP模型的嵌入向量在序列中变化平滑(相邻词余弦相似度更高),生成文本的主题连贯性优于标准GPT模型(在相同单词预测困惑度下)。文本分类任务中,其向量更准确反映文本主题。在复杂编程任务中,FTP模型性能显著优于GPT模型。
原文摘要 · Abstract (English)
Causal decoder-only transformer models used for generative language modelling, such as Generative Pre-trained Transformers (GPT), are trained to predict the next token in a sequence based only on its previous tokens. Despite this simple training objective, they have proved to be powerful AI tools. However, only predicting the next token results in top layer embedding vectors that are highly token-focused. There may be benefits in generating embedding vectors at each token position that better capture the overall meaning of longer sequences of future text. Recent studies matching brain scans with deep language models suggest that humans also predict upcoming words when listening or reading but consider multiple future tokens rather than just one. This research investigates a new pretraining method called Future Token Prediction (FTP). In FTP, a large transformer encoder generates top layer embedding vectors for each token position, which, instead of being passed to a language head, are linearly and expansively projected to a pseudo-sequence, which is cross attended to by a small transformer decoder to predict the next N tokens forward from that position in the sequence. The top layer embedding vectors from FTP models exhibit distinct properties compared to those from standard GPT models, varying smoothly along a text sequence as measured by cosine similarity between adjacent tokens. Text generated by FTP models show improved topic coherence compared to standard GPT-like models trained with the same prediction perplexity for the next single token. The vectors are shown to better represent the topic of text based on the results of text classification examples. On a toy, but complex, coding problem, FTP networks produce significantly better results than GPT networks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。