SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.11790 · EMNLP · 2023

Prompting with Pseudo-Code Instructions

Mayank Mishra, Danish Contractor, Prince Kumar, Riyaz Ahmad Bhat, V. Rudramurthy, Srikanth G. Tamilselvam

arXiv · PDF · Open in the Atlas

Code that ran

6 of 13 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 6 have no contract verdict; 0 failures of our instrument; 7 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/2305.11790.json · badge: /api/ran/2305.11790.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
mayank31398/pseudo-code-instructions canonical (classifier label)
classifier basis: census
6 ran · 7 no recorded run
FunctionStatusWhere it lives
pad Ran
ran on a synthesized input
mayank31398/pseudo-code-instructions/code_instruct/model.py
code served (permissive licence) · get_code("df1b3e1970a39db7")
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

torch.manual_seed(0)

# Construct arguments for the pad function
arrays = [
    [1, 2, 3],           # length 3
    [4, 5],              # length 2
    [6, 7, 8, 9]         # length 4
]

padding = 0

max_length = None  # Will be inferred as 4 from the arrays

side = 'left'

ARGS = {
    'arrays': arrays,
    'padding': padding,
    'max_length': max_length,
    'side': side
}
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
preprocess Ran
ran on a synthesized input
mayank31398/pseudo-code-instructions/instructions/1007.py
code served (permissive licence) · get_code("b8d1dd9b82ebdfde")
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

torch.manual_seed(0)

ARGS = {
    "input": "Hello, how are you today?"
}
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
preprocess Ran
ran on a synthesized input
mayank31398/pseudo-code-instructions/instructions/1019.py
code served (permissive licence) · get_code("ba93e42d23bea00f")
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

torch.manual_seed(0)

ARGS = {
    "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
preprocess Ran
ran on a synthesized input
mayank31398/pseudo-code-instructions/instructions/105.py
code served (permissive licence) · get_code("43f4d8361d5f4aee")
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

def preprocess(input: str):
    sentence_1 = input.split('Sentence2')[0].split('Sentence1: ')[-1]
    sentence_2 = input.split('Sentence3')[0].split('Sentence2: ')[-1]
    sentence_3 = input.split('Sentence4')[0].split('Sentence3: ')[-1]
    sentence_4 = input.split('Sentence4: ')[-1]
    sentences = [sentence_1, sentence_2, sentence_3, sentence_4]
    return sentences

# Construct a valid input string that matches the expected format
input_str = "Sentence1: Hello world Sentence2: How are you Sentence3: I am fine Sentence4: Thank you"

ARGS = {
    "input": input_str
}
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 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
preprocess Ran
ran on a synthesized input
mayank31398/pseudo-code-instructions/instructions/1061.py
code served (permissive licence) · get_code("54a724b27bcc9357")
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

torch.manual_seed(0)

ARGS = {
    "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
sort Ran
ran on a synthesized input
mayank31398/pseudo-code-instructions/code_instruct/split_tasks.py
code served (permissive licence) · get_code("d493bce6bf95b3e1")
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

# Analyze the function:
# - Takes parameter 'l' which is a set
# - Each element in the set is a string
# - The string is split by '_', first part is split by 'task', and the second part is converted to int
# - This suggests strings like "task0_something", "task1_something", etc.

# Create a set with strings that match the expected format
test_set = {
    "task0_data",
    "task2_info",
    "task1_value",
    "task3_test"
}

ARGS = {
    "l": test_set
}
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
english_to_gujarati Not yet run
unverified (harvested, no recorded run)
mayank31398/pseudo-code-instructions/instructions/1079.py
code served (permissive licence) · get_code("cea75406d359ed14")
How it ran

no invocation recorded.

load_tokenizer Not yet run
unverified (harvested, no recorded run)
mayank31398/pseudo-code-instructions/code_instruct/model.py
code served (permissive licence) · get_code("35ab7eb005ae0a76")
How it ran

no invocation recorded.

story_sentence_generation Not yet run
unverified (harvested, no recorded run)
mayank31398/pseudo-code-instructions/instructions/105.py
code served (permissive licence) · get_code("08da323c868e03b6")
How it ran

no invocation recorded.

translate_bengali_to_marathi Not yet run
unverified (harvested, no recorded run)
mayank31398/pseudo-code-instructions/instructions/1061.py
code served (permissive licence) · get_code("dfa75eb02881dee8")
How it ran

no invocation recorded.

translate_english_to_punjabi Not yet run
unverified (harvested, no recorded run)
mayank31398/pseudo-code-instructions/instructions/1007.py
code served (permissive licence) · get_code("124a5b44b23a83b5")
How it ran

no invocation recorded.

translate_oriya_to_tamil Not yet run
unverified (harvested, no recorded run)
mayank31398/pseudo-code-instructions/instructions/1073.py
code served (permissive licence) · get_code("71ac44a0094c857b")
How it ran

no invocation recorded.

translate_oriya_to_telugu Not yet run
unverified (harvested, no recorded run)
mayank31398/pseudo-code-instructions/instructions/1019.py
code served (permissive licence) · get_code("aa32f3d974f6de21")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 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 13 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-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

Prompting with natural language instructions has recently emerged as a popular method of harnessing the capabilities of large language models (LLM). Given the inherent ambiguity present in natural language, it is intuitive to consider the possible advantages of prompting with less ambiguous prompt styles, like pseudocode. In this paper, we explore if prompting via pseudo-code instructions helps improve the performance of pre-trained language models. We manually create a dataset 1 of pseudo-code prompts for 132 different tasks spanning classification, QA, and generative language tasks, sourced from the Super-NaturalInstructions dataset (Wang et al., 2022b). Using these prompts along with their counterparts in natural language, we study their performance on two LLM families -BLOOM (Scao et al., 2023), CodeGen (Nijkamp et al., 2023). Our experiments show that using pseudo-code instructions leads to better results, with an average increase (absolute) of 7-16 points in F1 scores for classification tasks and an improvement (relative) of 12-38% in aggregate ROUGE-L scores across all tasks. We include detailed ablation studies which indicate that code comments, docstrings, and the structural clues encoded in pseudo-code all contribute towards the improvement in performance. To the best of our knowledge, our work is the first to demonstrate how pseudocode prompts can be helpful in improving the performance of pre-trained LMs.

For agents

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

get_harvested_code_for_paper("2305.11790")
get_code_for_paper("2305.11790")
have("2305.11790")

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

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

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

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

Connect an agent — have() is free.