An essential part of monitoring machine learning models in production is measuring input and output data drift. In this paper, we present a system for measuring distributional shifts in natural language data and highlight and investigate the potential advantage of using large language models (LLMs) for this problem. Recent advancements in LLMs and their successful adoption in different domains indicate their effectiveness in capturing semantic relationships for solving various natural language processing problems. The power of LLMs comes largely from the encodings (embeddings) generated in the hidden layers of the corresponding neural network. First we propose a clustering-based algorithm for measuring distributional shifts in text data by exploiting such embeddings. Then we study the effectiveness of our approach when applied to text embeddings generated by both LLMs and classical embedding algorithms. Our experiments show that general-purpose LLM-based embeddings provide a high sensitivity to data drift compared to other embedding methods. We propose drift sensitivity as an important evaluation metric to consider when comparing language models. Finally, we present insights and lessons learned from deploying our framework as part of the Fiddler ML Monitoring platform over a period of 18 months.
翻译:生产环境中机器学习模型的监控核心在于度量输入与输出数据漂移。本文提出了一种针对自然语言数据分布偏移的度量系统,着重探讨并验证了利用大规模语言模型解决该问题的潜在优势。近年来,大语言模型在不同领域的成功应用表明,其在捕获语义关系以解决各类自然语言处理问题方面具有显著效能。大语言模型的强大能力主要源于其神经网络隐藏层生成的编码(嵌入)。我们首先提出一种基于聚类的算法,利用此类嵌入度量文本数据的分布偏移;进而研究该算法在由大语言模型与传统嵌入算法生成的文本嵌入上的应用效果。实验结果表明,相较于其他嵌入方法,通用型大语言模型嵌入对数据漂移具有更高的敏感性。我们提出将漂移敏感性作为评估语言模型时的重要度量指标。最后,本文总结了将所提框架部署于Fiddler机器学习监控平台18个月的实践洞察与经验教训。