← all work
● case study 02researchmsr '26

Can LLMs fix slow web pages?

venueMSR 2026, Technical Papers
authorsGideon Peters (first author), SayedHassan Khatoonabadi, Emad Shihab · Concordia University
stackPython, Lighthouse, Docker, 9 LLMs
read morePaper ↗Code ↗
01 / the questionwhy

Performance work is slow, manual, and lives in the DOM.

Users expect pages to be fast, but fixing performance is time-consuming, and changing the Document Object Model is among the hardest parts of the job. LLMs are increasingly pitched as the tool for this kind of change.

So we asked a concrete question: given a real page's DOM and its Lighthouse audit, can an LLM actually make the issues go away, and what does it break along the way?

02 / setupscale
0popular web pages, including major social, shopping and streaming sites
0state-of-the-art LLMs compared
0Lighthouse audit categories
0best audit reduction on performance categories
03 / pipelinehow
Extract

Capture each page's full DOM and run a baseline Lighthouse audit.

Chunk

Split large DOMs into token-aware chunks that fit each model's context.

Repair

Give every model the chunk and its audits, and ask it to resolve the issues.

Reassemble

Stitch the modified chunks back into a working page.

Re-audit

Re-run Lighthouse, measure the change in audit incidence, and diff the DOM.

04 / findingswhat happened

Excellent at the easy fixes, mixed where performance really lives.

Every model cleared all SEO and accessibility issues. On the categories that matter most for speed (initial load, interactivity and network), results varied widely. The strongest model, GPT-4.1, cut audit incidence by roughly 47–49%, while others, such as GPT-4o-mini, consistently fell short.

reduction in audit incidencebest result
SEO
100%
Accessibility
100%
Load, interactivity, network
46.5–48.7%

SEO and accessibility: every model. Performance categories: the strongest model (GPT-4.1), with reductions between 46.52% and 48.68%. See the paper for the per-category, per-model breakdown.

05 / what it meanstakeaways

LLMs mostly add things and move things around, and sometimes the page gets less stable.

  • Additive by default. Diffing the DOMs showed models mostly add elements and attributes and often reposition nodes, rather than simplifying the page.
  • Regressions are real. Some fixes made visual stability worse: the page passed one audit and failed another.
  • There's a safe zone. SEO and accessibility fixes are good candidates for automation today.
  • Everything else needs a check. For performance-critical changes, the answer is hybrid workflows where every LLM edit is re-measured before it ships.