[Bug]: JSON Mode Eval exact match conflates Boolean and numeric values

オープン
#23,268 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@JunkaiWang-TheoPhy がすでに取り組んでいます。

2026年12月2日 から。

  • #23269 @JunkaiWang-TheoPhy による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
testing-qa

調査の方向性

Start with tensorrt_llm/evaluate/json_mode_eval.py and inspect JsonModeEval.compute_score, then run the reproduction in the issue; it needs no model or GPU. Add or locate coverage for Boolean versus numeric values nested in objects and arrays, while preserving object key order and equivalent numeric representations. Done when those Boolean and numeric mismatches score 0 and equivalent JSON values still match.

索引モデルが issue の本文から書いたものです。

説明

System Info

TensorRT-LLM main at c29791e46a7ef586921114da197d5d6be899bdaf. Reproduced on CPU with Python 3.12 and the real evaluator. This is score calculation after generation and needs no model or GPU.

Reproduction

Call the scorer with a schema-valid Boolean prediction and a numeric reference:

from types import SimpleNamespace

from tensorrt_llm.evaluate.json_mode_eval import JsonModeEval

evaluator = JsonModeEval.__new__(JsonModeEval)
output = SimpleNamespace(outputs=[SimpleNamespace(text='{"items": [false]}')])
print(evaluator.compute_score([output], ['{"items": [0]}'], ['{"type": "object"}']))

The default dataset exhibits this too. In zero-indexed training row 39, replacing properties.propertiesCount.minimum from the integer 0 with false preserves validation against that row's schema. Pinned NousResearch dataset revision

Expected behavior

Both predictions can be grammar-valid, but their exact-match score should be 0. JSON Boolean and numeric values differ, including when nested inside an object or array. JSON Schema instance equality

Actual behavior

The example above returns 100.0, and the substitution in default dataset row 39 does the same. Python compares False == 0 and also treats these values as equal inside nested containers.

Additional notes

The evaluation should still accept differences in object property order and equivalent JSON numeric representations such as 1 and 1.0. The score can reuse the JSON Schema validator's const semantics.

主要言語
Python
スター
15.2k
フォーク
3k
平均マージ
2日 21時間
マージ済み PR(30日)
477

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/TensorRT-LLM のほかの issue

NVIDIA/TensorRT-LLM の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。