SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.05514 · NAACL · 2021

Self-Training with Weak Supervision

Subhabrata Mukherjee, Ahmed Awadallah, Guoqing Zheng, Giannis Karamanolakis

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 4 failures 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/2104.05514.json · badge: /api/ran/2104.05514.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/ASTRA marked official in Papers with Code
Papers with Code archive
5 ran · 3 no recorded run
FunctionStatusWhere it lives
MajorityVoter Ran
ran on a synthesized input · constructed an object; no result was computed
microsoft/ASTRA/astra/RuleAttentionNetwork.py
code served (permissive licence) · get_code("5bd104cc331427b1")
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 an instance of its own class, MajorityVoter: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

# Create a MajorityVoter instance with 3 labels
num_labels = 3

# Create rule_pred: shape (n_samples, n_rules)
# Values should be class indices (0, 1, 2) or -1 (abstain)
# Using shape (4, 5) for 4 samples and 5 rules
rule_pred = np.array([
    [0, 0, 1, -1, 0],      # Sample 0: mostly class 0
    [1, 1, 2, 1, -1],      # Sample 1: mostly class 1
    [2, 2, 2, 0, -1],      # Sample 2: mostly class 2
    [0, 1, 0, 0, 2],       # Sample 3: mostly class 0
], dtype=np.int64)

ARGS = {
    "num_labels": num_labels,
}
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 MajorityVoter — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MajorityVoter 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
MinEntropyLoss Ran
ran; our contract draft was wrong, not the code
microsoft/ASTRA/astra/RuleAttentionNetwork.py
code served (permissive licence) · get_code("f32fd61774a67c5b")
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 function. 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 tensorflow as tf
import numpy as np

def MinEntropyLoss(batch_size):

    def loss(y_true, y_prob):
        per_example_loss = -y_prob * tf.math.log(y_prob)
        return tf.nn.compute_average_loss(per_example_loss, global_batch_size=batch_size)
    return loss


# Setup code to construct valid arguments
batch_size = 2

# Create dummy y_true and y_prob tensors
y_true = tf.constant([[1.0, 0.0, 0.0, 0.0],
                       [0.0, 1.0, 0.0, 0.0]], dtype=tf.float32)

y_prob = tf.constant([[0.7, 0.1, 0.1, 0.1],
                      [0.1, 0.8, 0.05, 0.05]], dtype=tf.float32)

# Construct the loss function
loss_fn = MinEntropyLoss(batch_size)

# Create the ARGS dict
ARGS = {
    "batch_size": batch_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
create_learning_rate_scheduler Ran
ran; our contract draft was wrong, not the code
microsoft/ASTRA/astra/RuleAttentionNetwork.py
code served (permissive licence) · get_code("8cc45bdab04a9a3b")
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 LearningRateScheduler. 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 math
import tensorflow as tf

ARGS = {
    'max_learn_rate': 5e-05,
    'end_learn_rate': 1e-07,
    'warmup_epoch_count': 10,
    'total_epoch_count': 90
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LearningRateScheduler — a LearningRateScheduler output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LearningRateScheduler 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
l1_normalize Ran
ran; our contract draft was wrong, not the code
microsoft/ASTRA/astra/RuleAttentionNetwork.py
code served (permissive licence) · get_code("475912483414ae4d")
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 EagerTensor, ndim 2, dtype family float, shape (2, 4) 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 tensorflow as tf
import numpy as np

# Create a small tensor for testing
# Shape: (batch_size=2, num_labels=4)
# The function will normalize along the last axis
x = tf.constant([[1.0, 2.0, 3.0, 4.0],
                 [2.0, 3.0, 4.0, 5.0]], dtype=tf.float32)

num_labels = 4

ARGS = {
    'x': x,
    'num_labels': num_labels
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
to_one_hot Ran
ran; our contract draft was wrong, not the code
microsoft/ASTRA/astra/RuleAttentionNetwork.py
code served (permissive licence) · get_code("a9b299e92b4afc95")
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 2, dtype family float, shape (3, 4) 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

# Analyze the function:
# - x: gets reshaped to 1D array, used as indices into np.eye(num_classes)
# - num_classes: integer, dimension of one-hot encoding

# Create valid arguments
x = np.array([0, 2, 1])  # class indices, will be reshaped to 1D
num_classes = 4  # number of classes for one-hot encoding

ARGS = {
    "x": x,
    "num_classes": num_classes
}
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 2, dtype family float, shape (3, 4) — shape (3, 4) 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
RAN Not yet run
unverified (harvested, no recorded run)
microsoft/ASTRA/astra/RuleAttentionNetwork.py
code served (permissive licence) · get_code("56b51e9592950345")
How it ran

no invocation recorded.

construct_rule_network Not yet run
unverified (harvested, no recorded run)
microsoft/ASTRA/astra/RuleAttentionNetwork.py
code served (permissive licence) · get_code("5cf01877f237896d")
How it ran

no invocation recorded.

normalize_with_random_rule Not yet run
unverified (harvested, no recorded run)
microsoft/ASTRA/astra/RuleAttentionNetwork.py
code served (permissive licence) · get_code("c0b2adb20625f132")
How it ran

no invocation recorded.

Also present in other papers' code

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

State-of-the-art deep neural networks require large-scale labeled training data that is often expensive to obtain or not available for many tasks. Weak supervision in the form of domainspecific rules has been shown to be useful in such settings to automatically generate weakly labeled training data. However, learning with weak rules is challenging due to their inherent heuristic and noisy nature. An additional challenge is rule coverage and overlap, where prior work on weak supervision only considers instances that are covered by weak rules, thus leaving valuable unlabeled data behind. In this work, we develop a weak supervision framework (ASTRA 1 ) that leverages all the available data for a given task. To this end, we leverage task-specific unlabeled data through self-training with a model (student) that considers contextualized representations and predicts pseudo-labels for instances that may not be covered by weak rules. We further develop a rule attention network (teacher) that learns how to aggregate student pseudo-labels with weak rule labels, conditioned on their fidelity and the underlying context of an instance. Finally, we construct a semi-supervised learning objective for end-to-end training with unlabeled data, domain-specific rules, and a small amount of labeled data. Extensive experiments on six benchmark datasets for text classification demonstrate the effectiveness of our approach with significant improvements over state-of-the-art baselines.

For agents

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

get_harvested_code_for_paper("2104.05514")
get_code_for_paper("2104.05514")
have("2104.05514")

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

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

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

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

Connect an agent — have() is free.