The Topology of Ill-Posed Questions: Persistent Homology for Detection and Steering in LLMs

LLM HDFE Model Editing
2026年06月22日
表述不当的问题(包括语义模糊、信息不足或自相矛盾的查询)可能根本不存在有效答案,或存在多个看似合理的答案,这对大语言模型(LLMs)构成了严峻挑战。现有方法大多依赖模型输出来分析问题的表述不当性,且通常仅聚焦于其中某一特定子类。本研究探究:不同来源的表述不当性是否可统一表征为LLM内部状态的一种拓扑结构?该拓扑结构能否用于引导模型的响应行为?具体而言,我们将提示词(prompt tokens)在每一Transformer层中所对应的上下文隐状态建模为一个点云,并借助有限零维持续同调(finite zero-dimensional persistent homology)刻画其几何结构。每一层均通过三个紧凑型描述符进行表征:平均有限生命周期(mean finite lifetime)、归一化生命周期熵(normalized lifetime entropy)以及最大生命周期集中度(largest-lifetime concentration)。将这些描述符沿网络深度方向拼接,即可得到一个问题的拓扑表征。进一步地,我们提出“拓扑条件激活引导”(topology-conditioned activation steering)方法:该方法首先检索与当前问题拓扑结构最相似的历史样例,继而构建面向查询的、特定于激活空间的干预策略,以鼓励模型生成具备源头意识的澄清性回答,或在必要时主动拒绝作答。在三款开源权重的大语言模型上,拓扑特征在表述不当性分类任务中始终显著优于基于提示词(prompt-based)和池化隐状态(pooled-hidden-state)的基线方法:在AmbigQA数据集上,平均准确率由67.4%提升至78.9%;在SituatedQA数据集上,由79.9%提升至88.5%;在CLAMBER九分类任务中,亦由57.6%提升至69.6%。此外,采用拓扑条件引导后,模型整体可接受响应率(average total acceptable response rate)从61.4%提高至70.6%,其中具备事实依据的可接受响应率(grounded acceptable responses)也从11.9%提升至16.4%。上述结果表明,持续同调不仅为表述不当性提供了可解释的表征方式,同时也构成了一种行之有效的、面向特定响应目标的引导机制。
Ill-posed questions, including ambiguous, underspecified, or contradictory queries, may admit no valid answer or multiple plausible answers, posing a challenge for large language models (LLMs). Existing approaches largely analyze ill-posedness through model outputs and often focus on specific subclasses. We investigate whether diverse sources of ill-posedness can be represented within a unified topology of LLM internal states and whether this structure can be used to steer response behavior. We model the contextual hidden states of prompt tokens at each transformer layer as a point cloud and characterize its geometry using finite zero-dimensional persistent homology. Each layer is summarized by three compact descriptors: mean finite lifetime, normalized lifetime entropy, and largest-lifetime concentration. Concatenating these descriptors across layers yields a topology representation of the question. We further introduce topology-conditioned activation steering, which retrieves topologically similar examples and constructs query-specific activation interventions that encourage source-aware clarification or abstention. Across three open-weight LLMs, topology features consistently outperform prompt-based and pooled-hidden-state baselines for ill-posedness classification, improving average accuracy from \(67.4\%\) to \(78.9\%\) on AmbigQA, from \(79.9\%\) to \(88.5\%\) on SituatedQA, and from \(57.6\%\) to \(69.6\%\) on CLAMBER 9-way classification. Topology-conditioned steering increases the average total acceptable response rate from \(61.4\%\) to \(70.6\%\) and grounded acceptable responses from \(11.9\%\) to \(16.4\%\). These results show that persistent homology provides both an interpretable representation of ill-posedness and an effective mechanism for targeted response steering.
许愿