166 comments

[ 2.7 ms ] story [ 235 ms ] thread
This seems to use a hard coded list of explicit rules, not an LLM

https://writewithharper.com/docs/rules

https://github.com/Automattic/harper/blob/0c04291bfec25d0e93...

        "PointIsMoot" => (
            ["your point is mute"],
            ["your point is moot"],
            "Did you mean `your point is moot`?",
            "Typo: `moot` (meaning debatable) is correct rather than `mute`."
        ),
From a quick look phrase corrections is just one type of rule. There are many other rules, some are dynamic like when to use "your" vs "you're", oxford commas, etc.

That it doesn't use LLMs is its advantage, it runs in under 10ms and can be easily embedded in software and still provide useful grammar checking even if it's not exhaustive

IMO not using LLMs is a big plus in my book. Grammarly has been going downhill since they've been larding it with "AI features," it has become remarkably inconsistent. It will tell me to remove a comma one hour, and then tell me to add it back the next.
So is there a similar tool but based on an LLM?

Not that I think LLM is always better, but it would be interesting to compare these two approaches.

Grammarly came out before the LLMs. I'm not sure what approach it took, but they're likely feeling a squeeze as LLMs can tell you how to rewrite a sentence to remove passive voice and all that. I doubt the LLMs are as consistent (some comments below show some big issues), but they're free (for now).
Thank you. In general my grammarly and gboard predictions have become so, so bad over the last year.
General purpose LLMs seem to get very confused about punctuation, in my experience. It's one of their big areas of obvious failing. I'm surprised Grammarly would allow this to happen.
The internet, especially post phone keyboards, is extremely inconsistent about punctuation. I’m not sure how anyone could think an llm wouldn’t be.
> It will tell me to remove a comma one hour, and then tell me to add it back the next.

So just like English teachers I see

Grammarly sometimes gets stuck in a loop, where it suggests changing from A to B. It then immediately suggests changing from B to A again, continuing to suggest the opposite change every time I accept the suggestion.

It's not a problem; I make the determination which option I like better, but it is funny.

Being dyslexic, I was an avid Grammarly user. Once it started adding "AI features" the deterioration was noticeable, I cancelled my subscription and stopped using it a year ago.

I also only ever used the web app, so copy+pasting as installing the app is for all intentness and purposes is installing a key logger.

Grammar works on rules, not sure why that needs an LLM, Grammarly certainly worked better for me when it was more dumb, using rules.

DeepL Write was pretty good in the post-LLM, pre-ChatGPT era.
DeepL is different in my opinion. They always focused on machine learning for languages.

They must have acquired fantastic data for their Models. Especially because of the business language and professional translations which they focus on.

They keep your intended message in tact and just refine it. Like a book post editing. Grammarly and other tools force you to sound like they think is best.

DeepL shows, in my opinion, how much more useful a model trained for specific uses is.

Any suggestions for models ppl can run locally that are close to deepl
If you are talking about the current status of DeepL, that would be a low bar.
'imo' and 'in my book' are redundant in the same sentence. Are there rules-based techniques to catch things like that? Btw I loved the use of 'larding' outside the context of food.
I think if you can self host language tool, it would still be the better option.
"Me and Jennifer went to have seen the ducks cousin."

No errors detected. So this needs a lot of rule contributions to get to Grammarly level.

What the duck is that test
Nominative vs objective
There's a little more going on than that.
Yeah, I stopped parsing after "Me and Jennifer".
In addition to case, it's testing tense (went to have seen) and plural vs. posessive (ducks cousin)
Similarly 0 grammatical errors flagged: "My name John. What your name? What day today?"
I was initially impressed. But then I tested a bunch, it wasn't catching some really basic things. Mostly hit or miss.
Goes the other way around too. For

> In large, this is _how_ anything crawler-adjacent tends to be

It suggests

> In large, this is how _to_ anything crawler-adjacent tends to be

Slightly controversial compared to other comments here but I haven't used Grammerly at all since LLMs came out. Even a 4B local LLM is good enough to rephrase all forms of text and fix most grammer mistakes.
I think a lot of value comes by integrating with a language server and/or browser extensions.

Do you have a setup where this is possible or do you copy paste between text fields? (Genuine question. I’d love to use a local LLM integrating with an LSP).

(comment deleted)
Very buggy, but great start!!

I.e. if you write an "MISTAEK" and then you scroll the highlight follows me around the page

Good start. But still has bugs i guess.

I tried with the following phrase -- "This should can't logic be done me." --

No errors.

Why wouldn't you want an LLM for a language learning tool? Language is one of things I would trust an LLM completely on. Have you ever seen ChatGPT make an English mistake?
uh. yes? it's far from uncommon, and sometimes it's ludicrously wrong. Grammarly has been getting quite a lot of meme-content lately showing stuff like that.

