LLM-generated Rust similarities

173 points vulthoom1 108 comments

In our team we’ve recently noticed that, whenever any agent generates Rust, it always tends to be in the same specific style. It’s very evident, like non-idiomatic, very much imperative style, especially noticeable after coming from Scala into Rust (it even generates Scala in the same style! A lot of vars, while loops etc.). It’s as if it always tries to follow a very impure way of programming, so to speak. Either in existing code base or in a new one, always the similar result.

Has anyone also noticed this? It’s as if a language model was allergic to a more declarative programming style.