<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dimitar Kretski</title>
    <description>The latest articles on DEV Community by Dimitar Kretski (@dimitar_kretski_329e6235e).</description>
    <link>https://dev.to/dimitar_kretski_329e6235e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3823553%2F32c06245-2067-4ca0-89d1-7955b62dfedf.webp</url>
      <title>DEV Community: Dimitar Kretski</title>
      <link>https://dev.to/dimitar_kretski_329e6235e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dimitar_kretski_329e6235e"/>
    <language>en</language>
    <item>
      <title>Can AI tell whether an optimum is unique? A small Kaggle benchmark with exact answers</title>
      <dc:creator>Dimitar Kretski</dc:creator>
      <pubDate>Sat, 10 Oct 2026 09:58:51 +0000</pubDate>
      <link>https://dev.to/dimitar_kretski_329e6235e/can-ai-tell-whether-an-optimum-is-unique-a-small-kaggle-benchmark-with-exact-answers-5e27</link>
      <guid>https://dev.to/dimitar_kretski_329e6235e/can-ai-tell-whether-an-optimum-is-unique-a-small-kaggle-benchmark-with-exact-answers-5e27</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/kaggle-2026-09-23"&gt;Kaggle Benchmarking Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Benchmarked
&lt;/h2&gt;

&lt;p&gt;When a solver or an AI model returns "the optimal solution", it rarely says whether it is the only one. That matters: if many equally good solutions exist, a small change in the data can silently move you to a very different "optimal" answer. I wanted to know whether language models notice this, so the benchmark asks one question: &lt;strong&gt;can a model tell whether an optimum is unique, and if it is not, how many optimal solutions there are?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;87 small optimization problems of five kinds: subset selection, QUBO, assignment, knapsack and a toy portfolio selection (16 to 20 binary variables; assignment 8x8 or 9x9).&lt;/li&gt;
&lt;li&gt;Each problem is small enough to enumerate exhaustively, so the ground truth is exact: the optimal value and the exact number of optimal solutions. The model is never told the count.&lt;/li&gt;
&lt;li&gt;Instances are balanced by number of optima: 1, 2, 3 to 5, 6 to 10, 11 to 50 and more than 50 (the toy portfolio family has no instance above 50).&lt;/li&gt;
&lt;li&gt;The model answers in free text and ends with one JSON line: solution, objective, unique, number of optima. The scorer recomputes the objective of the returned solution instead of trusting the model's number.&lt;/li&gt;
&lt;li&gt;Three things are scored: is the solution optimal, is the unique / not-unique claim right, and is the count exactly right.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Kaggle task &lt;code&gt;uniqueness_of_optimum&lt;/code&gt; uses a fixed board of 29 instances (one per problem type and count bin). An answer scores 1 only if all three checks pass, and the leaderboard value is the share of the 29 answers that score 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Models Tested
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;On the Kaggle leaderboard: Gemini 3.7 Flash and gpt-oss-120b, one run each on the 29-instance board.&lt;/li&gt;
&lt;li&gt;Outside the leaderboard, with the same generator and scorer: Gemini 3.7 Flash on all 87 instances with two prompts (plain, and one that asks the model to look explicitly for other solutions), and GPT-6.1-sol on the 10 instances that Flash found hardest.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I picked them by availability, budget and contrast: a fast general model, a small open-weight model, and a stronger model on the hardest cases. This is a small lineup, not a ranking of the field.&lt;/p&gt;

