Building Robust Evaluation Systems for GitHub Copilot

github · Tech · 2023 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.5 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Evaluation infrastructure for AI coding assistants

GitHub needed evaluation systems that could guide Copilot from code-completion experiments into production releases and later chat/tool-use capabilities, where correctness ranged from executable code to subjective conversation quality.

Constraints:

Architecture

GitHub Copilot used a layered evaluation architecture. Harness lib built offline verifiable code-completion tests from open-source Python and JavaScript repositories whose tests passed, mapped functions to unit tests with coverage, removed candidate implementations, asked Copilot to regenerate them, and reran tests. Ship-room A/B experiments then ramped online changes around 10% traffic while watching completion acceptance, characters retained, latency, and many guardrails. Copilot Chat added Label Studio human comparisons and then GPT-4 LLM-as-judge prompts with granular criteria. Tool-use evaluations checked whether models selected the correct function/tool calls and used confusion matrices to expose routing overlap.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  open-source-repository-sampler[Open source repository sampler] --> training-cutoff-filter[Training cutoff filter]
  open-source-repository-sampler --> coverage-mapper[Coverage mapper]
  training-cutoff-filter --> candidate-function-set[Candidate function set]
  coverage-mapper --> candidate-function-set
  candidate-function-set --> harness-lib[Harness lib]
  harness-lib --> copilot-completion-model[Copilot completion model]
  harness-lib --> unit-test-runner[Unit test runner]
  unit-test-runner --> offline-scorecard[Offline scorecard]
  harness-lib --> offline-scorecard
  offline-scorecard --> ship-room-a-b-experiment[Ship room A/B experiment]
  copilot-completion-model --> ship-room-a-b-experiment[Ship room A/B experiment]
  ship-room-a-b-experiment --> production-metric-dashboard[Production metric dashboard]
  production-metric-dashboard --> data-science-investigation[Data science investigation]
  data-science-investigation --> ship-room-a-b-experiment
  copilot-chat-prototype[Copilot Chat prototype] --> label-studio-human-comparison[Label Studio human comparison]
  copilot-chat-prototype --> llm-judge-prompt[LLM judge prompt]
  label-studio-human-comparison --> llm-judge-prompt
  tool-call-validator[Tool call validator] --> confusion-matrix[Confusion matrix]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Open source repository sampler Collects Python and JavaScript repositories whose tests can run cleanly for offline completion evaluation. Coverage mapper, Training cutoff filter
Training cutoff filter Screens evaluation repositories against known training data to reduce contamination. Open source repository sampler, Candidate function set
Coverage mapper Associates functions with unit tests so generated code can be verified by execution. Open source repository sampler, Candidate function set
Candidate function set Filtered functions with tests, coverage, bounded size, docstrings, signatures, and surrounding context. Coverage mapper, Harness lib
Harness lib Offline verifiable code-completion harness that removes implementations, runs Copilot, and executes unit tests. Candidate function set, Copilot completion model, Unit test runner, Offline scorecard
Copilot completion model Code-completion model being tested with prompt, context, model, or tokenization changes. Harness lib, Ship room A/B experiment
Unit test runner Executes regenerated functions' unit tests to produce verifiable pass/fail signals. Harness lib, Offline scorecard
Offline scorecard Simple offline metrics list used to compare model or prompt variants before exposure to users. Harness lib, Ship room A/B experiment
Ship room A/B experiment Online rollout process that ramps production traffic and monitors key and guardrail metrics. Copilot completion model, Production metric dashboard, Data science investigation
Production metric dashboard Azure-backed reporting for acceptance rate, characters retained, latency, guardrails, and statistical decision support. Ship room A/B experiment, Data science investigation
Data science investigation Deep-dive analysis path for metric anomalies before launch decisions. Production metric dashboard, Ship room A/B experiment
Copilot Chat prototype Conversational coding product whose quality required conversation-level evaluation rather than only executable code checks. Label Studio human comparison, LLM judge prompt
Label Studio human comparison Human side-by-side evaluation flow for baseline versus Copilot Chat responses. Copilot Chat prototype, LLM judge prompt
LLM judge prompt Granular GPT-4 judging prompt that checks explicit requirements for subjective chat tasks. Copilot Chat prototype, Label Studio human comparison
Tool call validator Algorithmic evaluator for whether the model selected the expected tool call. Confusion matrix
Confusion matrix Diagnostic view showing which tools were called versus expected so overlapping tools could be separated. Tool call validator

Data flow

