Language models vs. rules
June to October 2026
Undergraduate researcher, SUPER Fellowship, Jain Lab, Stanford Civil and Environmental Engineering
6%lower cost than a hand-tuned rule on the buildings it was developed on, gone on buildings it had never seen
Can a small language model running locally make good decisions about a real system? I built four controllers that schedule building batteries to cut electricity costs (language model, reinforcement learning, hand-tuned rule and no control) and benchmarked them in the CityLearn simulator.
- Split each controller into a brain that picks one of four modes and an executor that turns it into an action and enforces safety limits, so any difference in results comes from the decisions alone.
- The rule controller cut full-year costs 19% compared with no control.
- The language model beat the rule by 6% over a 48-hour test on its five development buildings.
- The lab took the code into its research repository to test with larger models.
Read the code on GitHub