SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2022.naacl-main.64 · NAACL · 2022

WALNUT: A Benchmark on Semi-weakly Supervised Learning for Natural Language Understanding

Ahmed Awadallah, Guoqing Zheng, Kai Shu, Giannis Karamanolakis

Open in the Atlas

Code that ran

8 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; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-24; 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/2022.naacl-main.64.json · badge: /api/ran/2022.naacl-main.64.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/MLC canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
flip_labels_C Ran
ran on a synthesized input
microsoft/MLC/CIFAR/load_corrupted_data_mlg.py
code served (permissive licence) · get_code("74fa122d15c0f3ce")
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 (5, 5) 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

ARGS = {
    "corruption_prob": 0.3,
    "num_classes": 5,
    "seed": 42,
}
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 (5, 5) — shape (5, 5) 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
flip_labels_C_two Ran
ran on a synthesized input
microsoft/MLC/CIFAR/load_corrupted_data_mlg.py
code served (permissive licence) · get_code("394e8668227b39c9")
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 (5, 5) 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

def flip_labels_C_two(corruption_prob, num_classes, seed=1):
    """
    returns a matrix with (1 - corruption_prob) on the diagonals, and corruption_prob
    concentrated in only one other entry for each row
    """
    np.random.seed(seed)
    C = np.eye(num_classes) * (1 - corruption_prob)
    row_indices = np.arange(num_classes)
    for i in range(num_classes):
        C[i][np.random.choice(row_indices[row_indices != i], 2, replace=False)] = corruption_prob / 2
    return C

ARGS = {
    "corruption_prob": 0.1,
    "num_classes": 5,
    "seed": 42
}
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 (5, 5) — shape (5, 5) 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
get_logger Ran
ran on a synthesized input
microsoft/MLC/logger.py
code served (permissive licence) · get_code("22905be7a3378c0f")
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 RootLogger. 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
import tempfile
import os

# Create a temporary file for logging (will be used when filename is not None)
temp_dir = tempfile.gettempdir()
log_filename = os.path.join(temp_dir, "test_logger.log")

