SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.15230 · EMNLP · 2022

How well can Text-to-Image Generative Models understand Ethical Natural Language Interventions?

Kai-Wei Chang, Da Yin, Hritik Bansal, Masoud Monajatipoor

arXiv · PDF · Open in the Atlas

Code that ran

5 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, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 2 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/2210.15230.json · badge: /api/ran/2210.15230.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
hritikbansal/entigen_emnlp canonical (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
FunctionStatusWhere it lives
clip_forward Ran
ran on a synthesized input
hritikbansal/entigen_emnlp/biases/score_clip.py
code served (permissive licence) · get_code("b0a5fdc3d1543189")
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

torch.manual_seed(0)

class SimpleClipModel(nn.Module):
    def __init__(self, image_dim=4, text_dim=3, feature_dim=5):
        super().__init__()
        self.image_encoder = nn.Linear(image_dim, feature_dim)
        self.text_encoder = nn.Linear(text_dim, feature_dim)
        self.logit_scale = nn.Parameter(torch.tensor(1.0))
    
    def encode_image(self, image):
        return self.image_encoder(image)
    
    def encode_text(self, text):
        return self.text_encoder(text)

model = SimpleClipModel(image_dim=4, text_dim=3, feature_dim=5)

# Batch size 2, image dimension 4
image = torch.randn(2, 4)

# Batch size 2, text dimension 3
text = torch.randn(2, 3)

ARGS = {
    "model": model,
    "image": image,
    "text": text
}
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 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
cutoff_topk_logits Ran
ran on a synthesized input
hritikbansal/entigen_emnlp/models/minDALL-E/dalle/utils/sampling.py
code served (permissive licence) · get_code("67105b92f0a7dddb")
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 2, dtype family float, shape (2, 4) 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

torch.manual_seed(0)

# Create a small batch of logits
# Shape: (batch_size=2, vocab_size=4)
logits = torch.randn(2, 4)

# Create a small positive integer for k (top-k cutoff)
k = 2

ARGS = {
    "logits": logits,
    "k": k,
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
cutoff_topp_probs Ran
ran on a synthesized input
hritikbansal/entigen_emnlp/models/minDALL-E/dalle/utils/sampling.py
code served (permissive licence) · get_code("6d7b37c2cf95fb65")
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 2, dtype family float, shape (2, 4) 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

torch.manual_seed(0)

# Create a small probability distribution tensor
# Shape: (batch_size=2, vocab_size=4)
# Values should sum to 1 along the last dimension
probs = torch.tensor([
    [0.5, 0.3, 0.15, 0.05],
    [0.25, 0.25, 0.25, 0.25]
], dtype=torch.float32)

# Normalize to ensure valid probabilities
probs = probs / probs.sum(dim=-1, keepdim=True)

p = 0.9

ARGS = {
    "probs": probs,
    "p": p
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
get_positional_encoding Ran
ran on a synthesized input
hritikbansal/entigen_emnlp/models/minDALL-E/dalle/utils/sampling.py
code served (permissive licence) · get_code("50f4d2c873a7aa5f")
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 2, dtype family int, shape (2, 4) 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

torch.manual_seed(0)

# Test case 1: 1d mode
inputs_1d = torch.randint(0, 10, (2, 4), dtype=torch.long)

ARGS = {
    'inputs': inputs_1d,
    'mode': '1d'
}
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 2, dtype family int, shape (2, 4) — shape (2, 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
realpath_url_or_path Ran
ran on a synthesized input
hritikbansal/entigen_emnlp/models/minDALL-E/dalle/utils/utils.py
code served (permissive licence) · get_code("d03334a78a33ccd1")
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 os
import tempfile
import hashlib
import tarfile
import urllib.parse

# Create a temporary directory for testing
temp_root = tempfile.mkdtemp()

# Test case 1: Local file path (no URL scheme)
local_path = "/path/to/local/file.txt"

# Test case 2: HTTP URL with mock structure
# The function expects url_or_path to be either a URL or a local path
# For URL case: it calls download(url_or_path, root)
# For local path case: it just returns url_or_path
http_url = "http://example.com/hash123/model.tar.gz"

ARGS = {
    "url_or_path": local_path,
    "root": temp_root
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — 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_tokenizer Not yet run
unverified (harvested, no recorded run)
hritikbansal/entigen_emnlp/models/minDALL-E/dalle/models/tokenizer.py
code served (permissive licence) · get_code("0d23c31b80ba171d")
How it ran

no invocation recorded.

download Not yet run
unverified (harvested, no recorded run)
hritikbansal/entigen_emnlp/models/minDALL-E/dalle/utils/utils.py
code served (permissive licence) · get_code("7469c69b65f2718f")
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, 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 7 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

Text-to-image generative models have achieved unprecedented success in generating highquality images based on natural language descriptions. However, it is shown that these models tend to favor specific social groups when prompted with neutral text descriptions (e.g., 'a photo of a lawyer'). Following Zhao et al. (2021), we study the effect on the diversity of the generated images when adding ethical intervention that supports equitable judgment (e.g., 'if all individuals can be a lawyer irrespective of their gender') in the input prompts. To this end, we introduce an Ethical NaTural Language Interventions in Text-to-Image GENeration (ENTIGEN) benchmark dataset to evaluate the change in image generations conditional on ethical interventions across three social axesgender, skin color, and culture. Through ENTI-GEN framework, we find that the generations from minDALL•E, DALL•E-mini and Stable Diffusion cover diverse social groups while preserving the image quality. Preliminary studies indicate that a large change in the model predictions is triggered by certain phrases such as 'irrespective of gender' in the context of gender bias in the ethical interventions. We release code and annotated data at https://github. com/Hritikbansal/entigen_emnlp.

For agents

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

get_harvested_code_for_paper("2210.15230")
get_code_for_paper("2210.15230")
have("2210.15230")

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

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

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

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

Connect an agent — have() is free.