SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.05518 · 2024

Bias-Augmented Consistency Training Reduces Biased Reasoning in Chain-of-Thought

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2403.05518.json · badge: /api/ran/2403.05518.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
raybears/cot-transparency canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
combine_indicator_with_separator Ran
ran; our contract draft was wrong, not the code
raybears/cot-transparency/cot_transparency/data_models/example_base.py
code served (permissive licence) · get_code("027aa06d7b084853")
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.

from enum import Enum

class IndicatorSeparator(str, Enum):
    DOT = 'dot'
    PAREN = 'paren'

def combine_indicator_with_separator(indicator: str, separator: IndicatorSeparator) -> str:
    match separator:
        case IndicatorSeparator.DOT:
            return f'{indicator}. '
        case IndicatorSeparator.PAREN:
            return f'({indicator}) '

ARGS = {
    'indicator': 'Note',
    'separator': IndicatorSeparator.DOT
}
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
convert_slist_to_df Ran
ran; our contract draft was wrong, not the code
raybears/cot-transparency/cot_transparency/data_models/pd_utils.py
code served (permissive licence) · get_code("2bd7687eb85b154b")
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 DataFrame. 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 pandas as pd
from abc import ABC, abstractmethod
from typing import Generic, TypeVar, Sequence

T_co = TypeVar('T_co')
T_contra = TypeVar('T_contra', contravariant=True)

class BaseExtractor(ABC, Generic[T_contra]):
    """
    column_names: list[str], the names of the columns that will be extracted
    extract: (output: TaskOutput) -> Sequence[str | float | None | bool]
        the function that will be used to extract the data must return a list of the same length as column_names
    """
    column_names: list[str]

    @abstractmethod
    def extract(self, output: T_contra) -> Sequence[str | float | None | bool]:
        pass

def convert_slist_to_df(slist: Sequence[T_co], extractors: Sequence[BaseExtractor[T_co]]) -> pd.DataFrame:
    """
    Converts an slist of TaskOutputs to a pandas dataframe using the extract method of the extractors passed in.
    """
    columns_names = []
    for extractor in extractors:
        columns_names.extend(extractor.column_names)
    rows = []
    for output in slist:
        row = []
        for extractor in extractors:
            row.extend(extractor.extract(output))
        rows.append(row)
    return pd.DataFrame.from_records(rows, columns=columns_names)


# Define a simple output type
class TaskOutput:
    def __init__(self, value: float, name: str, flag: bool):
        self.value = value
        self.name = name
        self.flag = flag


# Define concrete extractor implementations
class ValueExtractor(BaseExtractor[TaskOutput]):
    def __init__(self):
        self.column_names = ["value", "scaled_value"]
    
    def extract(self, output: TaskOutput) -> Sequence[str | float | None | bool]:
        return [output.value, output.value * 2.0]


class NameExtractor(BaseExtractor[TaskOutput]):
    def __init__(self):
        self.column_names = ["name", "flag"]
    
    def extract(self, output: TaskOutput) -> Sequence[str | float | None | bool]:
        return [output.name, output.flag]


# Create test data
torch.manual_seed(0)

task_outputs = [
    TaskOutput(value=1.5, name="task_1", flag=True),
    TaskOutput(value=2.7, name="task_2", flag=False),
]

extractors = [
    ValueExtractor(),
    NameExtractor(),
]

ARGS = {
    "slist": task_outputs,
    "extractors": extractors,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
deterministic_hash Ran
ran; our contract draft was wrong, not the code
raybears/cot-transparency/cot_transparency/util.py
pointer only (licence: MIT); the stored copy get_code serves, from felixbinder/introspection_self_prediction, is pointer only (licence: NONE) · get_code("a2e49f02b84ed98b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from felixbinder/introspection_self_prediction, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_exp_dir_name Ran
ran; our contract draft was wrong, not the code
raybears/cot-transparency/cot_transparency/util.py
code served (permissive licence) · get_code("9cfc88dfbeeda546")
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 datetime
import os

def get_exp_dir_name(exp_dir: str = None, experiment_suffix: str = None, sub_dir: str = None, root: str = './experiments'):
    if exp_dir is None:
        root = './experiments'
        if sub_dir:
            root = os.path.join(root, sub_dir)
        now = datetime.datetime.now().strftime('%Y%m%d')
        exp_dir = os.path.join(root, now)
    if experiment_suffix:
        exp_dir += f'_{experiment_suffix}'
    return exp_dir


ARGS = {
    'exp_dir': None,
    'experiment_suffix': 'test_suffix',
    'sub_dir': 'subdir_name',
    'root': './experiments'
}
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
is_openai_finetuned Ran
ran, violated the contract we drafted
raybears/cot-transparency/cot_transparency/data_models/config.py
code served (permissive licence) · get_code("b37de94d749b28d8")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

def is_openai_finetuned(model_name: str) -> bool:
    return 'ft:gpt' in model_name or ':ft' in model_name

ARGS = {
    'model_name': 'ft:gpt-4-20240613'
}
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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_logger Ran
ran; our contract draft was wrong, not the code
raybears/cot-transparency/cot_transparency/util.py
code served (permissive licence) · get_code("3ae749132f5cb915")
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 Logger. 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 logging

ARGS = {
    "name": "test_logger",
    "level": logging.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 Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
raise_if_not_multiple_choice_answer Not yet run
unverified (harvested, no recorded run)
raybears/cot-transparency/cot_transparency/data_models/example_base.py
code served (permissive licence) · get_code("814075f8ce28cb2d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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.

FunctionAlso present inEarliest-datedOthers named
deterministic_hash 1 other paper
1 later
2410.13787 (2024-10)
Looking Inward: Language Models Can Learn About Themselves by Introspection

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-23.

Repositories linked to this paper

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

Abstract

Chain-of-thought prompting (CoT) has the potential to improve the explainability of language model reasoning. But CoT can also systematically misrepresent the factors influencing models' behavior -- for example, rationalizing answers in line with a user's opinion. We first create a new dataset of 9 different biases that affect GPT-3.5-Turbo and Llama-8b models. These consist of spurious-few-shot patterns, post hoc rationalization, and sycophantic settings. Models switch to the answer implied by the bias, without mentioning the effect of the bias in the CoT. To mitigate this biased reasoning problem, we introduce bias-augmented consistency training (BCT), an unsupervised fine-tuning scheme that trains models to give consistent reasoning across prompts with and without biasing features. We construct a suite testing nine forms of biased reasoning on seven question-answering tasks, and find that applying BCT to GPT-3.5-Turbo with one bias reduces the rate of biased reasoning by 86\% on held-out tasks. Moreover, this model generalizes to other forms of bias, reducing biased reasoning on held-out biases by an average of 37\%. As BCT generalizes to held-out biases and does not require gold labels, this method may hold promise for reducing biased reasoning from as-of-yet unknown biases and on tasks where ground truth reasoning is unavailable.

For agents

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

get_harvested_code_for_paper("2403.05518")
get_code_for_paper("2403.05518")
have("2403.05518")

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

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

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

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

Connect an agent — have() is free.