SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.02003 · ICLR · 2024

L2MAC: Large Language Model Automatic Computer for Extensive Code Generation

Mihaela Van Der Schaar, Samuel Holt, Max Luyten

arXiv · PDF · Open in the Atlas

Code that ran

10 of 14 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; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 9 failures of our instrument; 4 no recorded run), measured 2026-11-21; 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/2310.02003.json · badge: /api/ran/2310.02003.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
samholt/l2mac canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
vanderschaarlab/l2mac canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
clean_string Ran
ran; our contract draft was wrong, not the code
samholt/l2mac/l2mac/utils/l2mac.py
code served (permissive licence) · get_code("0b71a825504a4b60")
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 clean_string(input_string):
    """
    Clean the input string by removing temporary directory paths using regex.

    Args:
    input_string (str): The string to be cleaned.

    Returns:
    str: The cleaned string.
    """
    temp_dir_pattern = '/tmp/[^/\\\\]+'
    cleaned_string = re.sub(temp_dir_pattern, '', input_string)
    return cleaned_string

ARGS = {
    "input_string": "This is a file path /tmp/tmpdir123/file.txt and another /tmp/another_dir/data.csv in the string."
}
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
create_logger_in_process Ran
ran; our contract draft was wrong, not the code
samholt/l2mac/l2mac/utils/logging.py
code served (permissive licence) · get_code("83b71f722d249b84")
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 Logger. 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 logging
import multiprocessing
import tempfile
import os

# Create a temporary file path for logging
temp_dir = tempfile.gettempdir()
log_file_path = os.path.join(temp_dir, "test_logger.log")

