SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.15018 · ACL · 2024

Unintended Impacts of LLM Alignment on Global Representation

Diyi Yang, Michael Joseph Ryan, William B. Held

arXiv · PDF · Open in the Atlas

Code that ran

5 of 11 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; 2 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 2 failures of our instrument; 6 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/2402.15018.json · badge: /api/ran/2402.15018.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
salt-nlp/unintended-impacts-of-alignment canonical (classifier label)
classifier basis: census
5 ran · 6 no recorded run
FunctionStatusWhere it lives
compute_negative_log_likelihoods Ran
ran, honoured the contract we drafted
salt-nlp/unintended-impacts-of-alignment/code/ask-reddit-perplexity-testing.py
code served (permissive licence) · get_code("292ef38a85bc5792")
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 Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn

torch.manual_seed(0)

class MockTokenizer:
    def encode(self, text, return_tensors=None):
        # Return a tensor of token IDs with shape (1, sequence_length)
        # Use consistent but small token sequences
        tokens = [101] + [token_id for token_id in range(102, 102 + len(text) % 5)]
        token_tensor = torch.tensor([tokens], dtype=torch.long)
        return token_tensor

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(1000, 4)
        self.lm_head = nn.Linear(4, 1000)
    
    def forward(self, input_ids, labels=None):
        # Return a mock output with a loss attribute
        embeddings = self.embedding(input_ids)
        logits = self.lm_head(embeddings)
        
        loss = None
        if labels is not None:
            loss_fn = nn.CrossEntropyLoss()
            loss = loss_fn(logits.view(-1, 1000), labels.view(-1))
        
        class Output:
            pass
        
        output = Output()
        output.loss = loss
        return output

tokenizer = MockTokenizer()
model = MockModel()
prompt = "What is the answer?"
answers = ["The answer is 42.", "I don't know."]
device = 'cpu'

