SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.14044 · EMNLP · 2024

ECCO: Can We Improve Model-Generated Code Efficiency Without Sacrificing Functional Correctness?

Daniel Fried, Vishruth Veerendranath, Zora Wang, Siddhant Waghjale

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, 0 violated it and 0 have no contract verdict; 10 failures of our instrument; 4 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.14044.json · badge: /api/ran/2407.14044.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
microsoft/DeepSpeed canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
codeeff/ecco canonical (classifier label)
classifier basis: census
3 ran · 2 no recorded run
FunctionStatusWhere it lives
apply_scores_before_experts_if_enabled Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/DeepSpeed/deepspeed/module_inject/auto_ep_layer.py
code served (permissive licence) · get_code("bc9117fa9c34b5ef")
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 Tensor, 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 torch

torch.manual_seed(0)

# Create small tensors for the function
# routed_input: shape (batch=2, dim=4) - token representations
routed_input = torch.randn(2, 4, dtype=torch.float32)

# top_scores: shape (batch=2,) - router scores, will be reshaped to (-1, 1)
top_scores = torch.randn(2, dtype=torch.float32)

# score_apply: Literal['pre', 'post']
score_apply = 'pre'

ARGS = {
    'routed_input': routed_input,
    'top_scores': top_scores,
    'score_apply': score_apply,
}
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 Tensor, 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
autoep_folding_gradient_reduction_strategy Ran
ran; our contract draft was wrong, not the code
microsoft/DeepSpeed/deepspeed/module_inject/auto_ep_folding.py
code served (permissive licence) · get_code("30700c5fc6cd1064")
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 torch
import torch.nn as nn
from dataclasses import dataclass

torch.manual_seed(0)

# Define the dataclass as shown in the function signature
@dataclass(frozen=True)
class ParallelFoldingSpec:
    world_size: int
    pp_size: int
    stage_size: int
    tp_size: int
    dp_size: int
    ep_size: int
    etp_size: int
    edp_size: int
    mp_mode: str = 'tp'

# Create a folding spec instance
folding_spec = ParallelFoldingSpec(
    world_size=8,
    pp_size=2,
    stage_size=4,
    tp_size=2,
    dp_size=2,
    ep_size=2,
    etp_size=4,
    edp_size=2,
    mp_mode='tp'
)

# Create a parameter with various attributes to test different code paths
param = nn.Parameter(torch.randn(4, 3))

# Test case 1: parameter with no special attributes (falls through to None/AVERAGE default)
param_plain = nn.Parameter(torch.randn(4, 3))

# Test case 2: parameter with router gate replicated marker
param_router = nn.Parameter(torch.randn(4, 3))
setattr(param_router, 'ds_autoep_folding_param_family', 'router_gate_replicated')

# Test case 3: parameter with model_parallel flag
param_mp = nn.Parameter(torch.randn(4, 3))
setattr(param_mp, 'model_parallel', True)

# Test case 4: parameter with tensor_model_parallel flag
param_tmp = nn.Parameter(torch.randn(4, 3))
setattr(param_tmp, 'tensor_model_parallel', True)

# Test case 5: parameter with expert_tp_cancel family
param_expert = nn.Parameter(torch.randn(4, 3))
setattr(param_expert, 'ds_autoep_folding_param_family', 'expert_tp_cancel')

# Test case 6: parameter with sp_sharded_layernorm family
param_ln = nn.Parameter(torch.randn(4, 3))
setattr(param_ln, 'ds_autoep_folding_param_family', 'sp_sharded_layernorm')

# Test case 7: parameter with router in name but no explicit marker
param_router_implicit = nn.Parameter(torch.randn(4, 3))

# Build ARGS for the main test case
ARGS = {
    'folding_spec': folding_spec,
    'param': param_plain,
    'param_name': 'layer.weight'
}
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 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
build_coder_prompts Ran
ran; our contract draft was wrong, not the code
codeeff/ecco/experiments/utils.py
pointer only (licence: NONE) · get_code("ffe9c8c7bc502548")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, codeeff/ecco 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.

build_feedback_prompts Ran
ran; our contract draft was wrong, not the code
codeeff/ecco/experiments/utils.py
pointer only (licence: NONE) · get_code("882b572136753409")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, codeeff/ecco 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.

expected_folding_group_tables Ran
ran; our contract draft was wrong, not the code
microsoft/DeepSpeed/deepspeed/module_inject/auto_ep_folding.py
code served (permissive licence) · get_code("ad8cfe379b811c40")
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 FoldingGroupTables. 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 numpy as np
from dataclasses import dataclass

torch.manual_seed(0)

@dataclass(frozen=True)
class ParallelFoldingSpec:
    world_size: int
    pp_size: int
    stage_size: int
    tp_size: int
    dp_size: int
    ep_size: int
    etp_size: int
    edp_size: int
    mp_mode: str = 'tp'

# Create a valid spec
# world_size = 8 (2 stages of 4 ranks each)
# pp_size = 2 (pipeline parallel stages)
# stage_size = 4 (ranks per stage)
# tp_size = 2 (tensor parallel)
# dp_size = 2 (data parallel)
# ep_size = 2 (expert parallel)
# etp_size = 1 (expert tensor parallel)
# edp_size = 2 (expert data parallel)

