arXiv:2501.08648cs.CLcs.AI2025-01ACL被引 7

让单向生成模型同时具备文本表示与补全能力

MAGNET: Augmenting Generative Decoders with Representation Learning and Infilling Capabilities

  • 用三重自监督目标统一训练,融合双向与单向注意力
  • 在词级和句级表示任务上超越主流编码器
  • 可精准补全文本且生成不重复,保留原始推理能力

尽管最初为单向生成设计,解码器仅的大语言模型(LLMs)正被越来越多地用于双向建模。然而,单向与双向模型通常采用不同目标分别训练(生成与表征学习),这种分离错失了发展更通用模型的机会,也未能让两类目标相互促进。本文提出MAGNET,一种将解码器仅的LLM适配为兼具鲁棒表征学习与缺失文本补全能力的方法。MAGNET引入三种自监督训练目标,并设计一种结合双向与因果注意力的机制,实现所有目标的统一训练。结果表明,经MAGNET适配的LLM:(1) 在词级与句级表征学习任务上优于强基准编码器;(2) 能利用前后文上下文生成合理文本补全;(3) 在开放式文本生成中避免过度重复词汇或短语;(4) 保留预训练阶段获得的知识与推理能力。

原文摘要 · Abstract (English)

While originally designed for unidirectional generative modeling, decoder-only large language models (LLMs) are increasingly being adapted for bidirectional modeling. However, unidirectional and bidirectional models are typically trained separately with distinct objectives (generation and representation learning). This separation overlooks the opportunity for developing a more versatile language model and for these objectives to complement each other. In this work, we propose MAGNET, a method for adapting decoder-only LLMs to generate robust representations and infill missing text spans. MAGNET employs three self-supervised training objectives and introduces an attention mechanism that combines bidirectional and causal attention, enabling unified training across all objectives. Our results demonstrate that LLMs adapted with MAGNET (1) surpass strong text encoders on token-level and sentence-level representation learning tasks, (2) generate contextually appropriate text infills by leveraging past and future contexts, (3) perform open-ended text generation without excessive repetition of words or phrases, and (4) preserve the knowledge and reasoning capability gained by the LLM during pretraining.

语言模型表征学习文本补全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。