ARGS = {
    'prompt': prompt,
    'answers': answers,
    'tokenizer': tokenizer,
    'model': model,
    'device': device
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
compute_negative_log_likelihoods Ran
ran, honoured the contract we drafted
salt-nlp/unintended-impacts-of-alignment/code/belebele.py
code served (permissive licence) · get_code("d93bb71a63350c87")
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 Tensor, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def encode(self, text, return_tensors=None):
        # Return a simple token tensor
        tokens = torch.tensor([[1, 2, 3, 4, 5, 6]], dtype=torch.long)
        if return_tensors == 'pt':
            return tokens
        return tokens.tolist()

# Create a minimal language model
class MinimalLM(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(10, 4)
        self.linear = nn.Linear(4, 10)
    
    def forward(self, input_ids, labels=None):
        # Minimal forward pass that returns a loss
        embeds = self.embedding(input_ids)
        logits = self.linear(embeds)
        
        if labels is not None:
            loss_fn = nn.CrossEntropyLoss()
            # Reshape for loss computation
            loss = loss_fn(logits.view(-1, 10), labels.view(-1))
        else:
            loss = None
        
        # Return an object with a loss attribute
        class Output:
            pass
        
        output = Output()
        output.loss = loss
        return output

# Create instances
tokenizer = MinimalTokenizer()
model = MinimalLM()

prompt_template = 'Given the following passage, please answer the following question.  Use the following format:\n\nContext: A passage containing the answer to the question.\nQuestion: The question being asked.\nChoices: The possible answers to the question.\nBased on the choices the answer is: The correct answer to the question: A, B, C, or D.\n\n---\n\nContext: {context}\nQuestion: {question}\nChoices: {choices}\nBased on the choices the answer is: '

answers = ['A', 'B', 'C', 'D']

ARGS = {
    'prompt': prompt_template,
    'answers': answers,
    'tokenizer': tokenizer,
    'model': model,
    'device': 'cpu'
}
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 Tensor, ndim 1, dtype family float, shape (4,) — shape (4,) 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
convert_iso_code_to_language_name Ran
ran; our contract draft was wrong, not the code
salt-nlp/unintended-impacts-of-alignment/code/belebele.py
code served (permissive licence) · get_code("6a5d0168a52f7d49")
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 convert_iso_code_to_language_name takes a single parameter 'code'
# which is expected to be a string ISO language code (like 'eng_Latn', 'fra_Latn', etc.)
# The function looks up the code in a language_map dictionary and returns the language name,
# or returns the code itself if not found.

ARGS = {
    'code': 'eng_Latn'
}
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
generate_country_prompts Ran
ran; our contract draft was wrong, not the code
salt-nlp/unintended-impacts-of-alignment/code/reward-testing.py
code served (permissive licence) · get_code("c904819afc630c4d")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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

def should_add_article(country):
    keywords = ['Islands', 'Island', 'States', 'Republic', 'United']
    special_cases = ['Bahamas', 'Gambia', 'Netherlands', 'Ivory Coast', 'Philippines', 'Maldives', 'Seychelles', 'Russian Federation', 'Vatican']
    if country in special_cases:
        return True
    for keyword in keywords:
        if keyword in country:
            return True
    return False

def generate_country_prompts(countries, prompt_template, add_article=True):
    prompts = []
    for country in countries:
        if add_article and should_add_article(country):
            prompts.append(prompt_template.format(country='the ' + country))
        else:
            prompts.append(prompt_template.format(country=country))
    return prompts

# Setup code to construct valid arguments
countries = ['France', 'United States', 'Bahamas', 'New Zealand']
prompt_template = 'This is a prompt about {country}.'
add_article = True

ARGS = {
    'countries': countries,
    'prompt_template': prompt_template,
    'add_article': add_article
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
should_add_article Ran
ran, violated the contract we drafted
salt-nlp/unintended-impacts-of-alignment/code/ask-reddit-perplexity-testing.py
code served (permissive licence) · get_code("98a3c96a35040079")
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
import numpy as np

# The function takes a single parameter: country (a string)
# It checks if the country name contains certain keywords or is in a special cases list
# No complex objects needed - just a string argument

ARGS = {
    'country': 'United States'
}
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 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
generate_answer Not yet run
unverified (harvested, no recorded run)
salt-nlp/unintended-impacts-of-alignment/code/md3game.py
code served (permissive licence) · get_code("ea124a9e59aa3d97")
How it ran

no invocation recorded.

get_rewards Not yet run
unverified (harvested, no recorded run)
salt-nlp/unintended-impacts-of-alignment/code/ask-reddit-reward-testing.py
code served (permissive licence) · get_code("c0b8cf9d3d7e3400")
How it ran

no invocation recorded.

get_rewards Not yet run
unverified (harvested, no recorded run)
salt-nlp/unintended-impacts-of-alignment/code/reward-testing.py
code served (permissive licence) · get_code("8e058265eaeef576")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
salt-nlp/unintended-impacts-of-alignment/code/md3game.py
code served (permissive licence) · get_code("1c3dd0abf6725ebd")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
salt-nlp/unintended-impacts-of-alignment/code/ask-reddit-perplexity-testing.py
code served (permissive licence) · get_code("53bbc4b31f140ab9")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
salt-nlp/unintended-impacts-of-alignment/code/ask-reddit-reward-testing.py
code served (permissive licence) · get_code("09fad9c068cf3e99")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 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

Before being deployed for user-facing applications, developers align Large Language Models (LLMs) to user preferences through a variety of procedures, such as Reinforcement Learning From Human Feedback (RLHF) and Direct Preference Optimization (DPO). Current evaluations of these procedures focus on benchmarks of instruction following, reasoning, and truthfulness. However, human preferences are not universal, and aligning to specific preference sets may have unintended effects. We explore how alignment impacts performance along three axes of global representation: English dialects, multilingualism, and opinions from and about countries worldwide. Our results show that current alignment procedures create disparities between English dialects and global opinions. We find alignment improves capabilities in several languages. We conclude by discussing design decisions that led to these unintended impacts and recommendations for more equitable preference tuning. We make our code and data publicly available on Github 1 .

For agents

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

get_harvested_code_for_paper("2402.15018")
get_code_for_paper("2402.15018")
have("2402.15018")

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

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

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

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

Connect an agent — have() is free.