AI Engineer World's Fair 2026
From Tokenmaxxing to Trusted Throughput — Mingsheng Hong, Ironclad
Read the talk
From Tokenmaxxing to Trusted Throughput
Mingsheng Hong explains how Ironclad connects AI coding costs to software that survives automated checks, human judgment, and customer use—and why faster generation moves the real bottleneck into review and CI.
From a talk by Mingsheng Hong
At a glance
Ideas worth remembering
Use token dashboards to investigate adoption gaps and unusual bursts, with comparisons grounded in each team’s work. Do not reward consumption.
Measure delivered value alongside cost. Ironclad’s complexity-weighted merged PRs are an evolving proxy, not a complete measure of customer value.
Trusted throughput combines objective checks, human engineering judgment, and evidence from customer use. A merge is only an intermediate delivery measure.
Expect abundant generation to move constraints into review and CI. Measure readiness-to-submission time and retries, remove flaky tests, and resist giant batched PRs.
Bound agent retry loops, arrange prompts for cacheable prefixes, prune growing context, and turn recurring lessons into shared practices.
Buy common infrastructure and build company-specific working knowledge, while evaluating ambiguous agent investments in light of their downstream review and CI costs.
Token usage is a smoke detector, not a leaderboard
Mingsheng Hong, VP of engineering focused on AI at Ironclad, opens with a management failure hiding inside an ordinary dashboard. In a reported story from Amazon, an employee created a voluntary view of AI token usage. Some engineers then competed to reach the top. Hong is explicit that he does not know whether leadership encouraged the competition; the consequential point is that publishing a number can create an incentive even without attaching a formal reward to it.
Ironclad also tracks token usage and cost by team and individual, but treats the dashboard as a “smoke detector.” Surprisingly low usage can expose a pocket where access, training, or confidence is missing. A sudden burst can justify investigating what changed. Neither observation establishes employee performance, and rewarding the largest number would turn consumption—the input cost—into the goal.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Cost controls come after the adoption hump
This advice has a boundary: it primarily applies after a team has made AI tools readily available and established real usage. A company still provisioning access or persuading engineers to experiment may undermine adoption by introducing aggressive cost controls too early. Ironclad had only crossed that threshold over the preceding couple of quarters, and roughly half the audience identified with the next phase: adoption exists, so spending has become a serious concern.
Adoption itself cannot be solved entirely by executive instruction. Some engineers told Hong that the pride of handcrafting code had been replaced by reviewing “AI slop code.” That objection describes a real change in the work, not mere resistance to a tool. Leaders need to sit with affected teams, understand where the friction comes from, and preserve demanding technical work through which engineers can continue developing judgment and skill.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Trust grows by testing familiar ground first
Ironclad builds AI products for legal contracting, where lawyers, procurement teams, and other business users need to move contracts faster without losing control of risk. A lawyer may first run conversational search over contracts they already know. Familiar material provides a reference point: if the answers match expectations, the lawyer can cautiously expand to unfamiliar contracts or higher-stakes workflows such as redlining and anomaly detection.
AI-assisted engineering follows the same progression. Generated work has to earn confidence from engineers and leadership before it reaches customers, then survive contact with actual customer use. Hong calls the result trusted throughput: code reviewed and validated internally, then ultimately validated in customer deployments. The objective is therefore better return on token spending, not austerity for its own sake.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Measure value before trying to minimize cost
Cost measurement starts with the available usage data. A team centered on one coding tool may get enough detail from its vendor dashboard. Ironclad uses several tools, so it built extraction pipelines and dashboards that combine vendor data, then aggregate and break down spending by team and individual. This makes cross-tool usage visible instead of leaving each vendor’s portion isolated.
Moving directly from that dashboard to cost cutting evaluates only one side of the return. Ironclad pairs cost with a proxy for delivered value, then looks for whatever prevents generated work from becoming shipped work. As code generation becomes abundant, those constraints increasingly appear downstream in code review, continuous integration, and merging.
Dashboard comparisons also require local context. A platform infrastructure team may use AI differently from a UI team and derive value through different work. Regular review should answer two practical questions. Adoption gaps: Where is usage unexpectedly low, and does that reveal a problem worth helping with? Anomalies: Where did spending suddenly jump, and was the burst legitimate? The resulting lessons can update shared practices without stack-ranking employees.
Lines of code provide the useful analogy. LOC can describe activity, but maximizing it would punish an engineer who deletes unnecessary code and leaves the system simpler. Token usage has the same shape: worth observing, terrible as a direct performance target.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
From generated volume to complexity-weighted merges
Hong uses lines of code as an analogy for a metric that counts output without saying whether it forms a useful change. He then describes Ironclad’s measurement evolution from open to merged pull requests. Open pull requests grouped work into proposals and showed a pronounced increase, but proposals can remain experimental or never ship. Merged pull requests moved the metric closer to delivery because the code had at least passed through the path to the codebase.
The next failure appears in a concrete comparison. A 10-line change might represent a concurrency bug that took substantial investigation to find and fix. A thousand-line change might be boilerplate that was easy to generate but expensive to review. Counting each as one merge treats visibly different work as equivalent; counting lines makes the boilerplate look more valuable. Ironclad therefore asks one or two LLMs, using a crafted prompt, to assign each merged PR a T-shirt-sized complexity score and uses that score as a weight.
This is an evolving proxy, not a settled definition of value. The talk supplies neither a reproducible scoring rubric nor numerical weights, and complexity does not necessarily equal customer value. The complexity weighting is intended to distinguish a concurrency fix from boilerplate; the talk does not report evaluated discrimination results, but the remaining gap is why trusted throughput needs qualitative evidence beyond the score.
What evidence makes throughput trusted? The comparison below separates three forms of validation that catch different failures. Automated checks test predefined properties, people judge qualities that resist simple rules, and customer experience reveals whether internally acceptable work holds up in production.
Test coverage, predefined security checks, and canary rollout practices test known requirements.
Objective checks and human judgment validate work internally. Production and customer signals provide the external test. These are evidence categories, not a claim that every check runs in one strict sequence.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Abundant generation moves the bottleneck into review and CI
Once AI makes PR creation easier, review and merging become the scarce stages. A tempting workaround is to stop splitting changes. If the regression suite takes an hour, an engineer may reason that 10 small PRs imply 10 hours of waiting and submit one large PR instead. The apparent CI saving creates a review problem: larger diffs demand more human attention, spread that attention thin, and make careful review less likely.
Ironclad uses AI as the first review pass rather than the final authority. Automated review can flag simpler issues such as style problems or missing test coverage before a human sees the change. Human reviewers can then spend their limited attention on code quality, architectural fit, and security design. The engineering team keeps final accountability.
CI creates a second queue. More numerous, smaller PRs increase test demand, while flaky tests force engineers to babysit runs and press retry. Assigning an agent to babysit merely exchanges human waiting for token spending. Both are workarounds around the same unstable pipeline, and the repetitive delay also damages morale.
The useful measurement is end-to-end waiting, not just the nominal duration of one CI run. Ironclad tracks wall-clock time from a PR being ready to submit until it is submitted, plus the number of retries required to pass. If one CI run normally takes an hour but a typical PR takes two or three hours to get through, the unexplained gap is the red flag. That observation directs platform and developer-experience investment toward flaky-test removal and CI capacity.
Where does the extra AI-generated work accumulate? The flow below shows review and CI as parallel downstream constraints rather than a universal ordering. Increasing generation loads both systems; slow CI can then encourage batching, which sends larger, harder diffs back into review.
Engineers can create and split changes into more pull requests.
Increasing generation without expanding review and CI capacity produces queues rather than trusted throughput. The exact ordering of review and CI varies by workflow; both must clear before delivery.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Bound waste, improve the loop, and build only local advantage
The operating framework combines three mechanisms. Guardrails set budgets and quotas, track usage, and define anomalies that trigger attention. Working practices improve how engineers use AI. Learning loops bring leaders and engineers together to review patterns, refine limits, and feed useful discoveries into institutional knowledge. Automated alerts identify known conditions; human review still catches patterns the predefined rules miss.
A test-and-repair agent loop makes the need for guardrails concrete. The agent generates a PR, runs tests, modifies the code or tests after a failure, and retries. A hard limit on loop steps makes the process finite. Hong does not prescribe a universal retry count; the design requirement is to stop a broken workflow from consuming tokens indefinitely.
Two prompt and context practices reduce repeated work. Stable prefixes: when a vendor supports prompt caching, fixed material should come first and varying material afterward—for example, a stable system prompt above the changing user prompt. Context pruning: as a session grows, engineers should summarize or compact accumulated history rather than repeatedly carrying everything forward. Coding tools may automate compaction. Hong presents these practices as improving token efficiency and output quality, without quantifying either effect.
The build-versus-buy rule is deliberately plain: buy common, non-differentiating infrastructure such as IDE and CI capabilities; build the knowledge specific to how the company works. Ironclad’s example is an internal playbook of carefully written prompts for distinct tasks such as small bug fixes, new UI features, and refactoring. Sharing those prompts lets teams reuse and improve their working methods.
The boundary remains ambiguous for systems that mix commodity infrastructure with local workflow. Ironclad was exploring a cloud-based “builder agent” wrapping coding tools while also considering external vendors. Hong leaves that decision unresolved rather than claiming every company should build its own agent.
The closing lesson is to plan for second-order effects. More code generation changes review load, CI demand, pull-request shape, and developer experience. Teams should make build-versus-buy decisions early, invest in downstream capacity before queues force bad workarounds, and keep instrumenting the path from ready PR to customer outcome. Maximizing token ROI means expanding the organization’s ability to validate and deliver software alongside its ability to generate it.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
The official talk page provides the recording, chapter navigation, timestamped transcript, and concise section summaries for revisiting individual mechanisms.
Related talks
- Leadership in AI-Assisted Engineering
Extends the organizational argument with evidence-based measurement, psychological safety, and attention to bottlenecks across the full software lifecycle.
- ReviewDebt: a practical framework for scoring every pull request — Sachin Gupta, eBay
Develops the downstream review problem into a deterministic framework for estimating the human burden created by each pull request.
- How to Quantify AI ROI in Software Engineering (Stanford Study / 120k Devs)
Provides a complementary outcome-oriented approach to AI coding ROI and similarly warns against treating raw token consumption as productivity.
Read the complete timestamped transcript
- 0:01
[music]
- 0:12
All right, let's get started. Apologies
- 0:15
for the delay, but I'm really excited to
- 0:17
be here. I'm Mingshan, VP of engineering
- 0:20
focused on AI at Ironclad. And today
- 0:24
I'll be telling you about something
- 0:25
that's probably on top of many of your
- 0:28
mind. uh how to control and optimize for
- 0:32
your AI token spend. Can I get a get a
- 0:35
quick show of hands that this is a
- 0:37
relevant topic?
- 0:40
Okay, awesome. I appreciate that.
- 0:45
So, we have all heard a few sensational
- 0:48
stories from the media. There's an
- 0:51
interesting Amazon story where an
- 0:53
employee just created kind of a
- 0:55
voluntary dashboard and everyone start
- 0:58
tracking their own AI token usage. I'm
- 1:01
not sure there's explicit encouragement
- 1:03
from the leadership, but the effect is
- 1:05
you know engineers some of the engineers
- 1:07
started competing with each other in
- 1:09
maximizing their token usage and get to
- 1:12
the top of the so-called leaderboard.
- 1:14
There's a similar story from Meta and
- 1:17
then another even more sensational story
- 1:19
about some companies spending $500
- 1:21
million on cloud oops within a month. So
- 1:26
while these may not be happening in your
- 1:28
companies today, the threats, the risks
- 1:31
are real. How do we think about the
- 1:34
policies? How do we measure the cost?
- 1:36
And how do we control and optimize for
- 1:38
it?
- 1:40
So one initial learning I want to share
- 1:42
is it is really important to have
- 1:45
dashboard that track every team every
- 1:48
individual's token usage and cost but
- 1:51
that should not be positioned as a
- 1:53
leaderboard. We think of the the usage
- 1:57
dashboard more as a smoke detector. If
- 2:00
there are local pockets of teams or
- 2:02
individuals that don't use much AI token
- 2:05
that might be a signal worth
- 2:06
investigating. But beyond that certainly
- 2:09
we don't want to create even indirect
- 2:12
incentive to maximize the token usage
- 2:15
itself.
- 2:18
So how do we think about it then? First
- 2:21
I want to make sure that we position
- 2:23
this talk for those of you whose teams
- 2:26
have already gone through the hump of
- 2:29
getting AI adopted. If you're still in
- 2:32
the initial process of provisioning easy
- 2:36
access to your engineers or encouraging
- 2:39
the teams and individuals to adopt, then
- 2:42
you may not be ready to implement some
- 2:45
of the ideas for controlling and
- 2:47
optimizing for cost. But that's okay.
- 2:50
This could still be a good discussion.
- 2:51
And frankly, we just got over that hump
- 2:54
over the last couple quarters. So this
- 2:56
is a very topical subject that every
- 2:59
engineering leader I believe is
- 3:01
navigating. So I would love to start
- 3:02
that dialogue with you all today to
- 3:04
explore the best practices. Can I get a
- 3:07
quick show of hand for those of you
- 3:09
whose teams have gone over the initial
- 3:11
adoption phase now you are starting to
- 3:14
seriously worry about the cost. Okay, I
- 3:17
see roughly half of the hands raised.
- 3:18
Thank you. So let's talk about then how
- 3:22
we can control and how we can optimize
- 3:25
what we call the trusted throughput as a
- 3:27
kind of a proxy metric as a way to
- 3:30
measure your ROI. But before that, just
- 3:33
for those of you who are in the process
- 3:35
of still increasing adoption, one lesson
- 3:38
we learned is to after the kind of the
- 3:41
top down leadership push is to sit down
- 3:43
with the individual teams and uh the
- 3:47
individuals who may be resistant or
- 3:49
struggling with adoption, understand
- 3:51
where they came from. For example, there
- 3:53
are some legitimate concerns that I
- 3:55
heard, you know, people say, "Hey, I
- 3:57
used to really take pride and joy in
- 3:59
handcrafting the code and now a lot of
- 4:01
the joy and the pride got taken away and
- 4:05
replaced with me reviewing AI slop code,
- 4:08
right? So that doesn't sound like a very
- 4:10
satisfying professional activity and
- 4:12
that's where we need to kind of dig down
- 4:14
and understand what are still the kind
- 4:16
of the high impact and uh engineering
- 4:19
tasks technical work that we can help
- 4:21
our engineers continue to grow
- 4:23
themselves in the era of the AI.
- 4:28
So I wanted to share with you a bit more
- 4:31
about what we at ironclad does and
- 4:33
there's an interesting connection
- 4:35
actually within how we think about
- 4:36
optimizing for engineering AI token
- 4:39
usage. So, ironclad is a legal
- 4:42
contracting AI companies AI company. We
- 4:45
build AI features and native AI products
- 4:49
to help lawyers, procurement and other
- 4:52
business users move forward new
- 4:54
contracts, move them forward faster with
- 4:57
controlled risk. What that means is
- 5:00
building trust is the number one
- 5:02
priority with our AI product features
- 5:05
and products. And for the prior speak uh
- 5:07
speaker speaker, she did a wonderful job
- 5:09
telling you about the importance of
- 5:11
trust and how to build it in their
- 5:13
domain. In our ironclad product domain,
- 5:16
it often means lawyers especially, but
- 5:19
other persona as well taking the time to
- 5:21
kind of test the water and see if they
- 5:23
can trust the AI output. For example,
- 5:26
they may feed our conversational search
- 5:28
a set of contracts they are firmly
- 5:30
familiar with and they run a search and
- 5:33
see if the output is towards the
- 5:35
expectation. If so, they may expand on
- 5:38
searching for things they don't know
- 5:39
about or apply other workflows using AI
- 5:42
to solve other things like redlinining
- 5:44
the contract um and you know finding
- 5:47
anomalies and so on. And so similarly
- 5:51
using AI and making sure AI is
- 5:54
delivering high engineering value also
- 5:56
involves a you know a sequence of steps
- 5:59
in gaining trust from the internal
- 6:01
engineers the leadership as well with as
- 6:04
uh with our customers. So this is the
- 6:06
focus of our talk today
- 6:11
and this probably will not come as a
- 6:13
surprise here. The goal is not to
- 6:17
minimizing or not even necessarily to
- 6:19
reduce token spend. So here we kind of
- 6:22
use the word it's not about austerity.
- 6:24
It's about further improving the ROI of
- 6:26
the token spend.
- 6:29
So how do we do that? Here we propose um
- 6:32
a concept we call trusted throughput. So
- 6:36
the trusted throughput comes from having
- 6:39
the code reviewed and validated
- 6:42
internally and ultimately validated in
- 6:45
customer uh in customer deployments.
- 6:50
So how do we go and how do we think
- 6:54
about controlling the cost and uh
- 6:57
measuring and in turn optimizing the
- 7:00
ROI? The first step is I'm pretty
- 7:03
confident that all of you your teams who
- 7:05
have been adopting AI have been
- 7:06
measuring the cost. If you're using a
- 7:09
single tool like claw code or codeex
- 7:12
then you tend to get very rich analytics
- 7:14
from the vendor's dashboard already. If
- 7:16
you're like us who use a combination of
- 7:18
these different coding tools then we
- 7:21
basically use AI to build simple
- 7:23
dashboards and pipelines to extract such
- 7:26
vendor data. So we can kind of
- 7:28
crossorrelate them. Then we can break it
- 7:30
down, aggregate and then break down by
- 7:32
per team, per individual, what is their
- 7:35
cost usage across all of these uh tools.
- 7:39
So that's the first step for measuring
- 7:40
cost. Now one pitfall I have seen and we
- 7:44
wanted to caution everybody is to then
- 7:47
jump from measuring cost to start
- 7:50
reducing or minimizing the cost, right?
- 7:52
Cutting cost. We think that is
- 7:54
premature. Instead, the other important
- 7:56
side of the equation for ROI is to
- 7:58
measure value. How much value are we
- 8:01
getting from burning the tokens? Once we
- 8:04
can measure the cost and value side, we
- 8:06
understand ROI and then to improve ROI,
- 8:09
we want to find and then fix the
- 8:11
bottlenecks. In the next couple slides,
- 8:14
I'm going to introduce two new
- 8:15
bottlenecks we identify in this whole
- 8:17
new software development life cycle
- 8:19
where code generation now becomes
- 8:21
abundant thanks to AI. But the pressure
- 8:24
is now getting pushed down to code
- 8:26
review and continuous integration CICD
- 8:29
the merging the code. So we'll talk
- 8:31
about that and finally we'll put
- 8:33
together these ideas into a pra
- 8:35
pragmatic framework of how we think
- 8:37
about optimizing the ROI and thus the
- 8:39
leverage in using AI.
- 8:45
Okay. So this is kind of just a slide in
- 8:48
building or using the vendor dashboard
- 8:50
to measure the cost. And again we want
- 8:52
to caution that here the main goal for
- 8:55
regularly reviewing the dashboard is to
- 8:58
see a if there's still adoption gap
- 9:00
within individual pockets of teams or
- 9:02
the individual engineers and b if there
- 9:05
are any sudden surprises in kind of the
- 9:08
usage burst and if so understand what's
- 9:10
been happening if they're legitimate and
- 9:12
then also compare teams
- 9:15
contextually. So this is important. We
- 9:17
don't control just the AI usage per se
- 9:20
because for example a platform
- 9:21
infrastructure team the way they use AI
- 9:24
and the way they get value may be
- 9:25
different from the UI team. So we need
- 9:27
to take the context into consideration.
- 9:30
All of such review analysis is to help
- 9:32
us extract learnings. So there's a
- 9:34
self-learning loop that we can then feed
- 9:36
back into institutional best practices.
- 9:39
What we don't want to use the dashboards
- 9:42
are to kind of stack rank people, right?
- 9:44
making it a a leaderboard and somehow
- 9:47
reward maximization.
- 9:49
There's an interesting analogy I want to
- 9:50
draw with uh a traditional edge
- 9:53
productivity metric called lines of
- 9:55
code. So I believe all of you will be
- 9:58
tracking that metric but it wouldn't be
- 10:00
wise to use that metric as the key goal
- 10:02
to measure engine velocity because if we
- 10:05
want productive and high quality engine
- 10:08
work one can argue that removing code is
- 10:11
even better. So, LOC line of code is an
- 10:14
important metric but not something we
- 10:16
want to directly optimize for. Same
- 10:18
thing for the token usage and spend.
- 10:22
So, that that gets us to the notion of
- 10:25
trusted throughput. How do we think
- 10:27
about that? How do we define that?
- 10:29
First, I want to kind of share the
- 10:31
quantified uh side of the things. What
- 10:33
are the metrics that kind of we have
- 10:34
been involving in defining and tracking.
- 10:37
So we talked about line of code is
- 10:39
clearly not a good way to measure if AI
- 10:42
is you know generating a lot of value.
- 10:44
So the next evolution can be let's count
- 10:47
the number of open PRs pull requests.
- 10:50
The intuition being engineers are using
- 10:53
AI to generate a lot more code. So let's
- 10:55
measure the open PR. So clearly we see a
- 10:59
big kind of inflection in the open PR
- 11:02
count. But eventually as we as I assume
- 11:05
everyone would agree over the time even
- 11:07
though people may do oneoff you know R&D
- 11:10
work to try out things without lending
- 11:12
them but eventually we're all measured
- 11:14
by the code we ship. So therefore we
- 11:17
evolved from tracking the open PR count
- 11:20
to tracking the merge PR count. So
- 11:22
that's an improvement.
- 11:25
But the next question is not every
- 11:27
merged PR is equal. There can be a PO
- 11:30
with only 10 lines of code that takes
- 11:32
forever that finds and fix a concurrency
- 11:34
bug or there can be a thousand line kind
- 11:37
of boilerplate code that just takes a
- 11:39
lot of time to then kind of generate and
- 11:41
review but otherwise it's not necessary
- 11:43
adding as much business value.
- 11:46
So as such we then started kind of
- 11:48
tagging each merged PR with some sort of
- 11:51
complexity score. There's no traditional
- 11:54
definition of what that means. We looked
- 11:56
at the literature a bit. So we just took
- 11:58
a pragmatic approach of giving AI a
- 12:00
well-crafted prompt and then we feed the
- 12:03
PR into basically one or two M and say
- 12:06
score the complexity based on t-shirt
- 12:08
size. So I the idea being if you use AI
- 12:11
to generate a more complex PR we
- 12:13
consider that as being more valuable
- 12:15
basically that's how we kind of add a
- 12:17
weightage to each merged PR but that's
- 12:20
not the end of the journey that's still
- 12:21
something we're going to evolve keep
- 12:23
evolving and I would love to discuss
- 12:25
with everyone on kind of how we end up
- 12:27
creating defining a set of metrics that
- 12:30
kind of approximate the value AI is
- 12:32
generating.
- 12:34
Now let's look at the qualitative view.
- 12:36
What we think about the way we would
- 12:38
define trusted throughput is a high
- 12:41
quality output that's interested by both
- 12:43
internal engineering and leadership and
- 12:46
external customers. We think they come
- 12:48
from three buckets.
- 12:50
The first bucket is all of the objective
- 12:53
metrics that we run with checking the
- 12:55
test coverage whether uh all of the
- 12:58
predefined security checks are passing.
- 13:00
Do we go through the regular canarying
- 13:03
practice as we roll out features safely
- 13:04
and so on. In addition, we complement
- 13:08
the subjective objective metrics with
- 13:11
our subjective human judgment. So that's
- 13:13
where the code review, the design review
- 13:16
come in to look at the code quality,
- 13:18
clarity, maintenance, architecture fit
- 13:20
and so on. And then finally we want to
- 13:23
make sure through all of these internal
- 13:25
objective and subjective check when the
- 13:27
rubber meets the road how customer
- 13:30
perceive the changes are there
- 13:32
production fire that lead to ro
- 13:34
rollbacks do customers complain have
- 13:37
tickets that talk about usability uh
- 13:39
friction uh bugs and so on. So these are
- 13:42
the three buckets that together form
- 13:44
what we think is trusted throughput from
- 13:46
engineering.
- 13:52
Okay. So now let's talk about from a
- 13:54
software deploy deployment life cycle
- 13:56
perspective where we observe the new
- 13:59
bottlenecks are as I mentioned earlier
- 14:02
AI code generation is making PR creation
- 14:06
abundant. So now the the bottleneck from
- 14:10
kind of the whole life cycle perspective
- 14:12
gets shifted onto re review and they're
- 14:15
subsequently merging the PR. Does that
- 14:17
resonate?
- 14:20
I see some heads nodding. So this is
- 14:23
where we spend time on figuring out how
- 14:25
we can further improve the review
- 14:27
process as well as the continuous
- 14:29
integration the CI process. So we will
- 14:32
dive into these two topics in the next
- 14:34
couple slides here. I just want to say a
- 14:37
potential anti-attern anti-solution is
- 14:40
that hey if the CI infrastructure gets
- 14:43
overloaded then a workar around by
- 14:45
engineers to stop splitting PR just
- 14:48
start submitting large PR for review and
- 14:50
submission because if it takes an hour
- 14:53
to run all of your regression test and
- 14:55
submit it I don't want to break my PR
- 14:57
into 10 right which might take 10 hours
- 14:59
however this in our view can be pretty
- 15:02
risky because it makes the human review
- 15:06
overhead higher it also reduce the
- 15:09
quality of the review because the human
- 15:10
attention can be spread thin so that is
- 15:12
an anti-attern I wanted to caution
- 15:17
so for code review the key principle we
- 15:21
use is to make sure we onboard AI
- 15:23
tooling as the first level of defense
- 15:26
they don't replace human reviewers but
- 15:28
we want to offload human reviewers as
- 15:30
much as possible let the AI review take
- 15:32
care of simpler things like coding style
- 15:35
issues or if there's a missing test
- 15:38
coverage. So, make sure the author gets
- 15:41
through all of them before then the
- 15:43
review gets routed to a human reviewer.
- 15:46
And this way our human engineers can
- 15:48
focus on applying their deep judgment on
- 15:51
aspects that are somewhat subjective
- 15:53
like if the code is good, if the
- 15:55
architecture is sound, if the code uh uh
- 15:59
passes kind of the security uh the
- 16:02
security design and so on. so that in
- 16:04
the end our engineering team can take
- 16:07
the final accountability.
- 16:11
Now let's look at CI. So I assume all of
- 16:14
you deploy some form of CI uh CI/CD and
- 16:18
what we're seeing is thanks to AI now
- 16:21
making it much easier to generate code
- 16:24
as splitting code into smaller but more
- 16:27
PRs it puts a lot more pressure on the
- 16:30
CI and this is something that uh if we
- 16:33
don't address uh at a company level
- 16:36
individual engineers can be struggling
- 16:38
because that means they have to waste
- 16:39
their human time babysitting the PR to
- 16:42
get merged. If they run into flaky test
- 16:45
then they have to manually they hit
- 16:47
rerun it's very frustrating or they can
- 16:49
recruit an AI agent to babysit and kind
- 16:52
of do a loop but that in turn waste AI
- 16:54
token as well. So these are not these
- 16:56
are just workarounds not perfect
- 16:58
solution and also tend to make engineers
- 17:01
feel a little bit lower morale a little
- 17:03
bit more frustrated. So what we what we
- 17:06
are doing is kind of we put more uh
- 17:09
developer experience uh platform kind of
- 17:12
engineering to invest into reducing
- 17:15
removing the flaky test improving the CI
- 17:18
infrastructure and the key thing here is
- 17:21
to also define and measure the right
- 17:24
metrics for example uh the work clock
- 17:27
time between when a peer is ready to
- 17:29
submit till when it's submitted right if
- 17:32
a typical CR uh run takes an hour. Does
- 17:36
the typical PR submission take two or
- 17:37
three hours? In which case, that's a red
- 17:39
flag and also the number of times a PR
- 17:42
needs to get retrieded for passing
- 17:44
through the test. So, these are the key
- 17:46
metrics that we are using to measure our
- 17:48
developer experiences and the relevant
- 17:50
team who is focused on improving uh
- 17:53
these uh the developer experience.
- 17:58
So with all of the analysis and ideas
- 18:00
here we uh want to share kind of the a
- 18:04
pragmatic framework of how we can then
- 18:07
measure and optimize token usage. It has
- 18:10
three aspects. The first one is set the
- 18:13
right set of guards across setting the
- 18:15
budget and quota tracking usage defining
- 18:19
anomalies so that no users uh leaders
- 18:22
can get notified if something feels
- 18:24
wrong. This is complementaryary to still
- 18:27
regular human review which can catch
- 18:29
other interesting patterns or learnings
- 18:31
and feedback into the institutional
- 18:33
knowledge base.
- 18:35
Let me just couple that with the third
- 18:37
item here which is the learning loop we
- 18:40
talk about as our leadership work with
- 18:43
individuals to define these guard rails
- 18:45
review the metrics and then refine
- 18:47
that's how we kind of close the learning
- 18:49
loop. In addition to that, we want to
- 18:52
work with our teams, individual
- 18:54
engineers to continue to search for and
- 18:56
if needed innovate on the best practices
- 18:59
of how to use AI, how to use AI to build
- 19:02
products and also use it internally. For
- 19:05
example,
- 19:07
some engineers may be writing an agentic
- 19:09
loop as part of the harness when they
- 19:11
use cloud code. after they generated
- 19:14
initial PR they go and loop around and
- 19:16
say try and pass the set of tests and
- 19:19
then if some tests don't pass just auto
- 19:22
fix the test or the code and retry. One
- 19:25
thing to watch out for is to put a limit
- 19:27
on the number of loop steps to make sure
- 19:30
if things go out of control we don't
- 19:32
waste too many tokens on that. Another
- 19:35
example is prompt caching. This is
- 19:38
becoming increasingly more prevalent by
- 19:39
the commercial uh model vendors where
- 19:44
what they advise is if you send a prompt
- 19:48
with the same prefix they could optimize
- 19:51
how they process the prefix of the
- 19:53
prompt. What that means then as a user
- 19:56
to those is that we want to encourage
- 19:58
our users to structure their prompt that
- 20:01
way. For example, if your prompt
- 20:03
consists of a system prompt followed by
- 20:05
a user prompt, you want to put the
- 20:06
system prompt that's fixed at the top
- 20:09
and the varying content at the bottom.
- 20:12
Context pruning is also important. We
- 20:14
want to kind of drill it into each
- 20:15
individual users kind of new kind of
- 20:18
muscle memory. So they are aware that as
- 20:20
they build out the context through a
- 20:22
longer chat session, they would be
- 20:24
mindful of summarizing the context and
- 20:26
make sure that the token usage is
- 20:28
efficient that way. There are
- 20:29
increasingly more tools like claw code
- 20:31
that will automatically manage and
- 20:33
compact the context for you. And so this
- 20:35
increases the token usage efficiency but
- 20:38
also increase the quality of AI output.
- 20:40
There are other ideas we're exploring as
- 20:42
well.
- 20:48
So I know we're at time so this is
- 20:50
towards the end of the talk. There is
- 20:52
sometimes we also face build versus by
- 20:54
decision. The principle is simple for
- 20:57
things that are non- differentiating
- 20:59
like IDE CI infrastructure we want to
- 21:02
buy. But then for things that are
- 21:04
specific to our context like how we
- 21:06
would generate high quality PR for small
- 21:09
bug fixes versus building a new UI
- 21:11
feature for refactoring and so on. We
- 21:13
have our internal playbook which is a
- 21:15
set of well-crafted AI prompts. So we
- 21:18
save that and share across our team. So
- 21:21
that gets reused and enhanced. So that's
- 21:23
something we must build internally. When
- 21:25
it comes to case to case though,
- 21:27
sometimes it's still a bit ambiguous
- 21:28
like we're trying to build what we call
- 21:30
builder agent. That's like a cloud-based
- 21:32
code generation that wrap the cloud
- 21:34
codec and so on. While we know there are
- 21:37
also other vendors out there that we're
- 21:39
still exploring. So we love to exchange
- 21:40
thoughts on that.
- 21:43
So then to summarize here are a couple
- 21:45
key lessons as we went through the last
- 21:47
couple quarters of journey. I wanted to
- 21:49
share so that hopefully you could kind
- 21:50
of accelerate your process there. If I
- 21:53
were to summarize these three things I
- 21:54
would it's about learning planning ahead
- 21:57
and learn from other people's stories
- 21:59
mistakes. So what that means is think
- 22:01
about build respences by early on as you
- 22:05
are encouraging more code gen think
- 22:07
about how that impact your code review
- 22:09
and CI and how you can address these new
- 22:12
bottlenecks. And finally, continue to
- 22:14
define and instrument your system to get
- 22:16
the right metrics to measure the health
- 22:18
of your CI system and the whole
- 22:21
developer experience in general.
- 22:24
So that's it for the talk. We believe
- 22:26
that this is the golden era of AI where
- 22:29
maximizing token ROI is the key for
- 22:32
every team success. And with that, I
- 22:34
just want to end with saying we are
- 22:36
hiring. I know this is engineering
- 22:38
leadership crowd but if you know of
- 22:39
someone who is interested in building
- 22:41
cutting edge legal contracting AI we
- 22:43
would love to talk. Thank you.