Product Research Pricing About Careers Blog Alpha Talk to us ⬇ Download Alpha Build
Research Agent evaluation · 12 May 2026 · 13 min read

A concept tagger that does not lie: calibration across 41 repositories

The skill graph is only as honest as the classifier that populates it. We measured accuracy and calibration for four tagger designs across 41 repositories, and chose the one that is wrong more often because it knows when it is wrong.

ReportAWL-2026-03
Versionv1.2
AreaAgent evaluation

Updated 12 May 2026 · v1.2 adds the repository-level against span-level split comparison

Abstract

We evaluated four concept-tagging designs on 12,400 hand-labelled code spans from 41 repositories in seven languages. The highest-accuracy design reached 92.1% but was severely overconfident (expected calibration error 0.19). The design we ship reaches 88.4% accuracy with an ECE of 0.04, enabling a three-band decision policy that gates merges only above a high-confidence threshold and routes the middle band to a human. Under that policy the calibrated tagger produces 61% fewer incorrect graph updates than the more accurate alternative.

88.4%accuracy of the shipped tagger, against 92.1% for the most accurate design
0.04expected calibration error, against 0.19 for the accuracy-optimised model
61%reduction in incorrect skill-graph updates under the three-band policy

A skill graph that says an engineer understands a concept they do not understand is worse than no skill graph. It will schedule the wrong review, skip the check that would have caught the gap, and tell a manager something false with a number attached. Everything downstream depends on the tagger, so the tagger's failure modes are the product's failure modes.

This paper is about a trade we made deliberately and would make again: we shipped the less accurate classifier.

Corpus and labelling

We hand-labelled 12,400 code spans across 41 repositories, spanning Python, TypeScript, Go, Java, Rust, C++ and SQL. Labels came from a 214-concept taxonomy covering things an engineer can plausibly be said to understand or not: backpressure, transaction isolation, memory ownership, cache invalidation, and so on.

Spans
12,400 hand-labelled, 41 repositories
Languages
Python, TypeScript, Go, Java, Rust, C++, SQL
Taxonomy
214 concepts, three levels of granularity
Labellers
Six engineers, every span double-labelled
Agreement
Cohen's kappa 0.74 on first pass, 0.89 after adjudication
Split
60/20/20 by repository, never by span

Splitting by repository rather than by span is the detail that makes this evaluation worth reading. A span-level split lets the model see other functions from the same file and inflates every number reported. We measured a 6.2 point accuracy drop moving from span-level to repository-level splits on the same model, which is roughly the size of the difference between our four candidate designs.

Four designs

Figure 00.10.20.30.40255075100A: single callB: citedC: fine-tunedD: ensemble (shipped)accuracy (%)expected calibration error
Accuracy and expected calibration error by design, repository-level split

Design A is the most accurate at 92.1% and the least honest. Its expected calibration error is 0.19, and the shape of the error is the dangerous kind: when it is wrong it is usually confident. Design D reaches 88.4% with an ECE of 0.04. Its confidence scores mean something.

Why calibration beats accuracy here

Suppose tagger A is right 92% of the time and wrong with full confidence. Tagger D is right 88% of the time, but a score of 0.9 means it is right about nine times in ten and a score of 0.5 means it is guessing. Tagger D is far more useful, because a calibrated score is something the rest of the system can act on differentially.

Above 0.85
Act: gate the merge, update the skill graph
0.55 to 0.85
Surface: ask the engineer to confirm the concept, do not gate
Below 0.55
Discard: no graph update, no prompt, log for evaluation
Figure 02550751000.10.30.50.70.9Perfect calibrationDesign D (shipped)Design A
Reliability diagram: predicted confidence against observed accuracy

Under this three-band policy the calibrated tagger produces 61% fewer incorrect graph updates than the accuracy-optimised one, because most of its errors fall into bands where the system does not act on them. The accurate-but-overconfident model has no such escape hatch: its errors arrive dressed as certainties and go straight into the graph.

