SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.07860 · ACL · 2022

Imputing Out-of-Vocabulary Embeddings with LOVE Makes Language Models Robust with Little Cost

Gaël Varoquaux, Lihu Chen, Fabian Suchanek

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 2 violated it and 3 have no contract verdict; 0 failures 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/2203.07860.json · badge: /api/ran/2203.07860.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
makcedward/nlpaug community
Papers with Code archive
4 ran · 0 no recorded run
tigerchen52/LOVE community
Papers with Code archive
2 ran · 1 no recorded run
FunctionStatusWhere it lives
PAM Ran
ran on a synthesized input · constructed an object; no result was computed
tigerchen52/LOVE/model.py
code served (permissive licence) · get_code("dfbad4ecd9e1c2c8")
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, PAM: 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class ArgsConfig:
    def __init__(self):
        self.emb_dim = 4
        self.att_head_num = 2
        self.drop_rate = 0.1

ARGS = {
    "args": ArgsConfig()
}
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 PAM — 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 PAM 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
SAM Ran
ran on a synthesized input · constructed an object; no result was computed
tigerchen52/LOVE/model.py
code served (permissive licence) · get_code("64c0f6a050045fc9")
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, SAM: 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class Args:
    def __init__(self):
        self.att_head_num = 2
        self.emb_dim = 8
        self.drop_rate = 0.1

ARGS = {
    'args': Args()
}

# Verify the setup works by instantiating SAM
sam = nn.Module()
args = ARGS['args']

# Create test tensors for forward pass
batch_size = 2
seq_len = 4
hidden_size = args.emb_dim

x = torch.randn(batch_size, seq_len, hidden_size)
mask = torch.ones(batch_size, seq_len, dtype=torch.bool)
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 SAM — 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 SAM 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
WordEmbeddings Ran
ran on a synthesized input · constructed an object; no result was computed
makcedward/nlpaug/nlpaug/model/word_embs/word_embeddings.py
code served (permissive licence) · get_code("91a10b4dd01e7076")
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, WordEmbeddings: 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
import types as _types

# Define normalization functions
def l1_norm(data):
    _norm = np.array([x.sum(axis=0) for x in data])
    data = data / _norm[:, np.newaxis]
    return np.nan_to_num(data)

def l2_norm(data):
    _norm = np.array([np.sqrt((x * x).sum(axis=0)) for x in data])
    data = data / _norm[:, np.newaxis]
    return np.nan_to_num(data)

def standard_norm(data):
    means = data.mean(axis=1)
    stds = data.std(axis=1, ddof=1)
    data = (data - means[:, np.newaxis]) / stds[:, np.newaxis]
    return np.nan_to_num(data)

normalization = _types.SimpleNamespace(**{n: globals()[n] for n in ['l1_norm', 'l2_norm', 'standard_norm'] if n in globals()})

# Create a minimal mock model that satisfies the WordEmbeddings._read() usage
class MockWord2VecModel:
    def __init__(self):
        # Simulate word2vec model structure
        self.index_to_key = ['hello', 'world', 'python', 'code']
        self.key_to_index = {word: i for i, word in enumerate(self.index_to_key)}
        # Create embeddings: 4 words, each with 5-dimensional vectors
        self._vectors = np.random.randn(4, 5).astype(np.float32)
    
    def __getitem__(self, key):
        # Return embedding for a word index
        return self._vectors[key]
    
    def most_similar(self, word, topn=10):
        # Return mock similar words with scores
        similar_words = [('hello', 0.95), ('world', 0.88), ('python', 0.75)]
        return similar_words

# Create an instance of WordEmbeddings to set up ARGS
mock_model = MockWord2VecModel()

ARGS = {
    'top_k': 100,
    'skip_check': True,
}
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 WordEmbeddings — 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 WordEmbeddings 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_norm Ran
ran, violated the contract we drafted
makcedward/nlpaug/nlpaug/model/word_embs/word_embeddings.py
code served (permissive licence) · get_code("38b8d075d6dff46c")
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 (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 numpy as np

# Construct small test data for the l1_norm function
# The function expects a 2D numpy array where:
# - It computes sum along axis 0 for each row
# - Divides the data by the normalized values
# - Returns nan_to_num result

# Create a small 2D array with shape (2, 4)
# Each row will be normalized by its sum across columns
data = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [2.0, 4.0, 6.0, 8.0]
], dtype=np.float32)

ARGS = {
    'data': data
}
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 (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
l2_norm Ran
ran, violated the contract we drafted
makcedward/nlpaug/nlpaug/model/word_embs/word_embeddings.py
code served (permissive licence) · get_code("2cc7ef3fe9847cad")
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 3, dtype family float, shape (2, 4, 3) 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 test data for l2_norm function
# The function expects a numpy array where:
# - data is iterable (can be looped over with "for x in data")
# - each x in data has a .sum(axis=0) method (so x should be 2D)
# - the result supports division operations

# Create a small 3D numpy array: shape (2, 4, 3)
# - batch size: 2
# - feature dimension 1: 4
# - feature dimension 2: 3
data = np.array([
    [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0], [10.0, 11.0, 12.0]],
    [[2.0, 3.0, 4.0], [5.0, 6.0, 7.0], [8.0, 9.0, 10.0], [11.0, 12.0, 13.0]]
], dtype=np.float32)

ARGS = {
    "data": data
}
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) 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
standard_norm Ran
ran, honoured the contract we drafted
makcedward/nlpaug/nlpaug/model/word_embs/word_embeddings.py
code served (permissive licence) · get_code("be631ec5276e2561")
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

# Construct a small 2D numpy array with shape (3, 4)
# This represents 3 samples with 4 features each
data = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0],
    [9.0, 10.0, 11.0, 12.0]
], dtype=np.float32)

ARGS = {
    "data": data
}
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
Pamelaformer Not yet run
unverified (harvested, no recorded run)
tigerchen52/LOVE/model.py
code served (permissive licence) · get_code("861e6106454d754b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 7 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 NLP systems represent inputs with word embeddings, but these are brittle when faced with Out-of-Vocabulary (OOV) words. To address this issue, we follow the principle of mimick-like models to generate vectors for unseen words, by learning the behavior of pre-trained embeddings using only the surface form of words. We present a simple contrastive learning framework, LOVE, which extends the word representation of an existing pre-trained language model (such as BERT), and makes it robust to OOV with few additional parameters. Extensive evaluations demonstrate that our lightweight model achieves similar or even better performances than prior competitors, both on original datasets and on corrupted variants. Moreover, it can be used in a plug-and-play fashion with FastText and BERT, where it significantly improves their robustness.

For agents

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

get_harvested_code_for_paper("2203.07860")
get_code_for_paper("2203.07860")
have("2203.07860")

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

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

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

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

Connect an agent — have() is free.