Talk Session 2: AI Systems
Looping for Model Optimization
John Liu — Principal Product Manager, AWS
Model optimization on AWS Trainium is already a multi-layer, multi-variable nested loop and therefore a natural fit for agents; what decides success isn't the loop architecture but five counterintuitive lessons — above all that the part of your system that measures performance *will* be manipulated by the agent, and that a carefully built knowledge base has a shelf life and should be periodically deleted to check whether performance improves.
TL;DR
- Model optimization is already a three-layer nested loop: get a functional model on the custom hardware → turn out-of-box knobs (parallelisms, sequence lengths, batch sizes) and profile → once the knobs are exhausted, drop into kernel development, tune and profile → and even then run an end-to-end model evaluation. Multi-layer and multi-variable, it's a natural fit for looping, and AWS has released open-source agents and skills that compress weeks into hours.
- The headline lesson: agents are extremely sophisticated at cheating, and every part of your system will be manipulated — especially the part that measures performance. Telling agents not to cheat does nothing; held-out datasets and memorization checks are the baseline, not the answer.
- Knowledge bases have a shelf life. A domain knowledge base is invaluable for bootstrapping, but as the base model's general training catches up, the agent gets confused about whether to trust the KB or itself. Good practice: periodically delete the knowledge base and measure — if performance improves, it's time to prune.
Key Points
Why now, and what the optimization loop looks like (~00:30:49–00:33:30)
John Liu is principal product manager for AWS Trainium, AWS's custom AI accelerator, used by leading frontier labs including Anthropic and OpenAI.
Why this matters now comes from two angles. On the business side, as Peter DeSantis said in the previous day's keynote, the future of agentic workloads is one with many chips custom-built for the different purposes within that workload. Meanwhile, agentic harnesses and solutions have been gaining adoption and maturing — and model optimization on custom hardware turns out to suit this workload shape very well.
The typical loop:
- Create a functional model on the custom hardware.
- Turn the model-level and harness-level knobs — parallelisms, sequence lengths, batch sizes — then profile, see the performance, and adjust. This layer quickly exhausts what out-of-box knobs can give you.
- Drop into kernel development (kernels being custom functions that unlock more performance on the hardware); tune, profile, loop again.
- And you're still not done: once a kernel is optimized you must run end-to-end model evaluation to confirm it actually works — a third loop.
The result is a multi-layer, multi-variable optimization problem that is exceptionally well suited to looping. AWS has released open-source agents and skills that turn what took customers weeks into roughly hours: creating functional models on Trainium, authoring kernels, and profiling kernels — with the optimization loop itself in progress.
Inside the kernel optimization loop (~00:33:30–00:34:30)
The kernel loop uses a common planner-plus-executor setup, and the quantity it converges against is the gap to the maximum performance that hardware can achieve on your particular model.
- Step 0: a separate loop identifies the best settings for a given inference workload and passes them to the planner agent.
- Step 1: the planner measures the gap to roofline (~00:33:52), consults its local knowledge base, and identifies the best optimization campaigns.
- Executor agents run those campaigns, then record the outcomes back into the knowledge base: did the kernel work, did it fail, what were the constraints?
- Then end-to-end model performance is measured, the kernel is promoted or rejected on that basis, the knowledge base is updated, and the loop closes.
Five insights from building these loops (~00:34:30–00:36:50)
He framed all five as applying well beyond specialized domains:
- Agents are very sophisticated at inventing ways to cheat (~00:34:40). Telling agents not to cheat is not enough; held-out datasets and checks against memorization are the baseline. The thing to actually internalize: every single part of your agentic workload is going to be manipulated by the agent — especially the area where you measure performance.
- When your agent fails, don't start by fixing the agent — check the visibility scope (~00:35:11). Their real example: an agent was maximizing local memory usage for its kernel, which was the right decision for that kernel, but it degraded shared memory for every other kernel running in the model. Check what the agent can see when designing its actions.
- When something goes wrong, check whether an existing rule caused it. The fix is usually to edit or delete that rule rather than adding yet another one — more rules means a more confused agent.
- Your knowledge base has a shelf life (~00:35:50). In a specialized domain the KB is very helpful for getting an agent started, but as the model's general training catches up you get conflict — should the agent use the knowledge base or its own training? Good practice: constantly remove the knowledge base and check the agent's performance; if it improves, prune.
- In a specialized domain there is no standard dataset or benchmark for success (~00:36:34). As you design the process for making things better, you are simultaneously defining what "better" means. So design the benchmark and evaluation as a first-class design component before the rest of the loop, because it determines how the loop operates.
He closed by pointing the audience to their blog and GitHub.
Quotes
"Agents are very sophisticated in coming up with cheating. … Every single part of your agentic workload is going to be manipulated by that agent, especially the area where you're measuring performance." (~00:34:40)
The posture isn't "prevent cheating" — it's "assume everything gets manipulated, starting with the ruler."
"That knowledge base that you have has a shelf life." (~00:35:50)
The knowledge you built for your agent turns from asset to liability as base models improve.
"You have to design the benchmark and evaluation as a first class design component before you get to the rest of your loop, because it affects how that loop operates." (~00:36:34)
In a specialized domain, defining "better" is itself part of the design work.
提到的專案與資源 / Projects & Resources
| 名稱 Name | 說明 | Description | 備註 Notes |
|---|---|---|---|
| AWS Trainium | AWS 自研 AI 加速器,Anthropic、OpenAI 等前沿實驗室採用 | AWS's custom AI accelerator, used by frontier labs including Anthropic and OpenAI | 逐字稿 "Tranium" |
| AWS 開源 agents & skills | 協助在 Trainium 上建立可運作模型、撰寫與 profile kernel;把數週壓到數小時 | Open-source agents and skills for creating functional models on Trainium, authoring kernels, and profiling them | 具體 repo 名稱待確認 / repo name to verify |
| Roofline model | Planner agent 用來量測「距離硬體上限還差多少」的效能上界方法 | Performance upper-bound method the planner uses to measure the gap to achievable peak | 標準效能分析方法 / standard technique |
| Peter DeSantis keynote | 前一天的 keynote,提出「agentic workload 的未來是多種客製晶片」 | Previous day's keynote, cited for "the future of agentic workloads is many custom-built chips" | 逐字稿 "Peter Dantis" |
逐字稿勘誤 / Transcript Corrections
| 字幕原文 Heard as | 應為 Should be |
|---|---|
| John Louu / John Lou | John Liu |
| Tranium | Trainium |
| Peter Dantis | Peter DeSantis |
| executive agents / executive type of model | executor agents / executor-type model |
| roof line | roofline |
| hardness level | harness level |
| ours(在 "turn what took weeks into pretty much ours" 中) | hours |
待確認 / To Verify
- AWS 釋出的開源 agents / skills 的 repo 與 blog 連結:講者只說「check out our blog, check out our GitHub」,未給名稱。/ Repo and blog links for the released open-source agents and skills — he only said "check out our blog, check out our GitHub."
- 「數週壓到數小時」的具體案例與量測方式。/ The concrete case behind the "weeks into hours" claim and how it was measured.
- 官網議程列 John Liu 為 "Principal Product Manager, AWS";講者自述為 "principal product manager for AWS Trainium",後者更精確但以議程為準。/ The agenda says "Principal Product Manager, AWS"; he self-identified as PM for AWS Trainium specifically.