SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.04815 · ICML · 2021

ChaCha for Online AutoML

John Langford, Chi Wang, Marco Rossi, Qingyun Wu, Paul Mineiro

arXiv · PDF · Open in the Atlas

Code that ran

3 of 8 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 1 has no contract verdict; 1 failure of our instrument; 5 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/2106.04815.json · badge: /api/ran/2106.04815.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/flaml canonical (classifier label)
classifier basis: classifier_2025
1 ran · 1 no recorded run
microsoft/FLAML marked official in Papers with Code
Papers with Code archive
2 ran · 4 no recorded run
FunctionStatusWhere it lives
TrialScheduler Ran
ran on a synthesized input
microsoft/FLAML/flaml/tune/scheduler/online_scheduler.py
code served (permissive licence) · get_code("f59fd6745ea95e75")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned NoneType. 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 time
import uuid
from collections import deque
from numbers import Number

class Trial:
    """A trial object holds the state for one model training run."""
    PENDING = 'PENDING'
    RUNNING = 'RUNNING'
    PAUSED = 'PAUSED'
    TERMINATED = 'TERMINATED'
    ERROR = 'ERROR'

    @classmethod
    def generate_id(cls):
        return str(uuid.uuid1().hex)[:8]

    def __init__(self, trainable_name, config, trial_id=None, local_dir=None, 
                 logdir=None, evaluated_params=None, experiment_tag=None, 
                 resources=None, status=PENDING, error_file=None, n_steps=None):
        self.trainable_name = trainable_name
        self.config = config
        self.trial_id = trial_id or self.generate_id()
        self.local_dir = local_dir
        self.logdir = logdir
        self.evaluated_params = evaluated_params or {}
        self.experiment_tag = experiment_tag
        self.resources = resources
        self.status = status
        self.error_file = error_file
        self.n_steps = n_steps or [5, 10]
        self.last_result = {}
        self.last_update_time = None
        self.start_time = None
        self.metric_analysis = {}
        self.metric_n_steps = {}

    def update_last_result(self, result):
        if self.experiment_tag:
            result.update(experiment_tag=self.experiment_tag)
        self.last_result = result
        self.last_update_time = time.time()
        for metric, value in flatten_dict(result).items():
            if isinstance(value, Number):
                if metric not in self.metric_analysis:
                    self.metric_analysis[metric] = {'max': value, 'min': value, 'avg': value, 'last': value}
                    self.metric_n_steps[metric] = {}
                    for n in self.n_steps:
                        key = f'last-{n:d}-avg'
                        self.metric_analysis[metric][key] = value
                        self.metric_n_steps[metric][str(n)] = deque([value], maxlen=n)
                else:
                    step = result.get('training_iteration', 1) or 1
                    self.metric_analysis[metric]['max'] = max(value, self.metric_analysis[metric]['max'])
                    self.metric_analysis[metric]['min'] = min(value, self.metric_analysis[metric]['min'])
                    self.metric_analysis[metric]['avg'] = 1 / step * (value + (step - 1) * self.metric_analysis[metric]['avg'])
                    self.metric_analysis[metric]['last'] = value
                    for n in self.n_steps:
                        key = f'last-{n:d}-avg'
                        self.metric_n_steps[metric][str(n)].append(value)
                        self.metric_analysis[metric][key] = sum(self.metric_n_steps[metric][str(n)]) / len(self.metric_n_steps[metric][str(n)])

    def set_status(self, status):
        """Sets the status of the trial."""
        self.status = status
        if status == Trial.RUNNING:
            if self.start_time is None:
                self.start_time = time.time()

    def is_finished(self):
        return self.status in [Trial.ERROR, Trial.TERMINATED]

def flatten_dict(dt, delimiter='/', prevent_delimiter=False):
    dt = dt.copy()
    if prevent_delimiter and any((delimiter in key for key in dt)):
        raise ValueError('Found delimiter in key when trying to flatten array.')
    while any((isinstance(v, dict) for v in dt.values())):
        remove = []
        add = {}
        for key, value in dt.items():
            if isinstance(value, dict):
                for subkey, v in value.items():
                    if prevent_delimiter and delimiter in subkey:
                        raise ValueError('Found delimiter in key when trying to flatten array.')
                    add[delimiter.join([key, str(subkey)])] = v
                remove.append(key)
        dt.update(add)
        for k in remove:
            del dt[k]
    return dt

class TrialScheduler:
    """Interface for implementing a Trial Scheduler class."""
    CONTINUE = 'CONTINUE'
    PAUSE = 'PAUSE'
    STOP = 'STOP'

    def __init__(self):
        pass

    def on_trial_add(self, trial_runner, trial):
        pass

    def on_trial_remove(self, trial_runner, trial):
        pass

INIT_ARGS = {}

