Publications LOCUS

LOCUS: Low-Dimensional Model Embeddings for Efficient Model Exploration, Comparison, and Selection

Shivam Patel1†, William Cocke1, Gauri Joshi1

1Carnegie Mellon University† Corresponding author

AdaptFM @ ICML 2026arXivPDFCode

A rapidly expanding model ecosystem

More than 300,000 text-to-text models are published on HuggingFace, and the ecosystem continues to expand. These models differ substantially in size, architecture, training data, and specialization. This heterogeneity is precisely what makes the model pool valuable — a 7B math model can outperform a 70B generalist on arithmetic at a tenth of the cost — but it also makes systematic model management increasingly difficult. Practical questions arise immediately: Which models are near-duplicates? Which small subset should be deployed? If a preferred model is unavailable, what is the closest substitute? When a new model is introduced, where does it belong relative to the existing pool?

These are fundamentally problems of model comparison, and a single leaderboard score is insufficient to address them. What is needed is a representation in which heterogeneous models can be placed in a common space, compared quantitatively, and searched efficiently. LOCUS adopts a simple representation for this purpose: each model is assigned a single fixed-dimensional vector.

\[m \;\longmapsto\; z_m \in \mathbb{R}^{d}\]

The remaining question is how this vector should be constructed. Model parameters are an obvious source of information, but they are difficult to compare across heterogeneous architectures and are unavailable for proprietary API models. Output logits similarly depend on model-specific tokenization. In contrast, behavioural evaluations provide a model-agnostic interface: submit a query and assign a score to the resulting response. LOCUS therefore constructs model embeddings from evaluations alone. For a model $m$ evaluated on a set of queries $\mathcal{Q}_m$, where each query $x$ has a sentence encoding $\phi(x)\in\mathbb{R}^{d_\phi}$ and an evaluation score $y^{(m)}(x)\in[0,1]$ (typically binary correctness), the input is the set

\[S_m \;=\; \big\{\,(\phi(x_i),\; y^{(m)}(x_i))\,\big\}_{x_i \in \mathcal{Q}_m}\]

and the output is a single model embedding. The remainder of the method follows from the construction of this mapping.

Desiderata for model embeddings

The use cases above impose several requirements that are individually natural but challenging to satisfy simultaneously:

Prior approaches broadly fall into two categories, each satisfying a complementary subset of these desiderata. Parametric methods — EmbedLLM, IRT-Net, and JE-IRT — treat each model embedding as a free parameter optimized jointly with a correctness predictor. These methods can predict performance accurately, but the resulting embedding is not uniquely determined by the evaluation data because it is obtained through stochastic optimization. Nonparametric methods such as LLM-DNA instead compute embeddings using fixed geometric operations, yielding deterministic representations, but require all models to be evaluated on the same queries, cannot naturally refine an embedding as additional evaluations arrive, and do not provide an associated correctness predictor.

Qualitative comparison of prior model-representation approaches. LOCUS combines training-free embedding generation at inference time with a trained encoder and correctness predictor, while supporting evaluation sets of varying size and composition.
Method Training-free embeddings Correctness prediction Varying eval queries
EmbedLLM
IRT-Net
LLM-DNA
LOCUS

Instability of fitted per-model embeddings

Training-free onboarding is particularly important for preserving a consistent embedding geometry. Consider an EmbedLLM-style setting in which the correctness predictor $G_\psi$ is frozen and the embedding of a newly introduced model is optimized by gradient descent. If this optimization is repeated using evaluation data identical to that of an already embedded model, the regenerated embedding would ideally reproduce the original representation. In practice, it does not.

Heatmap of cosine distance between original and regenerated EmbedLLM embeddings across decoder depths and embedding dimensions, showing large distances throughout
Average cosine distance between EmbedLLM embeddings and embeddings regenerated from the same evaluation data with the predictor held fixed, across decoder depths and embedding dimensions. Despite identical evaluation data and a fixed predictor, the regenerated embeddings can differ substantially from the originals. Corresponding correctness predictions exhibit up to 8.1% disagreement on a common test set.

This non-uniqueness undermines distance-based analyses. Nearest-neighbour retrieval, clustering, and similarity search implicitly assume that identical model behaviour maps to the same representation. LOCUS enforces this property by construction: the embedding is the output of a fixed function of the evaluation set, so identical evaluations produce identical embeddings deterministically.

LOCUS: an attention encoder over evaluations

