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

Abierto
#23,268 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@JunkaiWang-TheoPhy ya está trabajando en esto.

Desde el 2/12/2026.

  • #23269 de @JunkaiWang-TheoPhy — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
testing-qa

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
15.2k
Forks
3k
Merge medio
2 d 21 h
PR fusionados (30 d)
477

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NVIDIA/TensorRT-LLM

Todos los issues de NVIDIA/TensorRT-LLM

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.