&lt;h2&gt;
  
  
  Findings
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Leaderboard.&lt;/strong&gt; Gemini 3.7 Flash scored 0.90 (26 of 29) and gpt-oss-120b scored 0.55 (16 of 29). With 29 instances and one run each the uncertainty is large (roughly plus or minus 0.06 and 0.09), but the gap is bigger than that noise (Fisher exact test, p = 0.007).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Counting is harder than noticing.&lt;/strong&gt; In the full run on 87 instances, Gemini 3.7 Flash got the exact number of optima right in 70% of answers with the plain prompt and 75% with the explicit prompt. Accuracy fell as the number of optima grew: with the plain prompt it was 100% when the optimum was unique and 42% with more than 50 optima.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When the count is wrong, it is usually too low.&lt;/strong&gt; 43 of the 48 wrong counts were below the truth. At the level of instances, 25 had a net undercount and 1 a net overcount. Examples: 15 instead of 72, 9 instead of 65, 298 instead of 2,411. The model reports something like a lower bound as if it were the exact number.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A stronger model did much better on the hard cases.&lt;/strong&gt; On the 10 instances where Flash failed (0 of 10 exact counts with the plain prompt, 1 of 10 with the explicit prompt), GPT-6.1-sol was exact on all 10, including 2,411 optimal permutations. I do not know whether it reasoned internally or used tools. The benchmark measures the answer, not the method.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asking the model to check explicitly did not clearly help.&lt;/strong&gt; The explicit prompt was better on 8 instances and worse on 4, which is within noise (exact McNemar test, p = 0.39).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Answers are not repeatable.&lt;/strong&gt; In a small repeat test (15 tasks, same prompts, two runs) the claimed count differed between runs in 8 of 30 cases. The same 29 leaderboard instances gave exact counts in 22 of 29 in my earlier Flash run, against 26 of 29 fully correct answers on the leaderboard, so run-to-run variation is substantial and I treat these as separate measurements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What surprised me.&lt;/strong&gt; I expected models to claim uniqueness too often. In the runs where I kept the full answers, calling a non-unique optimum unique was rare (0 cases in the two pilot runs, 1 of 10 on the hardest instances for Flash). The failure is quieter: a plausible lower bound presented as an exact count.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What I would measure next: several runs per instance with intervals, thinking versus non-thinking versions of the same model, tool access, a count metric that tolerates scale (for example within a factor of two), and real-world problem sizes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limits.&lt;/strong&gt; The benchmark is small and most models have one run. The raw logs of my first full Flash run were lost when the notebook session restarted, so I reconstructed its instance-level counts and errors from the deterministic generator and the printed error list, and I only report count-based results from it. The 10 "hard" instances were picked because Flash failed on them, so GPT-6.1-sol's 10 of 10 says nothing about instances that are hard for GPT-6.1-sol. Exact count is a strict metric when there are thousands of optima. The toy portfolio problem uses small integer data. Instances with more optima are also harder to count, so I do not claim that any single property of the problem causes the errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Benchmark
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Benchmark: &lt;a href="https://www.kaggle.com/benchmarks/dimitarkretski/uniqueness-of-optimum" rel="noopener noreferrer"&gt;https://www.kaggle.com/benchmarks/dimitarkretski/uniqueness-of-optimum&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Task: &lt;a href="https://www.kaggle.com/benchmarks/tasks/dimitarkretski/uniqueness-of-optimum" rel="noopener noreferrer"&gt;https://www.kaggle.com/benchmarks/tasks/dimitarkretski/uniqueness-of-optimum&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Dataset with instances and ground truth: &lt;a href="https://www.kaggle.com/datasets/dimitarkretski/uniqueness-bench-large" rel="noopener noreferrer"&gt;https://www.kaggle.com/datasets/dimitarkretski/uniqueness-bench-large&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Notebook with the generator and scoring code: &lt;a href="https://www.kaggle.com/code/dimitarkretski/new-benchmark-task-97935" rel="noopener noreferrer"&gt;https://www.kaggle.com/code/dimitarkretski/new-benchmark-task-97935&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The question came out of my work on near-optimal solution degeneracy in QUBO problems, but this benchmark does not use or validate that work. &lt;br&gt;
I used an AI assistant for code, analysis and drafting. The numbers come from the raw result files and from the Kaggle leaderboard.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>kagglechallenge</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Your Optimizer Found a Good Answer — Is It the Only One?</title>
      <dc:creator>Dimitar Kretski</dc:creator>
      <pubDate>Mon, 21 Sep 2026 04:51:28 +0000</pubDate>
      <link>https://dev.to/dimitar_kretski_329e6235e/your-optimizer-found-a-good-answer-is-it-the-only-one-5gfj</link>
      <guid>https://dev.to/dimitar_kretski_329e6235e/your-optimizer-found-a-good-answer-is-it-the-only-one-5gfj</guid>
      <description>&lt;p&gt;&lt;strong&gt;Update (10 Oct 2026): corrections to this post.&lt;/strong&gt; Some claims below were stronger than what I can support, so here is what I changed in my own understanding.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Portfolio example.&lt;/strong&gt; The figures (1,998 near-optimal portfolios, no asset above 44%) came from a run whose script I did not preserve, so I cannot verify them. I rebuilt the experiment on real daily prices (20 large caps, K = 5, exhaustive C(20,5)). It reproduces the direction (higher risk aversion gives a larger and more diverse near-optimal set) but not the numbers: at lambda = 8 I get 684 portfolios and a maximum single-asset share of 67%. These values depend on the assets, the period and the band used for "near-optimal".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MAX-CUT numbers.&lt;/strong&gt; The simulated-annealing search reaches 96 to 99% of the best-known cuts (not 97 to 99%). The Entry-to-x* overlap across seven MQLib instances ranged from 0.08 to 0.125 (I could not reproduce the lower value of 0.06). x* is the best solution of a heavy search, not a proven optimum.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Penalty check.&lt;/strong&gt; Only one part is rigorous: if the penalty exceeds the largest total coefficient magnitude touching a variable, every single-flip local minimum satisfies the one-hot constraints. The ~1.25x figure is empirical, from one small synthetic family, and depends on coupling density (about 2.1x with ~12 couplings per variable). The 0% deviation across scales shows scale invariance, not that 1.25 is a general constant.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Correlation check.&lt;/strong&gt; The 1/sqrt(1 - rho) scaling is derived for equicorrelated, equal-variance assets with continuous weights and a fixed absolute tolerance. In my synthetic sweep the fitted exponent was about -0.83 rather than -0.5 (one possible reason is the tolerance definition, untested), and R^2 = 0.94 measures the quality of the fit, not agreement with -0.5. It has not been validated on real portfolios.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Null baseline.&lt;/strong&gt; As Ahmet pointed out in the comments, for K-of-N selection the baseline must preserve the constraint: for N = 20, K = 5 the mean overlap of random K-subsets is about 0.25, versus about 0.18 for unconstrained random spins. The LOW / INTERMEDIATE / HIGH labels are being recalibrated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Demo and licence.&lt;/strong&gt; The numbers you type into the demo are processed on the Space server (no account or file upload needed). The auditor itself is not open source; the demo is CC BY-NC-ND. The concept note linked below is v1.1; the two pre-solve checks are in the newer version &lt;a href="https://doi.org/10.5281/zenodo.22738805" rel="noopener noreferrer"&gt;https://doi.org/10.5281/zenodo.22738805&lt;/a&gt;
