SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.02155 · NeurIPS · 2022

Training language models to follow instructions with human feedback

Ryan Lowe, Jan Leike, Long Ouyang, Jeff Wu, Paul Christiano, Chong Zhang, John Schulman, Jacob Hilton, Alex Ray, Pamela Mishkin, Sandhini Agarwal, Diogo Almeida, and 8 more

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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 4 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2203.02155.json · badge: /api/ran/2203.02155.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
laion-ai/open-assistant community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
FunctionStatusWhere it lives
batch_inference Ran
ran on a synthesized input
laion-ai/open-assistant/model/model_eval/eval_rm.py
code served (permissive licence) · get_code("cf5703983b5310d1")
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 EvalPrediction. 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
import numpy as np
from transformers.trainer_utils import EvalPrediction
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.device_val = 'cpu'
    
    @property
    def device(self):
        return self.device_val
    
    def forward(self, input_ids, attention_mask):
        # Return object with logits attribute
        class Output:
            def __init__(self, logits_tensor):
                self.logits = logits_tensor
        
        # input_ids shape: (batch_size, seq_len) -> (2, 4)
        # output logits: (batch_size, num_labels) -> (2, 3)
        logits = self.linear(input_ids.float())
        return Output(logits)

model = MinimalModel()

# Create batch input: dictionary with input_ids and attention_mask
batch = {
    'input_ids': torch.randint(0, 100, (2, 4)),  # batch_size=2, seq_len=4
    'attention_mask': torch.ones((2, 4))  # batch_size=2, seq_len=4
}

# cu_lens (cumulative lengths) for 2 samples: [0, 1, 2]
# This means sample 0 has 1 token, sample 1 has 1 token
cu_lens = np.array([0, 1, 2])

inputs = (batch, cu_lens)

ARGS = {
    'inputs': inputs,
    'model': model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EvalPrediction — a EvalPrediction output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a EvalPrediction 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
batch_inference Ran
ran on a synthesized input
laion-ai/open-assistant/model/model_eval/sampling_score.py
code served (permissive licence) · get_code("45981d36c1069760")
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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 1)
        self.device = torch.device('cpu')
    
    def forward(self, input_ids, attention_mask=None):
        # Create a simple output with logits
        logits = self.linear(input_ids)
        
        class Output:
            pass
        
        output = Output()
        output.logits = logits
        return output

model = SimpleModel()

# Create a simple dataloader (list of dicts with tensors)
dataloader = [
    {
        'input_ids': torch.randn(2, 4),
        'attention_mask': torch.ones(2, 4),
        'sampling': torch.randn(2, 3)
    },
    {
        'input_ids': torch.randn(2, 4),
        'attention_mask': torch.ones(2, 4),
        'sampling': torch.randn(2, 3)
    }
]

ARGS = {
    'model': model,
    'dataloader': dataloader
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
describe_samples Ran
ran on a synthesized input
laion-ai/open-assistant/model/model_eval/utils.py
code served (permissive licence) · get_code("b43436c7df4225f4")
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 numpy as np

torch_seed = 0

# The function expects 'samples' which is a list of dicts
# Each dict has an 'outputs' key containing items where each item
# is indexable and item[1] gives a reward score (float-convertible)

samples = [
    {
        'outputs': [
            (0, 0.5),
            (1, 0.7),
            (2, 0.3)
        ]
    },
    {
        'outputs': [
            (0, 0.9),
            (1, 0.2)
        ]
    }
]

ARGS = {
    'samples': samples
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
load_sampling_data Ran
ran on a synthesized input
laion-ai/open-assistant/model/model_eval/utils.py
code served (permissive licence) · get_code("8825793b366ca162")
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 os
import tempfile

# Create a temporary directory and file for testing
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "sampling_data.json")

# Create valid sampling data matching the function's requirements
sampling_data = {
    "prompts": [
        {
            "prompt": "What is the capital of France?",
            "results": ["Paris", "The capital is Paris"]
        },
        {
            "prompt": "What is 2+2?",
            "results": ["4", "The answer is 4"]
        }
    ]
}

# Write the data to the temporary file
with open(temp_file, 'w') as f:
    json.dump(sampling_data, f)

# Define ARGS with the path to the temporary file
ARGS = {
    "path": temp_file
}
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

Also present in other papers' code

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

Making language models bigger does not inherently make them better at following a user's intent. For example, large language models can generate outputs that are untruthful, toxic, or simply not helpful to the user. In other words, these models are not aligned with their users. In this paper, we show an avenue for aligning language models with user intent on a wide range of tasks by fine-tuning with human feedback. Starting with a set of labeler-written prompts and prompts submitted through the OpenAI API, we collect a dataset of labeler demonstrations of the desired model behavior, which we use to fine-tune GPT-3 using supervised learning. We then collect a dataset of rankings of model outputs, which we use to further fine-tune this supervised model using reinforcement learning from human feedback. We call the resulting models InstructGPT. In human evaluations on our prompt distribution, outputs from the 1.3B parameter InstructGPT model are preferred to outputs from the 175B GPT-3, despite having 100x fewer parameters. Moreover, InstructGPT models show improvements in truthfulness and reductions in toxic output generation while having minimal performance regressions on public NLP datasets. Even though InstructGPT still makes simple mistakes, our results show that fine-tuning with human feedback is a promising direction for aligning language models with human intent.

For agents

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

get_harvested_code_for_paper("2203.02155")
get_code_for_paper("2203.02155")
have("2203.02155")

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

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

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

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

Connect an agent — have() is free.