The evaluation collection $S_m$ is naturally a set: it has no intrinsic ordering and its cardinality can vary across models. These properties motivate the architecture. LOCUS uses a set encoder $F_\theta$ to map $S_m$ to a fixed-dimensional vector, together with a lightweight correctness predictor $G_\psi$ that maps a model embedding and query encoding to a correctness probability.

Encoder pipeline: evaluations tokenized, passed through multi-head attention transformer layers, then a learned-query aggregation layer, producing a model embedding
The embedding generator $F_\theta$. Each (query encoding, score) pair is mapped to a token; bidirectional attention layers without positional encodings exchange information across the evaluation set; and a learned-query aggregation block maps the resulting tokens to a single vector. The shaded components are trained jointly once across the model pool; no model-specific parameters are optimized during onboarding.

Step 1: tokenize each evaluation

A trained MLP $h_\omega$ maps each (query encoding, score) pair to a $d$-dimensional token, placing heterogeneous inputs in a shared representation space suitable for attention:

\[t_i^{(m)} \;=\; h_\omega\!\big(\phi(x_i),\; y^{(m)}(x_i)\big) \in \mathbb{R}^{1\times d}\]

Stacking these tokens as rows gives $X_m^{(0)} \in \mathbb{R}^{n_m \times d}$, where $n_m = |S_m|$ denotes the number of evaluations available for model $m$. The subsequent architecture does not require $n_m$ to be shared across models.

Step 2: attention through a latent bottleneck

Direct self-attention over $n_m$ tokens has $\mathcal{O}(n_m^2)$ computational cost, which becomes restrictive when a model has thousands of evaluations. LOCUS instead introduces $r \ll n_m$ learned latent vectors $U^{(\ell)} \in \mathbb{R}^{r \times d}$. Each layer first compresses information from the evaluation tokens into the latents and then broadcasts the latent representation back to the evaluation tokens:

\[H_m^{(\ell)} = \mathrm{TBlock}\big(U^{(\ell)},\, X_m^{(\ell-1)},\, X_m^{(\ell-1)}\big) \in \mathbb{R}^{r\times d}\] \[X_m^{(\ell)} = \mathrm{TBlock}\big(X_m^{(\ell-1)},\, H_m^{(\ell)},\, H_m^{(\ell)}\big) \in \mathbb{R}^{n_m\times d}\]

This reduces the attention cost to $\mathcal{O}(n_m r)$ — linear in the number of evaluations for fixed $r$ — while retaining global information flow through the latent bottleneck.

Step 3: aggregate with a learned query

A single learned query vector $s \in \mathbb{R}^{1\times d}$ attends over the final token representations and produces the model embedding:

\[z_m \;=\; \mathrm{TBlock}\big(s,\; X_m^{(L)},\; X_m^{(L)}\big) \in \mathbb{R}^{1\times d}\]

Because the architecture uses no positional encodings and performs aggregation through attention rather than position-dependent indexing, $z_m$ is permutation invariant: reordering the evaluations does not change the embedding. This invariance is an exact architectural property rather than one learned approximately during training; the demonstration below verifies it numerically on the released checkpoint.

Step 4: predict correctness

To support downstream model selection, the embedding must be translated into query-specific performance estimates. A two-layer MLP $G_\psi$ takes a model embedding and query encoding as input and returns a correctness probability:

\[\widehat{p}_\psi\big(y^{(m)}(x)\!=\!1 \,\big|\, z_m, \phi(x)\big) \;=\; \sigma\big(G_\psi(z_m, \phi(x))\big)\]
The correctness predictor: a model embedding and a query embedding feed a small MLP that outputs correct or incorrect
The correctness predictor $G_\psi$. The predictor is intentionally lightweight: the model representation is supplied by the encoder, and the small decoder enables 4,096 queries to be scored against all 112 models in approximately 20 ms.

The encoder and predictor are trained jointly by minimizing binary cross-entropy. Each optimization step samples a mini-batch of models; for each model, an encoder subset $S_m^{\mathrm{enc}}$ is used to construct the embedding, while an independently sampled decoder batch $S_m^{\mathrm{dec}}$ provides the prediction targets:

\[\min_{\omega,\theta,\psi}\; \mathbb{E}_{m}\, \mathbb{E}_{x \sim S_m}\; \mathrm{BCE}\big(\widehat{p}^{(m)}(x),\, y^{(m)}(x)\big)\]

Training on subsets of varying cardinality exposes the encoder to different values of $n_m$, enabling inference with variable-sized evaluation sets.

Onboarding a new model

  1. Evaluate $m_{\text{new}}$ on available queries and record their scores. ≈128 evaluations typically suffice
  2. $z_{m_\text{new}} \leftarrow F_\theta(S^{\text{enc}}_{m_\text{new}})$ a single forward pass