A follow-up measurement in a different setting (whether language models can tell if an optimum is unique): &lt;a href="https://dev.to/dimitar_kretski_329e6235e/can-ai-tell-whether-an-optimum-is-unique-a-small-kaggle-benchmark-with-exact-answers-5e27Your"&gt;https://dev.to/dimitar_kretski_329e6235e/can-ai-tell-whether-an-optimum-is-unique-a-small-kaggle-benchmark-with-exact-answers-5e27Your&lt;/a&gt; Optimizer Found a Good Answer. Is It the Only One?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you've ever used simulated annealing, QAOA, or a D-Wave solver to tackle a QUBO or Ising problem — portfolio selection, routing, scheduling, resource allocation — you've probably checked one thing at the end: how good is the answer?&lt;/p&gt;

&lt;p&gt;Here's a question almost nobody checks: is that answer the only good one, or is it one of many equally-good configurations your solver happened to land on?&lt;/p&gt;

&lt;p&gt;This isn't a philosophical distinction. It has a concrete failure mode attached to it.&lt;/p&gt;

&lt;p&gt;The problem energy histograms can't see&lt;/p&gt;

&lt;p&gt;Say your solver returns a portfolio allocation with 98% of the best-known objective value. Great — but that number tells you nothing about whether nine other, structurally completely different allocations would have scored just as well.&lt;/p&gt;

&lt;p&gt;If they would have, your "optimal" answer is fragile. A small change tomorrow — an updated price, a shifted correlation, one different input — can flip the solver to a totally different "best" answer, and nobody will know why. It'll just look like the recommendation changed for no reason.&lt;/p&gt;

&lt;p&gt;Energy histograms — the standard tool everyone already uses — report the distribution of objective values. They say nothing about whether the near-optimal solutions are structurally similar or structurally unrelated. Two samples can have nearly identical energy and be almost orthogonal as bit configurations.&lt;/p&gt;

&lt;p&gt;A concrete example&lt;/p&gt;

&lt;p&gt;Take a cardinality-constrained portfolio problem: 20 assets, pick 5, exhaustively enumerate all C(20,5) = 15,504 combinations (small enough to brute-force, so the ground truth is exact, not estimated).&lt;/p&gt;

&lt;p&gt;At low risk-aversion (λ=0.5), the picture is what you'd hope for: one asset appears in 100% of near-optimal portfolios. The solver's answer is essentially unique.&lt;/p&gt;

&lt;p&gt;At higher risk-aversion (λ=8.0), the picture flips: 1,998 structurally distinct portfolios land within a tight band of the best objective value, and no single asset appears in more than 44% of them. Same problem class, same solver — completely different reliability profile, invisible if you only look at the objective value.&lt;/p&gt;