For offline completion evaluation, GitHub selected Python and JavaScript repositories, kept repos whose tests passed, used coverage tools to connect functions to unit tests, filtered candidate functions, removed the implementation body, let Copilot regenerate the body, and reran the unit tests to measure directional improvement. For online releases, promising variants entered A/B tests at around 10% traffic and were judged by acceptance rate, characters retained, latency, and guardrail metrics. For chat, human side-by-sides in Label Studio seeded a granular GPT-4 judge rubric. For tool use, expected versus actual tool calls fed confusion matrices to reveal overlapping tools.

7 supporting quotes
“you grab a large set of open source repos. Specifically, in our case, Python and JavaScript. Uh we had to narrow it down.”transcript, stated
“you run their tests and you keep the repos where all the tests pass. So it's kind of a funnel. Uh of those you use code coverage tools uh to associate the functions with your unit test. You had to make sure that you're actually testing something. And then of”transcript, stated
“use code coverage tools uh to associate the functions with your unit test. You had to make sure that you're actually testing something.”transcript, stated
“melon baller scoop out the the implementation of it um generate the contents again and run the unit test again.”transcript, stated
“we'll start them start our uh users on like 10% of the traffic and kind of wrap it up. Keep keep an eye on uh how the product is doing”transcript, stated
“and and judge which parts of it. Um, and then so I I set up a a basic version of that in label studio so I could just kind of test the flow and and I found it uh difficult just to to say which one was better. Um, and so I tried to make my life easier by passing it into GP4 and saying, "Okay, here's”transcript, stated
“given given that uh expected kind of trial input, you know what the output should be and you can you can uh besides just doing like uh you know checking for accuracy by seeing if this is an exact match for the tool call”transcript, stated

Why this architecture

The architecture deliberately used multiple evaluation modes because Copilot's product surfaces had different observability properties. Code completion could be verified by execution, production launches needed user-behavior metrics, chat required subjective conversation judgments, and tool use needed exact or diagnostic checks on function selection. The team also kept experimental notebook-style evaluation separate from repeatable regression and ship-room pipelines because model/product discovery and launch decisions had different reliability needs.

4 supporting quotes
“co-pilot was at this kind of interesting in between uh that I've come to call verifiable evaluations. There are things that it's like it's algorithmic in some respect, but it's not just so easy as looking at the output. Uh it's things like I'm generating”transcript, stated
“the code completion you can't immediately look at it but you can run it evaluate it somehow uh in a way that's more complicated than just the algorithm.”transcript, stated
“what we needed to evaluate wasn't just the code that was coming out of chat. What we needed to evaluate was the actual conversation”transcript, stated
“there's just more than more than one type of a val. There's these kind of unit testing, experimental things, and the more regression testing”transcript, stated

Models used: GitHub Copilot code-completion models · Copilot Chat models · GPT-4 as LLM judge

Scale

Alternatives considered (roads not taken)

Judge generated code only by inspecting the text

Rejected because: Copilot completions needed verifiable evaluation: generated code could not be immediately assessed by sight, but it could be compiled or tested.

“the code completion you can't immediately look at it but you can run it evaluate it somehow uh in a way that's more complicated than just the algorithm. And finally uh underlying everything is AB testing. Uh there's nothing particularly special about this”transcript, stated
“I want to make sure the code compiles. Uh I want to make sure that the code passes unit test. Maybe it's SQL and I want to make sure uh that this the I don't care what query it writes but it needs to have the right answers come back so it can have some”transcript, stated

Use the existing product as the only evaluation harness

Rejected because: New model capabilities and unlaunched product ideas required experimental harnesses that could prototype uses before the product existed.

“you can't just wrap the existing product in an evaluation harness and have that be the only way to test things.”transcript, stated
“you do need this more experimental system where you can kind of prototype out new ways of using the AI, new ways of using the product.”transcript, stated

Rely only on human side-by-side judgment for Copilot Chat

Rejected because: Human evaluation could capture subjective quality, but it was slow, expensive, and guideline-heavy.

“you just put it in front of a human and you ask them to, you know, to rate, you know, which one is better, which one is worse.”transcript, stated
“but obviously that's slow and it's uh expensive to you know hire people and and get a lot of those those kind of judgments.”transcript, stated

Ask a vague LLM judge which answer is better

Rejected because: Early GPT-4 judgments drifted to irrelevant criteria, so GitHub decomposed the rubric into explicit checklist items.

“sometimes it would get distracted and it would say, you know, this the code on this conversation is more maintainable because, you know, they put their braces on a new line”transcript, stated
“I started going in and actually just writing out in like bullet points what explicitly what I wanted it to evaluate.”transcript, stated

Optimize only for acceptance rate

Rejected because: Acceptance could be inflated by tiny or poor completions, so characters retained, latency, and guardrails had to be interpreted together.

