Sign up to save tools and stay up to date with the latest in AI
bg
bg
1

Ask HN: Do you document LLM-generated code as such?

Mar 07, 2024 - news.ycombinator.com
The article discusses the practice of documenting code generated by Language Model Libraries (LLMs) in Python source files. The author asks whether other programmers note when a function was written by an LLM, how specific the citation is, and whether they list the prompt. Some users responded that they do not document LLM-generated code as such, as they often modify the code to fit their needs and do not find it necessary to track timestamps and prompts. Others likened using LLMs to learning from resources like StackOverflow and saw no need for specific documentation.

Another user questioned the purpose of such citations, arguing that understanding the function and its purpose is more important than knowing its origin. They suggested that details about LLM generation could distract from understanding the function's purpose and functionality. The discussion highlights varying perspectives on the role and recognition of LLMs in coding practices.

Key takeaways:

  • Some developers use Language Learning Models (LLMs) to generate parts of their code, but do not typically document this fact in the code itself.
  • LLM-generated code is often used as a starting point and then tweaked to fit the specific needs of the project, rather than being used verbatim.
  • While some developers consider citing the use of LLMs in their code, others see no need for it, comparing it to not citing when they learn something from a resource like StackOverflow.
  • There's a debate on whether the origin of the code (whether it's LLM-generated or not) matters as long as the function works as expected and is understood by the developer.
View Full Article

Comments (0)

Be the first to comment!