SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.02691 · 2022

LUNA: Language Understanding with Number Augmentations on Transformers via Number Plugins and Pre-training

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 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 1 has no contract verdict; 1 failure of our instrument; 0 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/2212.02691.json · badge: /api/ran/2212.02691.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
zmy/luna canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
collate_fn Ran
ran; our contract draft was wrong, not the code
zmy/luna/phases/numerical_field/Pretrain.py
code served (permissive licence) · get_code("c1b5b4cf08a7ed6a")
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 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)

# Analyze the function:
# - collate_fn takes 'data' parameter
# - data is a list of tuples where each tuple has 3 elements:
#   - data[i][0]: a dict with keys that can be stacked into tensors
#   - data[i][1]: a list of numbers
#   - data[i][2]: a tensor that can be stacked

# Create sample data matching the expected structure
batch_size = 2
num_keys = 3
tensor_dim = 4

# Create individual data items
data_item_1 = (
    {
        'key_a': torch.randn(tensor_dim),
        'key_b': torch.randn(tensor_dim),
        'key_c': torch.randn(tensor_dim),
    },
    [1, 2, 3],
    torch.randn(tensor_dim)
)

data_item_2 = (
    {
        'key_a': torch.randn(tensor_dim),
        'key_b': torch.randn(tensor_dim),
        'key_c': torch.randn(tensor_dim),
    },
    [4, 5],
    torch.randn(tensor_dim)
)

# Create the batch (list of data items)
data = [data_item_1, data_item_2]

ARGS = {
    'data': data
}
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 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
get_coef Ran
ran, honoured the contract we drafted
zmy/luna/phases/numerical_field/Pretrain.py
code served (permissive licence) · get_code("5d3a76dcc66fcb8e")
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 tuple, 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 torch
import numpy as np

torch.manual_seed(0)

# Analyze the function: it takes config (dict) and alpha (numeric)
# and returns a tuple based on boolean flags in config

config = {
    'use_distrib': True,
    'use_mlm': True,
    'use_distill': True
}

alpha = 0.5

ARGS = {
    'config': config,
    'alpha': alpha
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — 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
prepare_data Ran
ran on a synthesized input
zmy/luna/phases/downstream_tasks/TAT/runner.py
code served (permissive licence) · get_code("5232978e81b1af1f")
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 DataLoader. 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 torch.utils.data import Dataset

torch.manual_seed(0)

# Create a minimal dataset
class DummyDataset(Dataset):
    def __init__(self, size=10):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return torch.randn(4), torch.randint(0, 2, (1,))

# Create a minimal collate function
def dummy_collate_fn(batch):
    xs = torch.stack([item[0] for item in batch])
    ys = torch.stack([item[1] for item in batch])
    return xs, ys

# Create a minimal args object
class Args:
    def __init__(self):
        self.world_size = 1
        self.rank = 0
        self.seed = 42
        self.batch_size_per_node = 2
        self.eval_batch_size_per_node = 4

ARGS = {
    "data": DummyDataset(size=10),
    "is_train": True,
    "args": Args(),
    "collate_fn": dummy_collate_fn
}
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 DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 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 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

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

Transformers are widely used in NLP tasks. However, current approaches to leveraging transformers to understand language expose one weak spot: Number understanding. In some scenarios, numbers frequently occur, especially in semi-structured data like tables. But current approaches to rich-number tasks with transformer-based language models abandon or lose some of the numeracy information - e.g., breaking numbers into sub-word tokens - which leads to many number-related errors. In this paper, we propose the LUNA framework which improves the numerical reasoning and calculation capabilities of transformer-based language models. With the number plugin of NumTok and NumBed, LUNA represents each number as a whole to model input. With number pre-training, including regression loss and model distillation, LUNA bridges the gap between number and vocabulary embeddings. To the best of our knowledge, this is the first work that explicitly injects numeracy capability into language models using Number Plugins. Besides evaluating toy models on toy tasks, we evaluate LUNA on three large-scale transformer models (RoBERTa, BERT, TabBERT) over three different downstream tasks (TATQA, TabFact, CrediTrans), and observe the performances of language models are constantly improved by LUNA. The augmented models also improve the official baseline of TAT-QA (EM: 50.15 -> 59.58) and achieve SOTA performance on CrediTrans (F1 = 86.17).

For agents

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

get_harvested_code_for_paper("2212.02691")
get_code_for_paper("2212.02691")
have("2212.02691")

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

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

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

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

Connect an agent — have() is free.