SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.06560 · ICLR · 2025

Inverse Constitutional AI: Compressing Preferences into Principles

Germany, Robert Mullins, Arduin Findeis, Timo Kaufmann, Munich Munich

arXiv · PDF · Open in the Atlas

Code that ran

6 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 3 failures of our instrument; 4 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/2406.06560.json · badge: /api/ran/2406.06560.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
rdnfn/icai canonical (classifier label)
classifier basis: classifier_2025
6 ran · 4 no recorded run
FunctionStatusWhere it lives
AlpacaEvalAnnotatorConfig Ran
ran on a synthesized input · constructed an object; no result was computed
rdnfn/icai/src/inverse_cai/algorithm/proposal.py
code served (permissive licence) · get_code("fad9c323896389d9")
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 an instance of its own class, AlpacaEvalAnnotatorConfig: the run constructed the object and did not call it, so no result was computed. 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.

from dataclasses import dataclass, field
from typing import Optional, Union

# Define ARGS dictionary with all parameters for AlpacaEvalAnnotatorConfig
ARGS = {
    "skip": False,
    "create_other_annotator_tmp_configs": True,
    "constitution": None,
    "is_single_annotator": True,
    "base_constitutional_annotator_configs": ["gpt4omini_fn_constitutional_base_neutral_v2"],
    "other_annotator_configs": ["alpaca_eval_gpt4omini_fn_noinstruction"],
}
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 AlpacaEvalAnnotatorConfig — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AlpacaEvalAnnotatorConfig 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
AnnotatorConfig Ran
ran on a synthesized input · constructed an object; no result was computed
rdnfn/icai/src/inverse_cai/algorithm/proposal.py
code served (permissive licence) · get_code("3c4ba0e3b3c33583")
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 an instance of its own class, AnnotatorConfig: the run constructed the object and did not call it, so no result was computed. 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
from dataclasses import dataclass, field
from typing import Optional, Union

torch.manual_seed(0)

@dataclass
class AlpacaEvalAnnotatorConfig:
    """Configuration for the AI annotator."""
    skip: bool = False
    create_other_annotator_tmp_configs: bool = True
    constitution: Optional[Union[str, bool]] = None
    is_single_annotator: bool = True
    base_constitutional_annotator_configs: list[str] = field(default_factory=lambda: ['gpt4omini_fn_constitutional_base_neutral_v2'])
    other_annotator_configs: list[str] = field(default_factory=lambda: ['alpaca_eval_gpt4omini_fn_noinstruction'])

@dataclass
class FunctionAnnotatorConfig:
    """Configuration for a annotator based on a Python function."""
    function: Optional[str] = None
    function_module_to_import: Optional[str] = None
    function_kwargs: dict = field(default_factory=dict)

@dataclass
class AnnotatorConfig:
    """Configuration for the AI annotator."""
    alpaca_eval: AlpacaEvalAnnotatorConfig = field(default_factory=AlpacaEvalAnnotatorConfig)
    fn_annotators: list[FunctionAnnotatorConfig] = field(default_factory=list)
    skip: bool = False
    test_data_only: bool = False
    create_other_annotator_tmp_configs: bool = True
    constitution: Optional[Union[str, bool]] = None
    is_single_annotator: bool = False
    base_constitutional_annotator_configs: list[str] = field(default_factory=lambda: [])
    other_annotator_configs: list[str] = field(default_factory=lambda: [])

    def __post_init__(self):
        """Check if deprecated config values are being used."""
        self._check_deprecated_config()

    def _check_deprecated_config(self):
        """Check if deprecated configuration options are set to non-default values."""
        deprecated_fields = {'create_other_annotator_tmp_configs': (True, 'alpaca_eval.create_other_annotator_tmp_configs'), 'constitution': (None, 'alpaca_eval.constitution'), 'is_single_annotator': (False, 'alpaca_eval.is_single_annotator'), 'base_constitutional_annotator_configs': ([], 'alpaca_eval.base_constitutional_annotator_configs'), 'other_annotator_configs': ([], 'alpaca_eval.other_annotator_configs')}
        warnings = []
        for field_name, (default_value, replacement) in deprecated_fields.items():
            current_value = getattr(self, field_name)
            if isinstance(default_value, list) and current_value != default_value:
                warnings.append(f'{field_name} is deprecated, use {replacement} instead')
            elif not isinstance(default_value, list) and current_value != default_value:
                warnings.append(f'annotator.{field_name} is deprecated, use annotator.{replacement} instead.')
        if warnings:
            for warning in warnings:
                pass
            raise ValueError('These deprecated config options found, please update your config file as suggested in Error log above.')

