How I used AI to understand a huge codebase

Поделиться
HTML-код
  • Опубликовано: 17 ноя 2024

Комментарии • 94

  • @LookingGlassUniverse
    @LookingGlassUniverse  6 месяцев назад +27

    If Claude is blocked in your country, try using Google's Gemini. The paid version of Gemini has an even larger context window than Claude. However, you can't upload docs and so instead you'll need to copy and paste each of the files, which is a bit awful, but will work (sorry).
    AlphaFold 3 came out while I was editing this video, and I'm so excited! I will definitely make a video about it soon!

    • @HoD999x
      @HoD999x 6 месяцев назад

      you need a VPN and ideally a friend in country X who makes an account for you. gemini isn't as smart

    • @hoeszyslak6989
      @hoeszyslak6989 6 месяцев назад

      Noooooo make a video about OpenFold instead!!!! c:

  • @aravkh
    @aravkh 6 месяцев назад +4

    Love your videos Mithuna! As another physicist at an Australian university wanting to study a PhD overseas, you're a huge inspiration to me.
    I'd strongly suggest drawing a mindmap as you ask AI about the different files and imports. I've done that a lot in the past and it helps me see the big picture as well as the links :)

  • @rachel_rexxx
    @rachel_rexxx 6 месяцев назад +2

    I'm a measly math undergrad, but Google Gemini has helped me conceptually get my head around the occasional abstract concept. I have had problems getting it to help me with code, so hearing that Claude was better at code comprehension is a good recommendation.

  • @AkamiChannel
    @AkamiChannel 6 месяцев назад +8

    Learning a codebase is like that. It's not something a person can realistically do for 8 hours in a day. Just spend a couple hours a day max going through randomly like you were doing. Every codebase is like its own mini-language. You have to just expose yourself, spend time, and become familiar. Takes time. Important to be patient.

  • @Lazarex
    @Lazarex 6 месяцев назад +2

    Love your work Mithuna! I love physics and you are simply brilliant at explaining so many difficult concepts and I am very impressed at your videos! Keep up the joy of science, discovery and living in the Wonderland with you!

  • @CapsAdmin
    @CapsAdmin 6 месяцев назад +2

    I tried using gemini 1.5 pro on my hobby project which is around 500k tokens. It seemed alright at understanding the codebase but it made a few mistakes every now and then. (well I know the codebase very well)
    The most fun and useful thing was asking it to find places to refactor. I've been working on this project for many years and it's really amazing to have "someone" look at your code, critique it and just overall chat about your code.

    • @Miguel_Noether
      @Miguel_Noether 6 месяцев назад

      What is refactor?

    • @CapsAdmin
      @CapsAdmin 6 месяцев назад

      @Miguel_Noether like redesigning the code to make it more readable and easier to maintain

  • @alankarmisra
    @alankarmisra 6 месяцев назад +3

    I just use Codium plugin with vscode and it seems like it creates a vector database locally to decide which code files reference your question and then send that forward to gpt to explain. That way you don’t have to upload all the code files online

  • @aresgalamatis7022
    @aresgalamatis7022 6 месяцев назад +1

    That is the first 5 minutes work of a software developer on a new codebase.

  • @Frutfive5
    @Frutfive5 6 месяцев назад

    One approach i have used is to use an IDE called Cursor. It looks exactly like visual studio but has an ai chat box built into the interface that can connect to OpenAI or anthropic. The best part is you can pass in your entire code base into the chat box with one simple command. I don’t know if it would be able to hand such a large context at the present moment, but you can always just pass in specific files that are relevant to the question you have.

  • @stephensong9597
    @stephensong9597 4 месяца назад +1

    how did you generate that picture of architecture , actually? did you mention "deep mind" for that step? is that some ai tool?

  • @NachtmahrNebenan
    @NachtmahrNebenan 6 месяцев назад +3

    That's a really good approach. But my employer would not allow anyone to upload our code base to someone outside services. I'd be interested in what local setups could explain code in a similar qualtity.

    • @moustafazada5990
      @moustafazada5990 6 месяцев назад +2

      well, in chatgpt for example , there is an option in the teams subscription plan i think to opt out from letting openai use ur prompts and data in the training and they SAY they wont save ur data, i guess anthropic might have something like that too , anyway , ur employer might stick to his policy but tell him about this if he dont arlready know abt it

    • @Gigusx
      @Gigusx 6 месяцев назад +1

      You can use local models, or trust that the companies who say they won't use your data in training their models will actually stay true to their word, but that's obviously placing your faith into a 3rd party. TabNine prides itself on privacy and protecting IP so you might want to look into them, but that's a coding assistant so I'm not sure how much it'd help you understand the codebase.

  • @lowenhere
    @lowenhere 6 месяцев назад +2

    Really cool! I'll definitely consider trying this out when I have to understand a new codebase.
    Could you share how much you spent throughout the process? Claude 3 Opus costs $15 per million input tokens according to the pricing page, and I'd imagine you'd need to make multiple queries, maybe changing your prompts along the way.

    • @HoD999x
      @HoD999x 6 месяцев назад

      this is for the api, the chat version is 20$/month

  • @xtieburn
    @xtieburn 6 месяцев назад

    LLMs are very useful as glorified manuals, I use them a bunch at work. Though you have to be able to confirm the information it feeds back to you, they absolutely will lie and do so with as much confidence as when they give you accurate information. For obvious reasons this gets much worse with anything even a little obscure.
    (In fact Computerphile recently did a video on a paper on the idea that it could be intractably difficult to improve these models much at all. This wouldnt be the first time AI has plateaud; Iterative improvements wont be enough, new fundamental changes will be required.)

  • @manso306
    @manso306 6 месяцев назад +5

    AIs don't have understanding, they just predict what word / token is likely to come next. Confronted with a function it hasn't seen before, it either extrapolates correctly from other patterns that it has seen, or it hallucinates some BS. There's no way to tell, unless you check its "reasoning" by actually understanding the code yourself.
    I'm a SW developer (junior, but still) and upon closer inspection I usually find that it usually makes up a load of BS.
    Maybe there's ways to i prove that by providing better prompts, but at that point it's usually just easier to step through the code myself.

    • @HoD999x
      @HoD999x 6 месяцев назад +1

      are you maybe using gpt 3.5 or other outdated ai? opus is definitely understanding very well.

    •  6 месяцев назад +1

      You would be surprised to see how good the better ones are.

    • @TheKdcool
      @TheKdcool 6 месяцев назад

      If I only used Llama 3 8B that's what I would say too but ChatGPT 4 Turbo understands surprisingly well most of the time

    • @kingplunger1
      @kingplunger1 6 месяцев назад

      ​@@HoD999xdepends what you call "understanding"

  • @Create-The-Imaginable
    @Create-The-Imaginable 6 месяцев назад +1

    Please more AI content about how you use AI to solve challenges and problems! I love it! 🙏

  • @MrKasper0001
    @MrKasper0001 6 месяцев назад

    Have you tried the open interpreter project? You can put gpt4 or opus into your command prompt and actually get it OUT of a chat box. I can't code so I asked it to code me a machine learning program that can predict the stock prices after exporting tradingview data.

  • @mariommamtaj3624
    @mariommamtaj3624 6 месяцев назад

    Hi Mithuna, I really enjoy your videos. But could you take some time out to complete the linear algebra series, they do not have to be perfect?

  • @Miguel_Noether
    @Miguel_Noether 6 месяцев назад +1

    Can you do it with your own PhD thesis, the process to upload it all and understand all of its parts?

    • @dibenp
      @dibenp 6 месяцев назад

      This is a great idea for a video.

  • @WestOfEarth
    @WestOfEarth 6 месяцев назад +1

    Do you think this approach would work for analysing journal papers?

    •  6 месяцев назад

      Meta created Galactica to do exactly that. However, at that point in time, people didn't know how to handle hallucinations. And Meta said the AI was going to be a perfect scientific tool. You can guess what happened when journalists got hold of it...

    •  6 месяцев назад

      You could do really nice things. E.g. producing slides to present a research report. Or go "backwards", and ask what biological processes are based on some specific mathematical relationship.

  • @finalfan321
    @finalfan321 6 месяцев назад

    whats the future for quantum computing in a world of AI? would one enhance the other?

  • @Vannishn
    @Vannishn 6 месяцев назад +1

    It helps but i dont really like "giving it it all" 🤷‍♂️

  • @pingnick
    @pingnick 6 месяцев назад

    I’ve done very little programming but I imagine the best use would be to see if it figures out a bug you haven’t noticed in your code that is rendering it partially or totally inoperative… also if it catches something in code that you think is 100% fine and hasn’t hiccuped on you yet… for that to believe it you’d likely need more experience/ability than I currently feel I have - wow striking a balance of doing stuff on your own vs with assistance of presumed often high but uneven quality in these AI offerings is wild indeed - it does seem that usefulness of programmers in various settings should be becoming much more effective to the point where wow impacting job market more than even offshoring!? A good reason to specialize obviously and good to have you as a PhD investigating specific topics to inspire us to remain useful as humans in specialties within this general coding arena maybe hahaha🤖🤪

  • @videotimebaby90
    @videotimebaby90 6 месяцев назад

    Very interesting, ill have to try this out!

  • @purezero23
    @purezero23 6 месяцев назад

    Good idea but i would recommend getting a good ide it will take you far

  • @emiliomagris8753
    @emiliomagris8753 6 месяцев назад

    Does it mean I can use Chat GPT to finally understand Italian bureaucracy?

  • @mediawolf1
    @mediawolf1 5 месяцев назад

    Super-useful little aside.

  • @HelloBrother22
    @HelloBrother22 6 месяцев назад

    Hey, so I'm facing a similar issue but I'm kind of reluctant because the code I'd be posting to gemini is a quite private and leaks could prove disastrous. Should I be wary of this, or are my worries unfounded?

    • @LookingGlassUniverse
      @LookingGlassUniverse  6 месяцев назад +1

      If you have the business version of ChatGPT then they don’t use your data for training. You can check, but Claude and Gemini might have a similar policy!

    • @HelloBrother22
      @HelloBrother22 6 месяцев назад

      @@LookingGlassUniverse Okay I'll take a look then, thanks for replying!

  • @LM-ch8rh
    @LM-ch8rh 6 месяцев назад

    Thank you so much. This is so helpful for me. Also, does anyone have suggestions on software that helps to formulate drugs based on knowing a mutation? For example, if I know that a mutation in FOXC2 causes vein disease is there software that can help me formulate a drug or "something" to fix the mutation? Thank you.

  • @wjrasmussen666
    @wjrasmussen666 5 месяцев назад

    How did you connect the repo? Sounds like a copy paste. Please explain in detail. I don't want to spend money on it only to be disappointed.

  • @chillphil967
    @chillphil967 6 месяцев назад +1

    cool application, thx for sharing

  • @laurenpinschannels
    @laurenpinschannels 6 месяцев назад +1

    oh I thought you were one of the random ai nonsense channels for a sec, then I clicked through and realized why I'd originally subscribed. FWIW I'd suggest being verrry careful with maintaining your presentation as focusing on your field, so that you don't end up lumped in with the ai hype burnout channels. That said, I do find claude is far less frustrating than gpt4, yes.

  • @CoderDBF
    @CoderDBF 6 месяцев назад

    I’m building a tool for doing exactly this.
    Understanding large or complicated codebases.
    I haven’t got anything meaningful yet unfortunately I’m still working on it.

  • @robo0428
    @robo0428 5 месяцев назад

    Ok, copying and pasting whole code bases into an AI chatbot window is not advisable or even really practical in many cases. This is, generally speaking, something you shouldn't do especially when it isn't your code to begin with. Also, if you put the AI through it's paces you'll find they're all not super great at calculus or really math in general. Until that AI can consistently solve integrals, you should be consistently skeptical of it's code.
    After many years of professional coding, I've found the best way to understand a large code base is to be familiar with the languages beforehand and to not be afraid to pull that code up in a terminal so you can pick it apart algebraically with CLI tools. It takes time and patience to build these types of skills but this is what will ultimately allow you to manage and parse through enormous amounts of code very very quickly.

  • @PsymonHawkeye
    @PsymonHawkeye 6 месяцев назад

    I've started using Claude Pro for disecting code too. I more use it for origination running test concepts. I've wondered about using it to dissect books. I'll have to try that. Does anyone else regularly run into message limits?

    • @LookingGlassUniverse
      @LookingGlassUniverse  6 месяцев назад +2

      Yes, I found that to be the only really frustrating thing about using claude! But it’s a cool idea to use it for dissecting books. I’d love to hear about that!

    • @PsymonHawkeye
      @PsymonHawkeye 6 месяцев назад

      @@LookingGlassUniverse I'm intrigued that you're getting into protein folding. Your quantum mechanics videos were very helpful when I went fishing around for better breakdowns and ACTUAL EXPEREMENTS. I appreciate your approach to these topics, and proteins are another growing area of interest of mine, so I'm glad you're getting into it.

  • @breezyashell
    @breezyashell 6 месяцев назад

    nice , looking forward to what you find. I need to be able to just drop a zip file tho

  • @Ideasquevalelapenadifundir
    @Ideasquevalelapenadifundir 6 месяцев назад +1

    nice, in my experience chatgpt is most of the times really useful when the documentation of a software is poorly maintained/explained

  • @6cef
    @6cef 6 месяцев назад +4

    this is such a good idea!
    could you train something like llama on the code base itself and produce similar results?

    • @LookingGlassUniverse
      @LookingGlassUniverse  6 месяцев назад +6

      Oh, that’s a cool idea! I don’t know anything about training llama this way. How does it work?

    • @claudyla
      @claudyla 6 месяцев назад +1

      Maybe not training but using Retrieval Augmented Generation on it?

  • @JuanPabloCarbajal
    @JuanPabloCarbajal 6 месяцев назад +1

    Great let's start writing even more horrible code, at the end AI will read it.

  • @Descenacre
    @Descenacre 6 месяцев назад +2

    Be careful, be sure to get permission from your project manager and/or the authors of the code before you upload the code into an online GPT,
    could probably be dubious to share that information especially if your project's repository is meant to be private--
    especially since ChatGPT and the like use your conversations to further improve and train their models
    For better data security, you might be better off with an offline model installed on a secure device

    • @mikeg9b
      @mikeg9b 6 месяцев назад +4

      The link to the repo is in the video description (OpenFold). It is open source under the Apache 2.0 license.

  • @satoshinakamoto5710
    @satoshinakamoto5710 5 месяцев назад

    anthropic is superior, no doubt

  • @mikicerise6250
    @mikicerise6250 6 месяцев назад +2

    You're so lucky you get access to Claude. Here in Europe we're not allowed. 😢

    • @shApYT
      @shApYT 6 месяцев назад +3

      That is what proxies are for.

    • @LookingGlassUniverse
      @LookingGlassUniverse  6 месяцев назад +3

      I heard about this from my friend yesterday, crazy! I really hope it changes.
      Gemini has an even bigger context window though. The only issue is that they don’t let you upload files for some reason. This means you have to copy and paste it all in yourself… if you’re ok with that, it will work just as well

  • @ashishpatel350
    @ashishpatel350 6 месяцев назад +1

    ask the ai when skynet will be self aware? lol

  • @sumedh-girish
    @sumedh-girish 6 месяцев назад

    MORE AI YAAAYYY!

  • @abrarshaikh2254
    @abrarshaikh2254 6 месяцев назад

    Intresting

  • @cohomologygroup
    @cohomologygroup 6 месяцев назад

    A backslash

  • @sanjuwa2677
    @sanjuwa2677 6 месяцев назад

    Yes claud is better than chaptgpt

  • @-q-b0_1
    @-q-b0_1 6 месяцев назад

    👍

  • @valerio84
    @valerio84 6 месяцев назад +35

    You guys/girls use AIs assuming they work well. Now I'll tell you a secret we SW engineers know, they are always wrong for some extent. If you try to go deeper in their understanding of something their failure rate increases. Sort of Heisenberg principle. You should be scared if you find that a non-specialized AI works well for your very technical specialized request. If you cannot understand a codebase yourself, you will likely not be able to understand when the AI is wrong about that codebase and is just fooling you around pretending an understanding. You'll add mistakes on top of mistakes due to these fake understandings. The perfect recipe to failure. If this is too difficult to accept, consider that your ability to understand a codebase is below par compared to a non-specialized AI. That's a tech gap that you should fulfill before putting your hands on the codebase. Otherwise code will start falling apart especially if there is no mandatory and well established code reviewing and automated regression testing processes.

    • @Zartymil
      @Zartymil 6 месяцев назад +6

      I do agree with you but I still think AI can be used if you ask small questions and verify that they're right. Like, it can give you a possibly wrong path but you can always check if it is right in software.
      For other subjects I'd stay away from AIs for now because they WILL make you learn wrong things.

    • @PlayerMathinson
      @PlayerMathinson 6 месяцев назад +5

      How do you recommend we read large codebases?

    • @GMPranav
      @GMPranav 6 месяцев назад +7

      ​@@PlayerMathinson
      Option a) pray there is documentation
      Option b) learn coding rigorously

    •  6 месяцев назад +1

      ​@@Zartymilagreed!
      To add to that, it is really helpful to ask where something is done. If the AI hallucinates, you will immediately see that when you look at the code.
      I use AI all day when coding, and hallucinations aren't any problem. I use it for the main boring work, and then I fix the details. I'd rather spend my time doing unit tests.

    • @AllMightGaming-AMG
      @AllMightGaming-AMG 6 месяцев назад

      There is simply not enough data to fine tune an existing LLM to make it explain a large code base. Are there not enough large public codebases? There are. Are there any explanation of all that? No. There needs to be clever engineering to generate that data, and that's not what the current AI models do.

  • @mdderrek9280
    @mdderrek9280 6 месяцев назад

    :)

  • @kalpanaanubhav
    @kalpanaanubhav 6 месяцев назад

    I am seriously baffled about how this girl transitioned from Quantum mechanics to protein structures 😅

  • @miskee11
    @miskee11 6 месяцев назад +1

    Really happy to see this transition towards AI-focused content. AI is not just the future; it's relevant right here and right now -- just like cryptocurrencies. In fact, I'd love to see you pairing your new AI focus with crypto talk. Now that would be topical!

    • @azertyQ
      @azertyQ 6 месяцев назад

      cryptocurrencies are 99% scams