Algorithm Selection with Zero Domain Knowledge via Text Embeddings

Stefan SzeiderAutoML 2026 Methods Track OralPoster 2026

TL;DR

ZeroFolio is a "feature-free" algorithm selection framework that bypasses expensive, domain-specific feature engineering by treating raw problem instance files as plain text. By pairing off-the-shelf, pretrained text embeddings with a weighted $k$-nearest neighbors ($k$-NN) classifier, ZeroFolio outperforms traditional feature-based machine learning models across a wide variety of combinatorial domains while running in a fraction of the time.

What Problem Does This Paper Address?

In hard combinatorial optimization (like SAT, Mixed Integer Programming, or Constraint Programming), no single solver dominates every problem instance. "Algorithm selection" aims to automatically pick the best solver from a portfolio for a given instance.

For decades, the standard approach has relied on Rice's 1976 framework: extract hand-crafted, domain-specific features (e.g., clause-to-variable ratios for SAT) and train a machine learning model to predict runtimes. However, this introduces a massive bottleneck:

  1. Domain Lock-in: Features designed for SAT do not translate to Mixed Integer Programming (MIP).
  2. Computation Cost & Fragility: Feature extractors can be incredibly slow, sometimes taking minutes per instance, or crashing entirely on complex inputs (failing on over 20% of modern SAT competition instances).

The author tackles this by asking: Can we achieve competitive algorithm selection with zero domain knowledge and zero feature engineering?

Methods

The proposed method, ZeroFolio, introduces a simple three-step pipeline that treats problem instances entirely as text files:

The ZeroFolio pipeline: serialize, embed, select.
  1. Zero Domain Knowledge Serialization: The raw instance file is read as plain text. To handle the token limits of embedding models, the text must be truncated to a character budget (set to 10,000). To prevent truncation from discarding crucial structural data hidden later in the file, ZeroFolio uses line shuffling—randomly permuting the lines before truncation to get a representative sample of the instance.
  2. Embedding: The shuffled, truncated text is passed to a frozen, pretrained text embedding model (primarily Google's gemini-embedding-2) via a single API call to yield a fixed-dimensional vector. Crucially, the model undergoes no fine-tuning or domain adaptation.
  3. Algorithm Selection via $k$-NN: Instead of using complex tree-based models, ZeroFolio uses a non-parametric weighted $k$-nearest neighbors ($k$-NN) selector. It calculates distances using Manhattan distance and weights neighbors inversely to their distance, picking the algorithm with the lowest weighted PAR10 runtime score.

Datasets

The approach was evaluated using 11 scenarios from the Algorithm Selection Library (ASlib), spanning 7 distinct problem domains:

  • SAT (SAT12-ALL, SAT03-16_INDU)
  • MaxSAT (MAXSAT12-PMS, MAXSAT-PMS-2016, MAXSAT-WPMS-2016)
  • QBF (QBF-2016)
  • ASP (ASP-POTASSCO)
  • Graph problems (GRAPHS-2015)
  • MIP (MIP-2016)
  • CSP (CSP-MZN-2013, CSP-MZN-Time-2016)

The evaluation utilized standard 10-fold cross-validation splits provided by ASlib.

Key Insights and Ideas

  • Pretrained Models Capture Abstract Structure: Even though a CNF formula or a MiniZinc model looks nothing like natural language, web-scale pretraining exposes embedding models to source code, configuration files, and structured data. This allows them to capture underlying structural regularities (like token distributions and clause patterns) that correlate strongly with solver performance.
  • Surface Statistics Are Not Enough: Replacing embeddings with a classical TF-IDF character $n$-gram vectorizer severely degraded performance. The deep geometry of pretrained embedding spaces captures latent structural properties that simple frequency metrics miss.
  • Why $k$-NN Beats Random Forests on Embeddings: Tree ensembles (like Random Forests) perform poorly on dense, high-dimensional embeddings because they split on individual coordinates. Conversely, $k$-NN excels because it exploits the global geometry of the embedding space.

Key Results

  • Outperforming the Baseline: ZeroFolio outperformed a standard Random Forest (RF) trained on hand-crafted features in 9 out of 11 scenarios, often by a substantial margin.
  • Tuned Baselines: Even when the Random Forest baseline was heavily tuned per scenario, ZeroFolio still won 8 out of 11 scenarios.
Percentage of the SBS–VBS gap closed by ZeroFolio vs. Random Forest.
  • Closing the Gap: As shown in Figure 1, ZeroFolio consistently closed a larger fraction of the gap between the Single Best Solver (SBS) and the Virtual Best Solver (VBS) across most domains.
  • Speed and Reliability: While traditional feature extraction can take minutes and fail on hard instances, ZeroFolio’s entire pipeline takes roughly one second per instance, with zero failure modes outside of basic I/O errors.

Limitations and Future Work

  • Proprietary Model Dependency: The best results rely on commercial APIs (Gemini, OpenAI). Open-source models like Qwen3-Embedding-8B currently lag behind in performance.
  • API Costs & Reproducibility: Relying on commercial web APIs introduces minor financial costs and long-term reproducibility risks if models are deprecated.
  • Weakness in Mature Domains: On SAT12-ALL—a scenario with highly mature, expert-engineered features—the feature-based Random Forest still won. However, the author showed that a hybrid approach combining both features and embeddings via soft voting yielded the absolute best overall performance on this scenario.
  • Future Work: The author suggests leveraging these text embeddings for automated benchmark design, helping researchers select diverse subsets of instances that evenly cover the problem space.

Summary updated

BibTeX
@inproceedings{szeider2026algorithm,
  author = {Stefan Szeider},
  title = {{Algorithm Selection with Zero Domain Knowledge via Text Embeddings}},
  booktitle = {AutoML 2026 Methods Track OralPoster},
  year = {2026},
  url = {https://openreview.net/forum?id=JfC4JIEWz2},
}
Figure