Product Research Pricing About Careers Blog Private beta Talk to us Get the private beta →
Research Skill measurement · 23 April 2024 · 21 min read

Reading the review state: a hidden Markov model of how engineers accept AI suggestions

Acceptance rate tells you how often an engineer said yes to a suggestion, not whether they read it. We built a three-state hidden Markov model over the telemetry every assistant already emits, and tested on simulated engineers whether it can tell engaged review from rubber-stamping, and what happens when engineers learn which number is being watched.

ReportAWL-2024-01
Versionv1.1
AreaSkill measurement

Updated 4 June 2024 · v1.1 names states by their outcome emissions rather than by speed, which changes the gaming result

Decoded review states across many sessions, rubber-stamping lit in amber Cover generated from this paper’s simulation
Abstract

Each AI suggestion an engineer sees yields an outcome (rejected, accepted unchanged, accepted then edited within a minute) and a dwell time. We model these as emissions of three latent review states, engaged review, skim and rubber-stamp, with a mixed categorical and log-normal emission, fitted by Baum-Welch to 319,437 simulated events from 300 engineers. BIC selects three states over two or four. The fitted dwell-time means (6.02, 2.20 and 0.90 seconds) recover the generating values to within 0.03 seconds, and Viterbi decoding assigns 90.8% of events to the correct state, with 93% precision and 95% recall for rubber-stamping against 89% and 84% for a 1.5-second dwell-time rule. Engineer-level rubber-stamp share correlates 0.98 with its true value. Under a simulated link to comprehension, it correlates −0.56 with the outcome, against −0.48 for acceptance rate. When engineers learn to pause before accepting, the dwell-time rule collapses to +0.07, and a model frozen before the change to +0.11, while acceptance rate, which waiting does not touch, holds at −0.50. Refitting the HMM and naming its states by what they do rather than how fast they are restores −0.53.

90.8%of suggestion events assigned to the correct latent review state
0.98correlation of the decoded rubber-stamp share with its true value per engineer
−0.53correlation with comprehension after gaming, HMM refitted with behaviour-named states; a dwell-time rule falls to +0.07

Every AI coding assistant emits the same telemetry: a suggestion was shown, it was accepted or not, and some time passed in between. Vendors summarise it as acceptance rate, and engineering managers have started to put acceptance rate on dashboards. We think it measures the wrong thing. A suggestion accepted after six seconds of reading and then adjusted is a different act from one accepted in under a second and never looked at again, and it is the second one we worry about.

Barke, James and Polikarpova observed that programmers working with completion tools move between an acceleration mode, where they know what they want and accept quickly, and an exploration mode, where they read and weigh suggestions. Mozannar and colleagues went further and labelled programmer activity in fine-grained states from screen recordings. Both point at the same structure: what matters is a latent state that the telemetry only partly reveals. That is the definition of a hidden Markov model. This paper builds one, tests it where the truth is known, and tries to break it.

What this paper is

A simulation study. Every engineer, session and event is generated by the script under Artefacts, including the link between review state and comprehension used in Result 3, which is an assumption of the simulation, not a finding. What the paper tests is whether the model can recover structure that is there, and how its summaries behave under pressure.

The model

Within a coding session, engineer i sees a sequence of suggestions t = 1, ..., T. Each produces an outcome ot in {reject, accept unchanged, accept then edit} and a dwell time dt from display to decision. A latent state zt in {E, S, R} (engaged, skim, rubber-stamp) follows a first-order Markov chain, and the observations are conditionally independent given the state:

Pr(zt = k | zt−1 = j) = Ajk,   p(ot, dt | zt = k) = θk,ot · LogNormal(dt; μk, σk2)(1)

The outcome distribution θk and the dwell distribution are what give the states their meaning. Nothing in the fitting tells the model which state is ‘engaged’; we name them afterwards from their fitted emissions. That turns out to matter in Result 4.

Fitting

Parameters are estimated by the Baum-Welch algorithm, the EM algorithm for hidden Markov models, with the forward and backward recursions computed in log space and vectorised across 7,200 sessions of 20 to 70 events. The E-step computes the posterior state probabilities γt(k) and pairwise transition posteriors ξt(j, k):

γt(k) = αt(k) βt(k) / L,   ξt(j,k) = αt−1(j) Ajk p(ot, dt | k) βt(k) / L(2)

and the M-step re-estimates A from expected transition counts, θ from γ-weighted outcome counts, and (μ, σ) from γ-weighted moments of log dwell. Each fit used three initialisations and kept the one with the highest likelihood. The number of states was chosen by the Bayesian information criterion, with K(K − 1) transition, K − 1 initial, 2K outcome and 2K dwell parameters.

Simulated engineers

