Ask HN: Why do LLMs struggle with word count?

2 rishikeshs 2 9/6/2025, 1:18:30 PM
I've noticed that most LLMs struggle to generate within a set word count. Any reason for this?

What is causing this limitation? If a basic online word count tool can do this, why can't these big companies do this?

Comments (2)

viraptor · 2h ago
> Any reason for this?

They're not trained for that. And there's no good reason to improve it if you can instead rerun the paragraph saying "make this slightly shorter".

> If a basic online word count tool can do this

It's an entirely different technology and not comparable at all. If you want to involve an actual word counter, this is not hard to integrate, with a basic loop that measures the output and feeds back the result so that the LLM can shorten/lengthen the text automatically before returning to you.

nivertech · 1h ago
they don't see words, only tokens

and even with tokens they don't know how to count them at the LLM completion layer

they have to be trained with something like RLHF about word counting at the question answering / instruction following layers

or at the application layer (so called "agentic workflows"), e.g. writing a Python code to count words, or calling a function or a CLI tool like "wc"