Papers
Topics
Authors
Recent
Search
2000 character limit reached

COD: Clustering-On-Difficulty Framework

Updated 27 January 2026
  • The paper introduces the COD framework, which partitions LLM samples and variables using difficulty and covariance profiles for robust performance prediction.
  • It employs modified MeanShift and sCOD thresholding algorithms to form clusters, enabling stable scaling law fitting and accurate subset-to-full mapping.
  • COD achieves minimax-optimal cluster recovery and outperforms competing methods through explicit separation thresholds and calibrated quartic mapping.

The Clustering-On-Difficulty (COD) framework encompasses a family of model-based clustering techniques that leverage difficulty or similarity metrics to robustly partition samples or variables for downstream performance prediction, covariance structure recovery, or high-dimensional exploratory analysis. COD has been developed and rigorously analyzed in contexts including LLM scaling prediction and model-assisted variable clustering, offering minimax-optimal recovery, explicit cluster separation thresholds, and end-to-end accuracy extrapolation pipelines (Xu et al., 24 Feb 2025, Bunea et al., 2015).

1. Modeling by Difficulty Features and Covariance Profiles

COD’s foundational principle is the clustering of samples (in LLM evaluation) or variables (in variable clustering) based on features that encode “difficulty” or “similarity” as measured by model predictions or covariance profiles.

  • In LLM performance prediction, each evaluation sample is characterized by its passrate vector across a suite of small models {M1,,MS}\{M_1, \dots, M_S\}. The difficulty-feature for sample pp is xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S, where pj(p)p_j(p) is the empirical passrate of MjM_j on pp, estimated via repeated few-shot stochastic trials. This vector is typically nondecreasing in index, as model performance increases with scale (Xu et al., 24 Feb 2025).
  • In high-dimensional covariance modeling, the G-block covariance model posits that the pp-dimensional random vector XX admits

Σ=ACA+Γ,\Sigma = A C^* A^\top + \Gamma,

with AA the pp0 indicator membership matrix, pp1 latent factor covariance, and pp2 diagonal noise. This structure clusters variables whose covariance profiles are similar across all other variables (Bunea et al., 2015).

2. Difficulty-Driven or Similarity-Based Clustering Algorithms

COD clusters are constructed by partitioning points with similar difficulty or similarity profiles, automatically adapting both the cluster count and outlier handling.

  • For LLMs: The passrate matrix pp3 (samples pp4 small models) is clustered using an improved MeanShift algorithm based on Euclidean distance. The steps are:

    1. All samples start unassigned.
    2. Standard MeanShift is run on the unassigned set with bandwidth pp5.
    3. Points within pp6 of each new center pp7 are assigned to the cluster; others remain unassigned.
    4. Clusters with fewer than pp8 points are dissolved; their members revert to unassigned.
    5. Repeat until convergence; remaining unassigned samples are marked as outliers (Xu et al., 24 Feb 2025).
  • For variable clustering: COD operates by identifying pairs of variables pp9 with minimal

xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S0

and iteratively extracts clusters based on a fixed threshold xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S1. Singleton clusters are identified where maximal similarity is above threshold; otherwise, a cluster is built by merging variables whose pairwise sCOD falls below xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S2 with respect to at least one seed variable (Bunea et al., 2015).

3. Cluster-Wise Performance Extrapolation and Scaling Laws

Only clusters with regular, predictable scaling are considered for further extrapolation, yielding stable predictions on subset performance.

  • Within each cluster, a scaling law is fit of the form:

xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S3

where xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S4 denotes the expected accuracy at compute xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S5. The random-guess floor xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S6 and asymptotic offset xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S7 are essential for accurate fits. Only clusters whose parameters and fitted curves satisfy these constraints, and that are monotonic and extrapolatable, are retained. Cluster-wise predictions xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S8 are aggregated as a cluster-size-weighted average for the subset (Xu et al., 24 Feb 2025).

4. Mapping Subset Prediction to Full Evaluation Set

