When the Next Step Is Not One Step: Distribution-Aware Execution Modeling for Concurrent Go Programs

· Source: cs.SE updates on arXiv.org · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Expert, long

Summary

This research introduces a novel approach for modeling concurrent Go programs by treating scheduler nondeterminism as a training signal. Instead of predicting a single next event, a 7B Qwen2.5-Coder model is fine-tuned using a KL objective to match an empirical distribution of next events observed across repeated program runs. This method achieved 36.2% accuracy on 798 held-out predictions from real production Go bugs (CockroachDB, Kubernetes, gRPC, etcd), outperforming Gemini 3.5 Flash zero-shot (34.8%) and the same model without fine-tuning (28.6%). While accuracy was comparable to cross-entropy training (35.8% vs. 36.2%), the KL objective reduced Expected Calibration Error from 0.205 to 0.169. The study also formally derived a goroutine-leak signature for select-blocked goroutines where P("GoUnblock")=0 due to scheduler semantics. The dataset, trained adapters, and tooling are publicly released.

Key takeaway

For AI Scientists and Machine Learning Engineers working on concurrent program analysis, recognize that traditional deterministic execution models fall short. You should consider using distribution-aware training with objectives like KL divergence to capture nondeterministic behavior, improving model calibration and accuracy on real-world concurrency bugs. Be aware that current single-step training limits multi-step prediction coherence. Explore enriching trace representations with synchronization state for future work.

Key insights

Nondeterminism in concurrent execution can be a training signal for next-event distribution prediction, improving model calibration.

Principles

Method

Fine-tune a 7B Qwen2.5-Coder model with a KL objective to match empirical next-event distributions from repeated concurrent Go program runs, using 4-bit QLoRA.

In practice

Topics

Code references

Best for: Research Scientist, AI Scientist, Machine Learning Engineer, Software Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by cs.SE updates on arXiv.org.