Engineers
300, each with 24 sessions of 20 to 70 suggestions; 319,437 events
States
Engaged: dwell about 6 s, rejects 45%, edits 25% of the time. Skim: about 2.2 s, accepts unchanged 60%. Rubber-stamp: about 0.9 s, accepts unchanged 94%
Dynamics
Sticky transitions; an engineer-level propensity to drift into rubber-stamping; the rubber-stamp state becomes stickier after 40 suggestions in a session (fatigue), which the homogeneous model does not represent
Outcome link
Simulated comprehension score = 4.3 − 3.0 × true rubber-stamp share + noise (SD 0.35)
Gaming scenario
A second cohort in which engineers pause before accepting: rubber-stamp dwell rises to about 3.2 s, everything else unchanged

The fatigue effect is deliberate misspecification. Real behaviour will not be a homogeneous Markov chain, and a model that only works when it is exactly right is not worth deploying.

Result 1: the structure is recoverable

StatesBICDifference from best
21,177,529+40,981
31,136,5480
41,136,682+134
BIC for the best of three initialisations at each number of states. Lower is better.

BIC prefers three states, and by a wide margin over two. The fourth state buys a little likelihood, but not enough to pay for its parameters. The fitted emissions are close to the generating ones: dwell-time means of 6.02, 2.20 and 0.90 seconds against 6.0, 2.2 and 0.9, and the rubber-stamp state accepts unchanged 94.0% of the time against 94%.

Figure 20%30%40%50%60%1 to 1011 to 2021 to 3031 to 4041 to 5051 to 70True shareHMM posterior share
Decoded share of events in the rubber-stamp state by position in the session, against the truth. The homogeneous model tracks the fatigue drift it was not told about.

Viterbi decoding assigns 90.8% of events to the correct state. Engaged review and rubber-stamping are almost never confused with each other (0.2% and 0.1% of events); the errors are between skim and its neighbours, which is where the states genuinely overlap. Even though the model assumes a constant transition matrix, the posterior share of rubber-stamping rises across a session from 34% in the first ten suggestions to 51% after the fiftieth, against a true 33% and 52%. The posterior is driven by the emissions, so drift in the dynamics shows up in the decoding anyway.

Result 2: better than a stopwatch

The obvious alternative is a rule: call any acceptance with a dwell under 1.5 seconds a rubber stamp. It is not bad.

Rubber-stamp detectorPrecisionRecall
Dwell under 1.5 s and accepted88.6%84.5%
HMM, Viterbi path93.4%94.9%
Event-level precision and recall for the rubber-stamp state, all 319,437 events.

The HMM gains on both, mainly because it uses context: a quick acceptance in the middle of a run of careful reviews is probably a skim of something obvious, while the same quick acceptance in a run of quick acceptances is probably not. That is the transition matrix doing its work.

Result 3: which summary tracks understanding

The reason to decode review states is to say something about engineers. We computed four engineer-level summaries and correlated each with the simulated comprehension outcome.

Figure -0.6-0.5-0.4-0.3-0.2-0.100.10.2Acceptance rate, before-0.48Acceptance rate, after-0.5Dwell rule, before-0.55Dwell rule, after0.07HMM, before-0.56HMM frozen, after0.11HMM refitted, after-0.53
Correlation of four engineer-level telemetry summaries with simulated comprehension, before and after engineers learn to pause before accepting (HMM refitted to the new data).

Before gaming, the three summaries built from dwell time all correlate about as well with the outcome (−0.55 to −0.56, or +0.55 for mean dwell), and acceptance rate somewhat worse (−0.48). The HMM’s advantage over the heuristic at the event level mostly averages out at the engineer level, which is an honest result and a useful one: if nobody is gaming the measure, a stopwatch is nearly as good.

Result 4: when engineers learn what is being watched

Any summary that becomes a target will be optimised. The cheapest way to look engaged on a dwell-time measure is to wait three seconds before pressing tab. We simulated exactly that: rubber-stamp dwell moves from about 0.9 to about 3.2 seconds, and nothing else about the behaviour changes.

The dwell-time rule collapses: its correlation with comprehension goes from −0.55 to +0.07, because rubber-stamp acceptances now take longer than 1.5 seconds. An HMM fitted before the change and left frozen fails the same way (+0.11), because it learned that rubber-stamping is fast. Mean dwell time weakens from +0.55 to +0.35. Acceptance rate is untouched at −0.50, since waiting does not change what is accepted, so for the moment the crudest metric on the dashboard is the best one.

Refitting the HMM on the new telemetry finds three states again. The rubber-stamp state now has a mean dwell of 3.2 seconds, but it still accepts unchanged 94% of the time and edits 3% of the time, so it is recognisable by its behaviour. Named that way, its engineer-level share correlates −0.53 with comprehension, almost all of the pre-gaming −0.56. The first version of this analysis named states by speed, labelled the skim state as rubber-stamping after the refit, and reported a correlation of +0.28; version 1.1 corrects that. The correction is the lesson: a behavioural model survives gaming only if its states are defined by what people do, not by the signal they can most easily change.

