The increasing prevalence of Large Language Models (LLMs) demands effective safeguards for their operation, particularly concerning their tendency to generate out-of-context responses. A key challenge is accurately detecting when LLMs stray from expected conversational norms, manifesting as topic shifts, factual inaccuracies, or outright hallucinations. Traditional anomaly detection struggles to directly apply within contextual semantics. This paper outlines our experiment in exploring the use of Representation Engineering (RepE) and One-Class Support Vector Machine (OCSVM) to identify subspaces within the internal states of LLMs that represent a specific context. By training OCSVM on in-context examples, we establish a robust boundary within the LLM's hidden state latent space. We evaluate out study with two open source LLMs - Llama and Qwen models in specific contextual domain. Our approach entailed identifying the optimal layers within the LLM's internal state subspaces that strongly associates with the context of interest. Our evaluation results showed promising results in identifying the subspace for a specific context. Aside from being useful in detecting in or out of context conversation threads, this research work contributes to the study of better interpreting LLMs.


翻译:随着大型语言模型(LLMs)的日益普及,对其运行实施有效保障变得尤为必要,特别是针对其易产生脱离语境回复的倾向。核心挑战在于准确检测LLMs何时偏离预期的对话规范,表现为话题转移、事实错误或完全虚构。传统异常检测方法难以直接应用于语境语义内部。本文阐述了我们探索利用表征工程(RepE)与单类支持向量机(OCSVM)来识别LLMs内部状态中表征特定语境的子空间的实验。通过在语境示例上训练OCSVM,我们在LLM隐藏状态潜在空间中建立了稳健的边界。我们使用两个开源LLM——Llama与Qwen模型,在特定语境领域评估了本研究。我们的方法包括识别LLM内部状态子空间中与目标语境高度关联的最优层级。评估结果表明,该方法在识别特定语境的子空间方面取得了良好效果。除了可用于检测对话线程是否处于语境之内或之外,本研究工作亦有助于推进对LLMs的更好解释研究。

0
下载
关闭预览

相关内容

大型语言模型增强强化学习综述:概念、分类和方法
专知会员服务
57+阅读 · 2024年4月4日
大型语言模型在预测和异常检测中的应用综述
专知会员服务
70+阅读 · 2024年2月19日
天大最新《大型语言模型评估》全面综述,111页pdf
专知会员服务
88+阅读 · 2023年10月31日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
NLP通用模型诞生?一个模型搞定十大自然语言常见任务
人工智能头条
10+阅读 · 2018年6月29日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
语料库构建——自然语言理解的基础
计算机研究与发展
11+阅读 · 2017年8月21日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
12+阅读 · 2015年7月1日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关VIP内容
大型语言模型增强强化学习综述:概念、分类和方法
专知会员服务
57+阅读 · 2024年4月4日
大型语言模型在预测和异常检测中的应用综述
专知会员服务
70+阅读 · 2024年2月19日
天大最新《大型语言模型评估》全面综述,111页pdf
专知会员服务
88+阅读 · 2023年10月31日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员