arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.12286cs.CLcs.AIcs.CR
收藏

对话上下文分类:一种表示工程方法

Conversational Context Classification: A Representation Engineering Approach

Nanyang Technological University Singapore(南洋理工大学新加坡)

Jonathan Pan

AI总结:

本文提出利用表示工程和一类支持向量机识别LLM内部状态中的上下文子空间,以提高对话上下文检测的准确性。

摘要:

随着大语言模型(LLMs)的普及,对其操作的有效保障变得尤为重要,尤其是它们倾向于生成脱离上下文的响应。一个关键挑战是准确检测LLMs偏离预期对话规范的情况,表现为话题转移、事实不准确或完全虚构。传统异常检测难以直接应用于上下文语义。本文概述了我们探索使用表示工程(RepE)和一类支持向量机(OCSVM)来识别LLMs内部状态中的子空间,以代表特定上下文的实验。通过在上下文示例上训练OCSVM,我们建立了LLM隐藏状态潜在空间中的稳健边界。我们使用两个开源LLM——Llama和Qwen模型在特定上下文领域进行了评估。我们的方法涉及识别LLM内部状态子空间中与目标上下文强烈相关的最佳层。我们的评估结果表明,在识别特定上下文的子空间方面取得了有希望的成果。除了在检测在或不在上下文对话线程中的应用外,这项研究还为更好地解释LLMs的研究做出了贡献。

英文摘要:

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.

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

↑