SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.14788 · 2024

Designing Algorithms Empowered by Language Models: An Analytical Framework, Case Studies, and Insights

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 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, 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/2407.14788.json · badge: /api/ran/2407.14788.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
modelscope/agentscope canonical (classifier label)
classifier basis: census
2 ran · 0 no recorded run
FunctionStatusWhere it lives
has_pending_inbox_or_release Ran
ran; our contract draft was wrong, not the code
modelscope/agentscope/src/agentscope/app/_bus_ops.py
code served (permissive licence) · get_code("6c53fb5b4aaf9e83")
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 coroutine. 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 asyncio
from unittest.mock import AsyncMock, MagicMock


class MessageBusKeys:
    """Stand-in for MessageBusKeys with required static methods and constants."""
    INBOX_LOCK_TTL_SECS = 30
    
    @staticmethod
    def inbox(session_id: str) -> str:
        return f"inbox:{session_id}"
    
    @staticmethod
    def inbox_lock(session_id: str) -> str:
        return f"inbox_lock:{session_id}"
    
    @staticmethod
    def inbox_consumer(session_id: str) -> str:
        return f"inbox_consumer:{session_id}"
    
    @staticmethod
    def INBOX_CONSUMER_FIELD() -> str:
        return "consumer_field"


class MessageBus:
    """Stand-in MessageBus with required async methods."""
    
    def __init__(self):
        self.locks = {}
        self.queues = {}
        self.registry = {}
    
    async def acquire_lock(self, lock_key: str, ttl_secs: int):
        """Context manager for acquiring a lock."""
        class LockContext:
            def __init__(self, bus, key):
                self.bus = bus
                self.key = key
            
            async def __aenter__(self):
                self.bus.locks[self.key] = True
                return self
            
            async def __aexit__(self, *args):
                if self.key in self.bus.locks:
                    del self.bus.locks[self.key]
        
        return LockContext(self, lock_key)
    
    async def queue_drain(self, queue_key: str, max_count: int = 100):
        """Drain items from a queue, returning list of (entry_id, payload) tuples."""
        if queue_key not in self.queues:
            return []
        
        queue = self.queues[queue_key]
        batch = queue[:max_count]
        self.queues[queue_key] = queue[max_count:]
        
        return batch
    
    async def queue_push(self, queue_key: str, payload: dict):
        """Push a payload onto a queue."""
        if queue_key not in self.queues:
            self.queues[queue_key] = []
        
        entry_id = len(self.queues[queue_key])
        self.queues[queue_key].append((entry_id, payload))
    
    async def registry_del(self, registry_key: str, field: str):
        """Delete an entry from the registry."""
        if registry_key in self.registry:
            del self.registry[registry_key]


# Create test instances
bus = MessageBus()
session_id = "test_session_123"

# Pre-populate the bus with some test data
inbox_key = MessageBusKeys.inbox(session_id)
bus.queues[inbox_key] = [
    (0, {"msg": "payload1", "data": [1, 2, 3]}),
    (1, {"msg": "payload2", "data": [4, 5, 6]}),
]

# Set up the registry entry
bus.registry[MessageBusKeys.inbox_consumer(session_id)] = {
    MessageBusKeys.INBOX_CONSUMER_FIELD(): "consumer_id"
}

ARGS = {
    "bus": bus,
    "session_id": session_id,
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
publish_session_event Ran
ran on a synthesized input
modelscope/agentscope/src/agentscope/app/_bus_ops.py
code served (permissive licence) · get_code("7a42498039ffbc4c")
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 coroutine. 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 asyncio
from unittest.mock import AsyncMock, MagicMock


class MessageBusKeys:
    SESSION_REPLAY_MAX_LEN = 1000
    
    @staticmethod
    def session_events(session_id: str) -> str:
        return f"session_events:{session_id}"


class MessageBus:
    """Mock MessageBus for testing."""
    
    def __init__(self):
        self.logs = {}
        self.published = {}
    
    async def log_append(self, key: str, event: dict, max_len: int = None) -> str:
        """Append to replay log and return entry id."""
        if key not in self.logs:
            self.logs[key] = []
        self.logs[key].append(event)
        entry_id = f"entry_{len(self.logs[key])}"
        return entry_id
    
    async def publish(self, key: str, message: dict) -> None:
        """Publish message to subscribers."""
        if key not in self.published:
            self.published[key] = []
        self.published[key].append(message)


# Create mock instances
bus = MessageBus()
session_id = "session_123"
event = {
    "type": "user_action",
    "action": "click",
    "timestamp": 1234567890,
    "data": {"button_id": "submit"}
}

ARGS = {
    "bus": bus,
    "session_id": session_id,
    "event": event
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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 2 samples lifted from this paper's linked repositories, 2 carry a function identity and 0 do not. Of the 2 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 2 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

This work presents an analytical framework for the design and analysis of LLM-based algorithms, i.e., algorithms that contain one or multiple calls of large language models (LLMs) as sub-routines and critically rely on the capabilities of LLMs. While such algorithms, ranging from basic LLM calls with prompt engineering to complicated LLM-powered agentic workflows and compound AI systems, have achieved remarkable empirical success, their design and optimization oftentimes require extensive trial-and-errors and case-by-case analysis. Our proposed framework serves as an attempt to mitigate such headaches, offering a formal and systematic approach for analyzing how the accuracy and efficiency of an LLM-based algorithm will be impacted by critical design choices, such as the pattern and granularity of task decomposition, or the prompt for each LLM call. Through a wide range of case studies covering diverse algorithm patterns (including parallel/hierarchical/recursive task decomposition and generic directed acyclic graphs), we demonstrate the proposed framework in action and derive interesting insights that generalize across scenarios, accompanied by systematic empirical validation in synthetic settings.

For agents

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

get_harvested_code_for_paper("2407.14788")
get_code_for_paper("2407.14788")
have("2407.14788")

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

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

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

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

Connect an agent — have() is free.