Blog

How do you know when a deployed model starts getting it wrong?

Models for compiler optimization and bug detection work at launch, then quietly get worse. PROM uses a statistical test to flag the predictions it can’t trust, and relabeling under 5% of samples brings performance back.

We ran an experiment. A vulnerability-detection model trained on CVE data from 2012 to 2014 scored an F1 above 0.8 on test data from the same years. On code from the following years, its F1 fell below 0.3.

The model hadn’t changed. The code had: new ways of writing bugs, new concurrency patterns it had never seen. A double free from 2012 is written plainly. A double free from 2023 might be several threads calling the same free routine, and the old model doesn’t recognize it.

The same happens in compiler optimization. A model that predicts how to vectorize a loop, or which device a kernel should run on, can start giving bad advice once the programs or the hardware change. The trouble is that it doesn’t throw an error. It just quietly gives worse answers.

The hard part is not knowing

There is a lot you can do at training time: more data, better representations, ensembles. But nobody knows what a model will meet after it ships. What we wanted was something else: a way for a deployed model to say “I’m not sure about this one.”

How PROM works

PROM, our CGO 2025 paper, uses conformal prediction, a statistical test. At training time it holds out a small calibration set, by default 10% of the training data, capped at 1,000 samples.

After deployment, each new input is compared with similar samples in the calibration set to get two scores, credibility and confidence. If both fall below a threshold, the input has drifted outside what the model knows, and the prediction shouldn’t be trusted.

Flagged samples aren’t thrown away. They get relabeled, for example by actually running the code to measure performance, mixed back with the original training data, and used to update the model incrementally. None of this changes the model’s architecture, so it works with models already in use.

Results

96%of mispredictions caught on average, up to 100%

< 5%of samples need relabeling

< 10 msto score a prediction

We tried PROM on 13 existing models across five tasks: thread coarsening, loop vectorization, heterogeneous device mapping, vulnerability detection and code generation for deep-learning operators.

Thread coarsening is the clearest case. Relabeling a single flagged sample took the model from 77.6% of the oracle to 99.0%. Vulnerability detection shows it more starkly: after drift, accuracy was down to 13.5%; relabeling under 5% of samples brought it back to 72.5%, 95.3% of what it was at training time.

Against TESSERACT, a comparable method, PROM’s F1 is 17.6% higher. It is cheap too. On a low-end laptop, computing the two scores takes under 10 milliseconds and the drift check under 2.

Limitations

Binary classification is harder for conformal prediction, and PROM sometimes rejects predictions that were right; we saw this in device mapping. It relies on the model’s probabilities, so noisy probabilities hurt. And rejection has a cost, either a person looks or another search runs, so the threshold has to suit the setting.

The paper won a Distinguished Paper award at CGO 2025. For us it answers a very practical question: once a model is in a customer’s hands, how do you know when it needs updating?

Paper · CGO 2025 · Distinguished PaperEnhancing Deployment-Time Predictive Model Robustness for Code Analysis and Optimization

BLOG

More posts

Next step

AI that understands how code runs.

Contact