Giving AI Coding Agents Foresight - Counterfactual Reasoning for Software Changes
Project overview
AI coding agents are rapidly transforming software development. They can generate code, fix bugs, implement new features, and autonomously work on increasingly complex software projects.
Modern coding agents can already reason about programs, plan modifications, execute tests, and refine their solutions based on feedback. However, anticipating the consequences of software changes remains challenging, particularly in large systems involving complex interactions, hidden states, or concurrency.
What if an AI coding agent could systematically explore what would happen if it made different software changes, anticipate potential failures, and identify promising solutions before committing to them?
This PhD will investigate counterfactual reasoning for AI coding agents, combining ideas from artificial intelligence, software fuzzing, formal methods, and program analysis.
The central idea is to enable coding agents to reason about hypothetical software modifications and their possible consequences, helping them make better-informed decisions without necessarily having to implement and fully execute every alternative.
The ambition is to develop new foundations and techniques that could make autonomous coding agents more capable, reliable, and computationally efficient.
Research directions
The project will explore questions such as:
- Counterfactual program analysis: Can we develop efficient techniques that allow coding agents to explore how software would behave under alternative modifications?
- Intelligent fuzzing and exploration: Can fuzzing help agents discover unexpected behaviours, challenge hypothetical changes, and identify more promising implementation strategies?
- Formal reasoning: How can program semantics, symbolic analysis, and formal verification provide rigorous foundations for reasoning about hypothetical software behaviours?
- Learning from execution: Can agents progressively develop and refine their understanding of software systems by combining counterfactual reasoning with actual execution feedback?
- Efficiency and scalability: Can these techniques help coding agents solve harder programming tasks, improve their success rates, or achieve comparable results with significantly less computation?
A central research challenge will be to establish whether, when, and how counterfactual reasoning can provide meaningful advantages over the capabilities and tools already available to modern AI coding agents.
The research may involve developing novel algorithms, lightweight semantic models, intelligent exploration strategies, and prototype tools evaluated on realistic software engineering tasks.
One exciting possibility is the development of a Foresight Engine: a system combining counterfactual program analysis, intelligent fuzzing, and formal reasoning to help coding agents evaluate alternative software changes, anticipate potential failures, and make more informed decisions. Such technology could potentially be integrated into existing autonomous coding agents.
Flexibility and research opportunities
The proposed research directions are deliberately open to refinement. We are looking for a student who is excited by the broader research vision and interested in contributing original ideas.
Depending on the student's background and interests, the research may evolve towards theoretical foundations in program semantics and formal reasoning, novel fuzzing and program-analysis techniques, or practical AI-agent architectures and tools.
The precise research questions, methodology, and scope will be developed collaboratively. Creative approaches that challenge existing assumptions about how AI coding agents should reason, explore, and interact with software are particularly welcome.
Who are we looking for?
We are looking for a curious, creative, and motivated student with a strong background in Computer Science and an interest in one or more of the following areas:
- Artificial Intelligence, large language models, or autonomous agents
- Software testing, fuzzing, and program analysis
- Formal methods, automated reasoning, and program verification
- Programming languages and software engineering
Strong programming and problem-solving skills are important, together with an interest in tackling challenging research questions.
Previous experience in all these areas is not expected. We particularly welcome candidates who enjoy combining theoretical ideas with practical implementations and experimentation.
Why this project?
As AI coding agents become increasingly capable, improving how they reason about software could have a significant impact on the future of software engineering.
Rather than simply making agents generate code faster, this project investigates whether they can make better decisions by systematically exploring alternative possibilities and understanding their consequences.
The research offers opportunities for foundational contributions, publications, open-source tools, and potential applications in industrial AI coding systems.
The ultimate ambition is to give AI coding agents the ability to reason not only about what software currently does, but also about what it could do under changes they have yet to make.
Eligibility and expressions of interest
This opportunity is open to Home students only, as defined by UK Research and Innovation (UKRI/EPSRC) eligibility criteria. Applicants must meet the relevant nationality or immigration status and residency requirements for Home-student status.
Interested candidates are encouraged to contact Dr Vasileios Klimis at v.klimis@qmul.ac.uk for an informal discussion about the project, their research interests, and potential directions.
Application process
Applications will be considered on a rolling basis, with suitable candidates invited for discussions as expressions of interest are received. There is no fixed application deadline, and the position may be filled as soon as a suitable candidate is identified.
Early expressions of interest are therefore encouraged.
Application details
Supervisor: Dr Vasileios Klimis
Institution: Queen Mary University of London
Eligibility: Home students only (UKRI/EPSRC definition)