SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1909.00126 · 2019

A Logic-Driven Framework for Consistency of Neural Models

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 2 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 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/1909.00126.json · badge: /api/ran/1909.00126.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
utahnlp/consistency canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
get_confusion_matrix Ran
ran on a synthesized input
utahnlp/consistency/confusion_table.py
code served (permissive licence) · get_code("123846fe86b24e7f")
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 2, 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - left: iterable of values to compare (predictions)
# - right: iterable of values to compare (ground truth)
# - labels: iterable of label values to construct confusion matrix rows/cols
# The function zips left and right, so they need same length
# It checks equality with labels, so all should be comparable types

# Create simple integer labels and predictions
left = [0, 1, 0, 1, 0]  # predicted labels
right = [0, 1, 1, 1, 0]  # ground truth labels
labels = [0, 1]  # unique label values

ARGS = {
    "left": left,
    "right": right,
    "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 list, ndim 2, 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
get_confusion_ratio Ran
ran on a synthesized input
utahnlp/consistency/confusion_table.py
code served (permissive licence) · get_code("7e87c334bb7df236")
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 2, 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

torch.manual_seed(0)

# Analyzing the function:
# - get_confusion_ratio takes a parameter 'mat'
# - It iterates over rows in mat
# - For each row, it iterates over items
# - It divides each item by sum(row)
# - This looks like a confusion matrix (2D structure of numbers)

# Create a small confusion matrix as a list of lists
# Using distinct dimensions: 3 rows x 4 columns for clarity
mat = [
    [10, 5, 2, 1],
    [3, 20, 4, 2],
    [1, 2, 15, 3]
]

ARGS = {
    "mat": mat
}
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 2, 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
get_glove_words Ran
ran on a synthesized input
utahnlp/consistency/extra_preprocess.py
code served (permissive licence) · get_code("02f680c0cdae0af1")
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 set. 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 tempfile
import os

# Create a temporary GloVe-format file
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("hello 0.1 0.2 0.3 0.4\n")
temp_file.write("world 0.5 0.6 0.7 0.8\n")
temp_file.write("python 0.9 1.0 1.1 1.2\n")
temp_file.close()

ARGS = {
    'f': temp_file.name
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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 Ran
ran on a synthesized input
utahnlp/consistency/confusion_table.py
code served (permissive licence) · get_code("9cd88edf7b072d2d")
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 tempfile
import os

# Create a temporary file with sample prediction data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("sample 0\n")
temp_file.write("sample 1\n")
temp_file.write("\n")
temp_file.write("sample 2\n")
temp_file.write("sample 3\n")
temp_file.close()

path = temp_file.name

ARGS = {
    'path': path
}
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 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
make_vocab Ran
ran on a synthesized input
utahnlp/consistency/extra_preprocess.py
code served (permissive licence) · get_code("05c8b6f42e3dc2fb")
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 int, ndim 0, dtype family int, 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 numpy as np

class MockWordIndexer:
    """Mock word indexer that tracks registered words."""
    def __init__(self):
        self.word_set = set()
    
    def register_words(self, glove_vocab, words, count):
        """Register words that exist in glove_vocab."""
        for word in words:
            if word in glove_vocab:
                self.word_set.add(word)
                count[word] = count.get(word, 0) + 1
    
    def register_all_words(self, words, count):
        """Register all words regardless of glove_vocab."""
        for word in words:
            self.word_set.add(word)
            count[word] = count.get(word, 0) + 1

class MockLabelIndexer:
    """Mock label indexer that tracks registered labels."""
    def __init__(self):
        self.label_set = set()
    
    def register_all_words(self, labels, count):
        """Register all labels."""
        for label in labels:
            self.label_set.add(label)
            count[label] = count.get(label, 0) + 1

# Create mock objects
opt = {"embedding_dim": 300, "max_seq_length": 10}

glove_vocab = {"hello", "world", "this", "is", "a", "test", "example", "sentence"}

word_indexer = MockWordIndexer()
all_word_indexer = MockWordIndexer()
label_indexer = MockLabelIndexer()

# Create sample sentences (sent1 and sent2)
sent1 = [
    "hello world this is test",
    "a test example sentence here"
]

sent2 = [
    "this is a test",
    "example sentence"
]

# Create labels
label = ["pos", "neg"]

# Parameters
max_seq_l = 10
count = {}

ARGS = {
    "opt": opt,
    "glove_vocab": glove_vocab,
    "word_indexer": word_indexer,
    "all_word_indexer": all_word_indexer,
    "label_indexer": label_indexer,
    "sent1": sent1,
    "sent2": sent2,
    "label": label,
    "max_seq_l": max_seq_l,
    "count": count
}
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 int, ndim 0, dtype family int, 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
pad Ran
ran on a synthesized input
utahnlp/consistency/extra_preprocess.py
code served (permissive licence) · get_code("da8e4408c385c601")
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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - ls: a list that supports len(), slicing, and concatenation with lists
# - length: an integer specifying target length
# - symbol: a value to use for padding
# - pad_back: a boolean controlling padding direction

# Create test arguments
test_list = [1, 2, 3]
target_length = 7
pad_symbol = 0
pad_direction = True

ARGS = {
    "ls": test_list,
    "length": target_length,
    "symbol": pad_symbol,
    "pad_back": pad_direction
}
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 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
warmup_constant Ran
ran, honoured the contract we drafted
utahnlp/consistency/bert_adam.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from sejong-rcv/TAME, is pointer only (licence: NONE) · get_code("59e4e730a9dc5dc6")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from sejong-rcv/TAME, 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.

warmup_linear Ran
ran, honoured the contract we drafted
utahnlp/consistency/bert_adam.py
code served (permissive licence) · get_code("e0960afdb0d64aa7")
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) and returned float, 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

torch.manual_seed(0)

ARGS = {
    "x": 0.001,
    "warmup": 0.002
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
load_pipeline Not yet run
unverified (harvested, no recorded run)
utahnlp/consistency/cache_bert_batch.py
code served (permissive licence) · get_code("34fb8d968db79ca7")
How it ran

no invocation recorded.

warmup_cosine Not yet run
unverified (harvested, no recorded run)
utahnlp/consistency/bert_adam.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Yueeeeeeee/Self-Supervised-QA, is pointer only (licence: NONE) · get_code("35f7cddf90dd05d4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Yueeeeeeee/Self-Supervised-QA, 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. 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, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 3 later) and 5 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
warmup_constant 28 other papers
5 dated earlier, 23 later
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1903.09588 (2019-03)
Utilizing BERT for Aspect-Based Sentiment Analysis via Constructing Auxiliary Sentence
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
and 25 more not named here
warmup_cosine 17 other papers
4 dated earlier, 13 later
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1903.09588 (2019-03)
Utilizing BERT for Aspect-Based Sentiment Analysis via Constructing Auxiliary Sentence
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
and 14 more not named here
warmup_linear 14 other papers
1 dated earlier, 13 later
1908.09355 (2019-08)
Patient Knowledge Distillation for BERT Model Compression
2021.emnlp-main.518 (2021 (year only))
NDH-FULL: Learning and Evaluating Navigational Agents on Full-Length Dialogue
2104.09791 (2021-04)
B-PROP: Bootstrapped Pre-training with Representative Words Prediction for Ad-hoc Retrieval
and 11 more not named here
get_glove_words 1 other paper
1 dated earlier
1606.01933 (2016-06)
A Decomposable Attention Model for Natural Language Inference
pad 1 other paper
1 dated earlier
1606.01933 (2016-06)
A Decomposable Attention Model for Natural Language Inference

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

While neural models show remarkable accuracy on individual predictions, their internal beliefs can be inconsistent across examples. In this paper, we formalize such inconsistency as a generalization of prediction error. We propose a learning framework for constraining models using logic rules to regularize them away from inconsistency. Our framework can leverage both labeled and unlabeled examples and is directly compatible with off-the-shelf learning schemes without model redesign. We instantiate our framework on natural language inference, where experiments show that enforcing invariants stated in logic can help make the predictions of neural models both accurate and consistent.

For agents

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

get_harvested_code_for_paper("1909.00126")
get_code_for_paper("1909.00126")
have("1909.00126")

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

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

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

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

Connect an agent — have() is free.