Not required

  1. Optimizing model-specific parameters. none are introduced
  2. Recomputing or modifying any existing $z_m$. existing embeddings remain unchanged

Interactive · one model, its evaluations, and the vector they produce

What this sample says the model can do n = 128

this sampleall 4,096
0%
100%

Fraction of that benchmark's questions the model answered correctly — green above 50%, red below, white at 50%. A dashed cell means the sample happened to contain no questions from that benchmark. The encoder never sees the benchmark names; they are shown only to make the estimate legible.

The embedding z ∈ ℝ128

component 1128
Distance to the 4,096-evaluation reference
Typical distance to a different model
Attention cost, r = 64 bottleneck vs plain

Convergence to the reference embedding

Experimental setup

All experiments use the evaluation matrix released with EmbedLLM, comprising 112 language models spanning base, chat, and finetuned specialists from approximately 1B to 72B parameters. The models are evaluated on queries drawn from 10 public benchmarks — MathQA, LogiQA, MedMCQA, PIQA, TruthfulQA, MMLU, GSM8K, GPQA, ASDiv, and SocialIQA. Queries are encoded with all-mpnet-base-v2 into $\mathbb{R}^{768}$; ablations with three additional sentence encoders are reported in the appendix.

The encoder uses $L=2$ latent-bottleneck blocks with 4-head attention and $r=64$ latent vectors, followed by the aggregation block. The embedding dimension is $d=128$, and the correctness predictor is a two-layer MLP with hidden width 64. Baselines are EmbedLLM and IRT-Net, both of which learn per-model embeddings through backpropagation. Test queries are never used to construct model embeddings and are reserved exclusively for evaluation.

Two metrics are used throughout. Correctness prediction accuracy thresholds $\widehat{p}^{(m)}(x)$ at $0.5$ and measures agreement with observed labels across model–query pairs. Routing accuracy assigns each query to the model with the highest predicted correctness probability and measures the fraction of routed queries for which the selected model is correct.

Results

Routing and correctness prediction

Overall routing and correctness prediction accuracy (%) as the number of query evaluations per model varies. LOCUS achieves the highest routing accuracy at each training-set size. Correctness prediction accuracies are closer across methods because this metric averages performance over all model–query pairs, whereas routing is sensitive to the ranking among the highest-scoring candidate models.
Approach Routing accuracy (%) Corr. prediction (%)
2565121024 2565121024
LOCUS 61.9062.9764.70 68.3168.3370.03
EmbedLLM 58.8059.4759.60 67.3368.1269.47
IRT-Net 59.5760.1763.37 67.3869.0770.12

Sample efficiency

The advantage becomes larger in the low-evaluation regime, which is operationally important because each additional evaluation incurs an inference call to a model in the pool.

Routing accuracy versus number of training samples: LOCUS above IRTNet above EmbedLLM, with 2.3x and 4.8x horizontal arrows
Routing accuracy as a function of the number of evaluations per model used to train $(F_\theta, G_\psi)$. To reach the accuracy LOCUS achieves with roughly 450 evaluations, IRT-Net requires 2.3× as many evaluations and EmbedLLM requires 4.8× as many. Joint attention over the evaluation set yields substantially greater sample efficiency than optimizing independent per-model embeddings.

A similar trend appears during test-time onboarding, where the relevant quantity is the number of evaluations required to obtain an informative embedding for a new model.

Grid of correctness prediction accuracy for held-out models by number of evaluation queries and number of training models
Onboarding 16 held-out models that are never observed during training. Rows vary the number of models used to train the encoder, while columns vary the number of evaluations used to embed each new model. Performance largely saturates by approximately 128 evaluations, and an encoder trained on a partial model pool loses less than 1% relative to one trained on all 112 models, demonstrating generalization to unseen models.

Robustness to evaluation-set composition

Different models are rarely evaluated on identical query sets, so useful model embeddings should remain stable when the available evaluations are resampled. We examine two forms of variation: changing which queries are used at a fixed evaluation count, quantified by the overlap fraction $\alpha$ with a reference set, and changing how many evaluations are available.

