SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.07876 · NeurIPS · 2024

Policy Improvement using Language Feedback Models

Xingdi Yuan, Marc-Alexandre Côté, Dipendra Misra, Victor Zhong

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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; 5 failures of our instrument; 0 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/2402.07876.json · badge: /api/ran/2402.07876.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
vzhong/language_feedback_models canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
adjust_render Ran
ran; our contract draft was wrong, not the code
vzhong/language_feedback_models/experiments/get_llm_feedback.py
code served (permissive licence) · get_code("d75641c0350a54f1")
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 torch

# Read the function to understand what it does:
# - Takes a 'render' string parameter
# - Takes a 'truncate' int parameter with default 7500
# - Processes the render string by finding 'Observation:', extracting steps, formatting them
# - Returns a formatted string

# Construct a valid render string that the function can process
render_input = """
Some header information here
More header lines

Observation:
Action: move forward
Position: (10, 20)
You got a reward of 5

Observation:
Action: turn left
Position: (10, 21)
You got a reward of 2

Available actions: move, turn, jump
"""

ARGS = {
    'render': render_input,
    'truncate': 7500
}
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 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
build_example Ran
ran; our contract draft was wrong, not the code
vzhong/language_feedback_models/experiments/build_bc_data.py
code served (permissive licence) · get_code("89b4a69cba8ab5cc")
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 copy

PROMPT = '\nTask: {task};\nScore: {score};\nObservation: {observation};\nAction history:\n{history};\n'.strip()

PROMPT_STEP = '\n[\nTime: t-{time}\nObservation: {observation};\nAction: {action};\nReward: {reward};\n'.strip()

PROMPT_ORDERED_HEAD = '\nTask: {task};\nScore: {score};\n'.strip()

PROMPT_ORDERED_TAIL = '\n[\nTime: t\nObservation: {observation};\nAction: \n'.lstrip().rstrip('\n')

# Build a minimal context that matches the structure expected by build_example
context = [
    {
        'before': 'This room is called the kitchen. There is a table here.',
        'action': 'go north',
        'reward': 1,
        'ins': 'Find the key'
    },
    {
        'before': 'This room is called the hallway. You see a door.',
        'action': 'open door',
        'reward': 2,
        'ins': 'Find the key'
    },
    {
        'before': 'This outside location is called the garden. The key is here.',
        'action': 'take key',
        'reward': 5,
        'ins': 'Find the key'
    }
]

total_reward = 8

ARGS = {
    'context': context,
    'total_reward': total_reward,
    'reverse': True
}
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_prompt Ran
ran; our contract draft was wrong, not the code
vzhong/language_feedback_models/experiments/prompt_utils.py
code served (permissive licence) · get_code("fe361276102577d5")
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 re
import random

class Config:
    def __init__(self):
        self.history = 'response'
        self.action = ActionConfig()

class ActionConfig:
    def __init__(self):
        self.type = 'admissible'
        self.numbered = True
        self.num_examples = 2

def action_to_string_fn(action):
    if isinstance(action, dict):
        return action.get('name', 'take action')
    return str(action)

traj = [
    {
        'action': 'move',
        'after': {
            'obs': {
                'instruction': 'Pick up the red ball',
                'observation': 'You see a red ball on the ground'
            },
            'info': {
                'action_taken': {'name': 'move forward'},
                'admissible_actions': [
                    'take red ball',
                    'move north',
                    'examine surroundings',
                    'drop inventory'
                ]
            },
            'reward': 1.0
        }
    },
    {
        'action': 'take',
        'after': {
            'obs': {
                'instruction': 'Pick up the red ball',
                'observation': 'You picked up the red ball'
            },
            'info': {
                'action_taken': {'name': 'take red ball'},
                'admissible_actions': [
                    'move north',
                    'move south',
                    'examine ball',
                    'drop ball'
                ]
            },
            'reward': 5.0
        }
    }
]

config = Config()

info = {
    'possible_action_types': [
        'take OBJ',
        'move DIRECTION',
        'examine OBJ',
        'drop OBJ'
    ],
    'possible_objects': [
        'red ball',
        'blue box',
        'key',
        'door'
    ]
}

ARGS = {
    'traj': traj,
    'config': config,
    'action_to_string': action_to_string_fn,
    'info': info
}
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
query_openai Ran
ran; our contract draft was wrong, not the code
vzhong/language_feedback_models/experiments/get_llm_feedback.py
code served (permissive licence) · get_code("99f9e3f30575cb13")
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 openai
import logging
import tenacity as T

# Mock the openai module to avoid actual API calls
class MockChatCompletion:
    @staticmethod
    def create(model=None, deployment_id=None, messages=None, **kwargs):
        return {
            'choices': [{'message': {'content': 'Mock response'}}],
            'usage': {'prompt_tokens': 10, 'completion_tokens': 5}
        }

openai.ChatCompletion = MockChatCompletion()

# Define ARGS dict with all parameters for query_openai
ARGS = {
    'prompt': 'What is the capital of France?',
    'mode': 'openai',
    'model': 'gpt-35-turbo',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai, tenacity — 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
setup_openai Ran
ran; our contract draft was wrong, not the code
vzhong/language_feedback_models/experiments/get_llm_feedback.py
code served (permissive licence) · get_code("aac32e1aa10ecf97")
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
import tempfile
import os

# Create a temporary JSON file with mock OpenAI credentials
temp_dir = tempfile.gettempdir()
secrets_file = os.path.join(temp_dir, 'test_openai_secrets.json')

secrets_dict = {
    'OPENAI_KEY': 'sk-test-key-12345'
}

with open(secrets_file, 'w') as f:
    json.dump(secrets_dict, f)

ARGS = {
    'fname': secrets_file,
    'mode': 'openai'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 5 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

We introduce Language Feedback Models (LFMs) that identify desirable behaviour -actions that help achieve tasks specified in the instruction -for imitation learning in instruction following. To train LFMs, we obtain feedback from Large Language Models (LLMs) on visual trajectories verbalized to language descriptions. First, by using LFMs to identify desirable behaviour to imitate, we improve in task-completion rate over strong behavioural cloning baselines on three distinct language grounding environments (Touchdown, ScienceWorld, and ALFWorld). Second, imitation learning using LFMs outperform using LLMs as experts to directly predict actions, when controlling for the number of LLM output tokens. Third, LFMs generalize to unseen environments, improving task-completion rate by 3.5-12.0% through one round of adaptation. Finally, we modify LFMs to provide human-interpretable feedback without performance loss, allowing human verification of desirable behaviour for imitation learning.

For agents

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

get_harvested_code_for_paper("2402.07876")
get_code_for_paper("2402.07876")
have("2402.07876")

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

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

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

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

Connect an agent — have() is free.