Anatomy of a bug-fixing agent

Every night, Serge, our CI agent, looks for real failures in Transformers, reproduces them on GPUs, investigates the cause, writes a patch, verifies it, and opens a PR for maintainers to review when everything checks out.

Over the last 80 days, 29 of those fixes have landed in Transformers.

This post explains how the system works, what happens before Serge is allowed to open a PR, and what we've learned so far.

Integration tests

In Transformers, integration tests run real model checkpoints end-to-end on real GPUs and verify their outputs.

They're expensive and slow, so running all of them on every commit would be wasteful. Instead, we run the relevant ones on model PRs and run a broader suite every night.