Live data from Hacker News

Type-constrained code generation with language models

arxiv.org

11–20 of 134 posts

Re: Type-constrained code generation with language models

#12
post #11

Hejlsberg mentioned the ability to quickly provide accurate type information to LLMs as one of the reasons for rewriting tsc into Go: https://youtu.be/10qowKUW82U?t=3186

But isn't TypeScript already a typed language to begin with?

This is about the speed with which the compiler can advise an LLM that a particular thing checks or doesn't check. Typescript is much slower than Go

Re: Type-constrained code generation with language models

#13
post #12
post #11

Earlier quoted context omitted.

But isn't TypeScript already a typed language to begin with?

This is about the speed with which the compiler can advise an LLM that a particular thing checks or doesn't check. Typescript is much slower than Go

okay so basically the faster compiling means a tigher feedback loop for the LLM to -know- if the code compiles or not etc? interesting

is go faster than rust?

Re: Type-constrained code generation with language models

#14
The general idea seems very promising, I had been hoping someone would do something like this since seeing JSON schema structured outputs for LLMs.

Need to dig in a bit more on the implementation, but I was surprised that the paper didn't mention hooking into existing language service/server. There's more than types that an LLM could leverage from existing language tooling. Auto imports is a good example, it is handy for the human developer to keep a linear writing flow, something a LLM needs even more.

Re: Type-constrained code generation with language models

#15
post #3

This was an obvious next step. Most current products can only restrict the token prediction to valid JSON or a specific JSON schema at best. There's no reason that this should be the only grammar available for constrained output mode. The real challenge will be to make this detect and switch languages automatically. For example, a snippet of code could include a LaTeX formula in a comment and SQL in a string literal.…

Backtracking idea is interesting, could maybe diffusion help? At some point it turns into sat solving.

[deleted]

Re: Type-constrained code generation with language models

#17
post #13
post #12

Earlier quoted context omitted.

This is about the speed with which the compiler can advise an LLM that a particular thing checks or doesn't check. Typescript is much slower than Go

okay so basically the faster compiling means a tigher feedback loop for the LLM to -know- if the code compiles or not etc? interesting is go faster than rust?

Go’s compiler is WAY faster than Rust’s. As far as speed of the actual program, Rust will generally be faster.
Post reply on HN