SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1909.03329 · 2019

LAMOL: LAnguage MOdeling for Lifelong Language Learning

arXiv · PDF · Open in the Atlas

Code that ran

10 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; 1 honoured the contract we drafted, 0 violated it and 8 have 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/1909.03329.json · badge: /api/ran/1909.03329.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
jojotenya/LAMOL canonical (classifier label)
classifier basis not recorded on the link
10 ran · 0 no recorded run
FunctionStatusWhere it lives
BN_convert_float Ran
ran on a synthesized input
jojotenya/LAMOL/fp16util.py
code served (permissive licence) · get_code("e7014fd797aa4e75")
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 SimpleModel. 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)

# Create a module with BatchNorm layers to test the function
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.bn1 = nn.BatchNorm2d(4, affine=True)
        self.bn2 = nn.BatchNorm1d(3, affine=True)
        self.linear = nn.Linear(3, 2)
        self.bn3 = nn.BatchNorm1d(2, affine=True)
    
    def forward(self, x):
        return x

# Instantiate the model
model = SimpleModel()

# Convert model to half precision first so we can test the float conversion
model.half()

ARGS = {
    "module": model
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
conversion_helper Ran
ran on a synthesized input
jojotenya/LAMOL/fp16.py
code served (permissive licence) · get_code("f887d5ffcbc6ad3b")
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

torch.manual_seed(0)

def simple_conversion(x):
    """A simple conversion function that doubles a value."""
    if isinstance(x, torch.Tensor):
        return x * 2
    elif isinstance(x, (int, float)):
        return x * 2
    else:
        return x

# Test case 1: Simple scalar value with conversion
val_scalar = 5

# Test case 2: List of scalars
val_list = [1, 2, 3]

# Test case 3: Tuple of scalars
val_tuple = (10, 20, 30)

# Test case 4: Nested list structure
val_nested_list = [1, [2, 3], [[4, 5], 6]]

# Test case 5: Nested tuple structure
val_nested_tuple = (1, (2, 3), ((4, 5), 6))

# Test case 6: Mixed nested structure (list containing tuples)
val_mixed = [1, (2, 3), [4, (5, 6)]]

# Define ARGS with one of the nested structures to demonstrate recursion
ARGS = {
    "val": [1, (2, 3), [[4, 5], 6]],
    "conversion": simple_conversion
}
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
convert_network Ran
ran on a synthesized input
jojotenya/LAMOL/fp16util.py
code served (permissive licence) · get_code("6063f8fe87afb580")
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 SimpleNetwork. 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)

# Create a simple network with various module types
class SimpleNetwork(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.bn1 = nn.BatchNorm1d(3, affine=True)
        self.linear2 = nn.Linear(3, 2)
        self.bn2 = nn.BatchNorm1d(2, affine=False)
        self.register_buffer('custom_buffer', torch.randn(2, 3))
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.bn1(x)
        x = self.linear2(x)
        x = self.bn2(x)
        return x

# Instantiate network
network = SimpleNetwork()

# Add a gradient to one parameter to test gradient conversion
network.linear1.weight.grad = torch.randn_like(network.linear1.weight)

# Define target dtype
dtype = torch.float32

ARGS = {
    'network': network,
    'dtype': dtype
}
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 SimpleNetwork — a SimpleNetwork output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleNetwork 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
fp16_to_fp32 Ran
ran on a synthesized input
jojotenya/LAMOL/fp16.py
code served (permissive licence) · get_code("38034aa1d784464d")
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. 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 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.autograd import Variable
from torch.nn.parameter import Parameter

torch.manual_seed(0)

# Test case 1: fp16 tensor
fp16_tensor = torch.randn(2, 4).half()

# Test case 2: fp16 variable
fp16_variable = Variable(torch.randn(2, 4).half())

# Test case 3: fp16 parameter
fp16_parameter = Parameter(torch.randn(2, 4).half())

# Test case 4: nested structure with mixed types
nested_val = (
    fp16_tensor,
    [fp16_variable, fp16_parameter],
    torch.randn(2, 4).half()
)

# Test case 5: fp32 tensor (should pass through unchanged)
fp32_tensor = torch.randn(2, 4)

# Test case 6: mixed fp16 and fp32
mixed_val = [fp16_tensor, fp32_tensor]

ARGS = {
    "val": nested_val
}
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
fp32_to_fp16 Ran
ran on a synthesized input
jojotenya/LAMOL/fp16.py
code served (permissive licence) · get_code("ea22baceb9a219a1")
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. 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 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.parameter import Parameter
from torch.autograd import Variable

torch.manual_seed(0)

# Test with various fp32 tensor types and nested structures
fp32_tensor = torch.randn(2, 4)
fp32_parameter = Parameter(torch.randn(3, 5))
fp32_variable = Variable(torch.randn(2, 4))

# Create nested structures to test the conversion_helper recursion
nested_tuple = (fp32_tensor, fp32_parameter)
nested_list = [fp32_variable, fp32_tensor]
deeply_nested = (fp32_tensor, [fp32_parameter, (fp32_variable, fp32_tensor)])

ARGS = {
    "val": deeply_nested
}
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
lcs Ran
ran on a synthesized input
jojotenya/LAMOL/metrics.py
code served (permissive licence) · get_code("0f21a55b40b92463")
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 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)

