Breaking the Myth: Can Small Models Infer Postconditions Too?
Gehao Zhang, Zhenting Wang, Juan Zhai

TL;DR
This paper demonstrates that a small, fine-tuned language model can generate high-quality postconditions for software, matching or surpassing larger models in accuracy and efficiency, thus challenging the necessity of large LLMs for this task.
Contribution
The authors show that a 7B-parameter fine-tuned model can effectively generate postconditions, reducing computational costs while maintaining high quality, unlike prior reliance on massive models.
Findings
Small models can match larger models in postcondition generation.
Fine-tuning on specialized datasets improves accuracy and semantic correctness.
Compact models outperform large models in bug detection capabilities.
Abstract
Formal specifications are essential for ensuring software correctness, yet manually writing them is tedious and error-prone. Large Language Models (LLMs) have shown promise in generating such specifications from natural language intents, but the giant model size and high computational demands raise a fundamental question: Do we really need large models for this task? In this paper, we show that a small, fine-tuned language model can achieve high-quality postcondition generation with much lower computational costs. We construct a specialized dataset of prompts, reasoning logs, and postconditions, then supervise the fine-tuning of a B-parameter code model. Our approach tackles real-world repository dependencies and preserves pre-state information, allowing for expressive and accurate specifications. We evaluate the model on a benchmark of real-world Java bugs (Defects4J) and compare…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