it is of course mostly very good at it, but it's very far from "trustworthy", and it tends to mirror mistakes you make.

Do you have any examples? The only time I noticed an LLM make a language mistake was when using a quantized model (gemma) with my native language (so much smaller training data pool).
Not GP, but I've definitely seen cutting edge LLMs make language mistakes. The most head scratching one I've seen in the past few weeks is when Gemini Pro decided to use <em> and </em> tags to emphasize something that was not code.
Grammarly is all in on AI and recently started recommended splitting "wasn't" and added the contraction to the word it modified. Example: "truly wasn't" becomes "was trulyn't"

https://imgur.com/a/RQZ2wXA

Hm ... I wonder, is Grammarly also responsible for the flood of contraction of lexical "have" the last few years? It's standard in British English, but outside of poetry it is proscribed in almost all other dialects (which only permit contraction of auxiliary "have").

Even in British I'm not sure how widely they actually use it - do they say "I've a car" and "I haven't a car"?

"they" say "I haven't got a car".

Contractions are common in Australian English to, though becoming less so due to the influence of US English.

In my experience "I've a car" is much more common than "I haven't a car" (I've never heard the latter construct used, but regularly hear the former in casual speech). "I haven't got a car" or "I've no car" would be relatively common though.
This is what peak innovation looks like
I don't think an LLM would recommend an edit like that.

Has to be a bug in their rule-based system?

Gemini: "Was trulyn't" is a contraction that follows the rules of forming contractions, but it is not a widely used or accepted form in standard English. It is considered grammatically correct in a technical sense, but it's not common usage and can sound awkward or incorrect to native speakers.
I wonder how much memes like whomst'd might skew the training set.
Because this "language learning tool" will be dominantly used to avoid actually learning the language.
Yeah, I agree. An open-source LLM-based grammar checker with a user interface similar to Grammarly is probably what I'm looking for. It doesn't need to be perfect (none of the options are); it just needs to help me become a better writer by pointing out issues in my text. I can ignore the false positives, and as long as it helps improve my text, I don't mind if it doesn't catch every single issue.

Using an LLM would also help make it multilingual. Both Grammarly and Harper only support English and will likely never support more than a few dozen very popular languages. LLMs could help cover a much wider range of languages.

I tried to use one LLM based tool to rewrite sentence in more official corporate form, and it rewrote something like "we are having issues with xyz" into "please provide more information and I'll do my best to help".

LLMs are trained so hard to be helpful that it's really hard to contain them into other tasks

I wish it had keyboard shortcuts. As a Vim user, in Chrome it's tedious to click on every suggestion given by the app. Also, maybe add a "delay" so it doesn't think the currently-being-typed word is a mistake (let me finish typing first!).

Otherwise, it's great work. There should be an option to import/export the correction rules though.

Given this is an Automattic product, I'm hesitant to use it. If it gets remotely successful, Matt will ruin it in the name of profit.
It's FOSS, so even if the worst happens, anyone could just fork the last good version and continue development there.
this solution is just fundamentally insufficient. in the age of LLMs it's pretty insane to imagine programmers manually hard-coding an arbitrary subset of grammatical corrections (sure: it's faster, it's local first, but it's not enough). on top of that, English (like any other natural language) is such a complicated beast that you will never write a classic deterministic parser that's sophisticated enough to allow you to reliably implement even the most basic of grammatical corrections (check the other comments for examples). it's just not gonna happen.

i guess it's a nice and lightweight enhancement on top of the good old spellchecker, though

(comment deleted)
Looks cool, but it's weird to constantly make comparisons to Grammarly (in the post title, description section of the site, benchmarks) when this is clearly a rule-based spellcheck and very different from what Grammarly offers.

Instead tell me how it compares to the built-in spellcheck in my browser/IDE/word processor/OS.

I would much rather check my writing against grammatical rules that are hard coded in an open source program—meaning that I can change them—than ones that I imagine would be subject to prompt fiddling or worse; implicitly hard coded in a tangle of training data that the LLM would draw from.

The Neovim configuration for the LSP looks neat: https://writewithharper.com/docs/integrations/neovim

The whole thing seems cool. Automattic should mention this on their homepage. Tools like this are the future of something.

