SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.08786 · 2021

Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity

Sebastian Riedel, Pontus Stenetorp, Yao Lu, Max Bartolo, Alastair Moore

arXiv · PDF · Open in the Atlas

Code that ran

3 of 10 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 0 have no contract verdict; 3 failures of our instrument; 7 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/2104.08786.json · badge: /api/ran/2104.08786.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
chicagohai/active-example-selection community
Papers with Code archive
3 ran · 7 no recorded run
FunctionStatusWhere it lives
print_json Ran
ran; our contract draft was wrong, not the code
chicagohai/active-example-selection/src/prompting/strategies/ordering_strategy.py
code served (permissive licence) · get_code("b3d1ae61efca9244")
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) 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 json
from typing import Any, Dict, Optional

# Construct a simple dictionary to pass to print_json
test_dict = {
    "name": "test",
    "value": 42,
    "nested": {
        "key": "value",
        "list": [1, 2, 3]
    },
    "flag": True
}

# Define ARGS mapping every parameter
ARGS = {
    "d": test_dict,
    "indent": 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
read_json_file Ran
ran; our contract draft was wrong, not the code
chicagohai/active-example-selection/src/prompting/strategies/ordering_strategy.py
code served (permissive licence) · get_code("aaa2f935eb008592")
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) 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 json
import tempfile
import os

# Create a temporary JSON file with valid content
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.json")

test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

with open(temp_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "path": temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
to_device Ran
ran; our contract draft was wrong, not the code
chicagohai/active-example-selection/src/prompting/strategies/ordering_strategy.py
code served (permissive licence) · get_code("2746f9dc0486a406")
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) 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

torch.manual_seed(0)

# Create a small tensor dictionary with distinct tensor shapes
tensor_dict = {
    "input": torch.randn(2, 4),
    "output": torch.randn(2, 3),
    "hidden": torch.randn(4, 5),
}

# Define device as a string (CPU only)
device = "cpu"

ARGS = {
    "tensor_dict": tensor_dict,
    "device": device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
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
BaseProcessor Not yet run
unverified (harvested, no recorded run)
chicagohai/active-example-selection/src/prompting/strategies/ordering_strategy.py
code served (permissive licence) · get_code("fc7136906d9c9a7c")
How it ran

no invocation recorded.

BaseStrategy Not yet run
unverified (harvested, no recorded run)
chicagohai/active-example-selection/src/prompting/strategies/ordering_strategy.py
code served (permissive licence) · get_code("46f065bae1a6397f")
How it ran

no invocation recorded.

GPT2Wrapper Not yet run
unverified (harvested, no recorded run)
chicagohai/active-example-selection/src/prompting/strategies/ordering_strategy.py
code served (permissive licence) · get_code("994279d788f316a5")
How it ran

no invocation recorded.

GenerationOutput Not yet run
unverified (harvested, no recorded run)
chicagohai/active-example-selection/src/prompting/strategies/ordering_strategy.py
code served (permissive licence) · get_code("d6240bea8a80b9a2")
How it ran

no invocation recorded.

GlobalEntropyOrderingStrategy Not yet run
unverified (harvested, no recorded run)
chicagohai/active-example-selection/src/prompting/strategies/ordering_strategy.py
code served (permissive licence) · get_code("e8a1fe25e604a705")
How it ran

no invocation recorded.

probe Not yet run
unverified (harvested, no recorded run)
chicagohai/active-example-selection/src/prompting/strategies/ordering_strategy.py
code served (permissive licence) · get_code("e75bb0724ba4a22a")
How it ran

no invocation recorded.

stop Not yet run
unverified (harvested, no recorded run)
chicagohai/active-example-selection/src/prompting/strategies/ordering_strategy.py
code served (permissive licence) · get_code("35ce439826a06f86")
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, 7 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 7 later) and 3 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
BaseProcessor
brick of this paper's assembly: helper
1 other paper
1 later
2211.04486 (2022-11)
Active Example Selection for In-Context Learning
BaseStrategy
brick of this paper's assembly: helper
1 other paper
1 later
2211.04486 (2022-11)
Active Example Selection for In-Context Learning
GPT2Wrapper
brick of this paper's assembly: model
1 other paper
1 later
2211.04486 (2022-11)
Active Example Selection for In-Context Learning
GenerationOutput
brick of this paper's assembly: helper
1 other paper
1 later
2211.04486 (2022-11)
Active Example Selection for In-Context Learning
print_json
brick of this paper's assembly: helper
1 other paper
1 later
2211.04486 (2022-11)
Active Example Selection for In-Context Learning
read_json_file
brick of this paper's assembly: helper
1 other paper
1 later
2211.04486 (2022-11)
Active Example Selection for In-Context Learning
to_device
brick of this paper's assembly: helper
1 other paper
1 later
2211.04486 (2022-11)
Active Example Selection for In-Context Learning

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

When primed with only a handful of training samples, very large, pretrained language models such as GPT-3 have shown competitive results when compared to fully-supervised, finetuned, large, pretrained language models. We demonstrate that the order in which the samples are provided can make the difference between near state-of-the-art and random guess performance: essentially some permutations are "fantastic" and some not. We analyse this phenomenon in detail, establishing that: it is present across model sizes (even for the largest current models), it is not related to a specific subset of samples, and that a given good permutation for one model is not transferable to another. While one could use a development set to determine which permutations are performant, this would deviate from the true fewshot setting as it requires additional annotated data. Instead, we use the generative nature of language models to construct an artificial development set and based on entropy statistics of the candidate permutations on this set, we identify performant prompts. Our method yields a 13% relative improvement for GPTfamily models across eleven different established text classification tasks. 1 We can also refer these models as GPT2-base, GPT2medium, GPT2-Large, and GPT2-XL. 2 The smallest model in our experiment is the same size as BERT-base.

For agents

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

get_harvested_code_for_paper("2104.08786")
get_code_for_paper("2104.08786")
have("2104.08786")

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

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

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

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

Connect an agent — have() is free.