SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.16684 · 2024

gzip Predicts Data-dependent Scaling Laws

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 (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 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/2405.16684.json · badge: /api/ran/2405.16684.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
KhoomeiK/complexity-scaling canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_perplexity Ran
ran, honoured the contract we drafted
KhoomeiK/complexity-scaling/training.py
code served (permissive licence) · get_code("f02c461b66961302")
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 float64, ndim 0, dtype family float; no output shape is stated. 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 and ndim 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)

# Build a minimal model that has the interface expected by the function
class MinimalLM(nn.Module):
    def __init__(self, vocab_size=10, hidden_dim=4):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.linear = nn.Linear(hidden_dim, vocab_size)
    
    def forward(self, input_ids, attention_mask=None):
        x = self.embedding(input_ids)
        logits = self.linear(x)
        
        # Create a simple output object with a logits attribute
        class Output:
            pass
        output = Output()
        output.logits = logits
        return output

# Build minimal dataloader with batch dictionaries
batch_size = 2
seq_length = 5
vocab_size = 10

dataloader = []
for _ in range(2):
    batch = {
        'input_ids': torch.randint(0, vocab_size, (batch_size, seq_length)),
        'attention_mask': torch.ones((batch_size, seq_length), dtype=torch.long),
    }
    # Add a to() method to the batch dict
    original_dict = batch
    
    class BatchDict(dict):
        def to(self, device):
            for key in self:
                if isinstance(self[key], torch.Tensor):
                    self[key] = self[key].to(device)
            return self
    
    batch_obj = BatchDict(batch)
    dataloader.append(batch_obj)

model = MinimalLM(vocab_size=vocab_size, hidden_dim=4)

ARGS = {
    'dataloader': dataloader,
    'model': model,
    'device': 'cpu',
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
count_total_tokens Ran
ran, honoured the contract we drafted
KhoomeiK/complexity-scaling/data_utils.py
code served (permissive licence) · get_code("8139d232d30238b4")
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

torch.manual_seed(0)

# Create a simple dataloader that yields batches with 'attention_mask' key
# The function iterates through batches and sums the flattened attention_mask values
class SimpleDataLoader:
    def __init__(self, num_batches=2, batch_size=3, seq_length=4):
        self.num_batches = num_batches
        self.batch_size = batch_size
        self.seq_length = seq_length
    
    def __iter__(self):
        for _ in range(self.num_batches):
            # Create attention mask: shape (batch_size, seq_length)
            # Values are 0 or 1 to represent valid tokens
            attention_mask = torch.randint(0, 2, (self.batch_size, self.seq_length))
            yield {'attention_mask': attention_mask}

# Create dataloader instance
dataloader = SimpleDataLoader(num_batches=2, batch_size=3, seq_length=4)

ARGS = {
    'dataloader': dataloader
}
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
generate_probs Ran
ran, honoured the contract we drafted
KhoomeiK/complexity-scaling/data_gen.py
code served (permissive licence) · get_code("2533b450b8e34469")
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, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 random

# Set seed for reproducibility
random.seed(42)

# Construct arguments for generate_probs
ARGS = {
    'num_options': 5
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
pad_and_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
KhoomeiK/complexity-scaling/data_utils.py
code served (permissive licence) · get_code("af46e9591a3b2bd0")
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, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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)

# Analyzing the function:
# - sequence: a list that supports len(), indexing with [:], and iteration
# - sequence_length: an integer used for comparison and arithmetic
# - The function pads with 32000 or truncates the sequence
# - It creates a mask based on whether tokens equal 32000

# Test case 1: sequence that needs padding
sequence_1 = [1, 2, 3]
sequence_length_1 = 5

# Test case 2: sequence that is exact length
sequence_2 = [10, 20]
sequence_length_2 = 2

# Test case 3: sequence that needs truncation
sequence_3 = [100, 200, 300, 400, 500]
sequence_length_3 = 3

# Use the first test case as the main argument
ARGS = {
    "sequence": [1, 2, 3],
    "sequence_length": 5
}
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, ndim 2, dtype family int — a tuple output has no array shape of its own; none is stated
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
pcfg_dataset_to_dataloader Ran
ran; our contract draft was wrong, not the code
KhoomeiK/complexity-scaling/data_utils.py
code served (permissive licence) · get_code("a73ce93fc83d94bd")
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 DataLoader. 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 transformers import AutoTokenizer
from datasets import Dataset
from torch.utils.data import DataLoader

torch.manual_seed(0)

# Create a minimal tokenizer stand-in
class MockTokenizer:
    def __init__(self):
        self.pad_token_id = 32000
        self.model_max_length = 256

# Create pcfg_dataset - list of space-separated token strings
pcfg_dataset = [
    "100 101 102 103",
    "200 201 202",
    "300 301 302 303 304"
]

# Create padder_tokenizer
padder_tokenizer = MockTokenizer()

ARGS = {
    'pcfg_dataset': pcfg_dataset,
    'padder_tokenizer': padder_tokenizer,
    'batch_size': 2,
    'context_length': 8,
    'dataset_name': 'test_dataset'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
run_training Ran
ran; our contract draft was wrong, not the code
KhoomeiK/complexity-scaling/training.py
code served (permissive licence) · get_code("956054a202b209ff")
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 numpy as np
import torch
import torch.nn as nn
from torch.optim import Adam

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, input_ids, attention_mask):
        logits = self.linear(input_ids)
        loss = logits.mean()
        
        class Output:
            pass
        
        output = Output()
        output.loss = loss
        return output

model = SimpleModel()

train_dataloader = [
    {
        'input_ids': torch.randn(2, 4),
        'attention_mask': torch.ones(2, 4)
    }
    for _ in range(3)
]

valid_dataloader = [
    {
        'input_ids': torch.randn(2, 4),
        'attention_mask': torch.ones(2, 4)
    }
    for _ in range(2)
]

optimizer = Adam(model.parameters(), lr=0.001)

ARGS = {
    'model': model,
    'train_dataloader': train_dataloader,
    'valid_dataloader': valid_dataloader,
    'optimizer': optimizer,
    'num_epochs': 2,
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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
run_fsdp_training Not yet run
unverified (harvested, no recorded run)
KhoomeiK/complexity-scaling/fsdp_training.py
code served (permissive licence) · get_code("1e6df76ca8f45cf5")
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

Past work has established scaling laws that predict the performance of a neural language model (LM) as a function of its parameter count and the number of tokens it's trained on, enabling optimal allocation of a fixed compute budget. Are these scaling laws agnostic to training data as some prior work suggests? We generate training datasets of varying complexities by modulating the syntactic properties of a PCFG, finding that 1) scaling laws are sensitive to differences in data complexity and that 2) gzip, a compression algorithm, is an effective predictor of how data complexity impacts scaling properties. We propose a new data-dependent scaling law for LM's that accounts for the training data's gzip-compressibility; its compute-optimal frontier increases in dataset size preference (over parameter count preference) as training data becomes harder to compress.

For agents

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

get_harvested_code_for_paper("2405.16684")
get_code_for_paper("2405.16684")
have("2405.16684")

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

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

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

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

Connect an agent — have() is free.