Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to effectively use chat GPT in unity?

Discussion in 'General Discussion' started by marqumax, May 4, 2023.

  1. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,589
    To be fair, removing all of the code is definitely one way to improve performance. :p
     
    bugfinders likes this.
  2. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,453
    Well yes. It would be faster ......
     
  3. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,018
    In my experience, it starts skipping code when it approaches memory limits. Just need to start a new chat or engage with 32k memory API (it's expensive though). Furthermore, large scripts eat up tokens fast, you need to stick under roughly 300 loc for it to be able to effectively refactor something. And the free version has even less memory.

    The other thread that got locked had a suggestion to use free CodeGPT IDE plugin with GPT4 API. So I set that up in Rider and it's been pretty great. In some ways a little better than ChatGPT, because as soon as you mention Unity, ChatGPT wants to make everything a monobehaviour, scriptable object, etc. While direct interaction with API via CodeGPT opts for pure C# if the code is not directly Unity dependent, which I prefer. Direct API calls also generate quicker, and I assume don't have the 25 message limit. That together with the ability of it taking current selection as part of input prompt and then being able to replace selection with generated results, makes this a much better experience overall.
     
    Last edited: Jul 23, 2023
  4. RobertOne

    RobertOne

    Joined:
    Feb 5, 2014
    Posts:
    258
    nice. I just started to use the api/playground since i can select the gpt4 version from march there. Not the clownshow it is now. Its really expensive tho getting charged per token.

    never heard of codegpt. Is it better then copilot chat?
     
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,774
    It's just an integration plugin.
     
  6. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,018
    I've yet to accumulate more than the ChatGPT subscription, which with VAT is almost 25USD. I guess august will be the real test on pricing but for now it pays for itself in productivity gains. Luckily, there are hard limits I can set for API usage so I can stay within budget.

    And as Ryiah mentioned, CodeGPT is just a convenient wrapper/IDE integration for GPT4 API.
     
  7. Taro_FFG

    Taro_FFG

    Joined:
    Jun 24, 2022
    Posts:
    57
    Largely depends what you do with it. I mostly let it refactor functions with limited line count. We are using this with two devs and have other API usage. Typically we had 2$/month with a couple of queries here and there.
    A single query saving you some refactor work while you grab a coffee saves you that money in productivity.

    For the typical ChatGPT user doing a couple of queries a month will be a lot cheaper.
    But ofc if you go completely nuts, use the 32k model and fill it up you will get a big invoice.

    I use all these tools in concert where they make sense.
    For certain exploration/prototype feature code I prefer the chatGPT interface, copilot for auto complete and codeGPT for medium size tasks.

    The trend with the Github tools seems to be to add hidden context without letting you know.
    Both try to improve the queries by sending the model what feels like all the currently opened files.
    Can be good, can misslead the model. Will probably change in future updates.
    I'm not the biggest fan of that approach in the current iteration, I'd prefer they tell me somewhere what it knows so I can adjust.
    Sometimes it heads off in the wrong direction because some other file I have opened in the background.


    CodeGPT you just copy/paste or select and use the query feature to send it what you want, you can also save some macro queries. Useful when you figure out what fluff text you typically need to get the desired style of code from the model.
     
  8. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    I solve 100% of my programming issues by using stackoverflow, reddit or these forums, what ChatGPT does is browse forums for you but you don't get to choose which is the right answer.
     
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,774
    ChatGPT doesn't browse anything for you. It creates responses from scratch by assembling tokens chosen via probabilities. You can increase its available pool of tokens using GPT-4's Link Reader plugin but even then the answer isn't being copied out of that or any other thread.

    Thanks to this the bot can solve problems that are incredibly difficult to find solutions for or may not even have a solution, and far faster than waiting for a response which can easily take multiple days or even weeks. It can also create a completely bogus answer, but it's often possible to work around that limitation.
     
    Last edited: Jul 26, 2023
  10. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,018
    StackOverflow has lost 35% of its traffic and is experiencing up to 50% decrease of questions and answers, as well as upvotes: https://observablehq.com/@ayhanfuat/the-fall-of-stack-overflow

    Ryah already explained why.
     
    Rewaken, Ryiah and Voronoi like this.
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,774
    Indeed banning questions and answers from the bot wasn't going to stop people from using the bot. It was just going to stop them from coming to the site after they'd exhausted what the bot could provide them.
     
    Last edited: Jul 26, 2023
  12. Voronoi

    Voronoi

    Joined:
    Jul 2, 2012
    Posts:
    577
    I'm finding the results lately to be quite variable in general and somewhat repetitive for my various queries, mainly using Bing and ChapGPT4. It's still pretty great at specific types of coding questions. I mainly use it because it's just faster to get a summary than click on a link and wade through a long post covered with ads.

    Lately though, a general question will result in it only referencing one or two sources and it's reluctant to go beyond that. I think it's what people have described, that they are throttling it down to use less resources and so the results are 'meh'.

    Knowing that many people are posting less on StackOverflow, it makes me think a year from now AI may not be nearly as capable as it is now since it has a large trove of past answers to ingest. If people all over ask less questions on the internet in general, there is going to be less good information available for AI to draw from. In fact, it may start ingesting other AI content like an ouroboros and become useless.
     
  13. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,774
    Speaking of throttling I noticed that the message limit for GPT-4 which had been "25 messages every 3 hours" for the past few months has now been raised up to "50 messages every 3 hours".
     
  14. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,018
    The model collapse is a worry but GPT4 is nearly three years out of date already and it still continues to be useful. A year won't change much unless some massive technological shift happens at Unity, which it won't.
     
  15. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,498
    If AI-generated data is valid, doesn't matter if it is AI-generated, it can be used for training the next iteration. Same deal with AI art. If human judged it to be aesthetically pleasing, it can be used for training.

    Eventually learning algorithms will be probably optimized and require less material.

    At the moment, for example, open-assistant is gathering their own database. The database has something like 84k rows of data which is not a whole lot and is smaller than Crawl. People used it already to finetune.
     
  16. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    Well if it does not read what knowledgeable people share about the subject there is no wonder it makes so many mistakes.
     
  17. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,073
    ...because wise usage of Unity is pretending you're using a 5 year old version of it.
     
  18. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,735
    I am a bit skeptical about this reasoning.
    First of all, fewer repeating over and over questions, doesn't contributes much. Other than by adding to more junk, which need to be filtered out, just to find information.
    Often marked as duplicates of duplicates.

    People ask ChatGPT or similar, for questions which has been typically answered at least once somewhere. Or crawled through documentations, or sites.
    The one who will stay on these forums, are people who either refuse to use generative tools, or in case of very specific technical questions, for which answer is not present anywhere, or very difficult to obtain.

    As the result, there may be less of junk and more of quality responses. And community will be narrower.

    But I see other side of the coin.
    If there is less of people to post things, then less people to discuss with. And perhaps discouraging of even asking questions, on abandoned ship.
     
    neginfinity likes this.
  19. RobertOne

    RobertOne

    Joined:
    Feb 5, 2014
    Posts:
    258
    Gtp isn’t asking me all the time if have googled the problem before or what i have done on my own to solve the problem. It just answers the question. And there is not another gtp sliding into my gtp chat telling the first gtp its a fkng idiot for doing it that way. In short: you have no human interaction and thats the best part.

    that you cant find „anything“ anymore on the internet already started with discord. Like for unity plugins there are is almost no forum interaction anymore. Everyone shifted towards their own discord server and its super hatd to find answers there. I would be very happy if assetstore plugin creators would just train a lmaa instead of letting me crawl through discord servers looking for answers
     
    whoft, Rewaken, Antypodish and 4 others like this.
  20. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,498
    We need to implement this as a feature.

    I agree with the overall idea, though.
     
    whoft likes this.
  21. RobertOne

    RobertOne

    Joined:
    Feb 5, 2014
    Posts:
    258
    while we are at it. Just randomly add a „laughs in godot“ as a possible solution to a problem
     
  22. Taro_FFG

    Taro_FFG

    Joined:
    Jun 24, 2022
    Posts:
    57
    Not using LLMs because they sometimes get things wrong is like saying in '96 to not use the internet because sometimes somebody is saying something stupid in a forum/blog.

    They clearly have some utility and they will only get better but they also have their drawbacks the same way forums and books have their downsides.

    So much easier to find niche/contextual information in a LLM and be able to direct your research with that initial direction.
     
    Ryiah and DragonCoder like this.
  23. RobertOne

    RobertOne

    Joined:
    Feb 5, 2014
    Posts:
    258
    not rly in context but i just remembered this quote:


    1. Anything that is in the world when you’re born is normal and ordinary and is just a natural part of the way the world works.

    2. Anything that’s invented between when you’re fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it.

    3. Anything invented after you’re thirty-five is against the natural order of things.

    -Douglas Adams in the Salmon of Doubt
     
    Daydreamer66 likes this.
  24. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,638
    On the other hand these tools encourage so many more people to learn programming or in general become more knowledgable for the situations where the tool does not automatically solve the problem. After all Wikipedia has not replaced knowledge in our heads either.
    Yes some people will completely overuse it but those people would likely have failed otherwise anyways.
    Think we'll see more people having success than abandoning ship in general.

    Oh do I wish I had this back then when studying...

    Edit: Quite a matching take by Douglas Adams
     
    Last edited: Jul 27, 2023
    PanthenEye and Antypodish like this.
  25. septN

    septN

    Joined:
    Oct 29, 2015
    Posts:
    53
    The more I use chatgpt the more I realize that it doesn't have any intelligence at all. All it does is some way to spin output according to what the users input. A fancy form of "Search" box that we have right here on the forums.
     
  26. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,018
    That is correct, it's just a probability engine. Skynet is not taking over.
    AI is not search, it does not display results from somewhere else unless using a browsing plugin and even then it does not copy/paste. And it does outwardly present a level of understanding even if its not inherently intelligent. Paste in some new API docs you're trying to learn and the AI will discern the purpose of the API and will be able to provide common usages and go deeper on any of those usages in the context of your project assuming you provide that context in prompt form. AI can also implement them and give you a good start.

    And even if used just as search, it's faster than googling 9 times out of 10 assuming training dataset contains the information necessary and if you have further problems on the topic, it can troubleshoot those as well with 0 wait time.

    You also haven't mentioned which AI and which version you tried. A lot of people try freeGPT or Bing chat and then dismiss the technology as a whole when all the power is in paid services right now. GPT4, ChatGPT4 and perhaps Copilot are a generation or two ahead of free tools.
     
    Last edited: Jul 28, 2023
    septN, DragonCoder and Ryiah like this.
  27. Rewaken

    Rewaken

    Joined:
    Mar 24, 2015
    Posts:
    124
    I prefer Claude2 over GPT4 its knowledge cutoff date is 2023 and it also has a 100k context model available to use. I can feed a book or other resource to its 100k model before asking questions about it. For example, when I was trying to understand scriptable object architecture, I uploaded a book and asked Claude2 questions about it. Also, GPT4 API doesn't feel dumbed down compared to ChatGPT4 (I use poe since it gives me 700 GPT-4 messages and 1k Claude2 messages)
     
    Last edited: Jul 29, 2023
  28. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,498
    Claude 2 has more limited availability than GPT 4. It is only available in US/UK and that's it.
     
    bugfinders likes this.
  29. Rewaken

    Rewaken

    Joined:
    Mar 24, 2015
    Posts:
    124
    It is available on Poe.com
     
    bugfinders likes this.
  30. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,498
    "Due to limited capacity, we've had to limit message sending on this bot. You have 3 free messages left today across all bots that use Claude-2-100k."

    Also, who is this poe? Feels like it is affiliated with quora.

    I feel like I need to start looking in running MPT storywriter locally. THough last times I tried it, it tended to go crazy.

    ---

    I've managed to get through Poe's waiting queue for Claude 2, and, honestly, this is more like it. I've managed to stuff a story in a ballpark of 75k characters into it, and it could analyze it. However, apparently it still lost the end of the story, so would be nice to have even bigger attention window. Something in ballpark of 200k would be probably bare bones sufficient for a writer's assistant, and ideally would be nice to have a 1..10 mil tokens attention window while being able to run it locally.

    But we can dream, I guess.

    Also, can't say I agree with conclusion it drew from it.
     
    Last edited: Aug 1, 2023
  31. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,498
    I tested claude 2 through official site. While the attention window is impressive, the model itself occasionally arrives at bizarre conclusions, skips good chunk of source material, and for example, when I asked to translate a decent sized body of text (about 50 kilobytes), it lost the middle, due to two scenes being similar. Then it terminated the response halfway...
     
    Last edited: Aug 2, 2023
    Ryiah and bugfinders like this.
  32. RobertOne

    RobertOne

    Joined:
    Feb 5, 2014
    Posts:
    258
    just wasted a good amount of time setting up and applying for copilot chat.

    the product page says "With chat and terminal interfaces, support for pull requests, and early adoption of OpenAI’s GPT-4" but when i asked copilot what its using because it felt kinda "dumb", it says "the website states that Copilot has early adoption of OpenAI's GPT-4, not that it already has it. The model powering Copilot is currently based on GPT-3." which you can already tell by the quality of it but its a shame that its false advertised!.

    so in the end: its not worth it
     
  33. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,453
    I also have copilot. I often end up in a fight with it, i type say "if (something) {" and it suggests like 20 lines of code, and deletes some of my own.. so I say no, and start entering - the word (and valid variable) Target, is flipping always replaced with something and the more i correct it then more determind it is its not... I dont see an option in the Rider plugin to ask it a question it just randomly makes suggestions and you can click on a window for a bunch of alternatives
     
  34. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,498
    Some additional information about claude (after using it for a while):

    - It works much better than FreeGPT with non-english languages. Basically, in case of FreeGPT, for me it is only really usable in english, in case of claude non-english is fine and is well constructed. I think I've only seen one error.
    - The model actively tries to pretend to be a human. When questioned, it insists that acting as a human is one of the project's goal. It never says "as a language model", and can say things like "I want to see what happens next".
    - The maximum amount of text I managed to feed into it was about 158 kilobytes. It does keep entire text in mind, but can cut conversation short if t he total number of characters in conversation hits the limit of around 160k.
    - It does work fairly well for text analysis. Basically, you can dump a short story into it or several book chapters, and say "I need an opinion about this story", it'll oblige, and it'll understand t he whole thing.
    - However output is not really consistent. If you reroll you can get a different opinion. When asked to "provide an opinion" on a short story, It frequently acts as if it selects several key point and then focuses on them while ignoring other things.
     
    bugfinders likes this.
  35. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    261

    I didn't think about doing this until I stumbled upon your thread, and I then figured out that you can learn just by asking ChatGPT.

    I'm considering using paid model 4, can someone confirm the amount of lines or efficiency gained on average with the newer model compared to 3.5?


    Oh god, we're entering the beginning stages of that Movie.

    but I don't care.
     
  36. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,498
    You might want to try WizardLM, Vicunia, claude and CodeLlama first. See if you can run any of them locally.
     
    the_unity_saga likes this.
  37. zulo3d

    zulo3d

    Joined:
    Feb 18, 2023
    Posts:
    774
    You could ask ChatGPT how to use ChatGPT.
     
  38. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,774
    You can't really compare them in that manner as it's very dependent on your prompts. While GPT-4 is consistently "better" than GPT-3.5 I've had cases where the free outperformed the paid in weird ways.
     
    the_unity_saga likes this.
  39. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Apparently the current "low end" champion is mistral 7B, it can reason on the level, allegedly, of gpt3.5. The creator is a former lead on LLaMA2.

    IMHO, people who say LLM aren't intelligent miss the point, they won't need to be "intelligent" to mess you up and take over.

    Also the value of LLM aren't in not making mistake and being used as a chat consultant. It's when people start bringing their autonomous "stupidity" such as it can do half your work in 10s, 24/24 7/7, and never complain. If 7B model are enough, at best that's 100WH, which roughly translate into my local rates to 400€ of initial investment on the machine, then 4€ of electricity per month. Compared to a full human at 10 000€ a month only 8h a day, which only 6 are productive. Machine only need to be mediocre at the task to be competitive.

    Currently experiment show that a fleet of agents can actually do a lot of small SOP task "good enough", where you have each task layered by "personality" that cross check each others and only have memory for very small history, and manager that distribute the task and take decision. For any task that have clear validation (such as does the code compile) they will be able to progress.

    I'm trying to learn docker right now ... :eek:
     
    the_unity_saga, PanthenEye and Ryiah like this.