ARGS = {
    "log_file_path": log_file_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 Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
create_logger_in_process Ran
ran; our contract draft was wrong, not the code
vanderschaarlab/l2mac/l2mac/utils/logging.py
code served (permissive licence) · get_code("181d691bea998bff")
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 Logger. 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 logging
import multiprocessing
import tempfile
import os

# Create a temporary file path for logging
temp_dir = tempfile.gettempdir()
log_file_path = os.path.join(temp_dir, "test_logger.log")

ARGS = {
    "log_file_path": log_file_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 Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
detect_cycles Ran
ran, violated the contract we drafted
samholt/l2mac/l2mac/utils/l2mac.py
code served (permissive licence) · get_code("f480b53ce00346f2")
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

# Test case 1: List with repeating cycle of length 2
list_with_cycle = ["hello", "world", "hello", "world"]

# Test case 2: List without repeating cycles
list_without_cycle = ["a", "b", "c", "d", "e"]

# Test case 3: List with repeating cycle of length 3
list_with_cycle_3 = ["x", "y", "z", "x", "y", "z"]

# Using the first test case as the main argument
ARGS = {
    "list_of_string_messages": list_with_cycle,
    "cycle_lengths": None
}
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
detect_cycles Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
vanderschaarlab/l2mac/l2mac/utils/l2mac.py
code served (permissive licence) · get_code("651da3ba8f61a0ef")
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

torch.manual_seed(0)

# Test case 1: List with a repeating cycle of length 2
lst1 = [1, 2, 1, 2]

# Test case 2: List with a repeating cycle of length 3
lst2 = [1, 2, 3, 1, 2, 3]

# Test case 3: List with no repeating cycles
lst3 = [1, 2, 3, 4, 5]

# Test case 4: List with a repeating cycle of length 4
lst4 = [5, 6, 7, 8, 5, 6, 7, 8]

# Using the first test case with default cycle_lengths
ARGS = {
    "lst": lst1,
    "cycle_lengths": [2, 3, 4]
}
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
find_best_match Ran
ran; our contract draft was wrong, not the code
samholt/l2mac/l2mac/llm_providers/utils.py
code served (permissive licence) · get_code("77eab2d0bffb3e96")
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 difflib import get_close_matches

# Construct a sample data_dict with model information
data_dict = {
    "bert-base-uncased": {
        "name": "bert-base-uncased",
        "params": 110000000,
        "hidden_size": 768
    },
    "gpt2-medium": {
        "name": "gpt2-medium",
        "params": 355000000,
        "hidden_size": 1024
    },
    "roberta-large": {
        "name": "roberta-large",
        "params": 355000000,
        "hidden_size": 1024
    },
    "distilbert-base-uncased": {
        "name": "distilbert-base-uncased",
        "params": 66000000,
        "hidden_size": 768
    }
}

# The model_name to search for (will be matched against data_dict keys)
model_name = "bert-base"

# Number of close matches to return
n = 1

ARGS = {
    "data_dict": data_dict,
    "model_name": model_name,
    "n": n
}
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 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
find_best_match Ran
ran; our contract draft was wrong, not the code
vanderschaarlab/l2mac/l2mac/llm_providers/utils.py
code served (permissive licence) · get_code("50ad5dbe5bb99660")
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
import torch.nn as nn

# Set random seed for reproducibility
torch.manual_seed(0)

# Create a sample data dictionary with model information
data_dict = {
    "bert-base-uncased": {
        "name": "bert-base-uncased",
        "hidden_size": 768,
        "num_layers": 12,
        "vocab_size": 30522
    },
    "gpt2-medium": {
        "name": "gpt2-medium",
        "hidden_size": 1024,
        "num_layers": 24,
        "vocab_size": 50257
    },
    "roberta-large": {
        "name": "roberta-large",
        "hidden_size": 1024,
        "num_layers": 24,
        "vocab_size": 50265
    },
    "distilbert-base-uncased": {
        "name": "distilbert-base-uncased",
        "hidden_size": 768,
        "num_layers": 6,
        "vocab_size": 30522
    }
}

# Define model_name to search for (with intentional typo to test matching)
model_name = "bert-base-uncase"

# Number of matches to return
n = 1

# Construct ARGS dictionary with all parameters
ARGS = {
    "data_dict": data_dict,
    "model_name": model_name,
    "n": n
}
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 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
hash_messages Ran
ran; our contract draft was wrong, not the code
samholt/l2mac/l2mac/utils/l2mac.py
code served (permissive licence) · get_code("a88d2b9a3580b853")
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 hashlib
import json
import secrets
from typing import List, Optional, Union

# Construct the input_list argument
# The function expects: list[dict[str, Optional[Union[dict[str, str], str]]]]
# This means a list of dicts where keys are strings and values are either:
# - None
# - A dict with string keys and string values
# - A string

input_list = [
    {
        "role": "user",
        "content": "Hello, how are you?"
    },
    {
        "role": "assistant",
        "content": {
            "type": "text",
            "value": "I'm doing well, thank you!"
        }
    },
    {
        "role": "user",
        "content": None
    }
]

ARGS = {
    "input_list": input_list
}
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
hash_messages Ran
ran; our contract draft was wrong, not the code
vanderschaarlab/l2mac/l2mac/utils/l2mac.py
code served (permissive licence) · get_code("a14eca3ee93220ee")
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 hashlib
import json
import secrets
from typing import List

ARGS = {
    "input_list": ["hello", "world", "test", "messages"]
}
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
remove_nulls Ran
ran; our contract draft was wrong, not the code
samholt/l2mac/l2mac/llm_providers/general.py
code served (permissive licence) · get_code("3c47508f7c1651ed")
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

torch.manual_seed(0)

d = {
    'a': 1,
    'b': None,
    'c': 'hello',
    'd': None,
    'e': [1, 2, 3],
    'f': torch.tensor([1.0, 2.0, 3.0, 4.0])
}

ARGS = {'d': d}
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 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
generate_log_file_path Not yet run
unverified (harvested, no recorded run)
samholt/l2mac/l2mac/utils/logging.py
code served (permissive licence) · get_code("49d36eae6084799b")
How it ran

no invocation recorded.

generate_log_file_path Not yet run
unverified (harvested, no recorded run)
vanderschaarlab/l2mac/l2mac/utils/logging.py
code served (permissive licence) · get_code("19930614e876cc0c")
How it ran

no invocation recorded.

num_tokens_from_messages Not yet run
unverified (harvested, no recorded run)
samholt/l2mac/l2mac/llm_providers/openai.py
code served (permissive licence) · get_code("2c48ff24398fb8a0")
How it ran

no invocation recorded.

num_tokens_from_messages Not yet run
unverified (harvested, no recorded run)
vanderschaarlab/l2mac/l2mac/llm_providers/openai.py
code served (permissive licence) · get_code("b2239c20c6dcebef")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 12 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
create_logger_in_process 1 other paper
1 later
2403.10766 (2024-03)
ODE Discovery for Longitudinal Heterogeneous Treatment Effects 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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Transformer-based large language models (LLMs) are constrained by the fixed context window of the underlying transformer architecture, hindering their ability to produce long and coherent outputs. Memory-augmented LLMs are a promising solution, but current approaches cannot handle long output generation tasks since they (1) only focus on reading memory and reduce its evolution to the concatenation of new memories or (2) use very specialized memories that cannot adapt to other domains. This paper presents L2MAC 1 , the first practical LLM-based general-purpose stored-program automatic computer (von Neumann architecture) framework, an LLM-based multi-agent system, for long and consistent output generation. Its memory has two components: the instruction registry, which is populated with a prompt program to solve the user-given task, and a file store, which will contain the final and intermediate outputs. Each instruction in turn is executed by a separate LLM agent, whose context is managed by a control unit capable of precise memory reading and writing to ensure effective interaction with the entire file store. These components enable L2MAC to generate extensive outputs, bypassing the constraints of the finite context window while producing outputs that fulfill a complex user-specified task. We empirically demonstrate that L2MAC achieves state-of-the-art performance in generating large codebases for system design tasks, significantly outperforming other coding methods in implementing the detailed user-specified task; we show that L2MAC works for general-purpose extensive text-based tasks, such as writing an entire book; and we provide valuable insights into L2MAC's performance improvement over existing methods. Published as a conference paper at ICLR 2024 app.py from flask import Flask, request, render_template from user import User from mock_db import MockDB from contact import Contact from message import Message from group_chat import GroupChat app = Flask(__name__) db = MockDB() @app.route('/') def home(): return render_template('home.html'), 200 @app.route('/register', methods=['POST']) def register(): data = request.get_json() user = User(data['email'], data['password']) contact = Contact(data['email']) db.add(user.email, user) db.add(contact.email, contact) return render_template('register.html', message='User registered successfully'), 200 @app.route('/login', methods=['POST']) def login(): data = request.get_json() user = db.retrieve(data['email']) if user and user.password == data['password']: user.set_online_status(True) return render_template('login.html', message='Login successful'), 200 else: return render_template('login.html', message='Invalid email or password'), 401 @app.route('/logout', methods=['POST']) def logout(): data = request.get_json() user = db.retrieve(data['email']) if user and user.password == data['password']: user.set_online_status(False) return 'Logout successful', 200 else: return 'Invalid email or password', 401 @app.route('/send_message', methods=['POST']) def send_message(): data = request.get_json() sender = db.retrieve(data['sender']) receiver = db.retrieve(data['receiver']) if sender and receiver and sender.password == data['password']: message = Message(sender.email, receiver.email, data['content']) if receiver.get_online_status(): receiver.receive_message(message.send_message()) else: receiver.add_to_message_queue(message.send_message()) return 'Message sent', 200 else: return 'Invalid email or password', 401 if __name__ == '__main__': app.run(debug=True) contact.py class Contact: def __init__(self, email): self.email = email self.blocked_contacts = set() self.groups = {} def block_contact(self, contact_email): self.blocked_contacts.add(contact_email) 1. Setup structure 2. Create registration Contributions: 1 ⃝ We introduce the L2MAC framework, the first practical LLM-based generalpurpose stored-program automatic computer (von Neumann architecture) framework, an LLM-based multi-agent system, for long output generation tasks. 2 ⃝ We provide a practical implementation of this framework for code generation tasks called Code-L2MAC. This uses a Control Unit to control the input and output of the LLM and the use of entire memory file store read/write tools and highlights Published as a conference paper at ICLR 2024 Invoke Tool? Called Step Completed? 1. Summarize step output to Mrs and clear Ct. 2. Load next I(k)aa, and start new Ct={I(k),Mrs} Append cycle message Mc Would exceed context? 1. Unwind oldest messages M, till 2. Summarize progress to Mrs and clear Ct. 3. Restart same I(k), with Ct={I(k),Mrs}

For agents

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

get_harvested_code_for_paper("2310.02003")
get_code_for_paper("2310.02003")
have("2310.02003")

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

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

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

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

Connect an agent — have() is free.