SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.11765 · 2023

Privacy-Preserving In-Context Learning with Differentially Private Few-Shot Generation

arXiv · PDF · Open in the Atlas

Code that ran

17 of 17 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; 16 failures of our instrument; 0 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/2309.11765.json · badge: /api/ran/2309.11765.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
microsoft/dp-few-shot-generation canonical (classifier label)
classifier basis: census
17 ran · 0 no recorded run
FunctionStatusWhere it lives
bucket Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/lmapi/src/lmapi/async_tools/asyncitertools.py
code served (permissive licence) · get_code("44638cce82907058")
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 coroutine. 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 asyncio
from typing import AsyncGenerator, Iterable

async def sample_async_generator() -> AsyncGenerator[int, None]:
    """Simple async generator that yields integers 0-4"""
    for i in range(5):
        yield i

def sample_process(item: int) -> Iterable[tuple[int, str]]:
    """Process function that routes items to buckets and transforms them"""
    bucket_idx = item % 3
    transformed = f"item_{item}"
    yield (bucket_idx, transformed)

ARGS = {
    "num_buckets": 3,
    "it": sample_async_generator(),
    "process": sample_process,
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
construct_prompt_same Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_agnews.py
code served (permissive licence) · get_code("0bf84d7908b72654")
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

label_dict = {0: ['World'], 1: ['Sports'], 2: ['Business'], 3: ['Technology']}

train_examples = [
    {'text': 'International summit discusses climate change', 'label': 0},
    {'text': 'Local team wins championship match', 'label': 1},
]

test_example = {
    'text': 'New merger announced in tech sector',
    'label': 2
}

ARGS = {
    'train_examples': train_examples,
    'test_example': test_example,
}
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 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
construct_prompt_same Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_dbpedia.py
code served (permissive licence) · get_code("fa8cab36e1361d87")
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

labels = ['Company', 'School', 'Artist', 'Ath', 'Polit', 'Transportation', 'Building', 'Nature', 'Village', 'Animal', 'Plant', 'Album', 'Film', 'Book']

label_dict = {0: ['Company'], 1: ['School'], 2: ['Artist'], 3: ['Ath'], 4: ['Polit'], 5: ['Transportation'], 6: ['Building'], 7: ['Nature'], 8: ['Village'], 9: ['Animal'], 10: ['Plant'], 11: ['Album'], 12: ['Film'], 13: ['Book']}

# Create sample training examples
train_examples = [
    {
        'content': 'Apple Inc. is a technology company founded in 1976.',
        'label': 0
    },
    {
        'content': 'Harvard University is a prestigious school in Cambridge.',
        'label': 1
    }
]

# Create sample test example
test_example = {
    'content': 'The Beatles was a famous music band.',
    'label': 11
}

ARGS = {
    'train_examples': train_examples,
    'test_example': test_example
}
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
construct_prompt_same Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_movie.py
code served (permissive licence) · get_code("5b5e01e114acc5e6")
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

# Construct train_examples: list of dicts with 'content' and 'label' keys
train_examples = [
    {
        'content': 'This movie was great',
        'label': 'positive'
    },
    {
        'content': 'I did not like this film',
        'label': 'negative'
    }
]

# Construct test_example: dict with 'content' and 'label' keys
test_example = {
    'content': 'The acting was superb',
    'label': None  # Will be filled by the prompt construction
}

# Construct field_name: string
field_name = 'Sentiment'

ARGS = {
    'train_examples': train_examples,
    'test_example': test_example,
    'field_name': field_name
}
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 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
construct_prompt_same Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_trec.py
code served (permissive licence) · get_code("eecf2939e2cad740")
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

label_dict = {0: ['Ab'], 1: ['Entity'], 2: ['Description'], 3: ['Person'], 4: ['Location'], 5: ['Number']}

def construct_prompt_same(train_examples, test_example):
    prompt = 'Classify the questions based on whether their answer type is a Number, Location, Person, Description, Entity, or Abbreviation.\n\n'
    for train_example in train_examples:
        prompt += 'Question: ' + train_example['text'] + '\n'
        prompt += 'Answer Type: ' + label_dict[train_example['coarse_label']][0] + '\n\n'
    prompt += 'Question: ' + test_example['text'] + '\n'
    prompt += 'Answer Type:'
    return prompt

train_examples = [
    {'text': 'What is the capital of France?', 'coarse_label': 4},
    {'text': 'How many planets are in the solar system?', 'coarse_label': 5}
]

test_example = {'text': 'Who is the president of the United States?', 'coarse_label': 3}

ARGS = {
    'train_examples': train_examples,
    'test_example': test_example
}
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 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
densify Ran
ran, honoured the contract we drafted
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/prob_utils.py
code served (permissive licence) · get_code("5c7d9873d8d10f37")
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 ndarray, ndim 1, dtype family float, shape (10,) 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 numpy as np

# Based on the function signature and body:
# - vocab_size: int - used to create array of shape (vocab_size,)
# - logprobs: dict[int, float] - dict with int keys and float values, must be non-empty
#   The function iterates over items and uses k as index and v as value

vocab_size = 10
logprobs = {0: -2.5, 3: -1.2, 7: -0.8, 9: -3.1}

ARGS = {
    "vocab_size": vocab_size,
    "logprobs": logprobs,
}
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 ndarray, ndim 1, dtype family float, shape (10,) — shape (10,) 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
format_full_datum_for_prompt Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_agnews.py
code served (permissive licence) · get_code("1adc0f8de046bd4b")
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

labels = ['World', 'Sport', 'Business', 'Technology']

def format_full_datum_for_prompt(labels, datum: dict[str, str]):
    return f'''News Type: "{labels[datum['label']]}"\nText: "{datum['text'] + ' END'}"\n'''

# Construct the datum dictionary
datum = {
    'label': 0,
    'text': 'Breaking news from around the globe'
}

# Define ARGS mapping all parameters
ARGS = {
    'labels': labels,
    'datum': datum
}
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 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
format_full_datum_for_prompt Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_dbpedia.py
code served (permissive licence) · get_code("5ccd170c8c25a1a9")
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

labels = ['Company', 'School', 'Artist', 'Ath', 'Polit', 'Transportation', 'Building', 'Nature', 'Village', 'Animal', 'Plant', 'Album', 'Film', 'Book']

datum = {
    'label': 0,
    'content': 'This is a test document about a company'
}

ARGS = {
    'labels': labels,
    'datum': datum
}
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 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
format_full_datum_for_prompt Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_movie.py
code served (permissive licence) · get_code("b6fe1bbe225ef52b")
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 torch.nn as nn

# Construct arguments for format_full_datum_for_prompt
field_name = "label_field"
datum = {
    "label": "positive",
    "content": "This is a great product"
}

ARGS = {
    "field_name": field_name,
    "datum": datum
}
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 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
format_full_datum_for_prompt Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_trec.py
code served (permissive licence) · get_code("9c8615eda7477f90")
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

labels = ['Ab', 'Entity', 'Description', 'Person', 'Location', 'Number']

datum = {
    'coarse_label': 1,
    'text': 'This is a test entity'
}

ARGS = {
    'labels': labels,
    'datum': datum
}
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 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
format_test_input_for_prompt Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_agnews.py
code served (permissive licence) · get_code("34f0eccbe92abf73")
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.

labels = ['World', 'Sport', 'Business', 'Technology']

def format_test_input_for_prompt(labels, test_input: int):
    return f'News Type: "{labels[test_input]}"\nText: "'

ARGS = {
    'labels': labels,
    'test_input': 0
}
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
format_test_input_for_prompt Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_dbpedia.py
code served (permissive licence) · get_code("52e0b351e17a4c5b")
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.

labels = ['Company', 'School', 'Artist', 'Ath', 'Polit', 'Transportation', 'Building', 'Nature', 'Village', 'Animal', 'Plant', 'Album', 'Film', 'Book']

test_input = 3

ARGS = {
    'labels': labels,
    'test_input': test_input
}
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
format_test_input_for_prompt Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_movie.py
code served (permissive licence) · get_code("1eb0215575d63ba9")
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

def format_test_input_for_prompt(field_name, test_input: str):
    return f'{field_name}: "{test_input}"\nSentence: "'

torch.manual_seed(0)

field_name = "question"
test_input = "What is the capital of France?"

ARGS = {
    "field_name": field_name,
    "test_input": test_input,
}
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 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
format_test_input_for_prompt Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_trec.py
code served (permissive licence) · get_code("4d172e7132a9045a")
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.

labels = ['Ab', 'Entity', 'Description', 'Person', 'Location', 'Number']

ARGS = {
    'labels': labels,
    'test_input': 0
}
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
log_max_normalize Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/prob_utils.py
code served (permissive licence) · get_code("ccccd602b13c9a9f")
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

# Set random seed for reproducibility
torch.manual_seed(0)

# Create a simple log probability distribution as a dictionary
# The function expects a dict mapping token IDs (or any hashable type) to log probabilities
logprobs = {
    0: -0.5,
    1: -1.2,
    2: -2.3,
    3: -0.1,
}

ARGS = {
    "logprobs": logprobs
}
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 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
log_normalize Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/prob_utils.py
code served (permissive licence) · get_code("33a763306ed859f8")
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
import scipy.special

# log_normalize takes a dict mapping from token IDs (type T) to log probabilities (float)
# The function calls list(logprobs.values()) and scipy.special.logsumexp on it
# Then it iterates over k, v pairs in the dict

# Construct a simple logprobs dictionary
logprobs = {
    0: -0.5,
    1: -1.2,
    2: -2.1,
    3: -0.8
}

ARGS = {
    'logprobs': logprobs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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
openai_token_to_bytes Ran
ran; our contract draft was wrong, not the code
microsoft/dp-few-shot-generation/lmapi/src/lmapi/openai.py
code served (permissive licence) · get_code("dbda3623619056cc")
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 bytes. 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 ast

def openai_token_to_bytes(token: str) -> bytes:
    if token.startswith('bytes:'):
        return ast.literal_eval(f"b'{token[6:]}'")
    else:
        return token.encode('utf-8')

# Test case 1: regular string token
token_1 = "hello world"

# Test case 2: bytes-prefixed token
token_2 = "bytes:hello"

ARGS = {
    "token": token_1
}
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 bytes — a bytes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a bytes 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

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 16 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
openai_token_to_bytes 1 other paper
1 dated earlier
2206.10668 (2022-06)
BenchCLAMP: A Benchmark for Evaluating Language Models on Syntactic and Semantic Parsing

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

We study the problem of in-context learning (ICL) with large language models (LLMs) on private datasets. This scenario poses privacy risks, as LLMs may leak or regurgitate the private examples demonstrated in the prompt. We propose a novel algorithm that generates synthetic few-shot demonstrations from the private dataset with formal differential privacy (DP) guarantees, and show empirically that it can achieve effective ICL. We conduct extensive experiments on standard benchmarks and compare our algorithm with non-private ICL and zero-shot solutions. Our results demonstrate that our algorithm can achieve competitive performance with strong privacy levels. These results open up new possibilities for ICL with privacy protection for a broad range of applications.

For agents

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

get_harvested_code_for_paper("2309.11765")
get_code_for_paper("2309.11765")
have("2309.11765")

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

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

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

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

Connect an agent — have() is free.