ARGS = {
    'trial_runner': None,
    'trial': Trial(
        trainable_name='test_trainable',
        config={'lr': 0.001, 'batch_size': 32},
        trial_id='trial_001',
        local_dir='/tmp',
        logdir='/tmp/logs',
        evaluated_params={'lr': 0.001},
        experiment_tag='exp_1',
        resources=None,
        status=Trial.PENDING,
        error_file=None,
        n_steps=[5, 10]
    )
}

METHOD = 'on_trial_add'

scheduler = TrialScheduler()
trial = ARGS['trial']
scheduler.on_trial_add(ARGS['trial_runner'], trial)

result = {'loss': 0.5, 'accuracy': 0.95, 'training_iteration': 1, 'nested': {'metric': 0.8}}
trial.update_last_result(result)

trial.set_status(Trial.RUNNING)

print(f"Trial status: {trial.status}")
print(f"Trial is finished: {trial.is_finished()}")
print(f"Metric analysis: {trial.metric_analysis}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
flatten_dict Ran
ran; our contract draft was wrong, not the code
microsoft/FLAML/flaml/tune/scheduler/online_scheduler.py
code served (permissive licence) · get_code("fbb7d311c959569d")
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

torch.manual_seed(0)

# Test case 1: Simple nested dict
nested_dict_1 = {
    'model': {
        'layer1': 'value1',
        'layer2': 'value2'
    },
    'optimizer': {
        'lr': 0.001,
        'momentum': 0.9
    }
}

# Test case 2: Dict with prevent_delimiter=False (default behavior)
nested_dict_2 = {
    'a': {
        'b': 1,
        'c': 2
    },
    'd': 3
}

# Test case 3: Dict with custom delimiter
nested_dict_3 = {
    'config': {
        'batch_size': 32,
        'epochs': 100
    },
    'data': {
        'train': 'path/to/train',
        'test': 'path/to/test'
    }
}

# Test case 4: Already flat dict (no nested dicts)
flat_dict = {
    'key1': 'value1',
    'key2': 'value2',
    'key3': 'value3'
}

ARGS = {
    'dt': nested_dict_1,
    'delimiter': '/',
    'prevent_delimiter': False
}
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
size Ran
ran, honoured the contract we drafted
microsoft/flaml/flaml/automl/automl.py
code served (permissive licence) · get_code("f29ed149e7409855")
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) 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
import torch.nn as nn

torch.manual_seed(0)

class DummyLearner(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    @staticmethod
    def size(config):
        # Return a reasonable memory size estimate in bytes
        return 1024 * 512  # 512 KB

learner_classes = {
    'dummy_learner': DummyLearner
}

config = {
    'ml': {
        'learner': 'dummy_learner',
        'hidden_dim': 64,
        'batch_size': 2
    }
}

ARGS = {
    'learner_classes': learner_classes,
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
ChaChaScheduler Not yet run
unverified (harvested, no recorded run)
microsoft/FLAML/flaml/tune/scheduler/online_scheduler.py
code served (permissive licence) · get_code("38d8f852da64146a")
How it ran

no invocation recorded.

OnlineScheduler Not yet run
unverified (harvested, no recorded run)
microsoft/FLAML/flaml/tune/scheduler/online_scheduler.py
code served (permissive licence) · get_code("4309b9562a4b6aad")
How it ran

no invocation recorded.

OnlineSuccessiveDoublingScheduler Not yet run
unverified (harvested, no recorded run)
microsoft/FLAML/flaml/tune/scheduler/online_scheduler.py
code served (permissive licence) · get_code("151925adde8bd20a")
How it ran

no invocation recorded.

Trial Not yet run
unverified (harvested, no recorded run)
microsoft/FLAML/flaml/tune/scheduler/online_scheduler.py
code served (permissive licence) · get_code("0574fc6c8b3e963b")
How it ran

no invocation recorded.

report Not yet run
unverified (harvested, no recorded run)
microsoft/flaml/flaml/tune/tune.py
code served (permissive licence) · get_code("dc6c34254fe5f216")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 2 the same month, 1 later) and 6 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
size 2 other papers
1 the same month, 1 later
2106.09204 (2021-06)
An Empirical Study on Hyperparameter Optimization for Fine-Tuning Pre-trained Language Models
2303.04673 (2023-03)
Cost-Effective Hyperparameter Optimization for Large Language Model Generation Inference
report 1 other paper
1 the same month
2106.09204 (2021-06)
An Empirical Study on Hyperparameter Optimization for Fine-Tuning Pre-trained Language Models

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

We propose the ChaCha (Champion-Challengers) algorithm for making an online choice of hyperparameters in online learning settings. ChaCha handles the process of determining a champion and scheduling a set of 'live' challengers over time based on sample complexity bounds. It is guaranteed to have sublinear regret after the optimal configuration is added into consideration by an application-dependent oracle based on the champions. Empirically, we show that ChaCha provides good performance across a wide array of datasets when optimizing over featurization and hyperparameter decisions.

For agents

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

get_harvested_code_for_paper("2106.04815")
get_code_for_paper("2106.04815")
have("2106.04815")

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

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

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

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

Connect an agent — have() is free.