SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inference
Specifications are vital for ensuring program correctness, yet writing them manually remains challenging and time-intensive. Recent large language model (LLM)-based methods have shown successes in generating specifications such as postconditions, but existing single-pass prompting often yields inaccurate results. In this paper, we present SpecMind, a novel framework for postcondition generation that treats LLMs as interactive and exploratory reasoners rather than one-shot generators. SpecMind employs feedback-driven multi-turn prompting approaches, enabling the model to iteratively refine candidate postconditions by incorporating implicit and explicit correctness feedback, while autonomously deciding when to stop. This process fosters deeper code comprehension and improves alignment with true program behavior via exploratory attempts. Our empirical evaluation shows that SpecMind significantly outperforms state-of-the-art approaches in both accuracy and completeness of generated postconditions.
Code (0)
등록된 구현이 없습니다.
Similar Papers 제목 키워드 기반
Interactive inference: a multi-agent model of cooperative joint actions
We advance a novel computational model of multi-agent, cooperative joint actions that is grounded in the cognitive framework of active inference. The model assumes that to solve a joint task, such as pressing together a …
Towards Developmentally Plausible Rewards: Communicative Success as a Learning Signal for Interactive Language Models
We propose a method for training language models in an interactive setting inspired by child language acquisition. In our setting, a speaker attempts to communicate some information to a listener in a single-turn dialogu…
Language AcquisitionQuestion AnsweringOnce Upon a Time: Interactive Learning for Storytelling with Small Language Models
Children efficiently acquire language not just by listening, but by interacting with others in their social environment. Conversely, large language models are typically trained with next-word prediction on massive amount…
BabyLM Turns 3: Call for papers for the 2025 BabyLM workshop
BabyLM aims to dissolve the boundaries between cognitive modeling and language modeling. We call for both workshop papers and for researchers to join the 3rd BabyLM competition. As in previous years, we call for particip…
Language ModelingLanguage ModellingCogMem: A Cognitive Memory Architecture for Sustained Multi-Turn Reasoning in Large Language Models
Large language models (LLMs) excel at single-turn reasoning but often lose accuracy and coherence over extended, multi-turn interactions. Recent evaluations such as TurnBench highlight recurring failure modes-reasoning b…