SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.11364 · ACL · 2022

An Information-theoretic Approach to Prompt Engineering Without Ground Truth Labels

Mahmoud Khalil, Joshua Robinson, Nancy Fulda, Christopher Rytting, Taylor Sorensen, A. Shaw, K. Rogers, Alexia Pauline Delorey, D. Wingate

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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 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/2203.11364.json · badge: /api/ran/2203.11364.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
BYU-PCCL/information-theoretic-prompts community
Papers with Code archive
6 ran · 1 no recorded run
FunctionStatusWhere it lives
collapse_lower_strip Ran
ran; our contract draft was wrong, not the code
BYU-PCCL/information-theoretic-prompts/postprocessor.py
code served (permissive licence) · get_code("d1cdd1046c1d2c2d")
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 torch
import numpy as np

# Analyze the function:
# - It takes a single parameter 'd' which is a dictionary
# - The dictionary has keys that are strings and values that are numbers (probabilities)
# - It processes keys by applying .lower() and .strip()
# - It combines values for keys that collide after normalization
# - Returns a new dictionary

# Create a test dictionary with some keys that will collide after lower/strip
d = {
    "Hello": 0.3,
    "hello": 0.2,
    "  WORLD  ": 0.4,
    "world": 0.1,
}

ARGS = {
    "d": d
}
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 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
collapse_token_sets Ran
ran; our contract draft was wrong, not the code
BYU-PCCL/information-theoretic-prompts/postprocessor.py
code served (permissive licence) · get_code("d9fc0178d1bf4ae1")
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 torch
import numpy as np

torch.manual_seed(0)

# Construct arguments for collapse_token_sets

# d: Dictionary of probabilities (token -> probability)
d = {
    "hello": 0.3,
    "world": 0.2,
    "help": 0.15,
    "works": 0.1,
    "widget": 0.25
}

# token_sets: Dictionary mapping categories to lists of tokens
# Using 'startswith' strategy, so we want tokens that start with pattern tokens
token_sets = {
    "greeting": ["hello", "hel"],
    "object": ["world", "widget"],
    "action": ["works"]
}

# matching_strategy: Strategy for matching tokens
matching_strategy = 'startswith'

ARGS = {
    "d": d,
    "token_sets": token_sets,
    "matching_strategy": matching_strategy
}
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 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
coverage Ran
ran, honoured the contract we drafted
BYU-PCCL/information-theoretic-prompts/postprocessor.py
code served (permissive licence) · get_code("cf113e434acb350f")
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 int, ndim 0, dtype family int, 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

torch.manual_seed(0)

d = {
    "key1": 5,
    "key2": 10,
    "key3": 3
}

ARGS = {
    "d": d
}
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 int, ndim 0, dtype family int, 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
exponentiate Ran
ran; our contract draft was wrong, not the code
BYU-PCCL/information-theoretic-prompts/postprocessor.py
code served (permissive licence) · get_code("4764a0e5f32d9dfc")
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

def exponentiate(d):
    """
    Exponentiates a dictionary's probabilities.
    """
    return {k: np.exp(v) for k, v in d.items()}

# Create a dictionary with numeric values to exponentiate
d = {
    'class_0': np.log(0.2),
    'class_1': np.log(0.3),
    'class_2': np.log(0.5),
}

ARGS = {
    'd': d
}
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
normalize Ran
ran; our contract draft was wrong, not the code
BYU-PCCL/information-theoretic-prompts/postprocessor.py
code served (permissive licence) · get_code("a3730f3c9d52647e")
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 torch
import numpy as np

# Analyze the function:
# - normalize(d) takes a dictionary d
# - It iterates over d.items() to get k, v pairs
# - It computes v / sum(d.values()) for each pair
# - Returns a new dictionary with normalized values
# The function expects d to be a dictionary with numeric values

# Create a simple dictionary with numeric values
d = {
    'a': 2.0,
    'b': 3.0,
    'c': 5.0
}

ARGS = {
    'd': d
}
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 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
prob_function Ran
ran; our contract draft was wrong, not the code
BYU-PCCL/information-theoretic-prompts/postprocessor.py
code served (permissive licence) · get_code("b8fca42b22ff519c")
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
import pandas as pd

# Create a mock pandas Series with the required structure
# The function expects a Series with 'token_logprobs' and optionally 'token_sets' and 'matching_strategy'

token_logprobs = {
    'hello': 0.5,
    'HELLO': 0.3,
    '  world  ': 0.2,
    'goodbye': 0.1
}

token_sets = {
    'greeting': ['hello', 'hi', 'hey'],
    'farewell': ['goodbye', 'bye']
}

matching_strategy = 'startswith'

# Create a pandas Series that represents a single row
row = pd.Series({
    'token_logprobs': token_logprobs,
    'token_sets': token_sets,
    'matching_strategy': matching_strategy
})

ARGS = {
    'row': row
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
Postprocessor Not yet run
unverified (harvested, no recorded run)
BYU-PCCL/information-theoretic-prompts/postprocessor.py
code served (permissive licence) · get_code("cee149a735309191")
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

Pre-trained language models derive substantial linguistic and factual knowledge from the massive corpora on which they are trained, and prompt engineering seeks to align these models to specific tasks. Unfortunately, existing prompt engineering methods require significant amounts of labeled data, access to model parameters, or both. We introduce a new method for selecting prompt templates without labeled examples and without direct access to the model. Specifically, over a set of candidate templates, we choose the template that maximizes the mutual information between the input and the corresponding model output. Across 8 datasets representing 7 distinct NLP tasks, we show that when a template has high mutual information, it also has high accuracy on the task. On the largest model, selecting prompts with our method gets 90% of the way from the average prompt accuracy to the best prompt accuracy and requires no ground truth labels. "In a predicament, an animal might choose flight or what?" A. "leave home" B. "hunt for food" C. "smell prey" D. "feel pain" E. "fight for life" Ground Truth "If asked the question 'In a predicament, an animal might choose flight or what?', and given the choices 'leave home', 'hunt for food', '

For agents

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

get_harvested_code_for_paper("2203.11364")
get_code_for_paper("2203.11364")
have("2203.11364")

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

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

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

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

Connect an agent — have() is free.