Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#1,142 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@salma2vec 已经在做这个了。

开始于 2026年10月22日。

  • #1143 来自 @salma2vec —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
10.8k
派生
1k
平均合并
12 小时 33 分钟
30 天内合并 PR
126

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OpenPipe/ART 的其他 Issue

查看 OpenPipe/ART 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。