Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

ruler_score_group drops group exceptions, metadata and metrics, and trajectory policy versions

Abierto
#1,142 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@salma2vec ya está trabajando en esto.

Desde el 22/10/2026.

  • #1143 de @salma2vec — 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

Línea de trabajo

Start with art/rewards/ruler.py and trace how ruler_score_group rebuilds trajectories and the group. Compare the fields it preserves with the expected behavior in the issue, then run the reproduction provided in the report. Done means scored groups retain the listed group and trajectory fields while only reward, RULER metrics, and the RULER log line change; pull request #1143 is already open for this issue.

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

Descripción

ruler_score_group rebuilds the group it scores, and the rebuilt group loses everything except the trajectories' messages, reward, metrics, metadata and logs:

  • Group level: exceptions, metadata, metrics and logs are dropped. It returns art.TrajectoryGroup(new_trajectories).
  • Trajectory level: initial_policy_version, final_policy_version and the private _policy_token_counts are dropped, and start_time is reset to the time of scoring.

The documented usage is gather_trajectory_groups(..., after_each=lambda g: ruler_score_group(g, ...)), so every RULER-scored group reaches model.log / training without this information:

  • exception_rate is computed from group.exceptions (model.py), so failed rollouts in a group no longer register. A run whose rollouts are erroring reports an exception rate of 0.
  • metrics_taxonomy reads scenario_id from group.metadata and counts attempted rollouts as len(trajectories) + len(exceptions). Both are lost.
  • Custom group metrics (group_*) disappear from the logged metrics.
  • PipelineTrainer reads the trajectory policy versions and token counts for staleness and policy-age metrics. A group scored inside rollout_fn from a cached or replayed rollout loses its recorded age, and _apply_policy_versions then stamps the current worker version on it.

Reproduced on main at 5f0c1fb, with ruler stubbed (no judge call):

import asyncio, importlib
from types import SimpleNamespace
import art

ruler_module = importlib.import_module("art.rewards.ruler")

async def fake_ruler(message_lists, **kwargs):
    return [SimpleNamespace(score=1.0, explanation="") for _ in message_lists]

ruler_module.ruler = fake_ruler

t = art.Trajectory(
    messages_and_choices=[{"role": "user", "content": "q"}, {"role": "assistant", "content": "a"}],
    initial_policy_version=3, final_policy_version=5,
)
group = art.TrajectoryGroup(
    [t], exceptions=[RuntimeError("rollout failed")],
    metadata={"scenario_id": "s-7"}, metrics={"latency": 1.5},
)
scored = asyncio.run(ruler_module.ruler_score_group(group, "judge"))
print(scored.exceptions, scored.metadata, scored.metrics)
print(scored.trajectories[0].initial_policy_version, scored.trajectories[0].final_policy_version)
[] {} {}
None None

Expected: the scored group keeps its exceptions, metadata, metrics and logs, and each trajectory keeps its policy versions, token counts and start time. Only the reward, ruler_score / independent_reward metrics and the RULER log line should change. The input group should stay untouched, as it is today.

Lenguaje dominante
Python
Estrellas
10.8k
Forks
1k
Merge medio
12 h 33 min
PR fusionados (30 d)
126

Preparar el entorno

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 OpenPipe/ART

Todos los issues de OpenPipe/ART

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.