SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.01256 · EMNLP · 2021

Revisiting Self-Training for Few-Shot Learning of Language Model

Yiming Chen, Chen Zhang, Yan Zhang, Haizhou Li, Ran Cheng, Grandee Lee

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 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; 2 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 3 failures of our instrument; 2 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/2110.01256.json · badge: /api/ran/2110.01256.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
matthewcym/sflm canonical (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
timoschick/pet canonical (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
FunctionStatusWhere it lives
default_dev_objective Ran
ran, honoured the contract we drafted
matthewcym/sflm/src/trainer.py
pointer only (licence: MIT); the stored copy get_code serves, from uijeongjang/lora-ntk, is pointer only (licence: NONE) · get_code("e448786d5ff1875a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from uijeongjang/lora-ntk, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

eq_div Ran
ran, honoured the contract we drafted
timoschick/pet/pet/utils.py
code served (permissive licence) · get_code("8ce575c2247ba48a")
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 int; 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

ARGS = {
    "N": 12,
    "i": 3
}
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 int — 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
filter_words Ran
ran on a synthesized input
timoschick/pet/petal.py
code served (permissive licence) · get_code("a40f233e44e61f6e")
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.

from typing import Dict, List

# Construct valid arguments for filter_words function

# Sample tokens with proper format (starting with 'Ġ' for word tokens)
tokens = [
    'Ġhello',
    'Ġworld',
    'Ġpython',
    'Ġcode',
    'Ġtest',
    'Ġdata',
    'Ġfilter',
    'Ġwords',
    'Ġa',  # only 1 alpha char after 'Ġ', will be filtered
    'Ġx',  # only 1 alpha char after 'Ġ', will be filtered
    '!',   # doesn't start with 'Ġ', will be filtered
]

# Word counts dictionary mapping words (without the 'Ġ' prefix) to their occurrences
word_counts = {
    'hello': 5,
    'world': 8,
    'python': 12,
    'code': 3,
    'test': 7,
    'data': 10,
    'filter': 4,
    'words': 6,
}

# Maximum number of words to keep
max_words = 5

ARGS = {
    'tokens': tokens,
    'word_counts': word_counts,
    'max_words': max_words,
}
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 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
input_example_to_string Ran
ran; our contract draft was wrong, not the code
matthewcym/sflm/src/dataset.py
code served (permissive licence) · get_code("e768e25ca95f70cd")
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.

class Example:
    def __init__(self, text_a, text_b=None):
        self.text_a = text_a
        self.text_b = text_b

example_with_text_b = Example("Hello world", "This is text b")
example_without_text_b = Example("Hello world", None)

ARGS = {
    "example": example_with_text_b,
    "sep_token": "[SEP]"
}
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
input_example_to_tuple Ran
ran; our contract draft was wrong, not the code
matthewcym/sflm/src/dataset.py
code served (permissive licence) · get_code("fbef70dc7c700501")
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 logging
import pandas as pd

logger = logging.getLogger(__name__)

# Create a simple example class that mimics the structure needed
class Example:
    def __init__(self, text_a, text_b=None):
        self.text_a = text_a
        self.text_b = text_b

# Test case 1: example with both text_a and text_b
example_both = Example(text_a="Hello world", text_b="Goodbye world")

# Test case 2: example with only text_a
example_single = Example(text_a="Hello world", text_b=None)

# Test case 3: example with None text_a and None text_b
example_empty = Example(text_a=None, text_b=None)

# Use the most complete example for the ARGS dict
ARGS = {
    "example": example_both
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
lowercase_first Ran
ran on a synthesized input
timoschick/pet/pet/utils.py
code served (permissive licence) · get_code("cdc3095e36a5efa7")
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

ARGS = {
    "s": "Hello"
}
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
remove_final_punc Ran
ran on a synthesized input
timoschick/pet/pet/utils.py
code served (permissive licence) · get_code("20e328b05dd717e0")
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 string

def remove_final_punc(s: str):
    """Remove the last character from a string if it is some form of punctuation"""
    return s.rstrip(string.punctuation)

ARGS = {
    "s": "Hello, world!"
}
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
text_classification_metrics Ran
ran; our contract draft was wrong, not the code
matthewcym/sflm/src/processors.py
code served (permissive licence) · get_code("b62076c5483738dc")
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 text_classification_metrics
task_name = "sentiment"

# Create predictions and labels as numpy arrays
# The function compares them with == and calls .mean()
preds = np.array([0, 1, 0, 1], dtype=np.int64)
labels = np.array([0, 1, 1, 1], dtype=np.int64)

ARGS = {
    "task_name": task_name,
    "preds": preds,
    "labels": labels,
}
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
tokenize_multipart_input Ran
ran on a synthesized input
matthewcym/sflm/src/dataset.py
code served (permissive licence) · get_code("72e4be6e6f4cdc7e")
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 logging
from unittest.mock import Mock

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

class MockTokenizer:
    def __init__(self):
        self.cls_token_id = 101
        self.mask_token_id = 103
        self.sep_token_id = 102
        self.pad_token_id = 0
    
    def encode(self, text, add_special_tokens=False):
        # Simple mock: return a list of token ids based on text length
        tokens = [1000 + i for i in range(max(1, len(text.split())))]
        return tokens
    
    def _convert_token_to_id(self, token):
        # Mock conversion
        if token == '.':
            return 1012
        elif token == ',':
            return 1010
        else:
            return 1000

# Create mock objects
tokenizer = MockTokenizer()

# Setup ARGS dictionary with all required parameters
ARGS = {
    'input_text_list': ['This is sentence zero', 'This is sentence one'],
    'max_length': 128,
    'tokenizer': tokenizer,
    'task_name': 'sentiment',
    'prompt': False,
    'template': None,
    'label_word_list': ['positive', 'negative'],
    'first_sent_limit': None,
    'other_sent_limit': None,
    'gpt3': False,
    'truncate_head': False,
    'support_labels': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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
get_logger Not yet run
unverified (harvested, no recorded run)
timoschick/pet/log.py
code served (permissive licence) · get_code("999a29a2aa943ed5")
How it ran

no invocation recorded.

mask_tokens Not yet run
unverified (harvested, no recorded run)
matthewcym/sflm/src/utils.py
code served (permissive licence) · get_code("cbf3175e3ec772a0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 8 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 4 the same month, 8 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
input_example_to_string 9 other papers
1 the same month, 8 later
2110.06274 (2021-10)
LiST: Lite Prompted Self-training Makes Parameter-Efficient Few-shot Learners
2202.11451 (2022-02)
Zero-shot Cross-lingual Transfer of Prompt-based Tuning with a Unified Multilingual Prompt
2205.01308 (2022-05)
Contrastive Learning for Prompt-Based Few-Shot Language Learners
and 6 more not named here
input_example_to_tuple 9 other papers
1 the same month, 8 later
2110.06274 (2021-10)
LiST: Lite Prompted Self-training Makes Parameter-Efficient Few-shot Learners
2202.11451 (2022-02)
Zero-shot Cross-lingual Transfer of Prompt-based Tuning with a Unified Multilingual Prompt
2205.01308 (2022-05)
Contrastive Learning for Prompt-Based Few-Shot Language Learners
and 6 more not named here
default_dev_objective 7 other papers
1 the same month, 6 later
2110.06274 (2021-10)
LiST: Lite Prompted Self-training Makes Parameter-Efficient Few-shot Learners
2202.11451 (2022-02)
Zero-shot Cross-lingual Transfer of Prompt-based Tuning with a Unified Multilingual Prompt
2205.01308 (2022-05)
Contrastive Learning for Prompt-Based Few-Shot Language Learners
and 4 more not named here
text_classification_metrics 6 other papers
1 the same month, 5 later
2110.06274 (2021-10)
LiST: Lite Prompted Self-training Makes Parameter-Efficient Few-shot Learners
2205.01308 (2022-05)
Contrastive Learning for Prompt-Based Few-Shot Language Learners
2210.05643 (2022-10)
A Kernel-Based View of Language Model Fine-Tuning
and 3 more not named here
get_logger 4 other papers
1 dated earlier, 3 later
1904.01617 (2019-04)
Attentive Mimicking: Better Word Embeddings by Attending to Informative Contexts
2211.07349 (2022-11)
Finding Skill Neurons in Pre-trained Transformer-based Language Models
2212.09651 (2022-12)
Cross-Lingual Retrieval Augmented Prompt for Low-Resource Languages
and 1 more not named here
eq_div 1 other paper
1 later
2305.12761 (2023-05)
Enhancing Cross-lingual Natural Language Inference by Soft Prompting with Multilingual Verbalizer
lowercase_first 1 other paper
1 later
2305.12761 (2023-05)
Enhancing Cross-lingual Natural Language Inference by Soft Prompting with Multilingual Verbalizer
remove_final_punc 1 other paper
1 later
2305.12761 (2023-05)
Enhancing Cross-lingual Natural Language Inference by Soft Prompting with Multilingual Verbalizer

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

As unlabeled data carry rich task-relevant information, they are proven useful for fewshot learning of language model. The question is how to effectively make use of such data. In this work, we revisit the self-training technique for language model fine-tuning and present a state-of-the-art prompt-based fewshot learner, SFLM. Given two views of a text sample via weak and strong augmentation techniques, SFLM generates a pseudo label on the weakly augmented version. Then, the model predicts the same pseudo label when fine-tuned with the strongly augmented version. This simple approach is shown to outperform other state-of-the-art supervised and semi-supervised counterparts on six sentence classification and six sentence-pair classification benchmarking tasks. In addition, SFLM only relies on a few in-domain unlabeled data. We conduct a comprehensive analysis to demonstrate the robustness of our proposed approach under various settings, including augmentation techniques, model scale, and fewshot knowledge transfer across tasks. 1

For agents

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

get_harvested_code_for_paper("2110.01256")
get_code_for_paper("2110.01256")
have("2110.01256")

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

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

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

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

Connect an agent — have() is free.