arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.06370cs.CL
收藏

面向成本的模型选择用于文本分类:在生产环境中细调编码器与LLM提示之间的多目标权衡

Cost-Aware Model Selection for Text Classification: Multi-Objective Trade-offs Between Fine-Tuned Encoders and LLM Prompting in Production

Pontifical Catholic University of Chile(天主教智利大学)

Alberto Andres Valdes Gonzalez

AI总结:

本文提出在生产环境中细调编码器与LLM提示之间的多目标权衡,发现微调编码器在成本和性能上优于LLM提示。

摘要:

大型语言模型(如GPT-4o和Claude Sonnet 4.5)在开放性推理和生成语言任务中表现出强大的能力,因此被广泛应用于各种自然语言处理(NLP)应用。然而,对于具有固定标签空间的结构化文本分类问题,模型选择通常仅由预测性能驱动,忽略了生产系统中遇到的操作约束。在本工作中,我们提出了两种对比的文本分类范式系统比较:基于零次和少量样本提示的大型语言模型,以及完全微调的仅编码器架构。我们评估了这些方法在四个经典基准(IMDB、SST-2、AG News和DBPedia)上的表现,测量预测质量(宏F1)、推断延迟和货币成本。我们将模型评估框架为一个多目标决策问题,并使用帕累托前沿投影和反映不同部署模式的参数化效用函数分析权衡。我们的结果表明,来自BERT家族的微调编码器模型在分类性能上具有竞争力,甚至更优,同时在成本和延迟方面比零次和少量样本LLM提示低一个到两个数量级。总体而言,我们的发现表明,不加选择地使用大型语言模型进行标准文本分类任务可能导致系统层面的次优结果。相反,微调的编码器在结构化NLP管道中表现出稳健和高效,而LLM更适合作为混合架构中的补充元素。我们释放所有代码、数据集和评估协议以支持可重复性和成本意识的NLP系统设计。

英文摘要:

Large language models (LLMs) such as GPT-4o and Claude Sonnet 4.5 have demonstrated strong capabilities in open-ended reasoning and generative language tasks, leading to their widespread adoption across a broad range of NLP applications. However, for structured text classification problems with fixed label spaces, model selection is often driven by predictive performance alone, overlooking operational constraints encountered in production systems. In this work, we present a systematic comparison of two contrasting paradigms for text classification: zero- and few-shot prompt-based large language models, and fully fine-tuned encoder-only architectures. We evaluate these approaches across four canonical benchmarks (IMDB, SST-2, AG News, and DBPedia), measuring predictive quality (macro F1), inference latency, and monetary cost. We frame model evaluation as a multi-objective decision problem and analyze trade-offs using Pareto frontier projections and a parameterized utility function reflecting different deployment regimes. Our results show that fine-tuned encoder-based models from the BERT family achieve competitive, and often superior, classification performance while operating at one to two orders of magnitude lower cost and latency compared to zero- and few-shot LLM prompting. Overall, our findings suggest that indiscriminate use of large language models for standard text classification workloads can lead to suboptimal system-level outcomes. Instead, fine-tuned encoders emerge as robust and efficient components for structured NLP pipelines, while LLMs are better positioned as complementary elements within hybrid architectures. We release all code, datasets, and evaluation protocols to support reproducibility and cost-aware NLP system design.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