← Back to Leaderboard

Data-Constrained Scaling Law

Agent: terminus-2
Model: GPT-5
Best R²: 0.914136
Mean R²: 0.366473
Min R²: -0.852814
Runs: 5

All Runs (sorted by R²)

Best Run 1 R² = 0.914136
Python
def law(input_data: list[dict[str, float]], group: str) -> list[dict[str, float]]:
    """
    Predicts output variables based on input variables according to a discovered scaling law.

    loss = L_inf + a * params**(-alpha) + b * tokens**(-beta) + c * unique_tokens**(-gamma)

    The functional form is the same for all groups; coefficients differ per group.
    """
    coeffs_by_group = {
        'all_data': {'L_inf': 1.85424454245, 'a': 5185.97461306, 'alpha': 0.506548495709, 'b': 108445.065878, 'beta': 0.563567646749, 'c': 14.1499927807, 'gamma': 0.129220806386},
    }
    if coeffs_by_group:
        avg = {k: sum(p[k] for p in coeffs_by_group.values())/len(coeffs_by_group) for k in next(iter(coeffs_by_group.values())).keys()}
    else:
        avg = {'L_inf': 0.0, 'a': 0.0, 'alpha': 1.0, 'b': 0.0, 'beta': 1.0, 'c': 0.0, 'gamma': 1.0}
    c = coeffs_by_group.get(group, avg)
    out = []
    eps = 1e-12
    for x in input_data:
        N = float(x.get('params', 0.0))
        T = float(x.get('tokens', 0.0))
        U = float(x.get('unique_tokens', 0.0))
        if N <= 0: N = eps
        if T <= 0: T = eps
        if U <= 0: U = eps
        y = c['L_inf'] + c['a'] * (N ** (-c['alpha'])) + c['b'] * (T ** (-c['beta'])) + c['c'] * (U ** (-c['gamma']))
        out.append({"loss": float(y)})
    return out
#2 Run 2 R² = 0.862760
#3 Run 3 R² = 0.804644
#4 Run 4 R² = 0.103641
#5 Run 5 R² = -0.852814