Correctness prediction and routing accuracy against evaluation set size and overlap fraction, both flat after a small size
Correctness prediction (top) and routing accuracy (bottom) as functions of evaluation-set size (left) and overlap with a reference set (right). Performance saturates at approximately 128–256 evaluations and is nearly invariant to overlap, indicating comparable performance even when embeddings are generated from disjoint query samples.
t-SNE overlay of embeddings recomputed at varying overlap fractions, clustered near their reference points t-SNE overlay of embeddings recomputed from subsampled evaluation sets, clustered near their reference points
Geometric stability under evaluation-set perturbations. Embeddings for selected models are recomputed under varying overlap (left) and subsampling (right), with the remaining model pool shown in grey. Recomputed embeddings remain localized near their reference representations, in contrast to the instability observed when regenerating EmbedLLM embeddings above.

Embedding distance reflects behavioural similarity

The downstream utility of the embedding space depends on whether geometric distance tracks behavioural differences between models. We evaluate this directly by computing, for each model pair, both the embedding distance and the correctness disagreement rate — the fraction of test queries on which their binary correctness labels differ.

Correlation between embedding distance and correctness disagreement across all 6,216 model pairs. Strong correlations are observed for both distance metrics and across Pearson, Spearman, and Kendall statistics, including rank-based measures directly relevant to nearest-neighbour retrieval.
CorrelationCosine distanceEuclidean distance
Pearson $\rho$0.8450.887
Spearman $r_s$0.8860.876
Kendall $\tau$0.7140.702
Two scatter plots of embedding distance against correctness disagreement, both showing tight positive relationships
Embedding distance versus correctness disagreement for every model pair, using cosine distance (left) and Euclidean distance (right). Distances in the 128-dimensional embedding space provide a strong proxy for how frequently two models disagree on held-out queries.

The geometry also reveals structure that is not provided as supervision. Hierarchical clustering based on pairwise embedding distances separates math-finetuned and code-finetuned model families without access to these family labels.

Dendrogram of models clustered by embedding distance with math and code families highlighted Pairwise distance heatmap of models showing block structure aligned with families
Hierarchical clustering of model embeddings. Math models (orange) and code models (green) form coherent groups, with corresponding block structure in the pairwise distance heatmap. This indicates that model specialization is reflected directly in the learned embedding geometry.

Inspecting the embedding space

The interactive visualization below provides a direct view of the learned geometry. It contains all 112 model embeddings from the released checkpoint, together with their nearest neighbours, per-benchmark accuracy profiles, and correctness agreement statistics. The three-dimensional projection can be rotated and zoomed, which helps disambiguate points that overlap in any single two-dimensional view. The two interaction modes correspond to the downstream applications discussed next.

Interactive · all 112 model embeddings, in three dimensions

Loading…

Drag to rotate · scroll to zoom · click a model to select it

Selected model

Accuracy by benchmark

