CYGNET: 用于神经执行分类与成本控制的密码门
CYGNET: Cypher Gate for Neural Execution Triage and Cost Containment
AI总结:
提出CYGNET门控机制,通过预执行验证和错误修正,在保证生成准确率的同时,高效拦截结构错误的Cypher查询并标记成本过高的执行计划。
摘要:
作为知识图谱代理的语言模型生成的Cypher查询可能因结构错误(在数据库中崩溃)或语义错误(执行但返回错误结果)而失败。我们在查询生成与生产级Neo4j数据库之间设置了一个预执行门。该门通过一个四后端链验证结构,最终在镜像图上执行,中位延迟为5.6毫秒。结构错误的查询被路由到一个修正器,该修正器通过语言模型迭代结构化错误反馈。在七个CypherBench模式(2348个问题,ACL 2025)上,该流水线在所有测试模型上保持了生成准确率,证实其作为安全防御层的有效性。修正器在五个模型上的成功率为81%至95%(平均89%)。在九个模式的模板生成语料库上,该门捕获了100%的解析错误、100%的约束违规以及100%的路径查询中带标签端点的模式引用错误,在1135个查询中零误报。属性兄弟交换(替换后的名称在目标标签上有效)得分为0%,标志着结构验证结束和语义验证开始的正式边界。基于规划器的成本门在执行前标记灾难性的计划结构。
英文摘要:
Language models acting as agents over knowledge graphs generate Cypher queries that fail structurally (crashing at the database) or semantically (executing but returning wrong results). We place a pre-execution gate between query generation and a production Neo4j database. The gate validates structure through a four-backend chain culminating in execution against a mirror graph at 5.6 ms median latency. Structurally broken queries are routed to a corrector that iterates structured error feedback through a language model. On seven CypherBench schemas (2348 questions, ACL 2025) the pipeline maintains generation accuracy on every model tested, confirming it operates as a safe defensive layer. The corrector achieves 81% to 95% success across five models (mean 89%). On a template-generated corpus across nine schemas the gate catches 100% of parse errors, 100% of constraint violations, and 100% of schema-reference errors in path queries with labelled endpoints, at zero false positives across 1135 queries. Property sibling-swaps where the substituted name is valid on the target label score 0%, marking the formal boundary where structural validation ends and semantic validation must begin. A planner-based cost gate flags catastrophic plan structures before execution.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。