用简单方法让编码器模型直接生成分类结果,效果媲美大模型。
It's All in The [MASK]: Simple Instruction-Tuning Enables BERT-like Masked Language Models As Generative Classifiers
- 用原始掩码建模头做生成式分类,无需复杂提示或修改结构。
- 零样本下在MMLU上性能超同类小模型,参数少60%仍达Llama3-1B的93%。
- 适合追求高效、轻量级分类应用的研究者与工程师。
尽管如BERT和ModernBERT等编码器模型广泛应用于实际NLP任务,但其依赖特定任务分类头的传统方式,在与基于解码器的大语言模型(LLMs)相比时,适用性受限。本文提出ModernBERT-Large-Instruct,一个0.4B参数的编码器模型,利用其原始掩码语言建模(MLM)头实现生成式分类。该方法采用简洁的训练与推理流程,无需复杂预处理、精心设计的提示或架构改动。ModernBERT-Large-Instruct在分类与知识型任务中展现强大零样本能力,在MMLU上表现优于同规模LLMs,参数减少60%的情况下达到Llama3-1B 93%的性能。微调后,其生成式方法在多种自然语言理解任务上可匹配甚至超越传统分类头方法。该能力仅在使用现代多样化数据训练的模型中出现,低数据量或单一数据训练的模型表现显著更差。初步结果表明,利用原始生成式掩码建模头替代专用分类头具有潜力,值得进一步探索。
原文摘要 · Abstract (English)
While encoder-only models such as BERT and ModernBERT are ubiquitous in real-world NLP applications, their conventional reliance on task-specific classification heads can limit their applicability compared to decoder-based large language models (LLMs). In this work, we introduce ModernBERT-Large-Instruct, a 0.4B-parameter encoder model that leverages its masked language modelling (MLM) head for generative classification. Our approach employs an intentionally simple training loop and inference mechanism that requires no heavy pre-processing, heavily engineered prompting, or architectural modifications. ModernBERT-Large-Instruct exhibits strong zero-shot performance on both classification and knowledge-based tasks, outperforming similarly sized LLMs on MMLU and achieving 93% of Llama3-1B's MMLU performance with 60% less parameters. We also demonstrate that, when fine-tuned, the generative approach using the MLM head matches or even surpasses traditional classification-head methods across diverse NLU tasks.This capability emerges specifically in models trained on contemporary, diverse data mixes, with models trained on lower volume, less-diverse data yielding considerably weaker performance. Although preliminary, these results demonstrate the potential of using the original generative masked language modelling head over traditional task-specific heads for downstream tasks. Our work suggests that further exploration into this area is warranted, highlighting many avenues for future improvements.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。