Do large language models write more accessible web code than humans?
This study compared web code generated by GPT-4o and Qwen2.5-Coder against human-written code from real projects, using automated accessibility checkers to measure how well each handles wcag and aria requirements.
A comparative study regenerated the UI-related files of ten active, real-world web projects (GitHub repositories with over 50 stars and over 20 contributors) using GPT-4o and Qwen2.5-Coder-32B-Instruct-AWQ, then scored the regenerated code against the original human-written code with the IBM Equal Access Accessibility Checker and the QualWeb Web Accessibility Evaluator. The paper reports that "LLMs often produce more accessible code, especially for basic features like color contrast and alternative text, but struggle with complex issues such as ARIA attributes," and its conclusion restates that both models "often produce more accessible code than humans."
Because no formal specification existed for the ten projects' UI files, the authors built a two-step pipeline: one LLM instance summarized the existing code as a proxy specification, and a separate instance regenerated the code from that summary alone — a design meant to prevent the generating model from "simply memorizing and reproducing the source code." Generation ran at block level, segmented by structural tags such as <section>, <header>, <nav>, and <main>, after an earlier file-level attempt produced too many broken or incomplete outputs from functional and dependency errors.
This sits alongside Do generative UI tools actually implement their stated design rationales? as another case where LLM-generated interfaces clear surface-level checks but miss deeper structural or semantic requirements — here ARIA attributes, there design rationale. It also echoes the human-oversight argument in Does partial code help users understand logic better than complete solutions?: this paper's own discussion concludes the ARIA gap "reinforces the importance of maintaining human oversight" rather than full automation. The companion finding in Can feeding accessibility violations back into code generation improve results? is this same paper's proposed answer to the gap identified here.
The excerpt is explicit about scope limits: the inaccessibility-rate metric used "treats all violations equally, regardless of their severity or user impact," and the authors state findings "may not generalize beyond this study's LLMs and web projects" — two LLMs and ten projects, with no study involving actual users with disabilities. The result supports a narrow, checker-measured comparison between two specific models and ten codebases, not a general claim that LLMs write more usable code for people with disabilities.
Inquiring lines that read this note 13
This note is a source for these research framings, grouped by the broader line of inquiry each explores. Scan the bold lines of inquiry; follow any specific question forward.
Can visual rendering-based rewards effectively improve code and layout quality?- How does code asymmetry break DOM-based evaluation of generated web interfaces?
- What performance gains does ALISA achieve over prior WebUI-to-Code training methods?
- What specific ARIA constraints remain difficult for feedback-driven code generation?
- How does the accessibility tree representation limit both code generation and evaluation?
- Can code generation tools learn ARIA attributes from specification summaries?
- Can helper libraries reduce complexity of generating executable programs from text?
- Why do LLMs introduce new ARIA violations when given explicit accessibility prompts?
- Why do automated accessibility checkers miss complex semantic requirements?
- Why do LLMs succeed at element-level accessibility fixes but fail at document-wide constraints?
Related concepts in this collection 4
This note in its neighbourhood — explore the map, then jump to a related concept in the list below.
Click a node to walk · click center to open · click Open in graph to see this note in the full knowledge graph
-
Do generative UI tools actually implement their stated design rationales?
Explores whether generative UI tools build interfaces that match the design reasoning they provide. This matters because plausible-sounding rationales might persuade users to trust outputs without verification.
both find LLM-generated interfaces pass surface-level checks while missing deeper semantic or structural requirements
-
Does partial code help users understand logic better than complete solutions?
When AI provides hints and scaffolding instead of finished code, do learners retain better understanding of the underlying logic? This matters for balancing coding efficiency with maintainability and user comprehension.
both conclude accessible, reliable code generation still needs human oversight rather than full automation
-
Can feeding accessibility violations back into code generation improve results?
This explores whether closing a feedback loop between accessibility evaluators and LLM code generation can overcome the limitations of static prompting strategies alone, and whether such iteration successfully addresses complex ARIA constraints.
the same paper's proposed fix for the ARIA gap this note identifies
-
Why do LLM accessibility repairs fail at the document level?
LLMs successfully fix individual accessibility issues but struggle with document-wide constraints like heading order or landmark uniqueness. Understanding this gap could reveal what architectural changes might improve repair success rates.
Extends: traces ARIA-type failures to agents lacking a global DOM view needed for document-wide constraints like landmark uniqueness
Related papers in this collection 8
Papers most semantically related to this note, ranked by cosine similarity in the embedding space.
- Human or LLM? A Comparative Study on Accessible Code Generation Capability
- Generative UI: LLMs are Effective UI Generators
- LLM Based Web Accessibility Repair: An Empirical Study of Detection, Remediation, and Cost
- WebRenderBench: Enhancing Web Interface Generation through Layout-Style Consistency and Reinforcement Learning
- UI-Bench: A Benchmark for Evaluating Design Capabilities of AI Text-to-App Tools
- Code Aesthetics with Agentic Reward Feedback
- WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learning
- IFEvalCode: Controlled Code Generation
Original note title
GPT-4o and Qwen2.5-Coder generate more accessible web code than human developers on basic issues but struggle with complex ARIA attributes