SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2609.04094 · September 2026

DRACO: Fine-Grained Credit Assignment with Dynamic Rubrics for Long-Horizon Agent Training

Saurabh Goyal, Yara Rizk, Kiran Kate, Shubham Gandhi

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 5 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2609.04094.json · badge: /api/ran/2609.04094.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
IBM/draco canonical (classifier label)
classifier basis: census
7 ran · 5 no recorded run
FunctionStatusWhere it lives
classify_termination Ran
ran; our contract draft was wrong, not the code
IBM/draco/training/src/verl_appworld/agent_loop.py
code served (permissive licence) · get_code("5ff365a40ae6bff8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def _code_body(text: str) -> str:
    """Contents of the first code block in `text` (stripped), or "" if none/empty.
    Distinguishes a real action from the empty <code></code> episode close-out."""
    m = re.search('<code>(.*?)</code>', text, re.DOTALL)
    if m is None:
        m = re.search('```python(.*?)```', text, re.DOTALL)
    return m.group(1).strip() if m else ''

def _has_code(text: str) -> bool:
    return '```python' in text or '<code>' in text

def classify_termination(asst_turns: list[str], done: bool=False, max_turns: int=50) -> dict:
    """Classify how a rollout ended (its BEHAVIOR), from its assistant-turn texts.

    Pure (no I/O) so the live logger and offline backfill share ONE definition.
    `asst_turns` is the ordered list of non-empty assistant-turn texts.

    Two-tier design: the termination cause describes only HOW the agent ended the
    episode, NOT whether the task succeeded. Task success is a SEPARATE metric
    (shadoweval env_success / pass_count==num_tests) reported independently — it is
    deliberately NOT a termination subtype, because in rubric/union mode the tool
    defers scoring to the group barrier and never runs env.evaluate() in its
    done-branch, so `appworld_done` is structurally always False and cannot split
    successful vs unsuccessful here. `done` is recorded for reference only.

    The CORRECT AppWorld termination is: call complete_task(), then a turn with no
    <code> action. So complete_task as the agent's last real action is its
    termination signal.

    Returns the row fields {termination_cause, num_turns, last_turn_is_action,
    had_action}. Categories (mutually exclusive, in order):
      max_turns_awaiting_response    — hit turn cap, final real turn was an action
      max_turns_no_action            — hit turn cap, final turn not an action
      no_action                      — never emitted a real code action
      completed_task                 — last real action called complete_task and the
                                       agent closed out (the correct termination);
                                       success is reported separately, not here
      environment_stopped_responding — final turn was a real, NON-complete action
                                       with no following tool response (true env stop)
      agent_stopped_no_code_action   — ended with an empty <code></code> close-out,
                                       or a clean prose turn, without calling complete_task
      response_length_cutoff         — final prose turn cut off mid-generation
      unknown                        — none of the above
    """
    asst = [t.strip() for t in asst_turns if t and t.strip()]
    num_turns = len(asst)
    last = asst[-1] if asst else ''
    last_has_code = _has_code(last)
    last_code_body = _code_body(last)
    last_is_real_action = last_has_code and bool(last_code_body)
    last_turn_empty_close = last_has_code and (not last_code_body)
    had_action = any((_has_code(t) and _code_body(t) for t in asst))
    last_real = next((t for t in reversed(asst) if _has_code(t) and _code_body(t)), '')
    declared_complete = 'complete_task' in last_real
    at_cap = num_turns >= max_turns
    if at_cap:
        cause = 'max_turns_awaiting_response' if last_is_real_action else 'max_turns_no_action'
    elif not had_action:
        cause = 'no_action'
    elif declared_complete:
        cause = 'completed_task'
    elif last_is_real_action:
        cause = 'environment_stopped_responding'
    elif last_turn_empty_close:
        cause = 'agent_stopped_no_code_action'
    elif last and (not last.endswith(('.', ')', ']', '}', '"', "'", '`', ':'))):
        cause = 'response_length_cutoff'
    elif last:
        cause = 'agent_stopped_no_code_action'
    else:
        cause = 'unknown'
    return {'termination_cause': cause, 'num_turns': num_turns, 'last_turn_is_action': last_is_real_action, 'had_action': had_action}


# Test case: completed_task scenario
ARGS = {
    'asst_turns': [
        "Let me start by exploring the environment.",
        "```python\nprint('hello')\n```",
        "Now I will complete the task.",
        "```python\ncomplete_task()\n```",
        "Task completed successfully."
    ],
    'done': False,
    'max_turns': 50
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_step_quality_scores Ran
ran; our contract draft was wrong, not the code
IBM/draco/training/src/verl_appworld/credit_assignment.py
code served (permissive licence) · get_code("e21951dc6dc00d33")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct valid arguments for compute_step_quality_scores
credit_assignments = [
    {
        'verdict': 'PASS',
        'relevant_steps': [1, 2]
    },
    {
        'verdict': 'PASS',
        'relevant_steps': [2]
    },
    {
        'verdict': 'FAIL',
        'relevant_steps': [1, 3]
    },
    {
        'verdict': 'NOT_APPLICABLE',
        'relevant_steps': [4]
    },
    {
        'verdict': 'FAIL',
        'relevant_steps': [3]
    }
]

num_steps = 4

ARGS = {
    'credit_assignments': credit_assignments,
    'num_steps': num_steps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cos_cat Ran
ran; our contract draft was wrong, not the code
IBM/draco/evals/tau-bench/scoring/score_runs.py
code served (permissive licence) · get_code("98be736bcc80190a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse
import tempfile
import os

# Create a temporary directory for the cache
temp_cache_dir = tempfile.mkdtemp()

# Create a simple argparse.Namespace object with all required attributes
args = argparse.Namespace(
    cache=temp_cache_dir,
    offline=True,  # Set to True to avoid actual AWS calls
    aws_profile='default',
    cos_endpoint='http://localhost:9000',
    bucket='test-bucket'
)

# Define the key parameter
key = 'path/to/results.json'

# Construct the ARGS dict
ARGS = {
    'key': key,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_json Ran
ran; our contract draft was wrong, not the code
IBM/draco/evals/appworld/scoring/score_runs.py
code served (permissive licence) · get_code("f8b09014c8e5645a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
from unittest.mock import Mock

# Create a mock S3 client
cl = Mock()

# Create a mock response with valid JSON
mock_response = {
    'Body': Mock()
}
mock_response['Body'].read.return_value = b'{"key": "value", "number": 42}'

# Configure the mock to return our response
cl.get_object.return_value = mock_response

bucket = "test-bucket"
key = "test-key.json"

ARGS = {
    "cl": cl,
    "bucket": bucket,
    "key": key
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_text Ran
ran; our contract draft was wrong, not the code
IBM/draco/evals/appworld/scoring/score_runs.py
code served (permissive licence) · get_code("13dedb566b256f1d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import io
from unittest.mock import Mock, MagicMock

# Create a mock S3 client
mock_client = Mock()

# Create mock response data
mock_response = {
    'Body': io.BytesIO(b'This is test text content')
}

# Configure the mock to return the response
mock_client.get_object.return_value = mock_response

# Define ARGS with all required parameters
ARGS = {
    'cl': mock_client,
    'bucket': 'test-bucket',
    'key': 'test-key.txt'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load Ran
ran; our contract draft was wrong, not the code
IBM/draco/evals/tau-bench/scoring/score_runs.py
code served (permissive licence) · get_code("68561cf7f6531c1a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json

# Construct a valid raw JSON string that the load function can parse
raw = json.dumps({
    "simulations": [
        {
            "task_id": "task_1",
            "reward_info": {
                "reward": 0.9995
            },
            "messages": [
                {"role": "user", "content": "hello"},
                {"role": "assistant", "content": "hi"},
                {"role": "user", "content": "how are you"},
                {"role": "assistant", "content": "good"}
            ]
        },
        {
            "task_id": "task_2",
            "reward_info": {
                "reward": 0.5
            },
            "messages": [
                {"role": "user", "content": "test"},
                {"role": "assistant", "content": "response"}
            ]
        },
        {
            "task_id": "task_3",
            "reward_info": {
                "reward": 1.0
            },
            "messages": [
                {"role": "user", "content": "msg1"},
                {"role": "assistant", "content": "msg2"},
                {"role": "user", "content": "msg3"}
            ]
        }
    ]
})

ARGS = {
    "raw": raw
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_client Ran
ran; our contract draft was wrong, not the code
IBM/draco/evals/appworld/scoring/score_runs.py
code served (permissive licence) · get_code("f71d2ed346486dd4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned MagicMock. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os

# Set up minimal AWS credentials environment to avoid the sys.exit() call
os.environ['AWS_PROFILE'] = 'default'

# Mock boto3 to avoid actual AWS calls
import sys
from unittest.mock import MagicMock, patch

# Create a mock boto3 module
mock_boto3 = MagicMock()
mock_session = MagicMock()
mock_credentials = MagicMock()  # Non-None to pass the credentials check
mock_client = MagicMock()

mock_session.get_credentials.return_value = mock_credentials
mock_boto3.Session.return_value = mock_session
mock_session.client.return_value = mock_client

sys.modules['boto3'] = mock_boto3

# Define arguments for make_client
ARGS = {
    'endpoint': 'https://s3.amazonaws.com'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
boto3 — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MagicMock — a MagicMock output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MagicMock output the recorded ndim 1 and dtype family None describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
apply_credit_masking_to_advantages Not yet run
unverified (harvested, no recorded run)
IBM/draco/training/src/verl_appworld/credit_advantage_patch.py
code served (permissive licence) · get_code("e24b95859b343cd4")
How it ran

no invocation recorded.

compute_credit_assignment Not yet run
unverified (harvested, no recorded run)
IBM/draco/training/src/verl_appworld/credit_assignment.py
code served (permissive licence) · get_code("6401106acc05a16e")
How it ran

no invocation recorded.

format_credit_assignment_prompt Not yet run
unverified (harvested, no recorded run)
IBM/draco/training/src/verl_appworld/credit_assignment.py
code served (permissive licence) · get_code("02adb23008fc79ca")
How it ran

no invocation recorded.

format_system_prompt Not yet run
unverified (harvested, no recorded run)
IBM/draco/training/src/verl_appworld/prompts.py
code served (permissive licence) · get_code("c444b2dc0758d1bf")
How it ran

no invocation recorded.

rep_cost Not yet run
unverified (harvested, no recorded run)
IBM/draco/evals/tau-bench/scoring/score_runs.py
code served (permissive licence) · get_code("218417ac6290c6ca")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 12 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Reinforcement Learning from Verifiable Rewards works well when a task has a programmatic checker, but most long-horizon agent domains have none. We work in the outcome-blind setting, where ground-truth success signals are not available. Multi-criteria rubrics are a popular way to supply such a reward; they are scored once per trajectory, but a single scalar is a poor signal across tens of steps. We propose DRACO: Distributing Rubric-based Advantage for Credit Optimization. It generates rubrics dynamically during training to track the policy's evolving capability, scores those rubrics once per completed trajectory, and redistributes that judgment over the steps responsible for annotated rubrics to produce differentiated per-step advantages in GRPO. The redistribution is closed-form and does not introduce any trained attribution module. On AppWorld, DRACO gains 15.9 points over the base model and 5.3 points over GRPO trained with a sparse ground-truth reward, despite not using any verifiers itself. On out-of-domain Tau-Bench, it gains 5.3 points over the base model even without a frontier judge, beating both ground-truth-reward training and other rubric-based training settings. The code for DRACO is available at https://github.com/IBM/draco.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2609.04094")
get_code_for_paper("2609.04094")
have("2609.04094")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2609.04094.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2609.04094.svg)](https://syntology.ai/paper/2609.04094)

Connect an agent — have() is free.