SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.13353 · 2021

Cutting Down on Prompts and Parameters: Simple Few-Shot Learning with Language Models

arXiv · PDF · Open in the Atlas

Code that ran

7 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 6 have no contract verdict; 1 failure of our instrument; 3 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/2106.13353.json · badge: /api/ran/2106.13353.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
ucinlp/null-prompts canonical (classifier label)
classifier basis: census
7 ran · 3 no recorded run
FunctionStatusWhere it lives
get_clf_head Ran
ran on a synthesized input
ucinlp/null-prompts/nullprompt/models.py
code served (permissive licence) · get_code("73b104c2f2ab39f3")
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 ClassifierHead. 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 ClassifierHead(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)

class TransformerModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(10, 4)
        self.transformer_layer = nn.TransformerEncoderLayer(d_model=4, nhead=2, batch_first=True)
        self.classifier = ClassifierHead()
    
    def forward(self, x):
        x = self.embedding(x)
        x = self.transformer_layer(x)
        x = self.classifier(x)
        return x

model = TransformerModel()

ARGS = {
    'model': model
}
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 ClassifierHead — a ClassifierHead output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ClassifierHead 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
get_linear_schedule_with_warmup Ran
ran; our contract draft was wrong, not the code
ucinlp/null-prompts/nullprompt/trainers/finetune.py
code served (permissive licence) · get_code("52e0b2b6dde2c6f5")
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 LambdaLR. 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
from torch.optim import SGD

torch.manual_seed(0)

# Create a minimal model
model = nn.Linear(4, 2)

# Create an optimizer
optimizer = SGD(model.parameters(), lr=0.1)

# Define schedule parameters
num_warmup_steps = 100
num_training_steps = 1000
last_epoch = -1

ARGS = {
    "optimizer": optimizer,
    "num_warmup_steps": num_warmup_steps,
    "num_training_steps": num_training_steps,
    "last_epoch": last_epoch,
}
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 LambdaLR — a LambdaLR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LambdaLR 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
get_lm_head Ran
ran on a synthesized input
ucinlp/null-prompts/nullprompt/models.py
code served (permissive licence) · get_code("dc526f2f69d8e783")
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 Linear. 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)

# Create a simple transformer-like model with an lm_head attribute
class SimpleTransformerModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(100, 4)
        self.lm_head = nn.Linear(4, 100)
    
    def forward(self, x):
        return self.lm_head(self.embedding(x))

# Instantiate the model
model = SimpleTransformerModel()

ARGS = {
    "model": model
}
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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
get_word_embeddings Ran
ran on a synthesized input
ucinlp/null-prompts/nullprompt/models.py
code served (permissive licence) · get_code("2f89b905c683adc9")
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 Embedding. 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 WordEmbeddingModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.word_embeddings = nn.Embedding(num_embeddings=10, embedding_dim=4)

class SimpleTransformerModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding_layer = WordEmbeddingModule()
    
    def forward(self, x):
        return x

model = SimpleTransformerModel()

ARGS = {
    "model": model
}
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 Embedding — a Embedding output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Embedding 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
load_label_map Ran
ran on a synthesized input
ucinlp/null-prompts/nullprompt/utils.py
code served (permissive licence) · get_code("5d03070f1d676296")
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 json

# The function loads a label map from a JSON string
# It takes one parameter: label_map, which can be None or a JSON string
# The function calls json.loads() on it if it's not None

# Test case 1: With a valid label map JSON string
label_map_json = json.dumps({
    "0": "cat",
    "1": "dog",
    "2": "bird"
})

ARGS = {
    "label_map": label_map_json
}
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 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
pad_squeeze_sequence Ran
ran on a synthesized input
ucinlp/null-prompts/nullprompt/data.py
code served (permissive licence) · get_code("378294d453c3b8ad")
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 (4, 2) 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
from torch.nn.utils.rnn import pad_sequence

torch.manual_seed(0)

# Test case 1: sequence of tensors with shape (1,) - should concatenate
sequence_1d = [torch.tensor([1.0]), torch.tensor([2.0]), torch.tensor([3.0])]

# Test case 2: sequence of tensors with shape (1, 4) - should squeeze then pad
sequence_2d = [
    torch.randn(1, 4),
    torch.randn(1, 4),
]

# We'll use the 2D case as it exercises the squeeze path
ARGS = {
    "sequence": sequence_2d,
}
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 (4, 2) — shape (4, 2) 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
randomize_label_map Ran
ran on a synthesized input
ucinlp/null-prompts/nullprompt/utils.py
code served (permissive licence) · get_code("a80b2839bd8d317b")
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)

class MockTokenizer:
    def __init__(self, vocab_size=5000):
        self.vocab_size = vocab_size
    
    def __len__(self):
        return self.vocab_size
    
    def decode(self, idx):
        # Return a single token string for each index
        return f"token_{idx}"
    
    def encode(self, text, add_special_tokens=False):
        # Return a list with single element to satisfy the constraint
        # that each token encodes to exactly 1 token
        return [1]

label_map = {
    "label_0": "old_token_0",
    "label_1": "old_token_1",
    "label_2": "old_token_2"
}

tokenizer = MockTokenizer(vocab_size=5000)

ARGS = {
    "label_map": label_map,
    "tokenizer": tokenizer
}
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
get_optimizer Not yet run
unverified (harvested, no recorded run)
ucinlp/null-prompts/nullprompt/trainers/finetune.py
code served (permissive licence) · get_code("aa82a18e8211ca6c")
How it ran

no invocation recorded.

load_transformers Not yet run
unverified (harvested, no recorded run)
ucinlp/null-prompts/nullprompt/utils.py
code served (permissive licence) · get_code("e28c77e9a3880f76")
How it ran

no invocation recorded.

prime Not yet run
unverified (harvested, no recorded run)
ucinlp/null-prompts/nullprompt/data.py
code served (permissive licence) · get_code("6c2a94ad9c81a93a")
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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 later) and 9 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
get_linear_schedule_with_warmup 6 other papers
1 dated earlier, 1 the same month, 4 later
2005.13837 (2020-05)
Generating Diverse and Consistent QA pairs from Contexts with Information-Maximizing Hierarchical Conditional VAEs
2106.11310 (2021-06)
Towards Long-Form Video Understanding
2204.07275 (2022-04)
Incremental Prompting: Episodic Memory Prompt for Lifelong Event Detection
and 3 more not named here

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

Prompting language models (LMs) with training examples and task descriptions has been seen as critical to recent successes in few-shot learning. In this work, we show that finetuning LMs in the few-shot setting can considerably reduce the need for prompt engineering. In fact, one can use null prompts, prompts that contain neither task-specific templates nor training examples, and achieve competitive accuracy to manually-tuned prompts across a wide range of tasks. While finetuning LMs does introduce new parameters for each downstream task, we show that this memory overhead can be substantially reduced: finetuning only the bias terms can achieve comparable or better accuracy than standard finetuning while only updating 0.1% of the parameters. All in all, we recommend finetuning LMs for few-shot learning as it is more accurate, robust to different prompts, and can be made nearly as efficient as using frozen LMs.

For agents

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

get_harvested_code_for_paper("2106.13353")
get_code_for_paper("2106.13353")
have("2106.13353")

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

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

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

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

Connect an agent — have() is free.