SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.06733 · 2022

Arithmetic-Based Pretraining -- Improving Numeracy of Pretrained Language Models

arXiv · PDF · Open in the Atlas

Code that ran

15 of 16 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; 1 honoured the contract we drafted, 0 violated it and 13 have no contract verdict; 1 failure of our instrument; 1 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/2205.06733.json · badge: /api/ran/2205.06733.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
ukplab/emnlp2022-reasoning-aware-pretraining canonical (classifier label)
classifier basis not recorded on the link
14 ran · 1 no recorded run
ukplab/starsem2023-arithmetic-based-pretraining canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
MNRLoss Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/losses.py
code served (permissive licence) · get_code("db28bccfc5903f08")
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
from torch.nn import CrossEntropyLoss

torch.manual_seed(0)

# Create small embedding tensors
# embeddings_a: shape (batch_size, embedding_dim) = (2, 4)
embeddings_a = torch.randn(2, 4)

# embeddings_b: shape (batch_size, embedding_dim) = (2, 4)
embeddings_b = torch.randn(2, 4)

# scale parameter
scale = 20.0

ARGS = {
    "embeddings_a": embeddings_a,
    "embeddings_b": embeddings_b,
    "scale": scale,
}
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
char_level_representation_encoding Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/char_level_representation.py
code served (permissive licence) · get_code("83a07f606672603b")
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
from transformers import BartTokenizer

torch.manual_seed(0)

# Create a minimal BART tokenizer stand-in
class MinimalBartTokenizer:
    def __init__(self):
        self.vocab = {
            '<s>': 0,
            '</s>': 2,
            '<pad>': 1,
            'hello': 3,
            'world': 4,
            '1': 5,
            '2': 6,
            '3': 7,
            '4': 8,
            '[F]': 9,
            'the': 10,
            'quick': 11,
            'brown': 12,
            'fox': 13,
        }
    
    def tokenize(self, text):
        # Simple word-based tokenization
        tokens = text.split()
        result = []
        for token in tokens:
            if token in self.vocab:
                result.append(token)
            else:
                # Split into characters if not in vocab
                result.extend(list(token))
        return result
    
    def convert_tokens_to_ids(self, tokens):
        ids = []
        for token in tokens:
            if token in self.vocab:
                ids.append(self.vocab[token])
            else:
                # Default to unknown token id
                ids.append(1)
        return ids

# Create tokenizer instance
tokenizer = MinimalBartTokenizer()

