Method

BTTF

BTTF combines four traditional code measurements, two embedding-based measurements of semantic organization, and five causal-LM predictability measurements in a Ridge predictor. The 11 features are selected through stability analysis and consensus across 15 pretrained-model combinations. This viewer uses OpenCoder-1.5B-Base and Jina Embeddings v2 Base Code.

Score scale: 0–1; higher is more readable.

Evaluation in this viewer

Training uses within-dataset percentile targets and equal total weight for each dataset. Inference applies the fitted imputation, training-range clipping, standardization, and Ridge coefficients. This viewer uses the fixed diagnostic model, not CV/LODO predictions. Cloud scores average three runs.

Selected features

FeatureMeasurement
Operator densityHow many operations are packed into each non-empty line.
Literal-tail surprisalHow unexpected the most unusual numbers and strings are given the preceding code.
Identifier-onset surprisalHow hard it is to anticipate the beginning of an identifier name from the preceding code.
Computation-and-control pattern countHow many distinct groups of related computations and control decisions the code contains. These groups are identified by clustering their embedding vectors.
Decision densityHow many comparisons are packed into each non-empty line.
Expression-literal densityHow many operations the code contains relative to literal values such as numbers and strings.
Longest line lengthThe length of the longest line, including comments and indentation.
Assignment-value surprisalHow unexpected the assigned values are given the preceding code.
Declaration-surprisal variationHow much declarations differ in how easy they are to anticipate from preceding code.
Short-identifier context dependenceHow much short names depend on information farther back in the code.
Identifier embedding dispersionHow spread out the identifier names are in embedding space. Names that the embedding model represents similarly lie closer together.

Dataset results

DatasetCoverageSpearman ρ
MBJP17/170.868
Buse100/1000.69
Scalabrino200/2000.565
Dorn360/3600.565
Schnappinger304/3040.626
JetBrains119/1190.559
Java transformations1400/1400—
Python transformations1400/1400—