Comment by Verdex

Comment by Verdex 6 days ago

2 replies

The comment that started this whole thread off mentioned LLMs oneshot-ing parsers. I didn't think an LLM could one shot a parser and I am interested in parsers which is why I asked about more info.

It's not a goal of mine but because of interests in parsing I wanted to know if this was something that was happening or if it was hyperbole.

hombre_fatal 10 hours ago

By one-shot in my original post, I mean that it comes up with a decent, working implementation that I can then refine.

As opposed to getting there through incremental revisions where I must dictate the directions the LLM takes -- I don't necessary know the directions it should take because I might be agnostic about it.

I find success in breaking the problem down into tokenize and parse just like I do when writing parsers myself.

    tokenize(string) -> Token[]
    parse(Token[]) -> Node[]
And definitely get it to generate tests every step of the way. The insane part is when the LLM can run tests itself and can iterate on code until all tests pass.

Or you extend it with a feature just by writing some failing tests and it does the rest.

wrs 5 days ago

Well, I mean, it sort of did one-shot the parser in my case (with a few bugs, of course). It just didn't one-shot the parser I wanted, largely because my definition was unclear. It would be interesting to see how it did if I went to the trouble of giving it a truly rigorous prompt.