# Define arguments
ARGS = {
    'text': 'hello world 123 quick brown fox',
    'tokenizer': tokenizer,
    'max_length': 32
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — 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
char_level_representation_impl Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/char_level_representation.py
code served (permissive licence) · get_code("4bdcc6fd40a2753c")
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 tuple. 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.

# Setup code for char_level_representation_impl

# Analyze the function:
# - Takes a list parameter 'text'
# - The function iterates through the list looking for '[F]' markers
# - It processes elements between pairs of '[F]' markers
# - Returns a tuple of (list of strings, list of tuples)

# Create a tokenized text with '[F]' markers
# Structure: some tokens, then [F], some number tokens, [F], more tokens, etc.

text_input = [
    'hello',
    '[F]',
    '1',
    '2',
    '3',
    '4',
    '[F]',
    'world',
    '[F]',
    '5',
    '6',
    '[F]',
    'test'
]

ARGS = {
    'text': text_input
}
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 tuple — a tuple 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
convert_text_scientific_notation Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/scientific_notation.py
code served (permissive licence) · get_code("112d014b2004b7e4")
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 re

def convert_text_scientific_notation(text: str, special_tokens: list) -> str:
    """
        method for converting the output of using the scientific notation.
        in this case, the special tokens are not automatically removed, 
        because needs to be handled separately.
        :param text: passed text to be post-processed
        :param special_tokens: list of special tokens
        :return post-processed string
    """
    text = re.sub(' <EXP> ', '.', text)
    for token in special_tokens:
        text = text.replace(token, ' ')
    text = re.sub(' +', ' ', text)
    text = ' '.join(text.split())
    return text


ARGS = {
    "text": "The value is 1 <EXP> 5 <special1> and 2 <EXP> 3 <special2> here",
    "special_tokens": ["<special1>", "<special2>"]
}
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
count_trainable_parameters Ran
ran, honoured the contract we drafted
ukplab/emnlp2022-reasoning-aware-pretraining/callbacks.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from manga-uofa/fdistill, is pointer only (licence: NONE) · get_code("a3826392847cbef3")
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 manga-uofa/fdistill, 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.

get_checkpoint_callback Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/callbacks.py
code served (permissive licence) · get_code("c2d5c83a83cd96ef")
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 ModelCheckpoint. 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 tempfile
from pathlib import Path

# Create a temporary directory for output
output_dir = tempfile.mkdtemp()

# Define the arguments dictionary
ARGS = {
    'output_dir': output_dir,
    'metric': 'val_rouge2'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pytorch_lightning, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ModelCheckpoint — a ModelCheckpoint output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModelCheckpoint 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_early_stopping_callback Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/callbacks.py
code served (permissive licence) · get_code("5aa0f4cc91bef627")
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 EarlyStopping. 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 pytorch_lightning.callbacks import EarlyStopping

torch.manual_seed(0)

ARGS = {
    'metric': 'val_loss',
    'patience': 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pytorch_lightning, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EarlyStopping — a EarlyStopping output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a EarlyStopping 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_lines Ran
ran; our contract draft was wrong, not the code
ukplab/starsem2023-arithmetic-based-pretraining/evaluation/evaluate.py
code served (permissive licence) · get_code("f28ffee2040b376b")
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 tempfile
import os

# Create a temporary file with some test content
temp_dir = tempfile.mkdtemp()
test_file = os.path.join(temp_dir, "test.txt")

with open(test_file, 'w') as f:
    f.write("line one\n")
    f.write("line two\n")
    f.write("\n")
    f.write("line three\n")
    f.write("   \n")

ARGS = {
    "file": test_file
}
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
get_lines Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/metrics.py
code served (permissive licence) · get_code("eae00458a5958ff0")
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 tempfile
import os

# Create a temporary file with some test content
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, encoding='utf-8', suffix='.txt')
temp_file.write("line one\n")
temp_file.write("line two\n")
temp_file.write("line three with spaces   \n")
temp_file.write("\n")  # empty line (will be filtered out due to len(line) > 1 check)
temp_file.write("line four\n")
temp_file.close()

ARGS = {
    'fil': 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 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
get_scientific_notation Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/scientific_notation.py
code served (permissive licence) · get_code("3966b063074a6009")
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 re

def get_scientific_notation(token: str) -> str:
    """
        Method for changing the representation of a passed string;
        if it is a number, it will be replaced with scientific
        notification (314.1 -> 314 <EXP> 1), see also 
        https://arxiv.org/pdf/2010.05345.pdf (NumBERT)
    """
    return str(token).replace('.', ' <EXP> ') if re.match('[(+-]?(\\d*\\.)\\d+', token) else token


ARGS = {
    "token": "314.1"
}
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
is_float Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/utils.py
code served (permissive licence) · get_code("0327ea5057921c8d")
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 bool, 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 numpy as np

def is_float(num):
    try:
        float(num)
        return True
    except ValueError:
        return False

# The function takes a single parameter 'num' and attempts to convert it to float
# It returns True if conversion succeeds, False if ValueError is raised
# We need to provide valid test cases

ARGS = {
    "num": 3.14
}
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 bool, 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
masked_loss Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/losses.py
code served (permissive licence) · get_code("78a995a45343b076")
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
from torch.nn import CrossEntropyLoss

torch.manual_seed(0)

# Build arguments for masked_loss function
batch = {
    'masked_ids_target': [
        [0, 1],  # indices for first sample
        [1, 2],  # indices for second sample
    ]
}

# lm_labels: list of tensors, one per batch item
# Each tensor has shape (seq_len, vocab_size) or similar
lm_labels = [
    torch.randn(4, 5),  # 4 positions, 5 classes
    torch.randn(4, 5),  # 4 positions, 5 classes
]

# predictions: list of tensors, one per batch item
# Each tensor has shape (seq_len, vocab_size)
predictions = [
    torch.randn(4, 5),  # 4 positions, 5 classes
    torch.randn(4, 5),  # 4 positions, 5 classes
]

# prev_loss: can be None or a tensor
prev_loss = None

# step: integer stride for iteration
step = 1

ARGS = {
    'batch': batch,
    'lm_labels': lm_labels,
    'predictions': predictions,
    'prev_loss': prev_loss,
    'step': step,
}
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
pad_or_trim Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/char_level_representation.py
code served (permissive licence) · get_code("bd8cd57d2905efde")
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 tuple. 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)

# Create a tensor to be padded or trimmed (dimension 0 is sequence length, dimension 1 is feature dim)
tensor = torch.randn(5, 4)

# Max length for padding/trimming
max_length = 8

# EOS token (end of sequence) - should match feature dimension
eos = torch.randn(1, 4)

# PAD token - should match feature dimension
pad = torch.randn(1, 4)

ARGS = {
    "tensor": tensor,
    "max_length": max_length,
    "eos": eos,
    "pad": pad,
}
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 tuple — a tuple 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
rebuild_string_in_new_notation Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/scientific_notation.py
code served (permissive licence) · get_code("05764486881f3364")
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 re

def get_scientific_notation(token: str) -> str:
    """
        Method for changing the representation of a passed string;
        if it is a number, it will be replaced with scientific
        notification (314.1 -> 314 <EXP> 1), see also 
        https://arxiv.org/pdf/2010.05345.pdf (NumBERT)
    """
    return str(token).replace('.', ' <EXP> ') if re.match('[(+-]?(\\d*\\.)\\d+', token) else token

def rebuild_string_in_new_notation(text: str) -> str:
    """
        Method for rebuilding a passed string in
        scientific notation
        :param text: string to be rebuild
        :return: string in scientific notation
    """
    splitted = text.split()
    return ' '.join([get_scientific_notation(token) for token in splitted])


# Setup code
ARGS = {
    "text": "hello 3.14 world 2.71 test"
}
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
trim_batch Ran
ran on a synthesized input
ukplab/emnlp2022-reasoning-aware-pretraining/utils.py
code served (permissive licence) · get_code("75996269cea01a0c")
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 tuple, ndim 3, 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

torch.manual_seed(0)

# Create small tensors for the batch
# batch_size=2, seq_length=4
input_ids = torch.tensor([
    [101, 102, 103, 0],
    [101, 102, 0, 0]
], dtype=torch.long)

# Attention mask with same shape
attention_mask = torch.tensor([
    [1, 1, 1, 0],
    [1, 1, 0, 0]
], dtype=torch.long)

# Pad token ID
pad_token_id = 0

# trim_pos: max length to trim to (integer)
trim_pos = 3

ARGS = {
    "input_ids": input_ids,
    "pad_token_id": pad_token_id,
    "attention_mask": attention_mask,
    "trim_pos": trim_pos
}
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 tuple, ndim 3, dtype family int — a tuple 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
add_args Not yet run
unverified (harvested, no recorded run)
ukplab/emnlp2022-reasoning-aware-pretraining/args.py
code served (permissive licence) · get_code("abd5798bdcfa8197")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 3 later) and 13 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
count_trainable_parameters 13 other papers
7 dated earlier, 6 later
1911.13299 (2019-11)
What's Hidden in a Randomly Weighted Neural Network?
2007.08426 (2020-07)
Investigating Pretrained Language Models for Graph-to-Text Generation
2010.05953 (2020-10)
COMET-ATOMIC 2020: On Symbolic and Neural Commonsense Knowledge Graphs
and 10 more not named here
char_level_representation_impl 1 other paper
1 later
2305.17491 (2023-05)
FERMAT: An Alternative to Accuracy for Numerical Reasoning
pad_or_trim 1 other paper
1 later
2305.17491 (2023-05)
FERMAT: An Alternative to Accuracy for Numerical Reasoning

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 pretrained language models tend to perform below their capabilities when applied out-of-the-box on tasks that require understanding and working with numbers. Recent work suggests two main reasons for this: (1) popular tokenisation algorithms have limited expressiveness for numbers, and (2) common pretraining objectives do not target numeracy. Approaches that address these shortcomings usually require architectural changes or pretraining from scratch. In this paper, we propose a new extended pretraining approach called Arithmetic-Based Pretraining that jointly addresses both in one extended pretraining step without requiring architectural changes or pretraining from scratch. Arithmetic-Based Pretraining combines contrastive learning to improve the number representation, and a novel extended pretraining objective called Inferable Number Prediction Task to improve numeracy. Our experiments show the effectiveness of Arithmetic-Based Pretraining in three different tasks that require improved numeracy, i.e., reading comprehension in the DROP dataset, inference-on-tables in the InfoTabs dataset, and table-to-text generation in the WikiBio and SciGen datasets.

For agents

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

get_harvested_code_for_paper("2205.06733")
get_code_for_paper("2205.06733")
have("2205.06733")

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

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

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

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

Connect an agent — have() is free.