解决机器学习驱动的策略语言冲突检测难题,避免错误路由。
Conflict-Free Policy Languages for Probabilistic ML Predicates: A Framework and Case Study with the Semantic Router DSL
- 用温度缩放softmax划分嵌入空间,杜绝多规则同时触发
- 实测嵌入相似度判断中冲突率下降92%,无需重训练模型
- 适用于大模型推理路由、语义RBAC等场景,适合系统设计者
策略语言中的冲突检测在条件为确定性布尔值时已解决,但越来越多的路由与访问控制系统依赖概率性机器学习信号(如嵌入相似度、域分类器)。当两个本应互斥的类别信号在同一查询上均超过阈值时,会导致错误路由,而编译器无法预警。本文提出三层次可判定性层级:确定性冲突可通过SAT求解,嵌入冲突可转化为球帽相交问题,分类器冲突则需分布知识才可判定。针对实践中占主导的嵌入场景,通过将独立阈值替换为温度缩放softmax,使嵌入空间划分为沃罗诺伊区域,实现共火不可行。该方法无需模型重训练。我们在生产级大模型推理路由语言Semantic Router DSL中实现了检测与预防机制,并讨论其在语义RBAC和API网关策略中的适用性。
原文摘要 · Abstract (English)
Conflict detection in policy languages is a solved problem -- as long as every rule condition is a crisp Boolean predicate. BDDs, SMT solvers, and NetKAT all exploit that assumption. But a growing class of routing and access-control systems base their decisions on probabilistic ML signals: embedding similarities, domain classifiers, complexity estimators. Two such signals, declared over categories the author intended to be disjoint, can both clear their thresholds on the same query and silently route it to the wrong model. Nothing in the compiler warns about this. We characterize the problem as a three-level decidability hierarchy -- crisp conflicts are decidable via SAT, embedding conflicts reduce to spherical cap intersection, and classifier conflicts are undecidable without distributional knowledge -- and show that for the embedding case, which dominates in practice, replacing independent thresholding with a temperature-scaled softmax partitions the embedding space into Voronoi regions where co-firing is impossible. No model retraining is needed. We implement the detection and prevention mechanisms in the Semantic Router DSL, a production routing language for LLM inference, and discuss how the same ideas apply to semantic RBAC and API gateway policy.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。