INQUIRING LINE

AI tools can fix one bad button or image tag easily, but miss accessibility rules that depend on the whole page's structure — why?

Why do LLMs succeed at element-level accessibility fixes but fail at document-wide constraints?

This explores why AI models are good at fixing individual accessibility problems on a web page (a missing image description, a low-contrast button) but struggle with rules that apply to the page as a whole, and what that gap says about how LLMs handle structure more generally.


This explores why LLMs can patch individual accessibility problems on a web page but break down when a rule depends on the whole document. The numbers make the gap concrete. When Kimi K2.5 repaired real HTML pages, it improved compliance in 80% of files and cut violations per file from about 4 to under 2, yet fully fixed fewer than 26% of them Can LLMs actually fix web accessibility problems?. Running the repair again raised cost by 52% and fixed nothing more. The explanation offered is about scope. A missing alt attribute can be fixed by looking at one element. A rule like 'heading levels must not skip' or 'IDs must be unique' needs a view of the entire page structure (the DOM), and the model doesn't reliably hold one Why do LLM accessibility repairs fail at the document level?.

The same line shows up when LLMs write accessible code from scratch. GPT-4o and Qwen2.5-Coder beat human developers on local checks like color contrast and image alt text, but slipped on ARIA attributes, the markup that tells screen readers how parts of a page relate to each other. Their code often passed automated checkers while missing what those attributes are actually for Do large language models write more accessible web code than humans?. Feeding checker errors back into generation (FeedA11y) beats plain prompting, but keyboard navigation and focus management stay unsolved Can feeding accessibility violations back into code generation improve results?. Those are the most global requirements of all: they depend on how every interactive element on the page fits into one sequence. More feedback doesn't help, because the model isn't missing information about what's wrong. It's missing a way to reason about the whole.

Outside accessibility, the corpus suggests this is a general pattern and not a quirk of HTML. LLMs handle simple sentences well, but their grammatical accuracy drops predictably as clauses nest inside clauses Does LLM grammatical performance decline with structural complexity?, and even large models misidentify embedded structures Why do large language models fail at complex linguistic tasks?. Long-context models can match retrieval systems at finding semantically relevant passages, but they fail at queries that require joining information across structured tables Can long-context LLMs replace retrieval-augmented generation systems?. Fitting the whole document into the context window is not the same as reasoning about its structure.

The document-editing research adds a warning. In DELEGATE-52, giving models agentic editing tools did not make long document edits more reliable. The failure came earlier, in the model's judgment about what to change Can better tools fix LLM document editing errors?. Frontier models also tend to damage documents quietly, keeping the surface intact while corrupting the content, where weaker models visibly delete things Does model capability change how documents degrade?. That matches the accessibility finding that code can pass surface checks and still fail the people who depend on it. A related idea is 'Potemkin understanding': a model can state a rule correctly and still fail to apply it Can LLMs understand concepts they cannot apply?. Ask an LLM what heading hierarchy means and it will explain it well. Ask it to enforce that hierarchy across a 300-element page and it may not.

The practical fix the corpus points to is a division of labor based on scope: let the LLM handle local, meaning-heavy repairs such as writing good alt text, and give document-wide rules to deterministic validators that can actually see the whole tree Why do LLM accessibility repairs fail at the document level?. ReadAgent suggests another route. It compresses a document into short 'gist' summaries and then looks up details only when needed, which gives the model a deliberate overview instead of a long, flat stream of tokens Can LLMs read long documents like humans do?. The takeaway worth carrying beyond accessibility is that an LLM's errors cluster where a rule's scope is bigger than what the model attends to at one moment. Knowing a rule's scope tells you, before you run anything, whether to trust the model or hand the job to a checker.


Sources 11 notes

Why do LLM accessibility repairs fail at the document level?

LLMs achieve 80% partial compliance improvement but only 26% full resolution because they excel at element-level fixes but lack a global DOM view needed for document-wide rules. Scope-matched repair strategies pairing LLMs with deterministic validators could address this limitation.

Can LLMs actually fix web accessibility problems?

Testing Kimi K2.5 on real HTML pages shows LLM-generated repairs improve compliance in 80% of cases and reduce violations per file from 3.98 to 1.7, yet fully resolve fewer than 26% of files. Iterating repairs increases cost 52% with no improvement.

Do large language models write more accessible web code than humans?

GPT-4o and Qwen2.5-Coder outperformed human developers on contrast and alt text but struggled with ARIA attributes. Both models produced code that passed surface-level automated checks while missing deeper semantic requirements.

Can feeding accessibility violations back into code generation improve results?

FeedA11y's ReAct-based feedback loop significantly outperforms zero-shot, few-shot, and self-criticism prompting by iteratively feeding evaluator results back into generation. However, it still struggles with nuanced ARIA constraints like keyboard navigation and focus management, suggesting evaluator feedback alone cannot substitute for domain expertise.

Does LLM grammatical performance decline with structural complexity?

LLMs show systematic performance decline as syntactic depth and embedding increase. Simple sentences are handled well while complex structures with recursion and embedding fail consistently, suggesting LLMs learned surface heuristics rather than structural grammar rules.

Show all 11 sources
Why do large language models fail at complex linguistic tasks?

Top-tier LLMs like Llama3-70b consistently misidentify embedded clauses, verb phrases, and complex nominals. Performance degrades predictably as syntactic depth increases, revealing that statistical learning captures surface patterns but not deep grammatical rules.

Can long-context LLMs replace retrieval-augmented generation systems?

The LOFT benchmark shows LCLMs match RAG on semantic retrieval without explicit training, but cannot execute relational queries requiring joins across structured tables. Context length alone cannot bridge this gap.

Can better tools fix LLM document editing errors?

DELEGATE-52 shows that agentic tool access fails to improve performance on long-horizon document tasks. The degradation mechanism originates upstream in the model's judgment about what to change, not in editing interface limitations.

Does model capability change how documents degrade?

DELEGATE-52 shows weaker LLMs degrade documents through visible deletion, while frontier models degrade through subtle corruption that preserves surface integrity. This shift makes frontier failures harder to detect and potentially more dangerous at workflow scale.

Can LLMs understand concepts they cannot apply?

Models can explain concepts accurately, fail to apply them, and recognize the failure—a triple pattern incompatible with human cognition. This indicates functionally disconnected explanation and execution pathways rather than simple knowledge gaps.

Can LLMs read long documents like humans do?

ReadAgent compresses documents into gist memories before knowing the task, then retrieves details only when needed, extending effective context 3–20× and outperforming retrieval baselines on long-document QA.

Papers this line draws on 8

The research behind the notes this line reads — ranked by how closely each paper relates.