# The function lcs takes two parameters: X and Y
# Looking at the function body:
# - It calls len(X) and len(Y)
# - It indexes into X and Y with [i-1] and [j-1]
# - It compares elements with == (X[i-1] == Y[j-1])
# - It calls lcsstr(X, Y) which also indexes and compares elements
# 
# So X and Y should be sequences (strings, lists, etc.) that support:
# - len()
# - indexing with []
# - element comparison with ==
#
# The simplest choice is to use strings

X = "abcdef"
Y = "fbdamn"

ARGS = {
    "X": X,
    "Y": Y
}
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 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
lcsstr Ran
ran on a synthesized input
jojotenya/LAMOL/metrics.py
code served (permissive licence) · get_code("989078983378be2e")
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

# lcsstr finds the longest common substring between two strings
# It takes two string parameters and returns an integer
# The function iterates through string1 and string2 comparing characters

string1 = "abcdef"
string2 = "cdefgh"

ARGS = {
    "string1": string1,
    "string2": string2,
}
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 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
network_to_half Ran
ran on a synthesized input
jojotenya/LAMOL/fp16util.py
code served (permissive licence) · get_code("9919cae853c6180f")
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 Sequential. 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)

# Create a simple neural network with BatchNorm layers
# The function will call .half() on it and convert BatchNorms to float
class SimpleNetworkWithBN(nn.Module):
    def __init__(self):
        super(SimpleNetworkWithBN, self).__init__()
        self.conv1 = nn.Conv2d(3, 4, kernel_size=3)
        self.bn1 = nn.BatchNorm2d(4)
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        x = self.conv1(x)
        x = self.bn1(x)
        return x

# Instantiate the network
network = SimpleNetworkWithBN()