You would lose out on evolution of language.
Natural languages evolve so slowly that writing and editing rules for them is easily achievable even this way. Think years versus minutes.
Please share your reasoning that led you to this conclusion -- that natural language "evolves slowly". You also seem to be making an assumption that natural languages (English, I'm assuming) can be well defined by a simple set of rigid patterns/rules?
> Please share your reasoning that led you to this conclusion -- that natural language "evolves slowly".

Languages are used to successfully communicate. To achieve this, all parties involved in the communication must know the language well enough to send and receive messages. This obviously includes messages that transmit changes in the language, for instance, if you tried to explain to your parents the meaning of the current short-lived meme and fad nouns/adjectives like "skibidi ohio gyatt rizz".

It takes time for a language feature to become widespread and de-facto standardized among a population. This is because people need to asynchronously learn it, start using it themselves, and gain critical mass so that even people who do not like using that feature need to start respecting its presence. This inertia is the main source of slowness that I mention, and also and a requirement for any kind of grammar-checking software. From the point of such software, a language feature that (almost) nobody understands is not a language feature, but an error.

> You also seem to be making an assumption that natural languages (English, I'm assuming) can be well defined by a simple set of rigid patterns/rules?

Yes, that set of patterns is called a language grammar. Even dialects and slangs have grammars of their own, even if they're different, less popular, have less formal materials describing them, and/or aren't taught in schools.

Fair enough, thanks for replying. I don't see the task of specifying a grammar as straightforward as you do, perhaps. I guess I just didn't understand the chain of comments.

I find that clear-cut, rigid rules tend to be the least helpful ones in writing. Obviously this class of rule is also easy/easier to represent in software, so it also tends to be the source of false positives and frustration that lead me to disable such features altogether.

When you do writing as a form of art, rules are meant to be bent or broken; it's useful to have the ability to explicitly write new ones and make new forms of the language legal, rather than wrestle with hallucinating LLMs.

When writing for utility and communication, though, English grammar is simple and standard enough. Browsing Harper sources, https://github.com/Automattic/harper/blob/0c04291bfec25d0e93... seems to have a lot of the basics already nailed down. Natural language grammar can often be represented as "what is allowed to, should, or should not, appear where, when, and in which context" - IIUC, Harper seems to tackle the problem the same way.

I'm certainly not disputing the existence of grammar nor do I think an LLM is a good way to implement/check/enforce one. And now I realise how my first comment landed. Thanks again!
Your first point would be more fitting if a language checker would need a complete, computable grammar that can be parsed and understood. That would be problematic for natural languages.
Just because the rules aren’t set fully in stone, or can be bent or broken, doesn’t mean they don’t “exist” - perhaps not the way mathematical truths exist, but there’s something there.

Even these few posts follow innumerable “rules” which make it easier to (try) to communicate.

Perhaps what you’re angling against is where rules of language get set it stone and fossilized until the “Official” language is so diverged from the “vulgar tongue” that it’s incomprehensibly different.

Like church/legal Latin compared to Italian, perhaps. (Fun fact - the Vulgate translation of the Bible was INTO the vulgar tongue at the time: Latin).

Aight you win fam, I was trippin fr. You're absolutely bussin, no cap. Harvard should be taking notes.

(^^ alien language that was developed in less than a decade)

Yes, precisely. This "less than a decade" is magnitudes above the hours or days that it would take to manually add those words and idioms to proper dictionaries and/or write new grammar rules to accomodate aspects like skipping "g" in continuous verbs to get "bussin" or "bussin'" instead of "bussing". Thank you for illustrating my point.

Also, it takes at most few developers to write those rules into a grammar checking system, compared to millions and more that need to learn a given piece of "evolved" language as it becomes impossible to avoid learning it. It's not only fast enough to do this manually, it also takes much less work-intensive and more scalable.

Not exactly. It takes time for those words to become mainstream for a generation. While you'd have to manually add those words in dictionaries, LLMs can learn these words on the fly, based on frequency of usage.
At this point we're already using different definitions of grammar and vocabulary - are they discrete (as in a rule system, vide Harper) or continuous (as in a probability, vide LLMs). LLMs, like humans, can learn them on the fly, and, like humans, they'll have problems and disagreements judging whether something should be highlighted as an error or not.

Or, in other words: if you "just" want a utility that can learn speech on the fly, you don't need a rigid grammar checker, just a good enough approximator. If you want to check if a document contains errors, you need to define what an error is, and then if you want to define it in a strict manner, at that point you need a rule engine of some sort instead of something probabilistic.

I’m glad we have people at HN who could have eliminated decades of effort by tens of thousands of people, had they only been consulted first on the problem.
Which effort? Learning a language is something that can't be eliminated. Everyone needs to do it on their own. Writing grammar checking software, though, can be done few times and then copied.
I don't think anyone has the need to check such a message for grammar or spelling mistakes. Even then, I would not rely on a LLM to accurately track this "evolution of language".
What if you're writing emails to GenZers?
As a zoomer, I'd rather not receive emails that sound like they're written by a moron.
Attempting to write like a GenZ when you’re not gets you “hello fellow kids” and “Boomer” right away.
The existence of common slang which isn't used in the sort of formal writing that grammar linting tools are typically designed to promote is more of a weakness of learning grammar by a weighted model of the internet vs formal grammatical rules than a strength.

Not an insurmountable problem, ChatGPT will use "aight fam" only in context-sensitive ways and will remove it if you ask to rephrase to sound more like a professor, but RHLFing slang into predictable use is likely a bigger potential challenge than simply ensuring the word list of an open source program is sufficiently up to date to include slang whose etymology dates back to the noughties or nineties, if phrasing things in that particular vernacular is even a target for your grammar linting tool...

Huh, this is the first time I've seen "noughties" used to describe the first decade of the 2000s. Slightly amusing that it's surely pronounced like "naughties". I wonder if it'll catch on and spread.
The fact that you never saw it before suggests it did not catch on and spread during the last 25 years.
‘Noughties’ was popular in Australia from 2010 onwards. Radio stations would “play the best from the eighties nineties noughties and today”.
Common in Britain too, also appears in the opening lines of the Wikipedia description for the decade and the OED.
Pedantically,

aight, trippin, fr (at least the spoken version), and fam were all very common in the 1990s (which was the last decade I was able to speak like that without getting jeered at by peers).

I don't need grammar to evolve in real time. In fact, having a stabilizing function is probably preferable to the alternative.
If a language changes, there are only three possible options: either it becomes more expressive; or it becomes less expressive; or it remains as expressive as before.

Certainly we would never want our language to be less expressive. There’s no point to that.

And what would be the point of changing for the sake of change? Sure, we blop use the word ‘blop’ instead of the word ‘could’ without losing or gaining anything, but we’d incur the cost of changing books and schooling for … no gain.

Ah, but it’d be great to increase expressiveness, right? The thing is, as far as I am aware all human languages are about equal in terms of expressiveness. Changes don’t really move the needle.

So, what would the point of evolution be? If technology impedes it … fine.

> So, what would the point of evolution be?

Being equally as expressive overall but being more focussed where current needs are.

OTOH, I don't think anything is going to stop language from evolving in that way.

The world that we need to be expressive about is changing.
why did you use chatgpt for this text then?
I can write em-dashes on my keyboard in one second using the compose key: right alt + ---
Same here — the compose key is so convenient you forget most people never heard of it. This em-dashes mean LLM output thing is getting annoying though.
> This em-dashes mean LLM output thing is getting annoying though.

Agreed. Same with those non-ASCII single and double quotes.

(comment deleted)
LanguageTool (a Grammarly competitor) is also open source and can be managed locally:

https://github.com/languagetool-org/languagetool

I generally run it in a Docker container on my local machine:

https://hub.docker.com/r/erikvl87/languagetool

I haven't messed with Harper closely but I am aware of its existence. It's nice to have options, though.

It would sure be nice if the Harper website made clear that one of the two competitors it compares itself to can also be run locally.

There are two versions of the LanguageTool: open source and cloud-based. Open source checks the individual words in the dictionary just like the system's spell checker. Maybe there is something more to it, but in my tests, it did not fix even obvious errors. It's not an alternative to Grammarly or this tool.
I never understood the appeal of grammar tools. If you have reached the minimum professional/academic level needed to be designated to write something, shouldn't you at least be capable of verifying its semantic "correctness" just by reading through it once yourself?

Why would you pass a writing job to someone who isn't 100% fluent in the language and then make up for it by buying complex tools?

I use it (well, languagetool) in the free version for comments on sites like this. It directly catches mistakes I make, that I'd normally only catch on re-reads. From typos, over my brain doing weird stuff, to sometimes things I simply didn't (actively) know.
As a non native English speaker/writer there are a bunch of errors I miss, no matter how much attention I pay and how much I proofread, and these tools are useful to catch those.
Have you considered that some people aren’t 100% fluent in English but still competent?
I know for example David Sparks (MacSparky https://www.macsparky.com ) uses it (or at leased used it). And he was an American lawyer and he says writing has been his passion his whole life so I assume his English is better than the average person.
People are bad at proofreading their own work. Professional writers often use third-party copy editors and proofreaders for that reason.
I’m a production editor at an uni press, and I can tell you there’s not a strong correlation between professional/academic level and writing well.
I'm a lawyer. I write 10s of pages of text every day. "Reading through it once yourself" is obviously an imperfect solution. See, e.g., Poisson statistics. It's also slow and I bill in 6-minute increments. There is significant value in a grammar tool that protects confidentiality and is more effective than my wetware.
this is the right direction. rulebased, local, transparent. not perfect yet, but that's not the point. getting something lightweight and tweakable matters more than catching every edge case out of the box. if it misses, you add rules. simple as that. if you expect it to match grammarly day one then might be we are missing the tradeoff