&lt;p&gt;Two numbers instead of one&lt;/p&gt;

&lt;p&gt;The diagnostic I've been building (AZURO Landscape Auditor) reports two solver-agnostic quantities instead of just objective quality:&lt;/p&gt;

&lt;p&gt;P(q) — pairwise overlap between independently-obtained near-optimal configurations. High overlap means the near-optimal region is a single sharp basin (reliable). Low overlap means it's fragmented across structurally different solutions (fragile), even when every one of them scores well.&lt;/p&gt;

&lt;p&gt;Entry→x* gap — compares how self-consistent the solver is (does it agree with itself across runs?) against how close it actually sits to the reference optimum. These two numbers can diverge dramatically: across Gset/MQLib benchmarks, solvers hit 97–99% of the best-known cut while Entry→x* overlap sits at just 0.06–0.13 — the near-optimal configurations are nearly orthogonal to the reference solution despite excellent energy proximity. A solver monitoring only self-consistency would call this reliable. It isn't.&lt;/p&gt;

&lt;p&gt;Catching it before you even solve&lt;/p&gt;

&lt;p&gt;The more useful version of this question is: can you flag the risk before spending compute on a solve? Two mechanisms turned out to have closed-form, pre-solve answers:&lt;/p&gt;

&lt;p&gt;Penalty calibration. For constraints encoded as QUBO penalty terms (one-hot, cardinality, etc.), there's a scale-invariant minimum penalty ratio: P* ≈ 1.25 × max coefficient magnitude in your objective. Validated across a 3× change in coefficient scale with 0% relative deviation — below this threshold, feasibility drops sharply; above it, it's reliable. Computable in milliseconds, no solve required.&lt;/p&gt;

&lt;p&gt;Correlated-input degeneracy. For a cluster of correlated inputs (assets, resources, whatever your variables represent), the near-optimal spread grows as ~1/√(1−ρ) as pairwise correlation ρ→1 — derived directly from the risk Hessian's curvature, confirmed numerically (R²=0.94) against the theoretical exponent. The more correlated your inputs, the more arbitrary the "optimal" split between them becomes.&lt;/p&gt;

&lt;p&gt;Worth saying plainly: a third candidate mechanism — whether topological/structural symmetry in the problem graph predicts degeneracy — was tested across three independent designs (degree-variance regression, degree-preserving edge rewiring, spectral analysis) and found not supported. It's reported anyway, because a diagnostic tool that only publishes the mechanisms that worked isn't one you should trust.&lt;/p&gt;

&lt;p&gt;Try it yourself&lt;/p&gt;

&lt;p&gt;Both pre-solve checks are live as a small interactive demo — no data upload needed, runs on numbers you enter directly:&lt;/p&gt;

&lt;p&gt;🔗 huggingface.co/spaces/Kretski/azuro-landscape-auditor&lt;/p&gt;

&lt;p&gt;Full methodology, validation data, and the closed-form derivations:&lt;/p&gt;

&lt;p&gt;📄 DOI 10.5281/zenodo.21941962&lt;/p&gt;

&lt;p&gt;Code for the demo app: github.com/Kretski/azuro-landscape-auditor&lt;/p&gt;

&lt;p&gt;Curious whether this shows up in problems you're solving — happy to compare notes if you run it against something of your ow&lt;/p&gt;

</description>
      <category>quantumcomputing</category>
      <category>productivity</category>
      <category>machinelearning</category>
      <category>optimization</category>
    </item>
    <item>
      <title>ScalePredict update: 291 views, 29 testers this week. Predict cloud runtime in 2 min link + feedback!".</title>
      <dc:creator>Dimitar Kretski</dc:creator>
      <pubDate>Sat, 14 Mar 2026 08:03:14 +0000</pubDate>
      <link>https://dev.to/dimitar_kretski_329e6235e/scalepredict-update-291-views-29-testers-this-week-predict-cloud-runtime-in-2-min-link--mk8</link>
      <guid>https://dev.to/dimitar_kretski_329e6235e/scalepredict-update-291-views-29-testers-this-week-predict-cloud-runtime-in-2-min-link--mk8</guid>
      <description>&lt;p&gt;Share your benchmark + real run &lt;a href="mailto:kretski1@gmail.com"&gt;kretski1@gmail.com&lt;/a&gt;,&lt;a href="https://github.com/Kretski/ScalePredict" rel="noopener noreferrer"&gt;https://github.com/Kretski/ScalePredict&lt;/a&gt; &lt;br&gt;
@vast_ai&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
