AI Code Review

Following GPT-4’s introduction in March 2023, we began incorporating AI-powered review into our coding exercise interface from that Autumn. The reasoning behind this has been severalfold:

During the initial build of our guided editor we ran into a significant challenge: “How do we test that our learners are using the precise language syntax that the exercise requires?” For example, in an early JavaScript exercise we expect our learners to write comments and declare variables using the correct keywords (let and const). Pre-GPT, in phase one, our solution for this was necessarily complex: converting the code into an ‘abstract syntax tree’ (AST) then querying its structure.

Switching to GPT-4 has allowed us to lean on OpenAI’s inbuilt understanding of code, and build our exercises using natural language rather than querying the AST. It has also allowed us to think more creatively about how we guide the learner towards improving their submitted code. The current Code Review iteration uses a multi-step “chain of thought” prompt which reasons through the process of alternatively solving, comparing, and providing guided feedback on a learner’s exercise submission.

Walkthrough

1.png

2.png

5.png

6.png

7.png

Live Collaboration

Participants’ own exercise submissions are live and interactive on a unique URL, shareable through chat (WhatsApp, Slack, etc.) or wherever group discussion takes place.

Screen Recording 2025-01-06 at 10.46.47.mov

New features currently in progress (early 2025):