ARGS = {
    'alpaca_eval': AlpacaEvalAnnotatorConfig(
        skip=False,
        create_other_annotator_tmp_configs=True,
        constitution=None,
        is_single_annotator=True,
        base_constitutional_annotator_configs=['gpt4omini_fn_constitutional_base_neutral_v2'],
        other_annotator_configs=['alpaca_eval_gpt4omini_fn_noinstruction']
    ),
    'fn_annotators': [],
    'skip': False,
    'test_data_only': False,
    'create_other_annotator_tmp_configs': True,
    'constitution': None,
    'is_single_annotator': False,
    'base_constitutional_annotator_configs': [],
    'other_annotator_configs': []
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
loguru, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AnnotatorConfig — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AnnotatorConfig 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
FunctionAnnotatorConfig Ran
ran on a synthesized input · constructed an object; no result was computed
rdnfn/icai/src/inverse_cai/algorithm/proposal.py
code served (permissive licence) · get_code("59a4167a57113c68")
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 an instance of its own class, FunctionAnnotatorConfig: the run constructed the object and did not call it, so no result was computed. 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
from dataclasses import dataclass, field
from typing import Optional, Any, Union

torch.manual_seed(0)

# Define a simple stand-in function that could be imported
def sample_annotation_function(data, threshold=0.5):
    """A simple function for annotation purposes."""
    return data > threshold

# Build the ARGS dictionary with valid arguments for FunctionAnnotatorConfig
ARGS = {
    "function": "sample_annotation_function",
    "function_module_to_import": "builtins",
    "function_kwargs": {
        "threshold": 0.7,
    },
}
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 FunctionAnnotatorConfig — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FunctionAnnotatorConfig 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
clean_principle_str Ran
ran; our contract draft was wrong, not the code
rdnfn/icai/src/inverse_cai/algorithm/proposal.py
code served (permissive licence) · get_code("cf0ddec0199e9097")
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
import numpy as np

# The function clean_principle_str takes a single string parameter
# and performs various string operations on it.
# Let's create a test case that exercises the cleaning logic.

principle_str = "```json\n{\"key\": \"value\"}\n```"

ARGS = {
    "principle_str": principle_str
}
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 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_preferred_text Ran
ran; our contract draft was wrong, not the code
rdnfn/icai/src/inverse_cai/algorithm/proposal.py
code served (permissive licence) · get_code("56041d176337cc61")
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

torch.manual_seed(0)

# The function expects a row (dict-like object) with keys:
# - 'preferred_text': a string indicating which text to return ('text_a' or 'text_b')
# - 'text_a': the first text option
# - 'text_b': the second text option

row = {
    'preferred_text': 'text_a',
    'text_a': 'This is text A',
    'text_b': 'This is text B'
}

ARGS = {
    'row': row
}
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
get_rejected_text Ran
ran; our contract draft was wrong, not the code
rdnfn/icai/src/inverse_cai/algorithm/proposal.py
code served (permissive licence) · get_code("d1252752dc993a17")
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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - Takes a single parameter 'row'
# - 'row' is accessed like a dict with keys: 'preferred_text', 'text_a', 'text_b'
# - Returns either row['text_b'] or row['text_a'] based on preferred_text value

# Create a valid row dict
row = {
    'preferred_text': 'text_a',
    'text_a': 'This is text A',
    'text_b': 'This is text B'
}

ARGS = {
    'row': row
}
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 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
ExpConfig Not yet run
unverified (harvested, no recorded run)
rdnfn/icai/src/inverse_cai/algorithm/proposal.py
code served (permissive licence) · get_code("2417283750496843")
How it ran

no invocation recorded.

PromptConfig Not yet run
unverified (harvested, no recorded run)
rdnfn/icai/src/inverse_cai/algorithm/proposal.py
code served (permissive licence) · get_code("d93fe6772a75b268")
How it ran

no invocation recorded.

generate_principles_from_feedback Not yet run
unverified (harvested, no recorded run)
rdnfn/icai/src/inverse_cai/algorithm/proposal.py
code served (permissive licence) · get_code("7aeeac243f7d0d42")
How it ran

no invocation recorded.

generate_principles_from_single_ranking Not yet run
unverified (harvested, no recorded run)
rdnfn/icai/src/inverse_cai/algorithm/proposal.py
code served (permissive licence) · get_code("7e33551b08a8b93b")
How it ran

no invocation recorded.

Also present in other papers' code

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

Feedback data is widely used for fine-tuning and evaluating state-of-the-art AI models. Pairwise text preferences, where human or AI annotators select the "better" of two options, are particularly common. Such preferences are used to train (reward) models or to rank models with aggregate statistics. For many applications it is desirable to understand annotator preferences in addition to modelling them -not least because extensive prior work has shown various unintended biases in preference datasets. Yet, preference datasets remain challenging to interpret. Neither black-box reward models nor statistics can answer why one text is preferred over another. Manual interpretation of the numerous (long) response pairs is usually equally infeasible. In this paper, we introduce the Inverse Constitutional AI (ICAI) problem, formulating the interpretation of pairwise text preference data as a compression task. In constitutional AI, a set of principles (a constitution) is used to provide feedback and fine-tune AI models. ICAI inverts this process: given a feedback dataset, we aim to extract a constitution that best enables a large language model (LLM) to reconstruct the original annotations. We propose a corresponding ICAI algorithm and validate its generated constitutions quantitatively based on annotation reconstruction accuracy on several datasets: (a) synthetic feedback data with known principles; (b) AlpacaEval cross-annotated human feedback data; (c) crowdsourced Chatbot Arena data; and (d) PRISM data from diverse demographic groups. As an example application, we further demonstrate the detection of biases in human feedback data. As a short and interpretable representation of the original dataset, generated constitutions have many potential use cases: they may help identify undesirable annotator biases, better understand model performance, scale feedback to unseen data, or assist with adapting AI models to individual user or group preferences. We release the source code for our algorithm and experiments at https://github.com/rdnfn/icai.

For agents

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

get_harvested_code_for_paper("2406.06560")
get_code_for_paper("2406.06560")
have("2406.06560")

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

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

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

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

Connect an agent — have() is free.