ARGS = {
    "filename": log_filename,
    "local_rank": 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 RootLogger — a RootLogger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RootLogger 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
resnet32 Ran
ran; our contract draft was wrong, not the code
microsoft/MLC/CIFAR/resnet.py
code served (permissive licence) · get_code("b4009156896f530b")
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 ResNet. 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 = {
    'num_classes': 10
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
soft_cross_entropy Ran
ran on a synthesized input
microsoft/MLC/mlc_utils.py
code served (permissive licence) · get_code("d8cf974088fe695e")
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 0, dtype family float, shape () 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create tiny tensors for the function
batch_size = 2
num_classes = 4

# logit: model output logits, shape (batch_size, num_classes)
logit = torch.randn(batch_size, num_classes)

# pseudo_target: soft target probabilities, shape (batch_size, num_classes)
# Should sum to 1 along the class dimension
pseudo_target = torch.softmax(torch.randn(batch_size, num_classes), dim=-1)

# reduction: one of 'mean', 'none', 'sum'
reduction = 'mean'

ARGS = {
    'logit': logit,
    'pseudo_target': pseudo_target,
    'reduction': reduction,
}
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 0, dtype family float, shape () — shape () 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
tocuda Ran
ran on a synthesized input
microsoft/MLC/mlc_utils.py
code served (permissive licence) · get_code("d7fb2de38378a382")
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 (2, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn

torch.manual_seed(0)

# Test case 1: single tensor in a list
single_tensor = torch.randn(2, 4)
data_single_list = [single_tensor]

# Test case 2: multiple tensors in a list
tensor1 = torch.randn(2, 4)
tensor2 = torch.randn(3, 5)
data_multi_list = [tensor1, tensor2]

# Test case 3: single tensor (not in a list)
single_tensor_direct = torch.randn(2, 4)

# We'll use the single tensor case as the primary test
ARGS = {
    "data": single_tensor_direct
}
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 (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
uniform_mix_C Ran
ran on a synthesized input
microsoft/MLC/CIFAR/load_corrupted_data_mlg.py
code served (permissive licence) · get_code("ba6749b25e502f54")
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 (5, 5) 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

# Construct valid arguments for uniform_mix_C
mixing_ratio = 0.3
num_classes = 5

ARGS = {
    "mixing_ratio": mixing_ratio,
    "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 (5, 5) — shape (5, 5) 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
update_params_sgd Ran
ran on a synthesized input
microsoft/MLC/mlc.py
code served (permissive licence) · get_code("e09eb4814ee96cd9")
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. 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
import torch.optim as optim

torch.manual_seed(0)

# Create small parameter tensors
param1 = torch.randn(4, 3, requires_grad=True)
param2 = torch.randn(2, 5, requires_grad=True)
params = [param1, param2]

# Create corresponding gradients
grad1 = torch.randn(4, 3)
grad2 = torch.randn(2, 5)
grads = [grad1, grad2]

# Create an SGD optimizer with momentum
opt = optim.SGD(params, lr=0.1, momentum=0.9, dampening=0.0, weight_decay=0.01, nesterov=False)

# Simulate some optimizer state
opt.state[param1]['momentum_buffer'] = torch.zeros_like(param1)
opt.state[param2]['momentum_buffer'] = torch.zeros_like(param2)

# Create args dict (minimal config)
class Args:
    pass

args = Args()

# Set up ARGS dictionary
ARGS = {
    'params': params,
    'grads': grads,
    'eta': 0.01,
    'opt': opt,
    'args': args,
    'deltaonly': False,
    'return_s': False
}
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 — a list output has no array shape of its own; none is 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
clone_parameters Not yet run
unverified (harvested, no recorded run)
microsoft/MLC/mlc_utils.py
code served (permissive licence) · get_code("4fc1daf5ede1c34f")
How it ran

no invocation recorded.

step_hmlc_K Not yet run
unverified (harvested, no recorded run)
microsoft/MLC/mlc.py
code served (permissive licence) · get_code("4fdf2253fd80498b")
How it ran

no invocation recorded.

update_params Not yet run
unverified (harvested, no recorded run)
microsoft/MLC/mlc.py
code served (permissive licence) · get_code("a679c2cf98f9c0e3")
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, 11 are also present in other papers whose code we hold (11 with at least one paper dated earlier, 0 the same month, 1 later) and 0 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
resnet32 6 other papers
3 dated earlier, 2 later, 1 same year, order not determinable
1511.00561 (2015-11)
SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation
1911.03809 (2019-11)
Meta Label Correction for Noisy Label Learning
2006.12557 (2020-06)
Just How Toxic is Data Poisoning? A Unified Benchmark for Backdoor and Data Poisoning Attacks
and 3 more not named here
uniform_mix_C 6 other papers
6 dated earlier
1802.05300 (2018-02)
Using Trusted Data to Train Deep Networks on Labels Corrupted by Severe Noise
1901.09960 (2019-01)
Using Pre-Training Can Improve Model Robustness and Uncertainty
1902.07379 (2019-02)
Meta-Weight-Net: Learning an Explicit Mapping For Sample Weighting
and 3 more not named here
flip_labels_C 5 other papers
5 dated earlier
1802.05300 (2018-02)
Using Trusted Data to Train Deep Networks on Labels Corrupted by Severe Noise
1901.09960 (2019-01)
Using Pre-Training Can Improve Model Robustness and Uncertainty
1902.07379 (2019-02)
Meta-Weight-Net: Learning an Explicit Mapping For Sample Weighting
and 2 more not named here
flip_labels_C_two 3 other papers
3 dated earlier
1902.07379 (2019-02)
Meta-Weight-Net: Learning an Explicit Mapping For Sample Weighting
1911.03809 (2019-11)
Meta Label Correction for Noisy Label Learning
2008.00627 (2020-08)
Learning to Purify Noisy Labels via Meta Soft Label Corrector
clone_parameters 1 other paper
1 dated earlier
1911.03809 (2019-11)
Meta Label Correction for Noisy Label Learning
get_logger 1 other paper
1 dated earlier
1911.03809 (2019-11)
Meta Label Correction for Noisy Label Learning
soft_cross_entropy 1 other paper
1 dated earlier
1911.03809 (2019-11)
Meta Label Correction for Noisy Label Learning
step_hmlc_K 1 other paper
1 dated earlier
1911.03809 (2019-11)
Meta Label Correction for Noisy Label Learning
tocuda 1 other paper
1 dated earlier
1911.03809 (2019-11)
Meta Label Correction for Noisy Label Learning
update_params 1 other paper
1 dated earlier
1911.03809 (2019-11)
Meta Label Correction for Noisy Label Learning
update_params_sgd 1 other paper
1 dated earlier
1911.03809 (2019-11)
Meta Label Correction for Noisy Label Learning

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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Building machine learning models for natural language understanding (NLU) tasks relies heavily on labeled data. Weak supervision has been proven valuable when large amount of labeled data is unavailable or expensive to obtain. Existing works studying weak supervision for NLU either mostly focus on a specific task or simulate weak supervision signals from ground-truth labels. It is thus hard to compare different approaches and evaluate the benefit of weak supervision without access to a unified and systematic benchmark with diverse tasks and real-world weak labeling rules. In this paper, we propose such a benchmark, named WALNUT 1 , to advocate and facilitate research on weak supervision for NLU. WALNUT consists of NLU tasks with different types, including document-level and token-level prediction tasks. WALNUT is the first semi-weakly supervised learning benchmark for NLU, where each task contains weak labels generated by multiple real-world weak sources, together with a small set of clean labels. We conduct baseline evaluations on WALNUT to systematically evaluate the effectiveness of various weak supervision methods and model architectures. Our results demonstrate the benefit of weak supervision for low-resource NLU tasks and highlight interesting patterns across tasks. We expect WALNUT to stimulate further research on methodologies to leverage weak supervision more effectively. The benchmark and code for baselines are available at aka.ms/walnut_benchmark. Denoise-multi-weak-sources/blob/master/rules-noisy-labels/Agnews/angews_rule.py Rule name Description 1. world1 Keyword-based detection of the WORLD topic 2. world2 Keyword-based detection of the WORLD topic 3. sports1 Keyword-based detection of the SPORTS topic 4. sports2 Keyword-based detection of the SPORTS topic 5. sports3 Keyword-based detection of the SPORTS topic 6. tech1 Keyword-based detection of the TECH topic 7. tech2 Keyword-based detection of the TECH topic 8. business1 Keyword-based detection of the BUSINESS topic 9. business2 Keyword-based detection of the BUSINESS topic Table 7: List of rules for the IMDB dataset. The rules are the same as in (Zhang et al., 2015). The Python implementations can be found in: https://github.com/weakrules/Denoise-multi-weak-sources/blob/ master/rules-noisy-labels/IMDB/imdb_rule.py Rule name Description 1. expression_nexttime Regex-based detection of POSITIVE sentiment (re-watching expressions) 2. expression_recommend Regex-based detection of POSITIVE sentiment (recommendation expressions) 3. expression_value Regex-based detection of POSITIVE sentiment (value expressions) 4. keyword_compare Keyword-based detection of NEGATIVE sentiment based on movie comparisons 5. keyword_general Keyword-based detection of POSITIVE and NEGATIVE sentiment 6. keyword_actor Keyword-based detection of POSITIVE sentiment regarding the actors 7. keyword_finish Keyword-based detection of NEGATIVE sentiment 8. keyword_plot Keyword-based detection of POSITIVE and NEGATIVE sentiment regarding the plot Table 8: List of rules for the Yelp dataset. The rules are the same as in (Zhang et al., 2015). The Python implementations can be found in: https://github.com/weakrules/Denoise-multi-weak-sources/blob/master/ rules-noisy-labels/Yelp/yelp_rules.py Rule name Description 1. textblob_lf Model-based detection of POSITIVE and NEGATIVE sentiment (TextBlob model) 2. keyword_recommend Regex-based detection of POSITIVE sentiment (recommendation expressions) 3. keyword_general Regex-based detection of POSITIVE and POSITIVE sentiment (general expressions) 4. keyword_mood Keyword-based detection of POSITIVE and NEGATIVE sentiment based on the user's mood 5. keyword_service Keyword-based detection of POSITIVE and NEGATIVE sentiment relevant to the service 6. keyword_price Keyword-based detection of POSITIVE and NEGATIVE sentiment regarding the prices 7. keyword_environment Keyword-based detection of POSITIVE and NEGATIVE sentiment relevant to the ambience 8. keyword_food Keyword-based detection of POSITIVE and NEGATIVE sentiment relevant to the food

For agents

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

get_harvested_code_for_paper("2022.naacl-main.64")
get_code_for_paper("2022.naacl-main.64")
have("2022.naacl-main.64")

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

curl https://syntology.ai/api/ran/2022.naacl-main.64.json

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

[![Syntology run record](https://syntology.ai/api/ran/2022.naacl-main.64.svg)](https://syntology.ai/paper/2022.naacl-main.64)

Connect an agent — have() is free.