菜单

关于 🐙 GitHub
arXiv 提交日期: 2026-07-02
📄 Abstract - Object Aligner: A Configurable JSON Schema Similarity Score for Graphs, Applied to LLM Prompt Optimization

Large language models (LLMs) are often asked to produce JSON conforming to a fixed schema, powering information extraction, tool calling, agentic planning, and knowledge-graph construction. Measuring how closely an output matches a gold reference is essential yet surprisingly hard: exact match is brittle, text similarity ignores structure, and an LLM judge is expensive, opaque, and non-deterministic. We address this with Object Aligner (OA), an open-source Python library that scores two JSON objects deterministically by recursively aligning their trees (the Hungarian algorithm for unordered collections, sequence alignment for ordered ones) and awarding partial credit at the granularity the schema declares. The Object Aligner is configured entirely through a set of JSON Schema extensions, so adapting it to a new task involves annotating a schema rather than writing code. Complex structured data, however, are rarely flat trees: records may form graphs or hypergraphs keyed by arbitrary identifiers, breaking the assumptions of prior similarity metrics. Our central contribution, referential alignment, closes this gap by inferring a bijection between gold and candidate identifiers and scoring every reference through it, so the score is invariant to relabeling. Since recovering this bijection exactly is graph isomorphism, the Object Aligner approximates it with Weisfeiler-Leman color refinement. An order-sensitive sequence regime targets ranking and planning. Since the same alignment localizes every mismatch, the Object Aligner emits ranked repair suggestions at no extra cost. Used as a reward inside the GEPA prompt optimizer, Object Aligner helps or stays neutral across all datasets.

顶级标签: llm model evaluation
详细标签: json schema prompt optimization graph alignment structured data similarity metric 或 搜索:

Object Aligner:一种可配置的图结构JSON Schema相似度评分方法及其在大型语言模型提示优化中的应用 / Object Aligner: A Configurable JSON Schema Similarity Score for Graphs, Applied to LLM Prompt Optimization


1️⃣ 一句话总结

本文提出Object Aligner,一个开源Python工具,通过递归对齐JSON对象中的树或图结构(利用匈牙利算法和无序集合对齐、Weisfeiler-Leman算法处理引用关系),提供一种可配置、确定性的相似度评分方法,用于精准评估LLM输出与预期JSON模式的匹配程度,并能在不增加成本的情况下给出修复建议,进而提升提示优化效果。

源自 arXiv: 2607.01972