“if you really optimize for acceptance rates, well, one silly thing that would happen is like you have a bunch of little tiny completions and so the experience was was garbage”transcript, stated
“characters retained. Uh a lot of times especially for users like me, I would like mindlessly accept everything uh and then edit.”transcript, stated

Patterns

eval-driven-development (quality)

Copilot development used offline harnesses, A/B tests, LLM judges, and algorithmic tool-use checks to decide whether model, prompt, context, or product changes were safe to ship.

“evaluations were really a core piece of of what made Copilot and um so let's dig into that.”transcript, stated
“underlying everything is AB testing. Uh there's nothing particularly special about this for for uh for a co-pilot, but it it was just an important part of our history.”transcript, stated

llm-as-judge (evaluation)

For Copilot Chat, GitHub turned vague human preference work into granular GPT-4 judging criteria that were quick for humans to verify.

“At the other end of the spectrum, we have LLM is judge. Uh, which is hugely important because so so much of the work that we're doing is subjective in nature”transcript, stated
“finally that got it to the point where where I could use this LM as judge and it would stick to my, you know, very granular list of things that I wanted it to evaluate on”transcript, stated

structured-output-contract (validation)

The evaluation taxonomy separated simple algorithmic checks such as JSON/schema adherence and response length from more complex verifiable or subjective evaluations.

“is does the response structure adhere to JSON and in particular the the schema that I'm looking at”transcript, stated
“is is the length of the response within limit or does you know maybe it goes it's it's too verbose or something”transcript, stated

tool-use-orchestration (architecture)

GitHub evaluated function-calling behavior by comparing expected and actual tool calls, then used confusion matrices to reveal when tools overlapped too much.

“it was important to double check that the function was making the correct pool calls or sorry that the the LLM was making the correct tool calls”transcript, stated
“Here's all the uh the tools that my model has access to, and we call we attempted to call, you know, them this number of times. Here's what actually got called instead.”transcript, stated

canary-rollout (release)

Copilot shipped changes through A/B experiments that began at a small traffic percentage and ramped while watching key and guardrail metrics.

“AB testing is what we did whenever it was time to ship our changes online.”transcript, stated
“we'll start them start our uh users on like 10% of the traffic and kind of wrap it up.”transcript, stated

Tradeoffs

Evaluate completions by execution

Chose Verifiable unit-test harness over Pure text inspection or simple equality checks.

Rationale: Code completion quality has degrees of freedom: generated code may differ textually while still compiling and passing tests.

“Maybe it's SQL and I want to make sure uh that this the I don't care what query it writes but it needs to have the right answers come back so it can have some degree of freedom with that.”transcript, stated
“you can't immediately look at it but you can run it evaluate it somehow uh in a way that's more complicated than just the algorithm.”transcript, stated

Use production A/B metrics after offline tests

Chose Ship-room traffic ramp with key and guardrail metrics over Relying on offline harness results alone.

Rationale: Offline tests reduced surprise but could not prove the change behaved appropriately for real users.

“the offline test that we had would would you know hopefully uh you know uh limit limit the exposure to you know shipping something that was surprisingly bad.”transcript, stated
“But once we finally did ship it, uh we had to make sure that uh the changes are appropriate”transcript, stated

Granular LLM judging for chat

Chose Detailed GPT-4 checklist criteria over Open-ended human or LLM preference prompts.

Rationale: Specific checklists made the judge reliable enough to review quickly and avoided irrelevant stylistic criteria.

“I started going in and actually just writing out in like bullet points what explicitly what I wanted it to evaluate. Like does it have a test for, you know, passing in null values?”transcript, stated
“it would stick to my, you know, very granular list of things that I wanted it to evaluate on uh, and give me good results”transcript, stated

Keep separate evaluation styles

Chose Flexible notebooks and modular harness blocks plus canned scripts/pipelines over A single rigid evaluation pipeline.

Rationale: Researchers needed to prototype new uses before a product existed, while shippers needed reliable repeatable numbers.

“You could just use the piece that you needed. Uh, but it's kind of nice because if if you make if you were to make something that fit in the same place that the old Lego LEGO block went”transcript, stated
“for the more regression testing like flow, I guess these things were pretty pretty canned. uh it was in a Python script and you you could just like run the thing.”transcript, stated

Shorten some completions

Chose Incremental suggestions users can tab through over One-shot long code completions.

Rationale: Users sometimes accepted long completions reluctantly and then deleted half; shorter completions better matched incremental coding behavior.

“users were getting frustrated when Copilot was trying to write too much code for them at at one time.”transcript, stated
“let the user kind of naturally tab their way through uh the the solution instead of trying to to oneshot it.”transcript, stated

