# An AI agent rewrites the optimizer's own code mid-training and beats hand-tuned recipes

Original title: Reactive Optimizers: rewrite the optimizer's source code during training

> Hacker News story 50188440 · language: en · submitted 2026-10-21
> Web version: https://zeli.app/story/50188440
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 32 · by [matt_d](<https://news.ycombinator.com/user?id=matt_d>) · 💬 3
[original](<https://xingjianbai.com/reactive-optimizers/>) · [HN discussion](<https://news.ycombinator.com/item?id=50188440>)

## Summary

Researchers at MIT put an LLM agent inside the training loop: it watches gradient statistics, then rewrites the optimizer's source code on the fly. Called OPAL, it matches or beats the best off-the-shelf recipes in one-shot settings — a 162M GPT on Chinese, Thai and Kyrgyz data, and diffusion models LightningDiT-XL/1 and RAEv2-B. It also invents its own schedules, suppresses loss spikes, and escapes overfitting without being told to.

## Key quote

> Whether hand-crafted or automatically discovered, the optimizer then runs unchanged through the end of training, adapting, if at all, according to rules written in advance.

---

## Cite

- Page: https://zeli.app/story/50188440
- Date: 2026-10-21
- Source: xingjianbai.com (https://xingjianbai.com/reactive-optimizers/)
- Hacker News: https://news.ycombinator.com/item?id=50188440

## Other languages

- zh: https://zeli.app/zh/story/50188440 · markdown: https://zeli.app/zh/story/50188440.md
- ja: https://zeli.app/ja/story/50188440 · markdown: https://zeli.app/ja/story/50188440.md
- ko: https://zeli.app/ko/story/50188440 · markdown: https://zeli.app/ko/story/50188440.md
- de: https://zeli.app/de/story/50188440 · markdown: https://zeli.app/de/story/50188440.md
- es: https://zeli.app/es/story/50188440 · markdown: https://zeli.app/es/story/50188440.md
- ru: https://zeli.app/ru/story/50188440 · markdown: https://zeli.app/ru/story/50188440.md