# Define ARGS dict
ARGS = {
    "network": network
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
normalize_text Ran
ran; our contract draft was wrong, not the code
jojotenya/LAMOL/metrics.py
code served (permissive licence) · get_code("b971ea3b818d09b7")
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 string
import re

def normalize_text(s):
    """Lower text and remove punctuation, articles and extra whitespace."""

    def remove_articles(text):
        return re.sub('\\b(a|an|the)\\b', ' ', text)

    def white_space_fix(text):
        return ' '.join(text.split())

    def remove_punc(text):
        exclude = set(string.punctuation)
        return ''.join((ch for ch in text if ch not in exclude))

    def lower(text):
        return text.lower()
    return white_space_fix(remove_articles(remove_punc(lower(s))))


ARGS = {
    "s": "The Quick Brown Fox! Jumps over a lazy dog."
}
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
to_python_float Ran
ran, honoured the contract we drafted
jojotenya/LAMOL/loss_scaler.py
pointer only (licence: MIT); the stored copy get_code serves, from lengsicong/tell2design, is pointer only (licence: NONE) · get_code("6b5d363ab4dbf012")
How it ran

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

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, 10 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 10 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
to_python_float 9 other papers
1 dated earlier, 8 later
1904.00962 (2019-04)
Large Batch Optimization for Deep Learning: Training BERT in 76 minutes
2109.04332 (2021-09)
PPT: Pre-trained Prompt Tuning for Few-shot Learning
2022.acl-long.576 (2022 (year only))
PPT: Pre-trained Prompt Tuning for Few-shot Learning
and 6 more not named here
conversion_helper 4 other papers
2 dated earlier, 2 later
1803.09017 (2018-03)
Style Tokens: Unsupervised Style Modeling, Control and Transfer in End-to-End Speech Synthesis
1812.04342 (2018-12)
Learning latent representations for style control and transfer in end-to-end speech synthesis
2203.10652 (2022-03)
Continual Sequence Generation with Adaptive Compositional Modules
and 1 more not named here
fp16_to_fp32 4 other papers
2 dated earlier, 2 later
1803.09017 (2018-03)
Style Tokens: Unsupervised Style Modeling, Control and Transfer in End-to-End Speech Synthesis
1812.04342 (2018-12)
Learning latent representations for style control and transfer in end-to-end speech synthesis
2203.10652 (2022-03)
Continual Sequence Generation with Adaptive Compositional Modules
and 1 more not named here
fp32_to_fp16 4 other papers
2 dated earlier, 2 later
1803.09017 (2018-03)
Style Tokens: Unsupervised Style Modeling, Control and Transfer in End-to-End Speech Synthesis
1812.04342 (2018-12)
Learning latent representations for style control and transfer in end-to-end speech synthesis
2203.10652 (2022-03)
Continual Sequence Generation with Adaptive Compositional Modules
and 1 more not named here
normalize_text 3 other papers
3 later
2006.13009 (2020-06)
Iterative Deep Graph Learning for Graph Neural Networks: Better and Robust Node Embeddings
2203.10652 (2022-03)
Continual Sequence Generation with Adaptive Compositional Modules
2025.emnlp-industry.89 (2025 (year only))
L4: Mutual Learning Helps Lifelong Language Learning
BN_convert_float 2 other papers
2 later
2203.10652 (2022-03)
Continual Sequence Generation with Adaptive Compositional Modules
2025.emnlp-industry.89 (2025 (year only))
L4: Mutual Learning Helps Lifelong Language Learning
convert_network 2 other papers
2 later
2203.10652 (2022-03)
Continual Sequence Generation with Adaptive Compositional Modules
2025.emnlp-industry.89 (2025 (year only))
L4: Mutual Learning Helps Lifelong Language Learning
lcs 2 other papers
2 later
2203.10652 (2022-03)
Continual Sequence Generation with Adaptive Compositional Modules
2025.emnlp-industry.89 (2025 (year only))
L4: Mutual Learning Helps Lifelong Language Learning
lcsstr 2 other papers
2 later
2203.10652 (2022-03)
Continual Sequence Generation with Adaptive Compositional Modules
2025.emnlp-industry.89 (2025 (year only))
L4: Mutual Learning Helps Lifelong Language Learning
network_to_half 2 other papers
2 later
2203.10652 (2022-03)
Continual Sequence Generation with Adaptive Compositional Modules
2025.emnlp-industry.89 (2025 (year only))
L4: Mutual Learning Helps Lifelong Language 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-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

Most research on lifelong learning applies to images or games, but not language. We present LAMOL, a simple yet effective method for lifelong language learning (LLL) based on language modeling. LAMOL replays pseudo-samples of previous tasks while requiring no extra memory or model capacity. Specifically, LAMOL is a language model that simultaneously learns to solve the tasks and generate training samples. When the model is trained for a new task, it generates pseudo-samples of previous tasks for training alongside data for the new task. The results show that LAMOL prevents catastrophic forgetting without any sign of intransigence and can perform five very different language tasks sequentially with only one model. Overall, LAMOL outperforms previous methods by a considerable margin and is only 2-3% worse than multitasking, which is usually considered the LLL upper bound. The source code is available at https://github.com/jojotenya/LAMOL.

For agents

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

get_harvested_code_for_paper("1909.03329")
get_code_for_paper("1909.03329")
have("1909.03329")

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

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

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

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

Connect an agent — have() is free.