DesignAccuracyECEIncorrect graph updatesMedian latencyCost per 1k spans
A: single call, logprobs92.1%0.19412740 ms$0.41
B: cited chain of custody90.4%0.112681,180 ms$0.63
C: fine-tuned classifier84.2%0.0730122 ms$0.01
D: ensemble, agreement (shipped)88.4%0.041612,340 ms$1.28
Held-out repository split. Incorrect graph updates counted under the three-band policy on 12,400 spans.
The cost we accepted

Design D is three times slower and three times more expensive per span than Design A. Tagging runs asynchronously after merge, so latency is not on the engineer's critical path, and we would rather spend the money than put a confident falsehood into someone's skill profile.

Where it still fails

Errors concentrate in three places, and none of them are evenly distributed across your codebase, which means the tagger is more wrong about some engineers than others.

The adjacency errors are the ones we consider most serious, because they are invisible. A wrongly-tagged concept in the same neighbourhood as the right one still produces a plausible-looking skill graph and a review schedule that is subtly aimed at the wrong target.

Limits

The taxonomy, the labelling guide, per-language confusion matrices and the reliability diagrams are published. The labelled corpus itself is available to researchers under a data agreement, since it contains code from private repositories.

Our decision to prefer calibration over raw accuracy follows Guo and colleagues [1], who documented that modern neural networks are badly overconfident, and uses the reliability-diagram and ECE apparatus from Naeini and colleagues [2]. Brier [3] is the origin of the proper-scoring intuition underneath the whole argument. The repository-level split matters for the reasons Kapoor and Narayanan [4] set out in their survey of leakage in machine-learning-based science, and the specific hazard of span-level leakage in code models is documented by Allamanis [5]. The three-band decision policy is a selective-prediction design in the sense of Geifman and El-Yaniv [6]. Downstream consumers of the tagger are described in AWL-2026-02 [7].

Artefacts

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

InstrumentConcept taxonomy, 214 concepts, three levelsJSON, CC BY 4.0
InstrumentLabelling guide and adjudication protocolPDF, 11 pages
DataPer-language confusion matricesCSV plus notebooks
DataReliability diagrams, all four designsSVG plus source
CodeThree-band policy implementationPython, MIT
DataLabelled corpus, 12,400 spansOn request, data agreement

References

  1. Guo, C., Pleiss, G., Sun, Y., & Weinberger, K. Q. (2017). On Calibration of Modern Neural Networks. ICML.
  2. Naeini, M. P., Cooper, G. F., & Hauskrecht, M. (2015). Obtaining Well Calibrated Probabilities Using Bayesian Binning. AAAI.
  3. Brier, G. W. (1950). Verification of Forecasts Expressed in Terms of Probability. Monthly Weather Review, 78(1).
  4. Kapoor, S., & Narayanan, A. (2023). Leakage and the Reproducibility Crisis in Machine-Learning-Based Science. Patterns, 4(9).
  5. Allamanis, M. (2019). The Adverse Effects of Code Duplication in Machine Learning Models of Code. Onward!.
  6. Geifman, Y., & El-Yaniv, R. (2017). Selective Classification for Deep Neural Networks. NeurIPS.
  7. Bhardwaj, M. (2026). Spaced retrieval for code: FSRS against 18,000 review events. AI Work Lab Research, AWL-2026-02.
Cite this work

Bhardwaj, M. (2026). A concept tagger that does not lie: calibration across 41 repositories. AI Work Lab Research, AWL-2026-03.

Mohit Bhardwaj

Head of Research · aiworklab

Mohit runs the research programme at AI Work Lab: the longitudinal study of how agentic coding changes what engineers retain, the comprehension instruments the product gates on, and the evaluation harness the team uses to decide what ships. He writes up the measurements that changed our minds, including the ones that were inconvenient for the product.