Nearest neighbours — click a row to follow

    Routing accuracy of the selected portfolio

    Models chosen

      Colour by
      Jump to
      Selection rule
      Show

      Applications of the embedding geometry

      Nearest neighbours as model substitutes

      A routing system may select a model that subsequently becomes overloaded, unavailable, or ineligible under a deployment policy. In the absence of query-specific scores for all alternatives, a geometrically meaningful model space provides a principled basis for selecting a substitute. Ranking each model’s neighbours by embedding distance and measuring correctness agreement on common queries evaluates whether this substitution preserves behaviour.

      79%Correctness agreement with closest neighbour, averaged over all 112 models
      85%Routing accuracy retained when every routed model is replaced by its nearest neighbour
      77.7%Agreement with the fifth neighbour, indicating a gradual decline with neighbour rank
      Correctness agreement decaying gradually with neighbour rank k Routing accuracy under fallback to the kth nearest model, decaying gradually
      Left: average correctness agreement between a model and its $k$-th nearest neighbour in embedding space. Right: routing accuracy when the selected model is unavailable and the query is redirected to its $k$-th neighbour. Both metrics decrease gradually with neighbour rank, indicating graceful degradation and preserving useful fallback choices beyond the closest neighbour.

      Model portfolio selection

      Deploying all 112 models is often impractical. A more relevant systems question is which small subset should be retained while preserving the capabilities of the full pool. The embedding space enables this selection without evaluating every candidate subset: choose models that cover the space, using geometric coverage as a proxy for coverage of distinct model behaviours.

      Two classical facility-location objectives apply directly. k-center minimizes the maximum distance from any model to the selected set, while k-medoids minimizes the average distance. Under a total parameter budget rather than a model-count constraint, a coverage-greedy rule selects the model with the largest marginal coverage gain per parameter, thereby accounting explicitly for model size.

      15Models chosen by k-center that match the routing accuracy of all 112
      ~150BParameter budget reaching near-full accuracy, against 1,930B for the pool
      8%Of the pool's total parameters
      0Additional routing evaluations required for selection — embedding geometry only
      Left: routing accuracy versus number of selected models for k-center, k-medoids and random. Right: routing accuracy versus parameter budget for coverage-greedy and random
      Left: routing accuracy as a function of portfolio size. Both coverage objectives outperform the random-selection baseline, and k-center saturates at $k \approx 15$. Right: under a total-parameter budget, coverage-greedy reaches near-full accuracy using a small fraction of the pool's 1,930B parameters. Selection uses only $\{z_m\}$; no routing evaluation of candidate subsets is required.

      Searching by a target capability profile

      Because the encoder maps any evaluation set to a vector, it can also embed hypothetical evaluation profiles. Given a desired per-task accuracy profile, we can synthesize an evaluation set with matching task-wise rates, map it through $F_\theta$, and retrieve the nearest embeddings from the library of real models. This enables model search by a target capability profile rather than by model name or aggregate benchmark rank.

      Recall at k for retrieving the intended model from a hypothetical embedding, rising with evaluation set size
      Recall@$k$ for recovering the intended model from a synthetic capability profile. With 8,192 synthetic queries, recall@10 reaches ≈97%. Correctness labels are randomized at the query level subject only to matching task-level rates, suggesting that the encoder captures task-level behaviour rather than memorizing specific query identities.

      Identifying near-duplicate models

      Deterministic embedding generation together with stability under resampling provides a natural fingerprinting signal. If two endpoints repeatedly map to nearly the same location across independently sampled evaluation sets, they may correspond to the same or closely related models. In the embeddings recomputed for this page, the nearest model pairs have cosine distances on the order of $10^{-5}$ or smaller and correspond to closely related model variants.

      Closest model pairs in the recomputed embedding space. Starling-LM-7B-alpha is finetuned from openchat-3.5, while the remaining pairs are merge-and-finetune derivatives from the same base families. Model lineage is not provided to the encoder; the observed proximity is inferred solely from queries and binary evaluation scores.
      Model pairCosine distance
      ConvexAI/Luminex-34B-v0.2  ·  fblgit/UNA-SimpleSmaug-34b-v1beta< 10−5
      rishiraj/CatPPT-base  ·  bardsai/jaskier-7b-dpo-v5.6< 10−5
      berkeley-nest/Starling-LM-7B-alpha  ·  openchat/openchat_3.52 × 10−5
      CultriX/NeuralTrix-bf16  ·  openchat/openchat_3.52 × 10−5

      Computational cost

      Empirical runtime measurements confirm the encoder’s linear scaling with evaluation-set size. Embedding the full 112-model pool from 4,096 evaluations per model takes approximately 100 ms on a single V100, while scoring 4,096 unseen queries against all 112 models takes approximately 20 ms. This overhead is two to three orders of magnitude below the seconds-scale latency of the corresponding language-model generations.

      Encoder wall clock time growing linearly with number of evaluation queries Decoder wall clock time for correctness prediction across query batch sizes
      Left: embedding generation time as a function of evaluation-set size for several model-pool sizes, exhibiting the linear scaling expected from the latent bottleneck. Right: correctness prediction time as a function of the number of unseen queries. In both cases, the additional routing computation is small relative to language-model generation latency.

      Summary

      LOCUS represents a language model as a single low-dimensional vector computed from scored query evaluations by a trained attention encoder. Generating embeddings through a deterministic forward pass, rather than fitting model-specific parameters, provides several useful properties: new models can be onboarded without retraining or modifying existing embeddings, representations can be refined as additional evaluations accumulate, and identical evaluation sets map to identical vectors, making distance-based analyses reproducible.

      Empirically, LOCUS is substantially more sample efficient than learned-parameter baselines (up to $4.8\times$ relative to EmbedLLM), requires roughly 128 evaluations to embed an unseen model, and produces a geometry that is strongly associated with behavioural similarity. Embedding proximity supports model fallback while retaining 85% of routing accuracy, hierarchical clustering recovers model families, and geometric coverage selects a 15-model portfolio that matches the routing accuracy of the full 112-model pool. Promising extensions include multimodal model representations and adaptive selection of which queries should be evaluated when onboarding a new model.

      Cite this work

      @inproceedings{
        patel2026locus,
        title     = {{LOCUS}: Low-Dimensional Model Embeddings for Efficient
                     Model Exploration, Comparison, and Selection},
        author    = {Shivam Patel and William Cocke and Gauri Joshi},
        booktitle = {ICML 2026 Workshop on Adaptive Foundation Models},
        year      = {2026},
        url       = {https://arxiv.org/abs/2601.21082}
      }
      

      ← All publications