Gotchas (what bit them)

Evaluation repositories can leak training data or misrepresent production traffic.

Root cause: GitHub had to choose repositories outside the model training set, which biased the harness toward newer and smaller codebases.

Resolution: Use training-data cutoff information where available and treat repository representativeness as a known limitation.

“we we could get a list of what went into the training and make sure that we had something that was sprained after that date.”transcript, stated
“code bases that weren't in the training data were newer code bases. And guess what? Newer code bases tend to be smaller”transcript, stated

Optimizing a single production metric can degrade the user experience.

Root cause: Acceptance rate alone can favor many tiny completions, while users may accept and then heavily edit poor suggestions.

Resolution: Use retained characters, latency, and guardrail metrics as diagnostic companions to acceptance rate.

“if sometimes you would maximize one of the metrics and uh and it would just tank another metric and you'd have to think really hard about why those two were were trading off.”transcript, stated
“if you really optimize for acceptance rates, well, one silly thing that would happen is like you have a bunch of little tiny completions”transcript, stated

A vague LLM judge may reward irrelevant features.

Root cause: Early model judges followed broad prompts poorly and latched onto stylistic details unrelated to the intended criterion.

Resolution: Micromanage the judge with explicit checklist criteria for the behavior being evaluated.

“it would get distracted and it would say, you know, this the code on this conversation is more maintainable because, you know, they put their braces on a new line”transcript, stated
“once we kind of made the the adjustment to like micromanaging the judge where we're saying like you know is there a test for this? Is there a test for that?”transcript, stated

One evaluation pipeline cannot serve both experimental design and shipping decisions equally well.

Root cause: Exploratory product/model work needs modular notebooks and prototypes, while release gates need repeatable scripted metrics.

Resolution: Support both experimental Lego-block workflows and canned regression/ship-room pipelines.

“it wasn't always clear that that should be all one eval pipeline.”transcript, stated
“There's these kind of unit testing, experimental things, and the more regression testing, you know, shift decision things.”transcript, stated

Tools that overlap semantically confuse the orchestrator model.

Root cause: When two tools cover similar operating space, expected and actual tool calls diverge.

Resolution: Use confusion matrices to identify overlapping tool definitions and make tools partition the space more clearly.

“if you got any tools that get called uh that get mis mistook a lot, you you can kind of step back and say, oh, you know, I need to figure out how to make these things more distinct”transcript, stated
“your tools ideally need to partition the space uh that they're they're operating in so that there isn't, you know, silly overlaps that will confuse the model.”transcript, stated

Evaluation

GitHub used a four-part evaluation stack: verifiable offline harness tests for code completion, A/B testing for online rollout, LLM-as-judge for subjective chat quality, and algorithmic tool-call validation for function-calling behavior.

Metrics: Offline unit-test pass rate for regenerated functions · Completion acceptance rate · Characters retained · Latency · High tens to low hundreds of guardrail metrics · Human/LLM side-by-side conversation preference · Tool-call exact match and confusion matrix behavior

5 supporting quotes
“It was like 40 or 50%. It wasn't even a huge number back then. Uh but we talk a little bit about um if I recall y'all selected these repos to be like you know you had a way of selecting or filtering ones are like higher quality and stuff like that.”transcript, stated
“complete completion acceptance rate. So um you know a user gets the ghost text on the screen. Do they accept it or not?”transcript, stated
“characters retained. Uh a lot of times especially for users like me, I would like mindlessly accept everything uh and then edit.”transcript, stated
“the last thing is kind of an obvious one is is latency. If we come come out with uh a recommended piece of code that is too late, then it's that's just bad”transcript, stated
“you'd say, "Here's all the uh the tools that my model has access to, and we call we attempted to call, you know, them this number of times. Here's what actually got called instead."”transcript, stated

Outcomes

Copilot's evaluation architecture evolved across offline completion tests, ship-room A/B experiments, chat-quality judging, and tool-use checks, with production rollout beginning around 10% traffic and monitored by a few key metrics plus high tens to low hundreds of guardrails.

4 supporting quotes
“we would ship out new new models, new uh prompt crafting techniques and then, you know, we would hope to see, you know, the key metrics going up.”transcript, stated
“the offline test that we had would would you know hopefully uh you know uh limit limit the exposure to you know shipping something that was surprisingly bad.”transcript, stated
“once we got to that point, yeah, we were pretty confident that it was giving us uh good results.”transcript, stated
“this is concerning enough that it's worth, you know, delaying the launch for a week while someone digs into the logs and actually figures out what's going on”transcript, stated