Design consequence

A dwell-time or acceptance-based score should not be shown to managers. The defensible use of a review-state model is narrower: deciding when to ask an engineer to explain a change, a use that does not reward gaming it, with the model refitted on a schedule rather than frozen.

Method

Emission
Categorical over three outcomes times log-normal dwell, per state
Estimation
Baum-Welch in log space, vectorised over sessions; three random starts; relative tolerance 1e-6
Selection
BIC over K = 2, 3, 4
Decoding
Viterbi path for event-level metrics; posterior state probabilities for engineer-level shares
State naming
Rubber-stamp is the state most likely to accept unchanged; states are not named by speed
Heuristic
Accepted with dwell under 1.5 seconds

Limitations

The simulated engineers have exactly three review states, so finding three is reassurance about the fitting, not evidence about people; real behaviour may need more states, or a continuum. The link to comprehension is assumed, and the whole point of the cohort study we are planning is to measure it rather than assume it. Telemetry differs by tool, and some tools do not expose dwell or post-acceptance edits at all. Finally, the gaming scenario is one specific adaptation; engineers who learn to edit trivially after accepting would attack the outcome channel instead, and we have not simulated that.

Simulation only. No engineer or customer telemetry was used. Script, seed and results file are under Artefacts.

Hidden Markov models and the Baum-Welch algorithm are Baum and colleagues [1]; Rabiner [2] is the standard tutorial and Zucchini, MacDonald and Langrock [3] the reference for applied work. Model selection uses Schwarz [4] and decoding Viterbi [5]. The states we model follow the acceleration and exploration modes described by Barke, James and Polikarpova [6] and the activity taxonomy of Mozannar and colleagues [7]; Vaithilingam, Zhang and Glassman [8] document the gap between expectation and experience that makes quick acceptance worrying. Acceptance rate as a productivity signal is Ziegler and colleagues [9]. The gaming result is Goodhart’s law in the form Strathern [10] gave it, and automation complacency is Parasuraman and Riley [11] and Bainbridge [12].

Artefacts

Everything below is published or available on request. A number nobody can reproduce is an advertisement, not a result.

Codeawl_2024_01_hmm.pySession generator, vectorised Baum-Welch, Viterbi, BIC, gaming scenario · Python, MIT
Dataawl_2024_01.jsonResults file, every number quoted in this paper

References

  1. Baum, L. E., Petrie, T., Soules, G., & Weiss, N. (1970). A Maximization Technique Occurring in the Statistical Analysis of Probabilistic Functions of Markov Chains. Annals of Mathematical Statistics, 41(1).
  2. Rabiner, L. R. (1989). A Tutorial on Hidden Markov Models and Selected Applications in Speech Recognition. Proceedings of the IEEE, 77(2).
  3. Zucchini, W., MacDonald, I. L., & Langrock, R. (2016). Hidden Markov Models for Time Series (2nd ed.). CRC Press.
  4. Schwarz, G. (1978). Estimating the Dimension of a Model. Annals of Statistics, 6(2).
  5. Viterbi, A. J. (1967). Error Bounds for Convolutional Codes and an Asymptotically Optimum Decoding Algorithm. IEEE Transactions on Information Theory, 13(2).
  6. Barke, S., James, M. B., & Polikarpova, N. (2023). Grounded Copilot: How Programmers Interact with Code-Generating Models. OOPSLA.
  7. Mozannar, H., Bansal, G., Fourney, A., & Horvitz, E. (2022). Reading Between the Lines: Modeling User Behavior and Costs in AI-Assisted Programming. arXiv:2210.14306.
  8. Vaithilingam, P., Zhang, T., & Glassman, E. L. (2022). Expectation vs. Experience: Evaluating the Usability of Code Generation Tools Powered by Large Language Models. CHI Extended Abstracts.
  9. Ziegler, A., Kalliamvakou, E., Li, X. A., et al. (2022). Productivity Assessment of Neural Code Completion. MAPS at PLDI.
  10. Strathern, M. (1997). ‘Improving Ratings’: Audit in the British University System. European Review, 5(3).
  11. Parasuraman, R., & Riley, V. (1997). Humans and Automation: Use, Misuse, Disuse, Abuse. Human Factors, 39(2).
  12. Bainbridge, L. (1983). Ironies of Automation. Automatica, 19(6).
Cite this work

Bhardwaj, M. (2024). Reading the review state: a hidden Markov model of how engineers accept AI suggestions. AI Work Lab Research, AWL-2024-01.

Mohit Bhardwaj

Head of Research · aiworklab

Mohit led AI Work Lab’s research programme from January 2023 to March 2025: the comprehension item bank, the statistics of code-model leaderboards, review-state telemetry, variance in agent evaluations, and the design of the twelve-month cohort study that the Measurement team went on to run.