Since not all samples are in extrapolatable clusters, a mapping is learned to translate subset accuracy xp=[p1(p),,pS(p)]RS\mathbf{x}_p = [p_1(p),\dots,p_S(p)]^\top \in \mathbb{R}^S9 to total set accuracy pj(p)p_j(p)0.

  • The mapping function pj(p)p_j(p)1 is a quartic polynomial constrained by pj(p)p_j(p)2, pj(p)p_j(p)3:

pj(p)p_j(p)4

  • Coefficients pj(p)p_j(p)5 are fit by least-squares or interpolation on anchor points pj(p)p_j(p)6 obtained from mid-sized or external models. This calibration reduces bias, particularly when anchors are out-of-distribution models; empirically, out-of-distribution anchors reduce error approximately 40% over no-anchor mapping (Xu et al., 24 Feb 2025).

5. Minimax Thresholds, Theoretical Guarantees, and Empirical Results

COD is rigorously analyzed for optimality guarantees and demonstrated empirically to match the tightest known error rates.

  • Minimax-Optimality (variable clustering):
    • The MCOD (pj(p)p_j(p)7) and pj(p)p_j(p)8 metrics govern the cluster separation: pj(p)p_j(p)9, and MjM_j0.
    • For class MjM_j1, no estimator can guarantee exact recovery if MjM_j2. COD attains exact recovery for MjM_j3, matching the minimax threshold (Theorem 3.1, (Bunea et al., 2015)).
  • Downstream task prediction (LLMs):
    • On eight LLM benchmarks (GSM8K, MATH, BBH, TriviaQA, MBPP, AGIEval, DROP, MMLU-pro), COD achieves a mean absolute error of 1.63 percentage points (1.36% in the abstract) and a maximum error never exceeding 2.4 points, outperforming end-to-end, passrate-only, and loss-intermediate baselines.
    • Key ablation findings include the critical importance of fitting both MjM_j4 and MjM_j5, and the superiority of quartic mapping over lower or higher-degree interpolants (Xu et al., 24 Feb 2025).

COD is compared against PECOK, a penalized SDP tailored to the MjM_j6 metric, and corrected spectral clustering.

Algorithm Specialized Metric Exact Recovery Threshold Computational Regime
COD MCOD MjM_j7 MjM_j8, no SDP, cluster size MjM_j9
PECOK (SDP relaxation) pp0 pp1 SDP (pp2), clusters pp3 or balanced
Corrected Spectral Latent eigengap Stronger than minimax, no exact at threshold Low constant factors, needs larger separation

COD provides optimal recovery for MCOD-type separation with minimal assumptions and computational simplicity. PECOK is optimal for pp4 separation when clusters are balanced and pp5, but incurs SDP complexity. Corrected spectral clustering is computationally attractive but theoretically requires larger separation and does not attain minimax thresholds (Bunea et al., 2015).

7. Practical Implementation and Use Cases

COD is applied by:

  1. Gathering difficulty or covariance profile matrices.
  2. Clustering via improved MeanShift (LLM) or sCOD thresholding (variable clustering).
  3. Fitting cluster-wise scaling laws.
  4. Aggregating extrapolatable cluster predictions.
  5. Mapping to full set predictions via anchor-calibrated quartic.
  6. Recommending parameter choices: pre-filter all-zero passrates, smooth passrates across checkpoints, mean-shift pp6 and pp7 for intra-cluster diameter pp8 and cluster size pp9.

LLM experiments use small models from 122M to 12B parameters, predict full-model performance at 70B scale, and produce actionable insights for efficient resource allocation and pretraining monitoring (Xu et al., 24 Feb 2025). In fMRI variable clustering, COD identifies meaningful brain networks and outperforms classical clustering across sparsity regimes (Bunea et al., 2015).

COD thus serves as a state-of-the-art methodology for both principled model-based clustering and reliable performance extrapolation, combining minimax theoretical performance with robust empirical accuracy.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Clustering-On-Difficulty (COD) Framework.