spec = ParallelFoldingSpec(
    world_size=8,
    pp_size=2,
    stage_size=4,
    tp_size=2,
    dp_size=2,
    ep_size=2,
    etp_size=1,
    edp_size=2,
    mp_mode='tp'
)

ARGS = {
    'spec': spec
}
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 FoldingGroupTables — a FoldingGroupTables output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FoldingGroupTables 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
get_execution_feedback Ran
ran; our contract draft was wrong, not the code
codeeff/ecco/experiments/utils.py
pointer only (licence: NONE) · get_code("3e1be7ab52fa3b07")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, codeeff/ecco 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.

human_readable_size Ran
ran; our contract draft was wrong, not the code
microsoft/DeepSpeed/deepspeed/env_report.py
code served (permissive licence) · get_code("66a3320fa7fe659e")
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 torch
import numpy as np

# The function human_readable_size takes a numeric size parameter
# and converts it to a human-readable format with units (B, KB, MB, GB, TB)

# Test with a simple numeric value (bytes)
size_in_bytes = 1536000  # ~1.5 MB

ARGS = {
    'size': size_in_bytes
}
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 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
local_folding_ranks Ran
ran; our contract draft was wrong, not the code
microsoft/DeepSpeed/deepspeed/module_inject/auto_ep_folding.py
code served (permissive licence) · get_code("5f8a25a43a552f16")
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 numpy as np
from dataclasses import dataclass

torch.manual_seed(0)

@dataclass(frozen=True)
class ParallelFoldingSpec:
    world_size: int
    pp_size: int
    stage_size: int
    tp_size: int
    dp_size: int
    ep_size: int
    etp_size: int
    edp_size: int
    mp_mode: str = 'tp'

# Create a valid spec with consistent dimensions
# world_size=8, pp_size=2, stage_size=4, tp_size=2, dp_size=2, ep_size=2, etp_size=1, edp_size=4
spec = ParallelFoldingSpec(
    world_size=8,
    pp_size=2,
    stage_size=4,
    tp_size=2,
    dp_size=2,
    ep_size=2,
    etp_size=1,
    edp_size=4,
    mp_mode='tp'
)

global_rank = 3

ARGS = {
    'global_rank': global_rank,
    'spec': spec
}
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 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
move Ran
ran; our contract draft was wrong, not the code
microsoft/DeepSpeed/deepspeed/module_inject/auto_tp.py
code served (permissive licence) · get_code("7a2e41bee4f05c5a")
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 Tensor, 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 torch

torch.manual_seed(0)

# Create a small tensor
tensor = torch.randn(2, 4)

# Define the device (CPU only)
device = 'cpu'

# Define the copy parameter
copy = True

# Construct the ARGS dictionary
ARGS = {
    'tensor': tensor,
    'device': device,
    'copy': copy
}
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 Tensor, 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
resolve_combine_impl Ran
ran; our contract draft was wrong, not the code
microsoft/DeepSpeed/deepspeed/module_inject/auto_ep_layer.py
code served (permissive licence) · get_code("a2da1bc94fa8af7d")
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 torch

def resolve_combine_impl(config_override: str) -> str:
    """Resolve combine implementation from config override or default."""
    if config_override != 'auto':
        return config_override
    return 'weighted_sum'

ARGS = {
    'config_override': 'auto'
}
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 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
get_annotations Not yet run
unverified (harvested, no recorded run)
microsoft/DeepSpeed/deepspeed/compat.py
code served (permissive licence) · get_code("45604a14e400b2f3")
How it ran

no invocation recorded.

get_annotations_from_namespace Not yet run
unverified (harvested, no recorded run)
microsoft/DeepSpeed/deepspeed/compat.py
code served (permissive licence) · get_code("8c9ef2f97041c68b")
How it ran

no invocation recorded.

judge_eval_single_test Not yet run
unverified (harvested, no recorded run)
codeeff/ecco/evaluation/utils.py
pointer only (licence: NONE) · get_code("3f906c29f0acb355")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, codeeff/ecco 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. No invocation recorded.

judge_submit Not yet run
unverified (harvested, no recorded run)
codeeff/ecco/evaluation/utils.py
pointer only (licence: NONE) · get_code("10835a1ccca19d51")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, codeeff/ecco 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. 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 14 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 14 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

Although large language models (LLMs) have been largely successful in generating functionally correct programs, conditioning models to produce efficient solutions while ensuring correctness remains a challenge. Further, unreliability in benchmarking code efficiency is a hurdle across varying hardware specifications for popular interpreted languages such as Python. In this paper, we present ECCO, a reproducible benchmark for evaluating program efficiency via two paradigms: natural language (NL) based code generation and historybased code editing. On ECCO, we adapt and thoroughly investigate the three most promising existing LLM-based approaches: in-context learning, iterative refinement with execution or NL feedback, and fine-tuning conditioned on execution and editing history. While most methods degrade functional correctness and moderately increase program efficiency, we find that adding execution information often helps maintain functional correctness, and NL feedback enhances more on efficiency. We release our benchmark to support future work on LLMbased generation of efficient code. 1 * Equal contribution, ordered by a coin toss. 1

For agents

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

get_harvested_code_for_paper("2407.14044")
get_code_for_paper("2407.14044")
have("2407.14044")

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

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

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

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

Connect an agent — have() is free.