让语言模型分层并行推理,提升分类与生成效果
Making Language Model a Hierarchical Classifier
- 将模型不同层并行设置为语言头,实现分层推理
- 在多个任务上超越现有方法,最高提升7.3%准确率
- 适合需要层次化推理的文本分类与生成场景
Decoder-only语言模型(如GPT、LLaMA)通常仅在最后一层解码。受人类分层思维启发,我们提出一种分层解码架构,让不同层同时进行文本解码。由于时间和计算资源限制,我们通过微调预训练模型实现此结构:将最后一层的语言头复制到若干选定的中间层,并用不同任务输入进行微调。实验表明,这些中间层能生成有意义且合理的文本内容。该分层解码范式在多任务上达到当前最优表现,包括层次文本分类、分类引导生成和层次文本生成,在WoS、DBpedia、ESconv、EmpatheticDialogues等多个数据集及认知测试中均优于所有基线。我们还提供了理论分析,验证了方法的收敛性与计算效率。本研究揭示了从零开始预训练通用分层推理器的可能性。
原文摘要 · Abstract (English)
Decoder-only language models, such as GPT and LLaMA, generally decode on the last layer. Motivated by human's hierarchical thinking capability, we propose that a hierarchical decoder architecture could be built with different layers decoding texts simultaneously. Due to limited time and computationally resources, we choose to adapt a pretrained language model into this form of hierarchical decoder. Language heads of the last layer are copied to different selected intermediate layers, and fine-tuned with different task inputs. By thorough experiments, we validate that these selective intermediate layers could be adapted to speak meaningful and reasonable contents, and this paradigm of hierarchical decoder can obtain state-of-the-art performances on multiple tasks such as hierarchical text classification, classification-guided generation, and hierarchical text generation. HdLM outperforms all baselines on WoS, DBpedia, ESconv, EmpatheticDialogues, and several cognitive tests. We also provide thorough theoretical analysis to validate the convergence and computational savings of our methodology. This study suggests the possibility of a generalized hierarchical reasoner, pretraining from scratch.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。