43 ms·
Testing GPT 4's code-writing capabilities with some real world problems
- yosito 4y agoOnce GPT can look at the open issues in my GitHub repos, and submit Pull Requests that legitimately solve the problems, then I'll worry that AI might be coming for my job.
- IIAOPSW 4y agoSo, how long until GPT decides it wants to automate all this tedious work and starts trying to code its own language model?
- pixl97 4y agoGPT won't even have to decide that, we'll look for ways to expand the model to self learn and tell it to do just that. Self improving AI is the goal for a lot of people. Not that this is a particularly controllable goal, nor a long term smart goal if you're human.
- it_citizen 4y agoTo be fair, in 15 years writing code, I have spent the vast majority of my time working on minor variations of problems already solved. I am not a fancy developer coming up with new algorithms. I make sign up flows, on-boarding flows, paginated lists, integrations to other apis. And I definitely feel that my job might be threatened by LLMs.
- steve_adams_86 4y agoI think our jobs are threatened not because the LLMs will be much better than us, but because dirt cheap tooling will be developed on top of them that will make things which are “good enough” and are a fraction of the price. I think outstanding software will still require well-paid, competent people orchestrating and developing a lot of complex systems for a while yet… But there’s a ton of bad software out there that will be able to be maintained for far less, and I suspect a lot of companies will be drawn to creating cookie cutter products generated by LLMs. Just as people have turned to stores and blogs generated on templated systems, I think all of that and more will continue but with even more of it handled by LLM-based tooling. I don’t think it’ll be next week, but I suspect it’ll be less than 10 years. Some people expect that’ll lead to more software existing which will inevitably require more develops to oversee, but if that’s the case, I suspect they will be paid a lot less. I also expect that once AI tools are sophisticated enough to do this, they will largely make that level of oversight redundant. Soon they could potentially patch the bugs in the software they generate by watching Sentry or something. Just automatically start trying solutions and running fuzz tests. It would be way cheaper than a human being and it would never need to stop working.
- vlovich123 4y agoWhenever these kinds of comments are made, the short story “Profession” comes to mind by Isaac Asimov. In this story people’s aptitudes are evaluated and the relevant knowledge and skills are downloaded. The protagonist of the story however keeps being rejected for download and has to struggle to acquire the same skills his peers acquire instantly and magically. It’s a great read with a fantastic ending. The morale is that it’s always better to have unique hard won skill sets that others don’t. Double down on those. Think of LLMs as freeing you to do more interesting high level tasks. Rather than having to build those menial tasks, what if you focused on your creativity getting the AI to build new types of product or gain new insights that peers aren’t considering. What if you leveraged the AI to build prototypes of ideas you wouldn’t have to otherwise? Of course that’s easier said than done. For now, take comfort in the fact that no one is seriously trusting this as anything more than a glorified autocomplete (if that).
- s__s 4y agoThe unique hard-won skills are what AI can do on the cheap. The more high-level interesting stuff is just creativity, and creativity is a universal human trait. It’s amazing but low value (monetarily). As you often hear on HN, ideas are a dime a dozen it’s all about execution. Well we’re rapidly approaching the time when the execution is essentially free, and done faster and better than humans. A small team of four, over an afternoon, can literally just speak with the computer to generate a new TV ad, or develop a new sass product. There is no longer any skill required, just imagination. The problem being of course that the skills and specialized knowledge are what people have been traditionally paid for. With all that “work” out of the way there’s not much value anyone can add . You’re probably not any smarter or creative than whoever’s manning the machine.
- vlovich123 4y agoCare to place a wager where I give your mythical unskilled team the best AI available today against me without AI and we’ll see who can solve a difficult engineering problem? Heck, even a moderately skilled team. Sorry no. AI is impressive but I’ve given it very precise prompts where I describe exactly what I want it to do because I’ve already solved it and the solution it generates is complete and utter horseshit because it requires context that’s too difficult to communicate and a deep understanding of the business and technical aspects of that business. Similarly, novel ideas are not things it knows how to implement. If you have a counter example I’d love to see it because my experience seems to line up pretty well with other reporting of where the limits of it lies - ie it can regurgitate solutions to solve problems but struggles to provide solutions and correct implementation. In fact, trying to find the problems is itself even harder sometimes because the way it solves things is simultaneously not a good coder and the approach it takes isn’t one a human would and thus it takes extra effort to figure out what path it’s trying to take and where it made a mistake. As an example. Try to get ChatGPT to implement the server-side implementation of R2’s ListObjects (or heck - in any language / platform you choose, implement that). It’ll make really bad bugs like reading in the entire dataset into memory, not applying the delimiter properly in really subtle ways etc etc. basically, it can’t even do a usable first draft. Just don’t use go because I suspect it’ll cheat and just regurgitate minio
- bawolff 4y agoTbf, most of my time as a programmer was neither spent solving old problems nor solving new problems. Most of it was spent either fiding the bug hidden somewhere in the huge code base, or trying to get the business people to be clear on what their requirements actually are.
- saurik 4y agoTo the extent to which anything that makes you take less time doing the specific tasks you are doing today (and thereby, presumably, bill fewer hours or fail to defend such a high headcount on your team) threatens your job, we might also say that better programming languages and tooling threaten your job, better error messages and documentation threaten your job, or higher levels of abstraction and higher quality frameworks threaten your job... were you also fretting about the new version of TypeScript that just came out earlier today, or did you think "wow, that makes me more effective, I can't wait to use it"? I might go so far as to argue that the entire reason software developers exist is to threaten all jobs, including our own: at our best--when we are willing to put in a bit of thought into what we are doing--we don't just make things easier to do for a moment while we are employed (which is the best of what most professions can achieve): we make things persistently and permanently easier to do again and again... forever; and we don't just make other peoples' jobs easier: this same power we have applies to our own tasks, allowing us to automate and replace ourselves so we can move on to ever more rewarding pursuits. I'm not a fan of GPT for coding for a number of reasons (at least, in its current form, which is all we can ever have a true opinion about); but, it isn't because it will replace anything I've ever done: it would have just unlocked my ability to work on better things. There are so many things I wish I could get done before I die, and I know I'm going to be able to get to almost none of it... I have so many plans for ways to improve both the world and my life that will never happen as I just don't have the capability and bandwidth to do it all. If I had a God I could ask to do all the things I already do... I can only imagine what I'd do then.
- shp0ngle 4y agoYour job is already threatened by cheap outsourcing. However, the risk with cheap outsourcing is exactly the same as with LLMs - you get what you pay for, and you need to constantly check if it's really doing what it's supposed to be doing.
- lordnacho 4y agoThis is the thing. You need to know what you're doing to know whether you got the thing you wanted. Thus it's still a tool, rather than an expert. By contrast, you don't know what your pilot or your surgeon is up to, you have to trust their decisions.
- ThreeToZero 4y agoA modified A* that solves the fire routing problem (less efficiently than OP's I think). Each A* location stores where it comes from, how long it takes to get to it, and how many fires it passed through to get there. The algorithm only considers fire cells neighbors if the current number of fires passed through is less than the current fireWillingness global. 1. count fire tiles within movement range 2. run A* from src to dst completely avoiding fire 3. if we can reach then that's the solution 4. if we can't reach, increase fireWillingness to 1, re-run A* on the board 5. keep increasing fire-willingness until the A* results don't change, or we can now reach the dst. This works because a low fire path is always better than a high fire path. And increasing fire-tolerance will only shorten the paths from src to dst.
- thethirdone 4y agoThat algorithm (implemented efficiently) is just A* using a different concept of distance. The distance specifically would be `fire*episilon + steps if steps < max else inf`
- laserbeam 4y agoIt doesn't work if you just change the distance. Having implemented similar variations of A* I agree with Tyler. You need to change more than distance to get this to work. Usually you need to change the search space and increase the number of states you go through to get the algorithm to differentiate between things you want and things you don't want to happen in your final result.
- anonymoushn 4y agoCounterexample: ...XX SF.FD ...XX S = start F = fire X = wall D = destination The cat can to the destination in 6 moves passing through 1 fire. In the fireWillingness=1 pass, the middle tile is reached after passing through fire, so the destination appears unreachable. The proposed algorithm will pass through 2 fires instead of 1.
- ThreeToZero 4y ago
- keyle 4y agoSo, for a bit of fun, I signed up to GPT-4 thingy plus and I picked a fairly common web application and built it from scratch, only by talking to GPT-4 and copy pasting the code bits. I'm actually taken back by how well it's doing; including providing me some refreshers on stuff I forgot how it should work. I can see it failing at solving complex problems, but like the blog post mentions, most programming isn't new or hard problems. This is particularly powerful when you're producing something you've done before, but in a completely different language/stack. You just guide GPT-4 towards the goal, you roughly know the methods needed to get to the end goal and just watch your assistant do all the dirty work. Looking back, I came from a world of floppy disks; I left them behind for zip disks and CDs, then portable disks and cloud storage. I also came from dialup Internet, I left it behind for ADSL then fibre. I feel this is a tangential point here too, where AI, whatever it ends up being called, will become a fulltime assistant making our lives easier; so that we can focus on the hard parts and the creative problem solving. What are we leaving behind? For me, mostly Stack Overflow and Google. You'd be silly to ignore it and palm it off. It's a big deal.
- komali2 4y agoI don't really have anyone to ask questions I get sometimes about building software, and chatGPT has been helping fill the gaps. Basically I'm thinking of it like a combination of a rubber duck and a dialogue-enabled google search. But it's been really helpful along those lines when I'm for example not sure a good way to change a bunch of stuff across a bunch of files, and am pretty sure it's something that can be automated somehow, and chat GPT will be like "have you considered using one tool to get the file names that need changing, then another tool to create an AST of the files, and then another tool to actually modify that AST?" And I'm like oh duh, yeah, I didn't know there's tools like that but I should have assumed there are, nice. Basically that's how all my usage has gone. I've had it write some elisp and it has been ok, sometimes it invents made-up functions (that don't exist in org-mode for example) but I'll just tell it that a function doesn't exist and it'll come up with some other solution, until I get it to a point where all I need to do is change a couple things. I remain highly skeptical the thing will replace me anytime soon (ever in my lifetime?) but I'm surprised at the possibilities of making my life less tedious.
- est 4y agotl;dr > Given a description of an algorithm or a description of a well known problem with plenty of existing examples on the web, yeah GPT-4 can absolutely write code. It’s mostly just assembling and remixing stuff it’s seen, but TO BE FAIR… a lot of programming is just that.
- chillfox 4y agoI don't think I have ever solved a truly new problem from scratch when programming... It's all been apply algorithm x to y problem or crud stuff. The most difficult problem that I have asked GPT-4 to solve was writing a parser for the Azure AD query language in a niche programming language and it did that just fine (I did have to copy paste some docs into the prompt).
- nitwit005 4y agoPathfinding with extra constraints isn't "a new problem" either. There are a bunch of papers on the topic, and I'm sure there are multiple different variations on github. It still didn't succeed (did get close though).
- chillfox 4y agoMaybe it could have got there with better prompting, maybe not. But by the time GPT-5 or 6 comes around it would be highly likely to be able to solve it perfectly.
- nwienert 4y agoIn before all the comments about how “most code is trivial” or “most programming is stuff that already exists” or “you’re missing the point look how it’s getting better”. I really am in awe of how much work people seem willing to do to justify this as revolutionary and programmers as infantile, and also why they do that. It’s fascinating. Thinking back to my first job out of college as a solid entry level programmer. ChatGPT couldn’t have done what I was doing on day 2. Not because it’s so hard or I’m so special. Just because programming is never just a snippet of code. Programming is an iterative process that involves a CLI, shell, many runtimes, many files, a REPL, a debugger, a lot of time figuring out a big codebase and how it all links together, and a ton of time going back and forth between designers, managers, and other programmers on your team, iterating in problems that aren’t fully clear, getting feedback, testing it across devices, realizing it feels off for reasons, and then often doing it and redoing it after testing for performance, feel, and feedback. Often it’s “spend a whole day just reading code and trying to replicate something very tricky to find” and you only produce a single tiny change deep in the code somewhere. GPT is absolutely terrible at stuff like this. And yes, often it is finding new solutions that aren’t anywhere on the internet. That’s the most valuable programming work, and a significant % of it. Feel like there’s 10 more points I could make here but I’m on my phone and don’t like wasting too much time on HN. But man, what a disappointment of critical thinking I’ve seen in this specific topic.
- derefr 4y agoHave you seen this video? https://www.youtube.com/watch?v=9QZlQMpNk-M https://www.youtube.com/watch?v=9QZlQMpNk-M I think the author is onto something – while AI might not be able to program per se, it can certainly be handed a code snippet and then use its huge corpus of Internet Learning™ to tell you things about it, code that looks like it, and ways (people on the Internet think) it might be solved better. In that sense, it isn't replacing the programmer; it's replacing IDE autocomplete.
- red75prime 4y ago> ways (people on the Internet think) It reminds me of arguments that it's not the computer that plays chess, but its programmers. You can describe a GPT's response as a statistical average of responses on the internet (for quite a contrived definition of average), but at some point it will be easier to describe it as analyzing a snippet and forming an opinion (based on what people on the Internet think). Are we past that point? I'm not sure yet, but we are close.
- modeless 4y agoI wonder if the multimodal capabilities would be helpful on easily visualized problems like this. Could it benefit from seeing the diagrams? Seems far fetched, but so did its current capabilities a few months ago.
- akamoonknight 4y agoOne thought that came to mind when the author mentioned that GPT-4 seemed to want to use A* was that maybe the problem statement was not formed in a way that would get the best response. I'm not entirely sure if this type of back and forth would be useful, but just struck me as interesting to try. I put the following prompt into ChatGPT (no GPT-4 access for me yet): *A problem statement is given as follows: An agent needs to find the best path on a 10x10 tile grid from their current location to a target location. They have a limited movement range of 5 points. Regular tiles cost 1 point to move through, water tiles cost 2 points to move through. Fire tiles cost 1 point to move through, but they should avoid pathing through them even if it means taking a longer path to their destination (provided the path is still within their limited movement range) Please point out any parts of the problem statement that require clarification.* Which returned the following response: Based on the given problem statement, some potential areas that may require clarification are: Current location and target location: It is not clear if the current location and the target location are fixed or if they change with each problem instance. If they are fixed, it should be mentioned explicitly. If they are not fixed, it should be specified how they are generated for each problem instance. Movement range: It is not specified whether the agent's movement range is circular or square. If it is circular, it means that the agent can move to any tile that is within a distance of 5 from its current location. If it is square, it means that the agent can move to any tile that is within a range of 5 tiles in both the horizontal and vertical directions. The shape of the movement range needs to be specified. Fire tiles: The problem statement mentions that the agent should avoid pathing through fire tiles even if it means taking a longer path to their destination, but it is not clear how the agent knows which tiles are fire tiles. It should be specified how the agent perceives and distinguishes fire tiles from regular tiles. Tile costs: The problem statement mentions that regular tiles cost 1 point and water tiles cost 2 points, but it is not specified what happens if the agent moves diagonally. It should be specified whether diagonal moves are allowed and how much they cost. Objective function: It is not specified how the "best path" is defined. It should be mentioned whether the objective is to find the shortest path or the path that minimizes some other cost function (e.g., total cost of the path).
- TigeriusKirk 4y agoI really like that approach of asking it what needs to be clarified. That's going straight into my GPT toolbox.
- danjc 4y agoCode is just the rendering of an algorithm. It might be best to prompt it with a high level description of an algorithm, then iteratively prompt it to refine its prior output or add more detail. Render to code should be the final step.
- FeepingCreature 4y agoYep: the biggest remaining weakness is that it's incapable of thinking deeply and iteratively. This is an architectural limitation (lack of reflectivity), but to fix it will probably usher in the singularity, so maybe we should be glad for it. I suspect if you poked GPT-4 just right (starting with a detailed design/analysis phase?) it could find a rhetorical path through the problem that resulted in a correct algorithm on the other end. The challenge is that it can't find a path like that on its own. Op: Can you get it to write your algorithm for this problem if you describe it in detail, as-is? I suspect the difficulty here is just finding a socratic part to that description, which would tend to be rare in the training material. Most online material explains what and how, not why; more importantly, it doesn't tend to explain why first.
- TylerGlaiel 4y agoI have not tried, but I suspect if I described the algorithm I have instead of the problem that it could translate the algorithm into code pretty well. But I'm also unsure of that, some experiments with GPT 3.5 I did would definitely cause it to default to a common solution (ex, A) if the description was sufficiently similar to A, or not realize that a small deviation was intended. But also like... the point here was to see if it could solve a hard problem that has a non-obvious solution. not if it can translate an english description of an algorithm into code.
- photochemsyn 4y agoThe only take-home message here is that people who claim to write 'self-documenting code' are well, let's not be hyperbolistic, but come on. No comments on that code example? Every line could have an explanatory comment, then the author could remember what they were thinking at the time and it would probably help the AI out too. > "People who claim code can document itself considered harmful"
- TylerGlaiel 4y agochill, I'm the only programmer on the project, and I don't have any problems understanding what the code is doing (only lost track of some of the "why", the process that led me there. which was only relevant here because I was trying to recreate that process with ChatGPT). The original algorithm involved a ton of trial and error from my end, so the "why" is really just "I tried a bunch of permutations of this and ended up with this as the version that worked".
- sinuhe69 4y agoSo it continues to reaffirm what we’ve known: generative LLM does not have a model of the world, can not reason and can not plan. It generates text by mix-matching remembered texts and thus it can not generate truly new content. No surprise because GPT-4 is built upon the same model as GPT-3. Clever Engineering will bring us far, but breakthrough requires change of the fundamentals. Nevertheless, it’s useful and can helps us solve problems when we guide it and split the work into many smaller subunits.
- sinuhe69 4y agoI copied the opinion of Yann LeCun, one of the authorities on deep learning: (Feb 13,2023) My unwavering opinion on current (auto-regressive) LLMs 1. They are useful as writing aids. 2. They are "reactive" & don't plan nor reason. 3. They make stuff up or retrieve stuff approximately. 4. That can be mitigated but not fixed by human feedback. 5. Better systems will come. 6. Current LLMs should be used as writing aids, not much more. 7. Marrying them with tools such as search engines is highly non trivial. 8. There will be better systems that are factual, non toxic, and controllable. They just won't be auto-regressive LLMs. 9. have been consistent with the above while defending Galactica as a scientific writing aid. 10. Warning folks that AR-LLMs make stuff up and should not be used to get factual advice. 11. Warning that only a small superficial portion of human knowledge can ever be captured by LLMs. 12. Being clear that better system will be appearing, but they will be based on different principles. They will not be auto-regressive LLMs. 13. Why do LLMs appear much better at generating code than generating general text? Because, unlike the real world, the universe that a program manipulates (the state of the variables) is limited, discrete, deterministic, and fully observable. The real world is none of that. 14. Unlike what the most acerbic critics of Galactica have claimed - LLMs are being used as writing aids. - They will not destroy the fabric of society by causing the mindless masses to believe their made-up nonsense. - People will use them for what they are helpful with.
- dvt 4y agoFantastic comment, saving this. It's clear that for AI to be AI, it needs what philosophers of language call a Knowledge Base and a few intrinsic axiomatic presuppositions that, no matter what happens, cannot be broken (kind of like the Pauli exclusion principle in real life).
- scg 4y agoAs a human programmer I didn't quite understand the problem statement until I read the whole article and the tests. I believe the goal is to find a path with the fewest possible "fire" cells and the minimum cost as a tie breaker. The cost of a path is the sum of its cells' cost and it can't be greater than 5. If I understood the assignment correctly, I don't think the problem statement is equivalent to what's included in the prompt. Specifically, the prompt doesn't clarify what happens if you have to cross through multiple "fire" cells. > Fire tiles cost 1 point to move through, but they should avoid pathing through them even if it means taking a longer path to their destination (provided the path is still within their limited movement range)
- kenjackson 4y agoI agree. That description of the problem was horrible. Maybe ChatGPT could write a better description and then people could code up the algorithm.
- deleted 4y ago[deleted]
- syntheweave 4y agoThe problem is, indeed, that Mr. Glaiel did not know the category of problem he was dealing with. A correct statement would be: "Given a solution set containing both the shortest path through fire and the shortest path avoiding fire, select the solution that fits within six tiles of movement, preferring the solution that avoids fire where possible." It's a constraint optimization problem in disguise: generate a solution set, then filter and rank the set to return a canonical result. That describes most of the interesting problems in gameplay code: collision and physics can use that framing, and so can most things called "AI". They just all have been optimized to the point of obscuring the general case, so when a gamedev first encounters each they seem like unrelated things. The specific reason why it seems confusing in this case is because while pathfinding algorithms are also a form of constraint optimization, they address the problem with iterative node exploration rather than brute forcing all solutions. And you can, if you are really enterprising, devise a way of beefing up A* to first explore one solution, then backtracking to try the other. And it might be a bit faster, but you are really working for the paycheck that day when the obvious thing is to run the basic A* algorithm twice with different configuration steps. You explore some redundant nodes, but you do it with less code.
- tehsauce 4y agoThis is one of the best analyses of gpt4 Ive read so far. Besides potentially including the visual aspect, I wonder if part of the reason it has trouble with harder problems is that it’s been tuned/prompted in a suboptimal way. The advertised used case mostly is “write down the solution for this problem”, but for novel problems it does much better when it’s given the chance to reason through it before trying to write down a solution. I wonder how much better it would do with a prompt like “try to work out a way to solve this problem, and then validate it to be sure if it’s a correct solution.”
- ChatGTP 4y agoSo what is a software company going to do when people can use their own products to replace them ? It's a slippery slope for M$. If ChatGPT 15 can just build MS Outlook from looking at photos of the UI, design a hololens, or tell us the secrets of how their Chat bots work, not sure how much future they're going to have as a company? What I can see being the new thing is "innovation". People building useful solutions that the LLMs don't yet know about.
- deleted 4y ago[deleted]
- peterisza 4y agoI skipped the article and only read the prompt. I have no idea what to do with fire. Why does it matter what it costs if you must avoid it?
- closetnerd 4y agoWhat's most astounding is that it was expected to work when so much of the prompt just doesn't make sense: > Objects should only move if they will end up on an empty tile after their move > "An object is free to move onto a tile that another object moves onto if that other object is moving off of its tile"
- wbeckler 4y agoIf the issue was the prompt, I expect someone will prompt it with a better wording of the problem and get a decent algorithm, and post it in this conversation. Let's see what happens...
- hammyhavoc 4y agoRepeat the experiment in a better way and blog about it then rather than negging in the comments. I'm not the author, but I'll await your peer review.
- closetnerd 4y agoIn the post, author says that the GPT-3 version it apparently worked well. Which is really is amazing to me. The prompts really read in a way where I wouldn't have expected the "correct" output.
- joshka 4y agoI'm not sure that the commenter was negging here but instead showing that the language used in the prompt was imprecise (in a similar way that we might get system requirements in reality). The takeaway I got was more that the commenter was showing surprise at how well that ambiguity was resolved regardless. A more interesting experiment to run might be to intentionally reduce the precision of the task e.g. something In a 10x10 arena, work out if there is a path shorter than 5 steps from one start to finish with water tiles taking two steps and avoiding as many fire tiles as possible. But you can go even better than that really. The author jumps down to a more code oriented description too soon (10x10, etc.) but ChatGPT (3.5) does ok with just the original problem (I removed the text about A* and Djikstra's from the english version of the problem statement: PROMPT: In Mewgenics, movement abilities use pathfinding to get the cat from his origin to his destination. Cats have a maximum movement range stat and tiles have a cost (in this case its 1 for basic tiles and 9999 for blocking obstacles). We also have water tiles that cost 2 to path through. The complication comes in when we add Fire (and other hazard type tiles) into the mix. Fire tiles don’t cost extra to pathfind through like water tiles do, however a cat really wants to avoid pathing through the fire tile if it can. If there’s a lot of fire tiles it should go through the least number of them it can. ANSWER: To solve this problem, you can modify the pathfinding algorithm to take into account the hazard tiles, such as fire. One way to achieve this is by using a modified A* algorithm. First, assign a high cost to hazard tiles such as fire. This cost should be higher than the cost of regular tiles, but lower than the cost of blocking obstacles. For example, you can assign a cost of 5 to fire tiles. Next, modify the heuristic function used in the A* algorithm to take into account the distance from the hazard tiles. For example, you can modify the Euclidean distance heuristic to add an extra term that takes into account the distance from the closest hazard tile. The closer the cat is to a hazard tile, the higher the heuristic value should be. Finally, when selecting the next tile to visit, prioritize tiles with the lowest total cost (including both the movement cost and the heuristic cost), but also consider the number of hazard tiles that the cat would need to pass through to reach that tile. You can add an extra penalty term to the total cost that increases based on the number of hazard tiles the cat would need to pass through to reach the tile. This penalty term should be high enough to discourage the cat from pathing through too many hazard tiles. With these modifications, the cat should be able to find the shortest path to its destination while avoiding hazard tiles as much as possible.
- jsemrau 4y agoGPT3 worked well for me with smaller programming tasks. I.e, helper functions, api calls, etc In those cases it was easier to type : Write a javascript function that does X It totally failed for me creating a nice looking website using bootstrap. While GPT3 created a workable outline, it never looked right and the css adjustments never worked.
- qlm 4y agoI had a similar experience earlier. Described a problem that isn't even that hard - very similar to something there are probably lots of examples of online but subtly different. I wanted to see if handled these subtly different requirements. It failed miserably, even with repeated instructions. It just assumed I wanted the more common problem. Every time I pointed out the problem it would say "sorry for the confusion, I've fixed it now" and give me back identical code. I even asked it to talk me through test cases. It identified that its own code didn't pass the test cases but then still gave me back identical code. I eventually gave up.
- travisjungroth 4y agoI’ve found persistence is not a good strategy with GPT. Put effort into your prompt, maybe try clarifying once, and if it doesn’t work, do not keep trying. It will get closer to the solution at a diminishing rate, just enough to tease you along, never getting there.
- jrumbut 4y agoIt has failed every meaningful programming challenge I've given it (to be fair, I only ask when I've got something difficult in front of me). I do wonder if part of it is that my prompts are made worse because I have a partial solution in mind.
- theshrike79 4y agoI just used GPT-4 yesterday to write a Go-parser for a specific JSON input. Within two prompts it could read the JSON data from a stdin stream, unmarshal it to Go structs and print the correct fields to stdout as a human-readable line of text. Then I told it to colour the timestamp and id fields using the fatih/color -package, and it did it correctly. In total it took me about 4-5 prompts to get where I wanted. I just needed to fine-tune the printing to stdout part a bit to get it just how I liked, but it saved me a ton of boring template code writing and iteration. I could've done it easily myself, but there were a few fiddly bits that would've required me to look up the documentation to check the exact way to do things. GPT4 had it correct from the start. Then I asked it to write unit tests for the code, and it confidently started writing correct-looking code that would take the same input and expect the correct output, but just stopped in the middle. Three times. I stopped trying. And another case: I tried to use GPT-3.5 to write me a program that would live-tail JSON-logs from Sumo Logic and pretty-print them to stdout. It confidently typed out completely correct code with API endpoints and all. ...except the endpoints didn't exist anymore, Sumo Logic in their great wisdom had removed them completely. The only solution is to use their 5 year old binary-only livetail executable. GPT4 with the same input gave me a shell-script that starts a search job with the correct parameters and polls the endpoint that returns the result when it's done. The speed at which this is developing is really fascinating, I'm not really afraid for my job but I do love how this will automate (some of) the boring stuff away a bit like GitHub CoPilot did, but better.
- pixl97 4y ago>Then I asked it to write unit tests for the code, and it confidently started writing correct-looking code that would take the same input and expect the correct output, but just stopped in the middle. One of two things. First ask it to continue. Sometimes it just stops half way thru code foe whatever reason. The other possibility is you filled up the token context window. Not much you can do but wait for the 32k model.
- theshrike79 4y agoI asked it to continue twice after the first failure. Every time it failed in about the same point. Might've filled up some mysterious limit in the model. I didn't really need the unit tests anyway, but I wanted to try if it could do it :)
- bobek 4y ago> The useful thing to do would be to just say “I do not know of an algorithm that does this.” But instead it’s overcompetent in its own capabilities, and just makes shit up. I had recently very similar reaction. And then realized, that this is exactly same behavior as with many of my colleagues at work...
- laserbeam 4y agoActually, if the state A* searches through is not "tile reached" but "tile reached + count of fires on path", then it just becomes regular A*. This solves the A to C doesn't always go through B, because it turns B into multiple distinct states, some with fires, one without. There are a few issues with this. Search state is bigger (performance goes down), might not scale if other search features are needed in the game, you might need to be smart about when you stop the search and how you write your heuristic to not have to reach all combinations of fire counts before you end your search... But the trick to "just use A*" is not in modifying the cost, but changing the search space. PS. I see no reason why you should change your current code, obviously. PPS. I don't think GPT could come up with that insight. It sure didn't in your case.
- laserbeam 4y agoDid another pass through the article, and checked your code and GPT's code. The fun thing is you DID have similar insights, of changing the search space (including desire and bends in the cell). GPT never bothered to try (at least in the samples you provided).
- braingenious 4y agoI tried out gpt4 today with the task of “take some html files made by a non technical person using various versions of microsoft word over a decade ago and put the contents into a csv” and it hasn’t done great. Not terrible, but not great. That being said, I don’t know anybody talented enough to handle it that would even look at this project for $20 so ¯\_(ツ)_/¯
- danielbln 4y agoAn alternative path would be to tell it to write python (or $LANG) code that can parse these HTML files and output the right CSVs.
- braingenious 4y agoThat’s what I’m doing! I found myself amazed by the sheer terribleness of the html that Microsoft Word output. I managed to get it to write a script to clean up the files last night, but it took a surprising amount of finessing to avoid the myriad footguns involved in dealing with this godawful format.
- chrismsimpson 4y agoPrediction based on statistical probabilities != comprehension. So no.
- eggsmediumrare 4y agoIf the outcome is the same, does it matter?
- chrismsimpson 4y agoHave you heard of the halting problem? For one, you’ll never be able prove the outcome is the same.
- quonn 4y agoIn general. This does not mean that it could not be proven for most or even all relevant cases.
- halflife 4y agoI had the exact same experience. Writing code for existing popular problems is phenomenal. But when you diverge slightly, it breaks down. I asked it to write a regex which finds all html tags that has a specific class name, but does not contain another specific class name. I assume this problem has been tackled many times by scores of developers. It had outputted an excellent regex. I asked it to ignore texts in inline script (such as event handlers), and it presented an invalid regex. I tried to point out the problem but it just went into a loop of bad regex code.
- _nalply 4y agoI think what GPT-4 is missing: a feedback loop. Imagine you were GPT-4 and being asked to write a small program, but you can't try it out yourself.
- chapliboy 4y agoThe job of a programmer, in a business context especially, is to take real-world requirements, and convert them into clearly defined systems where they can be solved / reasoned with. I once had a manager telling me what needed to be done. Even with an actual person (me) in the loop, the code produced would often have glaring differences from what he wanted. By its very nature, code requires a lot of assumptions. In any business context, a lot of things are implicitly or explicitly assumed. If you need a computer, or another person to give you exactly what you desire, you need to be able to spot the assumptions that are required to be made, and then clearly state them. And after a point, that's just programming again. So this, or some other AI, is more likely to replace JS and python, or create another level of abstraction away from systems programming. But programmers will still always be required to guide and instruct it.
- deleted 4y ago[deleted]
- theK 4y agoI think this article is a great example of the one key shortcoming that Ai based code generation has. Even a seasoned developer will fail to describe the intricate details and context of what they are trying to do. Non developers constantly fall flat on their face on this and rely on devs to “keep the edge cases in mind” etc.
- bawolff 4y agoI feel like gpt is basically just stack overflow on steriods. With all the pros and cons that entails.
- graboid 4y agoYesterday evening I thought it would be fun to try to do a Raycaster in Javascript with the help of GPT-4. Experience was mixed. 1. Basic rendering logic was a breeze. I barely had to change anything, just copy paste, and I have a map with walls that were darker the further away they were, using textures, and basic movement using arrow keys. For an inexperienced graphics programmer like me probably saved hours getting to that point. 2. I asked it to add a minimap. Did not work perfectly at the first try, but after a few minutes of exchanging messages, it worked and looked okay. 3. I asked for an FPS display. Worked on first try. 4. Now I asked for a solution to render walls of different heights. Here I had to correct it a few times, or suggest a different approach, but it got it working halfway correct (but not very performant). Definitely took way longer than steps 1 to 3 combined (30+ minutes). 5. I asked for floor rendering (often called "floorcasting"). Here it completely failed. The code it suggested often looked like it might be the right approach, but never really worked. And the longer we exchanged messages (mostly me giving feedback whether the code worked or suggesting possible fixes), the more it seemed to hallucinate: very often variables suddenly appeared that were defined nowhere or in a different scope. At that point, it became increasingly frustrating for me, and I often closed the chat and "reset", by posting my complete working code, and again prompting for a solution to the floor rendering. Still, until I went to bed, it did not produce any working solution. In retrospect, it would probably have been faster to read a tutorial how the floorcasting should work, and implement it myself like a caveman, but that was not what I was aiming for. It was definitely fun, and I can clearly see the potential time-savings. But maybe I have to learn when to recognize it won't bring me past a certain point, and I will save time and nerves if I switch to "manual control".
- neom 4y agoI came up in the 90s, used a lot of dreamweaver to build sites, all my friends thought I was a wizard because I had a website and that required you to program interweb stuff. Then the net became pretty complex, I gave up around dhtml but always really appreciated and loved what folks could do with the DOM. I've been thinking a lot recently that GPT might allow me to build again, I have some of that 90s dreamweaver vibes using it.
- Kareem71 4y agoProblem is reading someone else's old code takes an order of magnitude longer than writing new code
- copperx 4y agoLLMs can explain code fairly accurately.
- Faint 4y agoRemember that these models generate one token at a time. They do not "think ahead" much more than maybe a few tokens in beam search. So if the problem requires search - actual comparison of approaches, and going back-and-forth between draft and thinking through the implications - the model can't do it (except in a limited sense, if you prompt it to give it's "train of thought"). So it's comparable of you being in front of whiteboard, hit with a question, and you would have to start answering immediately without thinking more than you can while talking through your answer at the same time. Doable if you know the material well. If it's a new problem, that approach is doomed. Given that, I think the language models do remarkably well. A little bit of search, and maybe trying to generate the answer in different order (like short draft -> more detailed draft -> more detailed draft... etc.) will improve things a lot.
- yawnxyz 4y agoAs a designer/non-coder, it feels like I'm just pair programming all the time. Stuff that usually took me a long time like regexes or Excel/Sheets formulas now take like two minutes. AND I'm learning how they work in the process. I can actually write regexes now that used to be wildly confusing to me a couple of months ago, because Copilot / ChatGPT is walking through the process, making mistakes, and me prodding it along. I feel like it doesn't matter how "mindblowing" or "a big deal" this tool is — it's a great learning tool for me and helps me do my work 100x faster.
- IshKebab 4y agoI don't feel like it's any faster for things I'm not really already familiar with. For instance I asked it to write me a Makefile. It wrote one. It looked plausible but I don't know enough about Make to know. So I had to do loads of reading about Make just to verify that the AI answer was correct. Basically the same amount as just learning anyway.
- maxdoop 4y agoIt seems so many of you guys are extremely lucky to be working on novel problems require elegant new solutions each day. That must be the case, otherwise I don’t understand these comments shrugging off GPT-n capabilities around coding. “Psh, it’s just doing stuff it saw from its training data. It’s not thinking. It can’t make anything new.” In my 11 years as a professional software engineer (that is, being paid by companies to write software), I don’t think I’ve once had come up with a truly original solution to any problem. It’s CRUD; or it’s an API mapping some input data to a desired output; or it’s configuring some infra and then integrating different systems. It’s debugging given some exception message within a given context; or it’s taking some flow diagram and converting it to working code. These are all things I do most days (and get paid quite well to do it). And GPT-4 is able to do that all quite well. Even likely the flow diagrams, given it’s multi-modal abilities (sure, the image analysis might be subpar right now but what about in a few years?) I’m not acutely worried by any means, as much of the output from the current LLMs is dependent on the quality of prompts you give it. And my prompts really only work well because I have deeper knowledge of what I need, what language to use, and how to describe my problem. But good god the scoffing (maybe it’s hopium?) is getting ridiculous.
- deleted 4y ago[deleted]
- marcyb5st 4y agoTo be honest, I am using ChatGPT and now GPT4 as tools to speed up my workflow. Writing tests, writing boilerplate, parsing logic for deeply nested and messy JSON. Most of the times it gets things quite well, and if you provide context in the form of other source code, it's really good, even at using classes or functions that you provide and hence are novel to it. The hard logic bits imho (something elegant, maintainable, ...) Are still up to you.
- GalahiSimtam 4y agoNo need to be sarcastic when ChatGPT-4 has issues using APIs, I mean software library interfaces
- lxe 4y agoIt is far from being able to solve difficult or even annoyingly complicated problems that programmers solve on a regular basis just by a one-shot prompt. Ask it to parse a PDF document and separate it into paragraphs, for example. The first solution isn't gonna work well, and by the time you get to solving yet another quirk while it apologizes to you making a mistake, it will lose context. Best way to use this tool is to ask it short and precise questions that deal with a small piece of code.
- Hedepig 4y agoIt brings to my mind the levels of self driving We're definitely at 2 right now, and picking away at level 3. I have heard some people skeptical that we can overcome the problems of truthfulness due to the inherent limitations of LLMs. But, at least on the face of it, it appears we can make incremental improvements. If only they would actually be OpenAI I have seen
- ChatGTP 4y agoTrue "Open AI" is coming, there's no way this is going to stay Microsoft alone for very long. Many, many companies will be looking to integrate with this thing and no one is going to juts sit three and let MS take their lunch forever.
- hackerlight 4y agoTry again with chain-of-thought prompting?
- bob1029 4y agoYes. I only need it to write 50-100 lines at a time to be incredibly effective. My productivity this month has been insane. I'm still writing most of the code the old fashioned way, but the confidence of having this kind of tool makes it a lot easier to push through boring/tricky items.
- bsaul 4y agothere's a bit of confusion when people say it's not going replace programmers because they all have tricky things to do in their work week. This is not how it's going to happen : if your boring time-consuming tasks take virtually 0 time thanks to gpt, and let you focus on the 1% that's hard, you've suddenly become 100x more efficient, and can thus accomplish the same job as 100 you. That means the company can now fire 99 coworkers, keeping only you, and end up with the same result.
- akmarinov 4y agoBut then competitor company B will keep its 100 devs and be that much more productive than your company, running you into the ground.
- dragonwriter 4y ago> if your boring time-consuming tasks take virtually 0 time thanks to gpt, and let you focus on the 1% that’s hard, you’ve suddenly become 100x more efficient, and can thus accomplish the same job as 100 you. That means the company can now fire 99 coworkers, keeping only you, and end up with the same result. But it means that tasks where building software would only deliver 1% of the necessary value to pay for the cost of doing it are now suddenly worth paying for, so even if your company, being a stick-in-the-mud non-innovator that is going to stay in exactly the same niche doing the same thing cut 99% of its programming staff and used the cost savings on executive bonuses and stock buybacks, a whole lot of customers (and the new and pivoting companies serving them) are going to be spending money on programmers that weren’t before, so not only will your ex-coworkers still be employed more programmers in total will be, even if their work is now mostly higher-level abstraction and wrangling LLM code generators, with the level we think of as “source code” today being touched as rarely as today’s high-level application developers touch machine code.
- tomduncalf 4y agoI didn’t have much luck with ChatGPT trying to solve a novel problem (sorry can’t share details), it gave answers that kind of sounded plausible if you didn’t really understand the problem but in reality were no help. It also hallucinated a bunch of research papers that sounded really useful haha. Will have to try GPT-4 for the same thing and see if it’s any better, I suspect though that this kind of genuinely novel problem solving may be beyond its current abilities (unless you work through to step by step in a very granular way, at which point you’re solving the problem and it’s writing the code - which could be a glimpse of the future!)
- jah242 4y agoWhilst maybe GPT-4 will change this, I think it is important to remember that these general ChatBots are not the way we have generally trained LLMs to write the best code. In fact, coding is one of the few areas where training specifically just using source code and maybe some stack overflow (not all natural language on the internet) leads to better results on the previous iteration of LLMs (GPT-3 wave). So the real test will be whether the GPT-4 wave of specific coding LLMs i.e GPT-4-Codex can 'actually write code' see: AlphaCode Codex CodeGen
- fancyfredbot 4y agoA great article with a practical example of a programmer using GPT to solve a problem it hasn't seen in its training data. It gives plausible but incorrect answers and the user isn't able to prompt it to correct them. It seems likely that a understanding of when NOT to use an LLM is a new skill programmers are going to want to learn in order to use their time efficiently.
- altitudinous 4y agoBlah Blah Blah. I use ChatGPT for this every day to write code to save my own efforts and it is doing just fine thanks. I also use it for creative content in my apps, although I edit this work to get the tone in its writing correct. It is excellent for this.
- naillo 4y agoThe biggest thing here is that it's semi capable and improving. I feel safe about my job right now but it is worrying to invest time to compete with a machine that will continue to get better over the years where previously I felt safe that the effort of my labour would bear fruit for decades to come. Now I'm not so sure.
- interdrift 4y agoSame here, but it was fun tho but I certainly feel like I'm no longer on top of the food chain
- eggsmediumrare 4y agoThis is what most people making "I'm not worried" arguments don't understand. Right now, it makes you way more productive. Even if its capabilities stalled right there, it will over time reduce the value of your labour. But it won't stall.
- capableweb 4y agoPersonally, I found GPT-4 to be helpful when writing code for games. But I'm a web programmer trying to learn game development, I'm no professional game developer by any measure. And I'm using Rust and Bevy, for what it's worth. So it might not be as helpful for someone like Tyler who actually know what they are doing, similarly for me if I were to use it for web development. The most helpful thing with GPT-4 have been getting help with math heavy stuff I don't really grok, and that I can try to compile the code, get an error and instruct GPT-4 that the code didn't work, here is the error, please fix it. Other things it been helpful for is applying the "Socratic method" for helping me understand concepts I don't really grok, like Quaternions. Then, knowing GPT-4 isn't perfect, I always verify the information it tells me, but it gives me great starting points for my research. Here a conversation I had lately with GPT-4 in order to write a function that generates a 2D terrain with Perlin Noise: https://pastebin.com/eDZWyJeL https://pastebin.com/eDZWyJeL Summary: - Write me a 2D terrain generator - Me reminding GPT-4 it should be 1D instead of 2D (I used the wrong wording, confusing a 1D vector with 2D) - Code had issues with returning only values with 0.0 - GPT-4 helping me tracking down the issue, where I used the `scale` argument wrong - Got a working version, but unhappy with unrealistic results, I asked it to modify the function - Finally got a version I was happy with
- davbryn 4y agoI'm more intrigued why the author finds this a difficult problem for the needs of their game. It looks like their search space is at most a 10 X 10 grid for the most part (I'm assuming based on asset since and detail it doesn't grow too much larger). I know it isn't relevant to the Chat-GTP code writing discussion, but A*, Dijkstra and heuristics to move an entity around 8 spaces could raise the question "Can the developer be more pragmatic?".
- DeathArrow 4y agoI think AI will never write good code but can be very useful for very basic stuff, boiler plate or repetitive stuff, like a smart IntelliCode. In fact, I think MS built some AI in IntelliCode but not advanced stuff so they can sell GitHub Copilot.
- danwee 4y agoI want to see GPT-4 dealing with this situation: - they: we need a new basic POST endpoint - us: cool, what does the api contract look like? URL? Query params? Payload? Response? Status code? - they: Not sure. Third-party company XXQ will let you know the details. They will be the ones calling this new endpoint. But in essence it should be very simple: just grab whatever they pass and save it in our db - us: ok, cool. Let me get in contact with them - ... one week later... - company XXQ: we got this contract here: <contract_json> - us: thanks! We'll work on this - ... 2 days later... - us: umm, there's something not specified in <contract_json>. What about this part here that says that... - ... 2 days later... - company XXQ: ah sure, sorry we missed that part. It's like this... - ...and so on... Basically, 99% of the effort is NOT WRITING CODE. It's all about communication with people, and problem solving. If we use GPT-X in our company, it will help us with 1% of our workload. So, I couldn't care less about it.
- anileated 4y agoWhy aren’t you thinking rather that instead of talking to you, “they” would already be talking to the LLM (likely trained on your code, among other data)—while you get 0 total billable workload in the first place?
- slfnflctd 4y agoMy intuition here is that it's because people don't always say what they mean, or know how to describe what they want. I've been working on a database migration recently, and I look forward to the rare moments when I get to write queries and analyze actual data. The vast majority of my billable hours are spent trying to tease out the client's needs by going over the same ground multiple times, because their answers keep changing and are often unclear. It takes a lot of processing to figure out an implementation for someone who will straight up describe their requirements incorrectly. Especially when a higher-ranking person comes back from vacation and says "no, everything you nailed down in the last two weeks is completely wrong". I don't think any of the current LLMs are going to handle these types of very common situations better than an experienced human any time soon. It's like that last 1% of self driving which may actually require AGI. No one can say for sure because it's not cracked yet. I think most of us will continue to have job security for quite a while.
- phkahler 4y agoI'll be impressed when they can debug existing code.
- iandanforth 4y agoThe second overlapping crescent moon solution the GPT provides is really interesting. If it was hard to find a counter example I wonder if there is a restricted case for the radius of the inner circles for which the proposed algorithm is true. I don't have the maths to determine this myself but would love to hear speculation from others.
- nathias 4y agoof couse it can write code, but it can't do software development
- davewritescode 4y agoI think most folks (perhaps not here) misunderstand is that writing code is the easiest part of a software engineering job. Anyone can write code in their little piece of the system, write some tests to prove it works and move on. Given enough time I feel most good software engineers can do that part of the job without issue. Knowing how code might fail and preventing cascading effects, tuning resource usage, troubleshooting incidents are the actual hard parts of software development and it's where even good software engineers tend to fall over. We've created whole specialties like SRE to pickup where application developers fall short. I've seen lots of systems fail for the dumbest reasons. Thread pools misconfigured, connection timeouts with poor configuration, database connection pools are completely incorrect. Wake me up when ChatGPT can troubleshoot at 1 AM when the SRE and on call engineer are both frantically trying to figure out why logs are clean but the service is missing it's SLO.
- the_af 4y agoThe first problem statement that GPT got wrong actually shows a problem with human language. "Avoid fire" means "do not ever go through fire" to me (and GPT thinks the same, apparently). The author thought it meant "avoid fire if you can, but go through it if there's no other way". This was a problem with informal requirements that could have happened in an entirely human context.
- wantsanagent 4y agoI find adding 'before you answer, ask clarifying questions' to a prompt is quite helpful in avoiding these traps.
- sgarland 4y agoThere are plenty of edge cases where it fails. However, the one thing that made me think it actually knows (for certain definitions of the word "knows") what it's doing was asking it to re-write a non-trivial SQL query into equivalent relational algebra. I created a simplified schema from Northwind [0], gave it the CREATE TABLE statements for tables, and then some sort-of-TSV files for the values. It was able to not only produce reasonable outputs from various queries, but also to produce valid relational algebra for them. To me, that shows a fairly deep level of understanding of the underlying concepts. [0]: https://en.wikiversity.org/wiki/Database_Examples/Northwind https://en.wikiversity.org/wiki/Database_Examples/Northwind
- lionkor 4y agoCould you share the results?
- sgarland 4y agoHere's a gist [0]. You can see that it made a couple of minor semantic mistakes, which it corrected. It also regressed a bit at the end, but it _was_ able to correctly parse the (admittedly simple) math in a WHERE predicate and return a partially valid tuple, with respect to pricing. [0]: https://gist.github.com/stephanGarland/ed18f8f8fdc63a0b997f9df4aa88cc6e https://gist.github.com/stephanGarland/ed18f8f8fdc63a0b997f9...
- jmull 4y agoIt's not just edge cases where it fails. It fails all the time at all kinds of things. I've been using chatgpt in my work, but I have to essentially know the answer it's going to give me because I have to catch all of its mistakes. It really, really nice for certain kinds of drudge work. Using northwind is probably not a good thing to use to evaluate chatgpt's general capability. It is very commonly used for examples of almost anything database-related, which means it's extremely well represented in chatgpt's training data. Chatgpt probably doesn't need to generalize or understand much of anything about northwind to answer your questions in terms of it. You need to try it on wacky problems specific to you.
- iambateman 4y agoThe replies here are defensive and I think misguided. Yes, a programming job doesn’t solely require typing code. But the reason we have well-paid programming jobs is because there is a specialized skillset required to understand a body of syntax that takes several years to really grasp. The difference is that writing a well-formed prompt is massively easier to teach than writing the code itself, for similar results. That’s not to say prompt writing requires no skill - it will certainly need understanding of systems and the scope of what is possible within a language. Asking GPT-4 to write a jQuery plug-in that generates an original Bob Dylan song will probably just not work. But it is wildly easier to teach someone what is possible with JavasScript and let them spend a month watching someone prompt the system and let them go from there.
- danparsonson 4y agoThe most challenging part of software development (and the reason we have well-paying jobs) is not understanding syntax, it's analysing and abstracting a problem domain into a set of cleanly separated modules that interact to solve those problems. That being the case then, actually none of us is getting replaced by GPT-n any time soon - 'prompt engineering' will just become the new Javascript, only more abstract; just another tool in the toolbox. Hopefully :-)
- gumballindie 4y agoCorrect. But once everyone has that tool in their toolbox everyone will become more productive, meaning skills scarcity will be greatly reduced. In turn that will lead to massive wage depression.
- danparsonson 4y agoYou mean such as when high level languages became mainstream and we no longer needed to code in assembly language? Or when IDEs became widely available? The underlying design skills are still difficult to acquire and not displaced by new tools - that is at least until SoftwareArchitectGPT comes along...
- yanis_t 4y agoI find it interesting that many people took a defensive position towards AI. For many the discurs seems to be "will this AI thing eventually replace me and kick out of me job". For me it's more like will that AI thing make me a 10x developer? And the answer I'm leaning for is yes. I use copilot which saves me time googling and reading stackoverflow. I use chatgpt for writing tests to my code (which I hate to do myself). Sometimes I use it to ping-pong ideas, and eventually set on a good solution to a problem. It saves me tons of time I use to complete other tasks (or spend with my family).
- itsaquicknote 4y agoYep. I wanna dial back to being a 0.2 programmer thanks. GPT can fill in the rest. I'll be hanging outside with my kids.
- yanis_t 4y agoHere's another view. If you're a music composer, you hear the music in your head. But in order to get it out, you need to play and record musical instruments, learn to sign, learn to produce, etc. What if you had a device that takes music from your brain and gives you an mp3 file? That's what I think AI is doing for developers here.
- blagie 4y agoOff topic: This problem was fun. I would really enjoy a site with a pile of nonstandard, fun, and interesting problems like this one. Coming up with a working algorithm took about 30 seconds (I got lucky, not brilliant), but it stretched my brain in an interesting way. That's different from practice sites like leetcode, which have pretty cookie cutter problems. On problems like this one, sometimes: - I get it in a few seconds, like this case - Get it in a few minutes - Get it in a few hours - Give up and look up the solution A fun problem a day would be, well, fun.
- adverbly 4y agoI think having a better understanding about the underlying statistical model of how these AIs are trained is helping me keep back the wave of fear and anxiety associated with AI risks. The singularity requires AIs to be very good at doing things people have not done before. But this form of machine learning is bad at that. It is like someone who doesn't actually understand anything has somehow managed to memorize their way through whatever topic you're asking about. They have lots of tips and information about things, similar to what you might currently find by doing research. But they don't seem to have what is required to push the boundaries of knowledge for understanding, because they don't actually really have it in the first place. Or maybe what they have is just very minimal when compared to the contribution of their memorization. Obviously you still have the main risks of breaking capitalism, mass unemployment, pollution of public communications, etc. But honestly, I think each of these are far less scary to me than the existential risk of superintelligence. So in a way I'm actually happy this is happening the way it is right now, and we don't have to deal with both of these risks at the same time. Our current approach is probably the safest way to progress AI that I can think of: it requires a new model to improve, and it's learning entirely from human data. It might not seem like it, but this is actually pretty slow, expensive, and limited compared to how I expected AI to improve given Sci fi movies or Nick Bostrom's writings(curious what he'd have to say about this resurgence of AI)
- uhtred 4y agoI was thinking last night about how my job as a pretty average software engineer is probably going to be taken by GPT* in less than 5 years, and how skilled blue collar jobs like electricians and plumbers and carpenters are probably much safer, since robotics is way behind AI.
- gumballindie 4y agoYou are not far from the truth to be fair. Software development as a career is bound to regress ai or not anyway. The goal is likely to turn it into manufacturing, and to adjust costs accordingly.
- haolez 4y agoJust imagine if these models fall in love with languages like APL/K/J. Even with the context windows, they will be able to do tons of work.
- mik1998 4y agoAs expected, LLMs don't actually think. This is not really a surprising result when you understand that it's a few billion Markov chains in a trenchcoat.
- LeanderK 4y agotraining ML model to code is a very interesting challenge. I am surprised by GPTs ability to code, given that it, as I understood it, has basically no tools at the ready. I am convinced that it is way harder to code without debugging and other interactive features both for a human and for a machine. Keep in mind that GPT could not have learned to simulate the code internally given its fixed runtime. I think ML models need to learn how to interact with our tools (compiler, debugger etc.) to really be effective at coding. That's hard.
- sequoia 4y agoI had a teacher with a sign on her door that read: Technology will not replace teachers But teachers who use technology will replace those who don't s/teachers/programmers/ and s/technology/AI/ and this sounds about right. It may become typical or even required to leverage AI to write code more efficiently.
- sequoia 4y agoOne other question: can GPT-4 reliably modify code? In A Philosophy of Software Design the author points out that code is written once and modified possibly dozens of times, so ease of maintainability/reading is more important than ease of writing. I wonder whether a) AI can reliably modify code and b) whether AI can reliably write code that is able to be easily modified by humans. If AI starts spitting out machine code or something, that's not useful to me even if "it works."
- vsareto 4y agoIt can do edits, yes. You can also generally specify what language to use so it shouldn't jump from C++ to assembly unless you tell it to. The bigger edits (refactoring things across an entire project) is out of reach because of the token limit. You could do it piece-meal through ChatGPT but that seems more tedious than it's worth.
- dmm 4y ago> so ease of maintainability/reading is more important than ease of writing. That may be the case now but in a theoretical future where software systems are generated by AI why would I bother modifying the old system? Why not generate a new one with the original prompts modified to meet the new requirements? In a sense the "source code" of the system could be the AI model + the prompts.
- MavisBacon 4y agoI think the question also needs to be asked of- can GPT-4 write accessible/WCAG compliant code? I just spent the last two days at a digital accessibility conference called axe-con, financed by a firm called Deque who primarily make AI/ML powered software for the detection of accessibility issues in code The resounding attitude seems to be that AI/ML is a friend to disabled users and can help do a lot of lifting with writing, maintaining, auditing code- but we are a long long ways away from fully automated processes that account for accessibility and produce websites that will work with assistive tech like screen readers, if it is possible at all
- ArchitectAnon 4y agoHere's my perspective on this as an Architect: Most construction details have been done before, they could be easily reproduced by an AI surely? There's usually just a few things that are different from the last time I have drawn it. A few 3D interactions with other components that need to be reasoned about. They are not that complicated individually. But yet I see this problem as well just using old fashioned automation let along AI to save time. I find that if you haven't drawn the 2D section through all the different edge cases of a particular thing you are trying to design, you haven't done the analysis and you don't really understand what's happening. I've made mistakes where I've been working in 3D on something complicated and I've had to hide some element to be able to view what I'm working on, only to find later that when I turn everything on again I've created a clash or something impossible to build. That's why we still do 2D drawings because they are an analysis tool that we've developed for solving these problems and we need to do the analysis, which is to draw section cuts through things, as well as building 3D models. After all, if models were such a good way to describe buildings, then why weren't we just building physical scale models and giving them to the builders 100 years ago; it's because you can't see the build-up of the layers and you can't reason about them. Reading this article I get the same sense about software engineering, if you haven't solved the problem, you don't really understand the code the AI is generating and so you don't really know if it is going to do what you've tried to describe in your prompt. You still have to read the code it's generated and understand what it is doing to be able to tell if it is going to do what you expect.
- IsaacL 4y ago> Reading this article I get the same sense about software engineering, if you haven't solved the problem, you don't really understand the code the AI is generating and so you don't really know if it is going to do what you've tried to describe in your prompt. You still have to read the code it's generated and understand what it is doing to be able to tell if it is going to do what you expect. Yes, this is pretty much exactly the way I've been using GPT and it works tremendously well. (GPT4 works especially well for this style of programming.) My prompts include things like: - "read the function below and explain in detail what each section does" -- this prompts GPT to explain the code in its own terms, which then fills in its context with relevant "understanding" of the problem. I then use the vocabulary GPT uses in its explanation when I ask it to make further changes. This makes it much more likely to give me what I want. - "I see this error message, what is the cause? It appears to be caused by $cause" -- if I'm able to diagnose the problem myself, I often include this in my prompt, so that its diagnosis is guided in the right direction. - "this function is too complex, break it up into smaller functions, each with a clear purpose", or "this function has too many arguments, can you suggest ways the code could be refactored to reduce the number of arguments?" -- if you go through several rounds of changes with GPT, you can get quite convoluted code, but it's able to do some refactoring if prompted. (It turned out to be easier to do large-scale refactoring myself.) - "write unit tests for these functions" -- this worked phenomenally well, GPT4 was able to come up with some genuinely useful unit tests. It also helped walk me through setting up mocks and stubs in Ruby's minitest library, which I wasn't experienced with. In brief, if you expect to just give GPT a prompt and have it build the whole app for you, you either get lame results or derivative results. If you're willing to put the effort in, really think about the code you're writing, really think about the code GPT writes, guide GPT in the right direction, make sure you stay on top of code quality, etc, etc, GPT really is an outstanding tool. In certain areas it easily made me 2x, 10x, or even 100x more productive (the 100x is in areas where I'd spend hours struggling with Google or Stack Overflow to solve some obscure issue). It's hard to say how much it globally increases my productivity, since it depends entirely on what I'm working on, but applied skilfully to the right problems it's an incredible tool. Its like a flexible, adaptive, powered exoskeleton that lets me scramble up rocky slops, climb up walls, leap over chasms, and otherwise do things far more smoothly and effectively. The key is you have to know what you're doing, you have to know how to prompt GPT intelligently, and you have to be willing to put in maximal effort to solve problems. If you do, GPT is an insane force multiplier. I sound like I work in OpenAI's marketing department, but I love this tool so much :)
- zitterbewegung 4y agoI had some Matlab code and I wanted it to be ported to numpy. I couldn't get it running on Python and it wasn't doing it correctly on chatGPT. On the other hand it could regurgitate code to use fastapi and transformers and it looked correct to me. When you think about it this is very very similar to a stack exchange or google search but with a much different way to search and it can synthesize simple things which limits the complexity of what you want to do. So I don't really think it can write code but it can surely get you something that gets you 50% there.
- gwoolhurme 4y agoI guess my genuine question is to the people who are saying this is a big deal and it will take our jobs. I am a bit lucky to where at the moment I am working in a "novel" field. Lets say though for the sake of argument that AI does come for SWE jobs. To be honest? I don't know what to do in that case, I have no backup plan, not enough to retire. The country I've lived in for 9 years is still through a work visa (hopefully at least that changes soon). I am just comfortable enough with my salary. If all that is pulled from under me, I lose my job tomorrow, I lose my profession, my visa, my home. I honestly would like to ask to the people who say this is and will come for us soon. Well OK, but what is your advice for someone like me? It's true society doesn't owe me anything, nobody does. So it is also just an answer that some of us will be dropped by the wayside. That's what happened before. Just curious what anyone's advice would be assuming they are right and it does take our jobs.
- IsaacL 4y agoCheck out my comments higher up in the thread (eg https://news.ycombinator.com/item?id=35197613 https://news.ycombinator.com/item?id=35197613), I really do believe that GPT4+ will be primarily useful as augmenters for capable and dedicated engineers, rather than replacements. It's like a very eager and brilliant junior dev that can solve many problems that you throw at it, but still needs hand-holding, error-checking, and someone who knows how to piece the actual system together.
- wara23arish 4y agoWhat about the junior devs of today ?
- IsaacL 4y agoIf they're willing to learn, GPT is a very powerful tool. https://www.youtube.com/watch?v=VznoKyh6AXs https://www.youtube.com/watch?v=VznoKyh6AXs ["How to learn to code FAST using ChatGPT (it's a game changer seriously)"]
- gwoolhurme 4y ago
- HervalFreire 4y agoGuys all of this happened within a couple months. If you guys are confident about the entity as it is right now not taking over your job, what if I double the accuracy of gpt output? What if I double it again? Then again? And again? And again? You guys realize this is what's coming right? This thing literally is a baby as of now.
- deelly 4y agoIs it true that GPT4 failure rate is .5 of GPT3?
- HervalFreire 4y agoI mean this is impossible to measure right? You'd have to compare all possible outputs of GPT3 with all possible outputs of GPT4. You can get away with a random sample. But there's a lot of bias in that sample and it's hard to control it. Out of the infinite possibilities there definitely exists sets of inputs and outputs where both GPT3 and GPT4 are always wrong. On the other side of the coin there are also sets where GPT4 is always right and GPT3 is always wrong and vice versa. Given that there's no methodology to control what is "random" in these sets it's hard to come up with a good metric. So the 0.5 thing is a bit of anecdotal number from the gut.
- breakingrules 4y agoi was trying to get it to make a document scanner last night, it apologized to me like 10 times and we eventually got running code but the result was way off. this thing can write code but you're not gonna rely on it and nobody is gonna know it enough to edit it. it is not there yet, still very helpful for small things or extremely simple things. if you tell it to give you an express server with socket.io and your db, it will probably set that up for you perfectly.
- numbsafari 4y agoHey GitHub / Microsoft / OpenAI How about this prompt: I have a web page where customers see their invoice due. When they enter their credit card information, sometimes the page just refreshes and doesn't show any kind of error information whatsoever, but the invoice remains unpaid. This has been going on FOR YEARS NOW. Can you write some code to fix this as we have been busy laying off all the umans. Oh, or this one: I have this page called "Pull Reqeuest", at the bottom there is a button that says "Comment" and right next to it is a button that says "Close this PR". We probably shouldn't have a button that performs a destructive action immediately next to the most common button on the page. This has also been going on for years, but, you know, no umans.
- Havoc 4y agoNot sure it matters? If the majority of coding is gluing things together and it can replace that then you've suddenly got 10x as many coders gunning for the remaining gigs that have hard problems. Good for whoever comes out on top, but not sustainable from a societal perspective
- marcyb5st 4y agoAh, in my experiments it writes like > 90% of the code correctly. I got the best results with prompts like: Given the following python code: ``` Few hundreds python loc here ``` Write tests for the function name_of_function maximizing coverage. The function in this example had a bit of read/dumps from disk and everything. The code returned correctly created mocks, set up setup and teardown methods and came up with 4 test cases. I only needed to fix the imports, but that's because I just dumped python code without preserving the file structure. I am amazed how fast these models are evolving.
- irobeth 4y ago> I think ChatGPT is just kind of bullshitting at this point. It doesn’t have an answer, and cannot think of one, so it’s just making shit up at this point [...] But instead it’s [overconfident] in its own capabilities, and just makes shit up. It’s the same problem it has with plenty of other fields If anything, the article demonstrates it can write code, but it can't thoroughly reason about problems it hasn't been trained on So when saying something like "Its possible that similar problems to that have shown up in its training set." as a way to dismiss any scintilla of 'intelligence', how many of these articles reduce to a critique e.g. "Can a Middle Schooler actually understand dynamic programming?" Like, what is the actual conclusion? That a software model with O(N) parameters isn't as good as a biological model with O(N^N) paremeters? That artisans need to understand the limits of their tools?
- IsaacL 4y agoI've been able to give it arbitrary blocks of code and have it explain how they work. (Asking this makes GPT more effective when I ask it make further changes. One reason I do this is when I start a new session with ChatGPT discussing code it helped me write previously, especially if I've gone away and done a big refactoring myself.) A very simple example is that I asked it to write some Ruby functions that would generate random creature descriptions (e.g., "a ferocious ice dragon", "a mysterious jungle griffin"). It did this by generating three arrays (adjectives, locations, creature types) and randomly selecting from them to build the output string. I then asked it to explain how many different descriptions it could generate, and it explained that multiplying the length of the three arrays would give the number of outputs. (125 for the first iteration, 5x5x5). I then asked it how it would increase the number of possible outputs to 1000, and it did so by increasing each of the three arrays to length 10. I then asked it how it would generate millions of possible outputs, and it added extra arrays to make the creature descriptions more complicated, increasing the number of permutations of strings. This is not the most sophisticated example, but it shows what GPT can do when it can combine "knowledge" of different areas. If it's able to combine the solutions to known problems in a straightforward way, it can accomplish a lot. Beyond a certain point it needs guidance from the user, but if used as a tool to fill in the gaps in your own knowledge, its enormously powerful. I it more as an "intelligence-augmenter" than a "human-replacer". See my comment here where I went into more detail on how I work with GPT: https://news.ycombinator.com/item?id=35197613 https://news.ycombinator.com/item?id=35197613
- dmix 4y agoFrom my own sampling of going through about 10 times I used GPT for real world Typescript code, some used in production, I can confirm that GPT-4 does a noticeably better job and produces code I actually want to use way more often. GPT-3.5 always produced very verbose types and over engineered code. The GPT-4 outputs were consistently shorter and more focused. Kind of like how a junior dev has to think through all the smaller steps and makes functions for each, as he incrementally solves the problem slower and less intuitively, almost over explaining the basics, while a senior dev merges the simpler stuff into small concise functions. You can see it with the var names and type choices GPT-4 focused much more on what the code is trying to accomplish rather than what the code itself is doing. And these are all with the same prompts. There’s still things like unused vars being included occasionally and some annoying syntax choices, if I could append prettier/eslint rules automatically to GPT output it’d be gold (I haven’t tried to do this myself). But still very encouraging.
- dmix 4y agoIf someone can make an ESLint/prettier rules to GPT prompt script I’d love you. Or even the airbnb-base baseline one.
- dukeofdoom 4y agoA solo developer can now afford an assistant. It's liberating, since it makes it easier to get some things done. So you can do more, or have more free time. You can get by using Midjourney for art, and GPT-4 to answer questions and occasionally help to write code.
- justinzollars 4y agoGPT 3.5 helped me debug something very complex. There was a bug related to symlinks in neovim with gopls LSP. The error dialog line was appearing, then disappearing. Chat GPT walked me through strategies to debug this, confirm everything was set up, tail the RPC log (wasn't aware that was a feature) - and identify the failing path - which was a symlink! I'm actually blown away by this capability. It was like having a savant next to me. I couldn't have debugged it on my own.
- tantaman 4y agoI was mock interviewing ChatGPT for a few hours yesterday with application and system design + coding said application. My conclusion was it was a no hire for even the most jr positions because it required considerable amounts of direction to arrive at anything approximating an acceptable solution. tldr -- this matches my experiences as well.
- burntalmonds 4y agoI'm sure I'll change my mind as this tech improves, but having AI generate code goes against every instinct I have. Way too easy for there to be a subtle bug in the code among other problems. It makes me wonder though if AI could useful for writing tests of my code. And also AI code review.
- welder 4y agoThat's what this beta extension for vscode[0] does, generate tests using AI and your code as input. [0] https://about.sourcegraph.com/blog/release/4.4 https://about.sourcegraph.com/blog/release/4.4
- deleted 4y ago[deleted]
- shanehoban 4y agoI'm building a pretty neat database with it at the moment, its not perfect, but it is saving me potentially months of fine tuning, down to just hours. It is amazing IMHO.
- deleted 4y ago[deleted]
- elif 4y agoI think it would have done well if you added an explicit rule like: "the path chosen should always minimize the number of fire tiles passed through." The way the prompt was phrased sort of invited the all-or-nothing fire approach.
- awb 4y agoHow are people generating multiple files for larger applications? I gave it a prompt and asked it to respond with a list of file names required to build the app. Then when I prompted a file name it should print the code for that file along with a list of ungenerated file names. It got through two before it got confused. I’m stuck with having it write one function at a time.
- gumballindie 4y ago> I’m stuck with having it write one function at a time. Because thats the most it can do. Claims that it can write code are getting quieter. People made wild claims on reddit but when prompted to share their code they either went mute or the code was hilariously amateurish and limited.
- importantbrian 4y ago> After going in circles a few more times, I decided that was it. It got close. It seemed to understand the problem, but it could not actually properly solve it. I had this same loop issue with Chat-GPT. I had something I wanted to do with asyncio in Python. That's not something I work with much so I thought I'd see if Chat-GPT could help me out. It was actually good at getting me up to speed on ansycio and which parts of the library to look at to solve my problem. It got pretty close, but it can't seem to solve edge cases at all. I got into this loop where I asked it to make a change and the code it output contained an error. I asked it to fix the error so it gave me a slightly modified version of the code prior to the change. So I asked it to make the change again and the code it spit out gave the same error again. I went through this loop a few times before I gave up. Overall, it's cool to see the progress, but from what I can tell GPT-4 suffers from all the same issues Chat-GPT did. I think we're probably missing some fundamental advance and just continuing to scale the models isn't going to get us where we want to go. My biggest concern with the current batch of LLMs is that we're in for Stackoverflow driven development on steroids. There's going to be a ton of code out there copy and pasted from LLMs with subtle or not so subtle bugs that we're going to have to spend a ton of time fixing.
- kneebonian 4y agoThis here is my fear to. I have a buddy right now that is getting his degree in CS and he is using ChatGPT for a lot of his assignements. I worry that the next generation of developers are going to grow up just figuring out how to "program GPT" and when they have an error rather than investigating it (because they can't because they aren't actually familiar with code in the first place) they'll simply tell GPT about the error they are having and tell it to spit out more code to fix that error, slapping more mud on the ball. Eventually these systems are growing larger and larger at a faster and faster pace, and no one understands what they are actually doing, and they are so complex that no one human could ever actually understand what it is doing. Imagine if every codebase in the world was like the Oracle DB codebase. In this future a programmer stops becoming a professional that works to create and understand things, instead they become a priest of the "Machine Spirit" and soon we are all running around in red robes chanting prayers to the Omnissiah in an effort to appease the machine spirit.
- bruce511 4y agoI don't need GPT-4 to write code, I can do that myself. I want it to attend all the meetings for me with endless managers discussing what the code does, should do, could do, customer would like it to do, can't be done and so on. Hint to managers: Programming doesn't take up my time. Your endless meetings to discuss my programming takes up all the time...
- awill88 4y agoAnd more things to yawn over! Come on, who cares if it writes code?! Is it that fascinating?
- d357r0y3r 4y agoGPT-4 can write code, but it can't build software. Well...it could build software if humans gave it the right prompts. Coming up with the right prompts is difficult, because it means you're asking all the right questions. If you're just really good at writing code, then yes, GPT is coming for your job. Do what humans are good at: responding to the needs of other human beings and building solutions around them.
- r3trohack3r 4y agoWatching GPT write code hurts my brain. It starts at the first character, works forward one “token” at a time, and ends at the last character. Never moving back. It feels like it knows where it’s going at the first character, even though it doesn’t. It’s like it starts speaking a sentence and, by the time it’s done speaking, it’s written a syntactically correct Node.js application. The way GPT communicates in English does seem similar to how humans communicate. The way GPT writes code doesn’t seem to come close to approximating how humans do - it’s an entirely different mechanism. Humans generally can’t write code without a cursor and backspace.
- thingification 4y agoSpeaking from ignorance (I've not studied attention nor transformers): This is my feeling too. I feel like the next step isn't far away: a more explicit model of the world with a mechanism to both query and "feed back on" that model, correcting mistakes. If it's possible to get so far when that functionality seems in an important sense basically missing, imagine how far it'll go when that does happen.
- jokoon 4y agoPeople need to understand that AI doesn't think, doesn't have insight or intuition. AI just repeat patterns it saw in a huge database, but are not able to understand what is going on. Nobody can really understand what's inside a trained neural network, and nobody is really looking. No psychologist or neuro-scientist can really understand how a human brain, a mouse brain or even an ant brain or a fly brain even works, so don't expect computer scientists to have any insight about doing something relevant with just a small collection of sophisticated statistical methods. AI is soon going to become the pseudo-scam status that bitcoin experienced. ChatGPT is an improved search engine at best.
- InCityDreams 4y agoI introduced my colleagues to chatgpt this morning and they're knocked out. We deal with people, and the people answers are considerably more thoughtful than 'improved search'. Not sure where btc and and pseudo-scam come into it.
- nmca 4y agoWrite a short poem called "All just patterns" in the style of Blake as a not-so-subtle dunk on those that can't see the wood from the trees w.r.t. AI progress. GPT4: In patterns woven in the loom of life, The threads entwined, a tapestry of strife; Man lost in shadows, seeks the hidden light, Yet grasps at embers, blind to Heaven's sight. All just patterns, the trees and wood we see, While we, like infants, crawl with bended knee. In ceaseless search, we delve in Nature's tome, For signs and symbols of our destined home. To find the wisdom locked in Nature's breast, In circuits traced by human hands, impressed; No gods or angels guide the curious hand, But human thoughts give life to grains of sand. Like children playing with forbidden toys, We forge our own creations, false and coy; Our machines breathe and mimic human soul, But hollow shells, as empty as the whole. In tangled webs of artifice we're caught, By our own hands, the noose of fate is wrought. As God did cast Prometheus from the skies, We bind ourselves in chains of our own lies. All just patterns, like woven silk, we spin, Entangled dreams, mere shadows of our kin; For in the end, the art we do create, Is but reflection of our human state.
- asah 4y agoMe & many senior engineer friends are starting to use ChatGPT like "junior engineers" to write code them. It's not even a question anymore.
- havefunbesafe 4y agoIf you've never worked as a dev/in product, this will not help you. If you have a working understanding of your codebase, as a product person, and can bump your way through writing code and the command line, it WILL help you immensely. Source: I wrote an integration that connects our API to google drive to pass video content (something I could have NEVER done before).
- legohead 4y agoI was just complaining to my friend about how much trouble I'm having with it. I purchased the $20 GPT-Plus so I could use GPT-4 after reading someone on HN say that GPT-4 is "scary impressive" at writing code. I have two tasks I wanted it to try, both making use of public APIs, starting from scratch. In short, it was frustrating as hell. Never-ending import problems -- I'd tell it the error, it'd give me a different way to import, only leading to a new import problem. I think I used up all my 100 queries in 4 hours of GPT-4 just on the import/library problem. Then there were constant mis-use of functions -- ones that didn't exist, or didn't exist in the object it was using, but did exist in some other object instead, at which point it would apologize and fix it (why didn't you give it to me correct the first time, if you "know" the right one?) The actual code it wrote seemed fine, but not what I'd call "scary impressive." It also kept writing the same code in many different styles, which is kind of neat, but I found one style I particularly liked and I don't know how to tell it to use that style. Lastly, it's only trained up to Sep 2021, so all the APIs it knew were well behind. I did manage to tell it to use an updated version, and it seemed to oblige, but I don't really know if it's using it or not -- I still continued to have all the above problems with it using the updated API version. Anyway, I hope MS fiddles with it and incorporates it into Visual Studio Code in some clever way. For now, I'll continue to play with it, but I don't expect great things.
- insomagent 4y agoI think the current train of thought is "keep increasing the size of the language model and you don't need to worry about integrating with LSPs". Perhaps there is some merit to this. If the language model is large enough to contain the entirety of the documentation and the LSP itself, then why bother integrating with the LSP? _Especially_ if you can just paste the entirety of your codebase into the LLM.
- runeks 4y ago> If the language model is large enough to contain the entirety of the documentation and the LSP itself, then why bother integrating with the LSP? If your goal is to get a response to an LSP query, why on earth would you use an LLM trained on data where >99.9999% of that data has nothing to do with answering an LSP query? Why would I switch out an LSP server of 100% accuracy for an LLM that’s slower and has lower accuracy?
- PopePompus 4y agoI'm a casual programmer, who knows enough to write decent Python scripts, but who is probably unaware of 99% of the Python library modules that have been written. Yesterday I had GPT-4 write a script that would accept the name of a star, and print out all the journal articles that have that star's name in the article title. This is a bit trickier than it sounds, because almost every interesting star has many names (Vega, for example, has more than 60 names, not including non-English names) and I wanted the script to check the titles for all the names that might be used for the particular star I had specified. I told GPT-4 to use the SIMBAD database to get all the star names, and to use NASA ADS to get all the publications. GPT-4 wrote a script to do that. The script was buggy, but I was able to fix the bugs easily and quickly. The wonderful thing was that GPT-4 used 2 different libraries that I had never even heard of, to pull data out of those databases. The process of producing the script was far faster than I would have been able to do on my own. Professional programmers may be well aware of the software packages that will allow them to do their jobs, and might not get much help from a GPT assistant. But I think for people who know how to program, but are not professionals and may not know "what's out there" in the way of resources, a GPT assistant will vastly increase their ability to use their programming skills (such as they are...) to get useful stuff done.
- GrumpyNl 4y agoI asked it to write the code for all the unique combinations of A,B,C,D in PhP, after 27 tries it succeeded. The i asked it to solve the problem of a horse is 15 dollar, a chicken one dollar and a egg .25 dollar, i can spend 100 dollar for 100 items, some of each. After 2 hours, it was not able to solve it. One time it gave 5 possible answers, with the correct one also, but it did not recognize the correct one.
- ben7799 4y agoI’m curious how long till we figure out if these algorithms are plagiarizing OSS or other code they come across like GitHub Copilot. It requires special tools to actually figure out if this is happening. Having seen tests with such tools the problem seems a lot worse than commonly discussed. Inserting stolen code or using OSS code in violation of licenses is going to be a big mess. Copying snippets versus pulling in dependencies creates tons of issues. Even if you get away with violating licenses you set yourself up for security issues if the tools plagiarize code with vulnerabilities in a way that won’t get updated. It might mean this stuff is a useful tool for someone with a clue but not for someone who doesn’t know what they’re doing.
- evo_9 4y agoIt's not bad. I just had it write a small API call to the NHL endpoint to gather some data for something I was curious about stat-wise. Anyway, I initially had it write it in Python, and it mostly worked, but I was having some issues getting the data exactly right, and formatted the way I wanted. Once I had it more / less right in Python, I had it rewrite it as a dotnet console app (C#), which is what I know best. The only real issue I ran into is it would randomly stop before completing the conversion to dotnet. Like it would write 85% then just stop in the middle of a helper function. Not a huge deal, I just had it complete the last function, and with a little bit of fiddling in VS Code got it running pretty much the way I wanted. So overall, yeah, not bad. Probably saved me an hour or so, plus I couldn't find great docs for the NHL endpoint, and ChatGPT was able to sus out the correct syntax to get to the data I needed. I wonder how git Copilot compares, has anyone tried out both?
- zamalek 4y agoI have been writing a text editor, and I'm currently working on the VT100 stuff. Unit testing VT100 is a lot of busy work. There's a bunch of different message frames (DCS, OSC, CSI, etc.) and many, many, escape codes. I decided to try out CodeGPT.nvim, and it was a massive help. It didn't provide perfect code, not by a long shot, but it gave me extremely valuable starting points - and did a somewhat decent job of exercising most of the branches (certainly enough for me to be happy): https://gitlab.com/jcdickinson/moded/-/blob/main/crates/term/src/vt/messages/ansi.rs#L182 https://gitlab.com/jcdickinson/moded/-/blob/main/crates/term... Many people have said it, and it's true. Expecting GPT to write a complete solution is just asking for problems, but it is an incredible assistant.
- tarkin2 4y agoThe only argument I've heard against our impending doom is: The productivity gains will not leave people unemployed, but will give managers the opportunity to start more projects. The role of a developer will change. We'll be looking at generated and regenerated code. But we'll still be demand by those with ideas and never-decreasing human demand. This assumes that GPT-X won't end up being used by end-users--bypassing both the C-level, the managers and the developers.
- fendy3002 4y agoI've used chatgpt and while it's mediocre, even bad at writing code, it's very good at reading code and explaining it in a way that's easier to understand. It's also good at giving hints and starting point for when you don't quite familiar with the language feature / library. From writing code, they're good at bootstrapping unit tests and skeleton code, also useful at transpiling dto / entities between languages. Overall if you're willing to learn and not just treat a gpt as code monkey, they're very useful.
- amluto 4y agoI'm not an AI as far as I know, but I would try a classic programming competition technique for this and observe that 6 isn't a very big number. Step 0: Let's try to find a path without walking through fire. Run Dijkstra's or A* to find the shortest path with no fire, up to distance 6. If it succeeds, that's the answer. Step 1: Okay, that didn't work. We need to go through at least 1 fire tile. Maybe we can do at most 1. Define distances to be a tuple (fire, cost) where fire is the number of fire tiles used and cost is the cost. Comparison works the obvious way, and Dijkstra's algorithm and A* work fine with distances like this. Look for a solution with cost at most (1, 6). Implemented straightforwardly will likely explore the whole grid (which may be fine), but I'm pretty sure that the search could be pruned when the distance hits values like (0, 7) since any path of cost (0, 7) cannot possibly be a prefix of a (1, c) path for any c<=6. If this succeeds, then return the path -- we already know there is no path of cost (0, c) for c <= 6, so a path of cost (1, c) for minimal c must be the right answer. Step f: We know we need to go through at least f fire tiles. If f > 6, then just fail -- no path exists. Otherwise solve it like step 1 but for costs up to (f, 6). Prune paths with cost (f', c') with c' > 6. This will have complexity 6D where D is the cost of Dijkstra's or A or whatever the underlying search is. Without pruning, D will be the cost of search with no length limit but, with pruning, D is nicely bounded (by the number of tiles with Manhattan distance 6 from the origin times a small constant). For a large level and much larger values of 6, this could be nasty and might get as large as t^2 * polylog(t) where t is the number of tiles. Fortunately, is upper-bounded by 6 and doesn't actually get that large.
- kneel 4y agoI self taught myself how to code and have never been very good, I don't code often and when I do I spend a lot of time relearning some simple programming detail I forgot. ChatGPT (also copilot) allows me to focus on the project that I'm working on and offload the stack overflow searches to prompting. I don't have to find a similar error someone else posted on SO and figure out how it applies to my current problem. I can keep a high level view of the project and not get bogged down with silly bugs, learning new libraries, or deciphering someone else's code. I imagine there are a lot of people who are in a similar situation, it's crazy that we've just unleashed this massive productivity booster onto millions of people.
- kneebonian 4y ago> I imagine there are a lot of people who are in a similar situation, it's crazy that we've just unleashed this massive productivity booster onto millions of people. Maybe it makes me sound like an elitist git, but I remember when the coding bootcamps started "unleashing massive productivity boosts" by promising to make people "full-stack engineers" in just a 6 weeks, and I still shudder to remember the code horrors I've seen as a result of that.
- kneel 4y agoTo be clear, I don’t think we are getting a bunch of rockstar coders from chatGPT prompt engineering. It’s more about the CFO who can now write his own SQL queries and dashboards, project managers can dive into details they don’t understand and come to meetings a little more prepared. This boosts everyone’s productivity, not just coders.
- cdchn 4y agoIf you look at the Leetcode scores, it looks like GPT-4 can generally do most "basic" leetcode but fails on "medium" or "hard" problems. This seems to align with what I see most people's experience with using GPT-3/3.5/4 to generate code seems to be. Works well for simple cases (which you could probably find examples of online) but stumbles on nuances of incrementally harder problems.
- sagebird 4y agoI would ask it to pretend a mathematician knows how to solve it, and is having a conversation with a novice programmer attempting to solve the problem, and pointing out mistakes and hints at each step, and gives examples of where it fails, until a proof is given that the program is correct.
- spywaregorilla 4y agoI wanted GPT to help me write some code for unreal engine. I was very impressed with what it could do. It was able to write code that correctly utilized Quartz, an experimental plugin for queuing things on the audio thread. Which is awful impressive given that Quartz is super niche and doesn't seem to have basically any documentation around to train on for cpp code. I presume it is because unreal engine is source available and the model has seen the whole damn thing. I'm curious if it must be worse on unity, which is not source available.
- abecedarius 4y agoFor fun, I had a chat with it starting with a request to work out the math of crescent intersection, before committing to code. It still confabulated, but I was able to coax out a solution in the end that made sense.
- race2tb 4y agoI like how it ends with it can write code that is repetitive and has many examples of solutions floating around which is most of coding. It will probably edge upward as well as time goes by till there are only very edge problems that it cannot solve. Even then I would use it to write the broken down version of the solution. It is going to be getting fed by pretty much every programmer,knowledge profession on the planet using copilots of some sort. Eventually it will have knowledge transferred everything humans can do into its model.
- ummonk 4y agoI use it to reduce the drudgery of writing code like this. I've found I have to do a lot of hand-holding in terms of telling it what data structures and logic it should use. I also just directly tell it what changes it needs to make to fix big bugs or logic errors I spot. That gets it to the point that I can tweak it myself and complete the code. One of the frustrating things is that it doesn't ask for clarification of something that's unclear - it just makes an assumption. Really demonstrates why software engineering interviews emphasize the candidate asking clarifying questions.
- marstall 4y agoI've wondered why got doesn't ask questions - that's a basic expert skill.
- hackandthink 4y agoMaybe LLM Code writing will us slow down (initially). Productivity is hard to measure and can be counter intuitive. Talking the whole time with your LLM may distract more than it helps. https://en.wikipedia.org/wiki/Productivity_paradox https://en.wikipedia.org/wiki/Productivity_paradox
- wankle 4y agoWhen business A's lightly technical aware AI operator asks their AI for a solution to push payment information to a bank B and describes it, and A's AI talks to the bank's AI and they coordinate the creation of the API then A's and B's AI talks to their respective production counterpart AI's and they create the implementation and put it into production; I feel we programmers will mostly be obsolete.
- mrandish 4y agoI'm actually quite excited by what the examples in the article show – despite the fact they show GPT-4 can't replace a good dev solving somewhat tricky algorithm problems. Reason: I'm a code hobbyist who glues various modules together that have been written by much better programmers than I am. My end goals are never more ambitious than doing pretty simple things which I'm doing mostly to amuse myself. My biggest time sucks turn out to be tracking down fairly simple syntax things that vary between different languages and frameworks I'm slapping together (because I rarely spent more than a couple hours working on any one thing, I never get super familiar with them). Being a lousy coder with little desire to put in significant effort to improve just to make my personal hobby projects a little easier, a basic AI assist like this looks pretty useful to me.
- PKop 4y ago"I think ChatGPT is just kind of bullshitting at this point." This line sums up the entire problem with these tools for anything concrete, like analyzing input data, writing code, producing a series of particular facts, data analysis etc. Much of it can be right, but whatever isn't makes the whole output useless. You'll spend as much time checking its work as producing it yourself.
- diedyesterday 4y agoSo this guy is basically complaining about GPT-4 not being a super-intelligence. Still that makes it more powerful and versatile thae the great majority of programmers out there.... And the game is only getting started. This is just the warmup.
- boringuser1 4y ago[dead]