Research

Can people explain the AI code they accept?

In an AI-assisted coding interview the AI writes much of the code, and the interviewer still asks you about it. Nyrion works the same way. When a stage's tests pass, the interviewer asks a follow-up question about the code the person just submitted, and a model grades the answer.

We looked at 398 answers to these questions from 103 people, each about code that had just passed its tests. Where the person had accepted the AI's code on that stage, 6 in 10 answers were correct. Where they had taken none, 8 in 10 were. Our research on AI coding interviews has this as finding 7.

What we found

After taking the AI's code60%After writing it themselves80%
Share of answers to the interviewer's follow-up question that were correct: 226 answers after taking the AI's code on that stage, 172 after writing it themselves.

Most of the answers that fell short were partly correct, such as saying where the bug was but not why.

What we checked

The gap holds for the same people. 22 people answered questions on both kinds of stage, and 53% of their answers were correct where they had accepted AI code, against 82% where they had not.

It holds on the same questions too. People took the AI's code more often on stages with harder questions, which explains part of the gap. On the 20 questions answered on both kinds of stage, 67% of answers were correct after accepted AI code and 81% without.

Most answers without AI code come from rounds where the assistant only answers questions and never writes code. In rounds where it could write code and the person wrote it themselves, 83% of 41 answers were correct, so the round format is not the reason.

We can't tell why the gap exists. People may ask for the AI's help on the parts they understand least, and they would explain those parts worse whoever wrote the code. And these are practice sessions, not real interviews.

What it means

This is no reason to avoid the AI and write everything yourself. When the AI had proposed code before the first submit, 88% of stage attempts passed that submit, against 56% without, and an AI round expects you to use it. The thing to work on is knowing each change you accept well enough to answer the interviewer's question about it.

In a practice round, right after you accept a change, say in a sentence or two what it does and why it is right, before you run the tests. If you can't, ask the assistant what the change does, or reject it and write that part yourself. Taking longer before you click Accept did not help: across 36 people, 63% of answers were correct on their faster stages and 60% on their slower ones.

For what the interviewer looks for in an AI round, read how to guide the AI in a coding interview. To try it, pick a problem from the catalog.

How we measured

The numbers come from the Nyrion production database, read only, for the period in which the questions and the grading have had their current form. Our own accounts and test accounts are excluded, and every number is over at least 20 people or answers.

A stage counts as one with AI code when the person had accepted at least one AI code proposal on it before the question came. The problem's author wrote down the answer to each question. An answer is correct when it says the same thing in any words, and partly correct when it gets part of it. To check the grader, a person on our team graded a random 60 answers without seeing the model's grade, and agreed with it on all 58 they could grade.

Faster and slower stages are split at each person's own median time from the proposal to the accept. The first submit figures cover the rounds where the assistant can write code, 2,194 stage attempts.

How to cite: Nyrion, "Can people explain the AI code they accept?", nyrion.ai/research/explaining-ai-code.