TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Can LLM's produce useful code?

4 点作者 kshitij_libra大约 1 年前
After using code LLMs&#x27; for a bit, I wonder whether there is significant productivity gain in using them. I found that it&#x27;s limited for me.<p>Main reason: a) to find the right code, I have to keep sampling it, and b) it doesn&#x27;t seem to be able to solve larger &#x2F; more complex problems that I actually find more need for.<p>I found some interesting research on combining planning-algorithms for complex problems, and some ideas on guiding the LLM&#x27;s decoding process towards correctness by optimizing it via reward functions and reducing the search space. I&#x27;ve detailed and summarised the main points in the post below.<p>Questions:<p>1) Do you find code LLM&#x27;s really useful? Please share some stories &#x2F; examples where they help vs they didn&#x27;t. I&#x27;m trying to form a better understanding of their usage<p>2) Any other research ideas being pursued in this field ? &#x2F; what are you trying ?<p>Full post with details here: https:&#x2F;&#x2F;kshitij-banerjee.github.io&#x2F;2024&#x2F;04&#x2F;30&#x2F;can-llms-produce-better-code&#x2F;

4 条评论

mindcrime大约 1 年前
I haven&#x27;t spent a lot of time using LLM&#x27;s for code, but overall I&#x27;d say my answer is a qualified &quot;yes&quot;. I <i>have</i> indeed used LLM&#x27;s on a couple of occasions to generate code, and while it might not have been <i>exactly</i> what I needed, and needed some hand modification, I think on net I still saved time over typing in the code by hand. Especially when you factor in things I don&#x27;t have memorized, and would have needed to stop and look up API docs, and similar minutiae.<p>The couple of times I&#x27;ve done these things, the task involved something like calling some REST API using Apache HttpClient and doing some processing on the response. I never have the exact API details of HttpClient cached &quot;top of mind&quot; since I do this just infrequently enough to not bother remembering the fiddly details. And the LLM did a credible job of giving me the basic structure of what I was trying to do, and then I just had to edit some of the details - mostly in the &quot;process the response&quot; part. Possibly if I spent more time fiddling with better prompting strategies, etc. I&#x27;d get more from the things, but I haven&#x27;t really invested a lot of time on that front yet.
8organicbits大约 1 年前
Personally, I haven&#x27;t found them useful. They make subtle mistakes and you&#x27;ll spend longer debugging and iterating than just doing it yourself. If you&#x27;re completely stumped, asking an LLM can give you direction. But you&#x27;ll need domain knowledge to validate and fix the generated code.<p>LLMs solve the easy problem (writing code) but don&#x27;t help with the hard problem (domain knowledge).
评论 #40212253 未加载
gnabgib大约 1 年前
Did you mean to duplicate this submission? You posted your own article about it[0](2 points) and this ask HN on the same topic.<p>[0]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=40211754">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=40211754</a>
评论 #40212910 未加载
PaulHoule大约 1 年前
I evaluated the Jetbrains assistant. I was more impressed with its ability to chat about science fiction than actual programming.<p>It could do some impressive things. I was working on a codebase that used JooQ to generate SQL code. The agent did not have access to the database or SQL scripts but it could figure out what the SQL schema was by looking at the Jooq stubs.<p>I tried to use it to write a somewhat complex query that involved CTEs in Postgres, there is a chicken-and-egg element of circularity that makes these queries tricky to write. I was able to get it to write very simple JooQ queries but it never really understood the problem I had and solutions and went through quite a few cycles that weren&#x27;t right even after I&#x27;d tell it that &quot;this didn&#x27;t compile&quot;, &quot;that won&#x27;t work because...&quot; and reading a lot of polite apologizing.<p>I found it very tiresome to cut and paste code snippets, add imports, have to fix little things, have it not compile, cut and paste compilation errors, then undo all the changes. With close integration to the IDE it might be less painful to cycle through a large number of wrong answers.<p>My take is that LLMs are very strong when doing things that are basically linear operations from one end to the other end. For instance, language translation is like that, at least at the entry level, since roughly every sentence in one text corresponds to a sentence in the other language. It is like translating JooQ stubs to a SQL script: you don&#x27;t need to really understand very much, just replace one pattern with another pattern.<p>Other tasks have an element of looping which is really fundamental in computer science<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Halting_problem" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Halting_problem</a><p>I&#x27;ve found that people often get really offended when you point out that LLMs cannot repeal the fundamentals of computer science, but because they invest a finite computing budget into a problem, an LLM just can&#x27;t do anything that takes a program which might not complete. The old book<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;G%C3%B6del,_Escher,_Bach" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;G%C3%B6del,_Escher,_Bach</a><p>has a running story about a conflict between the Tortoise and Achilles who are struggling to solve a problem isomorphic to great logical paradoxes and struggle deliciously for a long time before finally understanding the impossibility of what they are doing. Many people misinterpret this book as a critique of the symbolic AI of the 1970s, but it will give you some insight into how &quot;lets just write a loop with an LLM in it&quot; will get you into problems which are just as intractable as symbolic AI seemed to be the late 1980s.
评论 #40212524 未加载